Skip to main contentIBM Quantum Documentation
You are viewing the API reference for an old version of Qiskit SDK. Switch to latest version

count_keys

count_keys(num_qubits) GitHub(opens in a new tab)

Return ordered count keys.

Parameters

num_qubits (int) – The number of qubits in the generated list.

Return type

List[str]

Returns

The strings of all 0/1 combinations of the given number of qubits

Example

>>> count_keys(3)
['000', '001', '010', '011', '100', '101', '110', '111']
Was this page helpful?