"""
Build a simple bare-minimum quantum circuit that starts with a single
qubit (by default, in state 0), runs the experiment 1000 times, and
finally prints the total count of the states finally observed.
Qiskit Docs: https://qiskit.org/documentation/getting_started.html
"""
import qiskit
def single_qubit_measure(
qubits: int, classical_bits: int
) -> qiskit.result.counts.Counts:
"""
>>> single_qubit_measure(1, 1)
{'0': 1000}
"""
simulator = qiskit.Aer.get_backend("aer_simulator")
circuit = qiskit.QuantumCircuit(qubits, classical_bits)
circuit.measure([0], [0])
job = qiskit.execute(circuit, simulator, shots=1000)
return job.result().get_counts(circuit)
if __name__ == "__main__":
print(f"Total count for various states are: {single_qubit_measure(1, 1)}")