Skip to content

Commit 28d03f1

Browse files
github-actionsgithub-actions
github-actions
authored and
github-actions
committed
fixup! Format Python code with psf/black push
1 parent d33de31 commit 28d03f1

File tree

1 file changed

+21
-21
lines changed

1 file changed

+21
-21
lines changed

Diff for: quantum/q1.py

+21-21
Original file line numberDiff line numberDiff line change
@@ -2,32 +2,32 @@
22

33

44
def run():
5-
"""
6-
Build a simple bare-minimum quantum circuit that starts with a single
7-
qubit (by default, in state 0), runs the experiment 1000 times, and
8-
finally prints the total count of the states finally observed.
9-
"""
10-
# Use Aer's qasm_simulator
11-
simulator = q.Aer.get_backend('qasm_simulator')
5+
"""
6+
Build a simple bare-minimum quantum circuit that starts with a single
7+
qubit (by default, in state 0), runs the experiment 1000 times, and
8+
finally prints the total count of the states finally observed.
9+
"""
10+
# Use Aer's qasm_simulator
11+
simulator = q.Aer.get_backend("qasm_simulator")
1212

13-
# Create a Quantum Circuit acting on the q register
14-
circuit = q.QuantumCircuit(1, 1)
13+
# Create a Quantum Circuit acting on the q register
14+
circuit = q.QuantumCircuit(1, 1)
1515

16-
# Map the quantum measurement to the classical bits
17-
circuit.measure([0], [0])
16+
# Map the quantum measurement to the classical bits
17+
circuit.measure([0], [0])
1818

19-
# Execute the circuit on the qasm simulator
20-
job = q.execute(circuit, simulator, shots=1000)
19+
# Execute the circuit on the qasm simulator
20+
job = q.execute(circuit, simulator, shots=1000)
2121

22-
# Grab results from the job
23-
result = job.result()
22+
# Grab results from the job
23+
result = job.result()
2424

25-
# Returns counts
26-
counts = result.get_counts(circuit)
25+
# Returns counts
26+
counts = result.get_counts(circuit)
2727

28-
return counts
28+
return counts
2929

3030

31-
if __name__ == '__main__':
32-
counts = run()
33-
print("Total count for various states are:", counts)
31+
if __name__ == "__main__":
32+
counts = run()
33+
print("Total count for various states are:", counts)

0 commit comments

Comments
 (0)