Skip to content

Commit

Permalink
attempt fix doc error
Browse files Browse the repository at this point in the history
  • Loading branch information
gadhvirushiraj committed Sep 8, 2024
1 parent 3fa267a commit 4741753
Showing 1 changed file with 22 additions and 21 deletions.
43 changes: 22 additions & 21 deletions doc/source/qip-basics.rst
Original file line number Diff line number Diff line change
Expand Up @@ -365,31 +365,32 @@ QuTiP-QIP offers three distinct methods for visualizing quantum circuits. Below

- **Text**:

.. testcode::
from qutip_qip.circuit import QubitCircuit
from qutip_qip.operations import Gate
.. testcode::

from qutip_qip.circuit import QubitCircuit
from qutip_qip.operations import Gate

# create the quantum circuit
qc = QubitCircuit(2, num_cbits=1)
qc.add_gate("CNOT", controls=0, targets=1)
qc.add_gate("SNOT", targets=1)
qc.add_gate("ISWAP", targets=[0,1])
qc.add_measurement("M0", targets=1, classical_store=0)
# create the quantum circuit
qc = QubitCircuit(2, num_cbits=1)
qc.add_gate("CNOT", controls=0, targets=1)
qc.add_gate("SNOT", targets=1)
qc.add_gate("ISWAP", targets=[0,1])
qc.add_measurement("M0", targets=1, classical_store=0)

qc.draw("text")
qc.draw("text")

**Output**:
**Output**:

.. testoutput::
┌──────┐ ┌──────┐ ┌───────┐ ┌───┐
q1 :───┤ CNOT ├──┤ SNOT ├──┤ ├──┤ M ├───
└───┬──┘ └──────┘ │ │ └─╥─┘
│ │ │ ║
q0 :───────█───────────────┤ ISWAP ├────║─────
└───────┘ ║
c0 :════════════════════════════════════╩═════
.. testoutput::
:options: +NORMALIZE_WHITESPACE
┌──────┐ ┌──────┐ ┌───────┐ ┌───┐
q1 :───┤ CNOT ├──┤ SNOT ├──┤ ├──┤ M ├───
└───┬──┘ └──────┘ │ │ └─╥─┘
│ │ │ ║
q0 :───────█───────────────┤ ISWAP ├────║─────
└───────┘ ║
c0 :════════════════════════════════════╩═════

**Customization Parameters**

Expand Down

0 comments on commit 4741753

Please sign in to comment.