Skip to content

Commit

Permalink
tox -e black
Browse files Browse the repository at this point in the history
  • Loading branch information
abbycross committed Oct 22, 2024
1 parent 88a7972 commit e0dedbf
Showing 1 changed file with 21 additions and 21 deletions.
42 changes: 21 additions & 21 deletions qiskit/circuit/quantumcircuit.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,30 +124,30 @@ class QuantumCircuit:
structures that go with it, how it fits into the rest of the :mod:`qiskit` package, and the
different regimes of quantum-circuit descriptions in Qiskit, see the module-level
documentation of :mod:`qiskit.circuit`.
Example:
.. plot::
:include-source:
:nofigs:
from qiskit import QuantumCircuit
# Create a new circuit with two qubits
qc = QuantumCircuit(2)
# Add a Hadamard gate to qubit 0
qc.h(0)
# Perform a controlled-X gate on qubit 1, controlled by qubit 0
qc.cx(0, 1)
# Return a text drawing of the circuit.
qc.draw()
.. code-block:: text
┌───┐
┌───┐
q_0: ┤ H ├──■──
└───┘┌─┴─┐
q_1: ─────┤ X ├
Expand Down Expand Up @@ -215,11 +215,11 @@ class QuantumCircuit:
.. autoattribute:: data
Example:
.. plot::
:include-source:
:nofigs:
from qiskit import QuantumCircuit
qc = QuantumCircuit(2, 2)
Expand All @@ -237,12 +237,12 @@ class QuantumCircuit:
.. autoattribute:: global_phase
Example:
.. plot::
:include-source:
:nofigs:
:context: reset
from qiskit import QuantumRegister, ClassicalRegister, QuantumCircuit
qreg_q = QuantumRegister(2, 'q')
Expand All @@ -251,25 +251,25 @@ class QuantumCircuit:
circuit.h(qreg_q[0])
circuit.cx(qreg_q[0], qreg_q[1])
print(circuit.global_phase) # find the global phase of the current circuit
.. code-block:: text
0.0
.. plot::
:include-source:
:nofigs:
:context:
from numpy import pi
circuit.global_phase = pi/4 # set the global phase of the circuit to pi/4
print(circuit.global_phase)
.. code-block:: text
0.7853981633974483
The :attr:`name` of a circuit becomes the name of the :class:`~.circuit.Instruction` or
Expand Down

0 comments on commit e0dedbf

Please sign in to comment.