Skip to content

Commit afb45e9

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

File tree

2 files changed

+42
-42
lines changed

2 files changed

+42
-42
lines changed

Diff for: quantum/q1.py

+20-20
Original file line numberDiff line numberDiff line change
@@ -11,31 +11,31 @@
1111

1212

1313
def single_qubit_measure() -> q.result.counts.Counts:
14-
"""
15-
>>> single_qubit_measure()
16-
{'0': 1000}
17-
"""
18-
# Use Aer's qasm_simulator
19-
simulator = q.Aer.get_backend('qasm_simulator')
14+
"""
15+
>>> single_qubit_measure()
16+
{'0': 1000}
17+
"""
18+
# Use Aer's qasm_simulator
19+
simulator = q.Aer.get_backend("qasm_simulator")
2020

21-
# Create a Quantum Circuit acting on the q register
22-
circuit = q.QuantumCircuit(1, 1)
21+
# Create a Quantum Circuit acting on the q register
22+
circuit = q.QuantumCircuit(1, 1)
2323

24-
# Map the quantum measurement to the classical bits
25-
circuit.measure([0], [0])
24+
# Map the quantum measurement to the classical bits
25+
circuit.measure([0], [0])
2626

27-
# Execute the circuit on the qasm simulator
28-
job = q.execute(circuit, simulator, shots=1000)
27+
# Execute the circuit on the qasm simulator
28+
job = q.execute(circuit, simulator, shots=1000)
2929

30-
# Grab results from the job
31-
result = job.result()
30+
# Grab results from the job
31+
result = job.result()
3232

33-
# Get the histogram data of an experiment.
34-
counts = result.get_counts(circuit)
33+
# Get the histogram data of an experiment.
34+
counts = result.get_counts(circuit)
3535

36-
return counts
36+
return counts
3737

3838

39-
if __name__ == '__main__':
40-
counts = single_qubit_measure()
41-
print("Total count for various states are:", counts)
39+
if __name__ == "__main__":
40+
counts = single_qubit_measure()
41+
print("Total count for various states are:", counts)

Diff for: quantum/q2.py

+22-22
Original file line numberDiff line numberDiff line change
@@ -11,34 +11,34 @@
1111

1212

1313
def single_qubit_measure() -> q.result.counts.Counts:
14-
"""
15-
>>> single_qubit_measure()
16-
{'1': 1000}
17-
"""
18-
# Use Aer's qasm_simulator
19-
simulator = q.Aer.get_backend('qasm_simulator')
14+
"""
15+
>>> single_qubit_measure()
16+
{'1': 1000}
17+
"""
18+
# Use Aer's qasm_simulator
19+
simulator = q.Aer.get_backend("qasm_simulator")
2020

21-
# Create a Quantum Circuit acting on the q register
22-
circuit = q.QuantumCircuit(1, 1)
21+
# Create a Quantum Circuit acting on the q register
22+
circuit = q.QuantumCircuit(1, 1)
2323

24-
# Apply X (NOT) Gate to Qubit 0
25-
circuit.x(0)
24+
# Apply X (NOT) Gate to Qubit 0
25+
circuit.x(0)
2626

27-
# Map the quantum measurement to the classical bits
28-
circuit.measure([0], [0])
27+
# Map the quantum measurement to the classical bits
28+
circuit.measure([0], [0])
2929

30-
# Execute the circuit on the qasm simulator
31-
job = q.execute(circuit, simulator, shots=1000)
30+
# Execute the circuit on the qasm simulator
31+
job = q.execute(circuit, simulator, shots=1000)
3232

33-
# Grab results from the job
34-
result = job.result()
33+
# Grab results from the job
34+
result = job.result()
3535

36-
# Get the histogram data of an experiment.
37-
counts = result.get_counts(circuit)
36+
# Get the histogram data of an experiment.
37+
counts = result.get_counts(circuit)
3838

39-
return counts
39+
return counts
4040

4141

42-
if __name__ == '__main__':
43-
counts = single_qubit_measure()
44-
print("Total count for various states are:", counts)
42+
if __name__ == "__main__":
43+
counts = single_qubit_measure()
44+
print("Total count for various states are:", counts)

0 commit comments

Comments
 (0)