quantum_circuit::draw()← Back to Class quantum_circuit
Draw the circuit in ASCII art form
quantum_circuit::draw(debug = false)
debug (boolean, optional) — Activate debug mode. The default value is false
boolean — Always returns true
import quantum
qc = quantum_circuit(2)
qc.x(0)
qc.barrier(0, 1)
qc.h(1)
qc.cp(pi / 2, 0, 1)
qc.h(0)
qc.swap(0, 1)
qc.draw()
' Output:
' ╭───╮ | ╭───╮
' q0 ─┤ X ├──|────────────●──────┤ H ├──X──
' ╰───╯ | │ ╰───╯ │
' | ╭───╮ ╭───┴────╮ │
' q1 ────────|──┤ H ├─┤ P(π/2) ├────────X──
' | ╰───╯ ╰────────╯