Skip to content

Commit

Permalink
simplify circuit
Browse files Browse the repository at this point in the history
Co-authored-by: Frank Harkins <[email protected]>
  • Loading branch information
abbycross and frankharkins authored Jan 16, 2025
1 parent 1419254 commit c161247
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions qiskit/circuit/quantumcircuit.py
Original file line number Diff line number Diff line change
Expand Up @@ -4435,15 +4435,11 @@ def global_phase(self) -> ParameterValueType:
:nofigs:
:context: reset
from qiskit import QuantumRegister, ClassicalRegister, QuantumCircuit
qreg_q = QuantumRegister(2, 'q')
creg_c = ClassicalRegister(2, 'c')
circuit = QuantumCircuit(qreg_q, creg_c)
circuit.h(qreg_q[0])
circuit.cx(qreg_q[0], qreg_q[1])
from qiskit import QuantumCircuit
circuit = QuantumCircuit(2)
circuit.h(0)
circuit.cx(0, 1)
print(circuit.global_phase) # find the global phase of the current circuit
.. code-block:: text
Expand Down

0 comments on commit c161247

Please sign in to comment.