QCPlots Documentation
Example
using Plots
using QuantumCircuitDraw
N = 5 # number of qubits
steps = 8 # number of steps in the circuit
circuit_plot(N, steps; grid=false) #initialize the plot
Single(1, 3, "U")
Single(3, 1, "X")
Controlled(1, 1, 2, "X")
CY(2, 4, 2)
CNOT(3, 4, 5)
CCNOT(4, 4, 2, 3)
Swap(5, 1, 5)
MCX(6, [2, 3, 4], 1)
MCZ(7, [5, 3, 4])
Measurement(8, 1)
Measurement(8, 2)Documentation
QuantumCircuitDraw.circuit_plot — Methodcircuit_plot(N::Int, steps::Int; qubit_names=[], grid=false)Initializes a plot for a quantum circuit with N qubits and steps steps. If qubit_names is empty, the qubits are named q₁, q₂, etc. Set grid=true to show a grid.
QuantumCircuitDraw.Single — MethodSingle(i::Int, j::Int, name::String)Draws a single-qubit gate at step i and qubit j with name name.
QuantumCircuitDraw.Controlled — MethodControlled(i::Int, control::Int, target::Int, name::String)Draws a controlled gate with control qubit and target qubit at step i.
QuantumCircuitDraw.MCZ — MethodMCZ(i::Int, sites::Vector{Int})Draws a multi-controlled Z gate acting on sites qubits at step i.
QuantumCircuitDraw.MCX — MethodMCX(i::Int, controls::Vector{Int}, target::Int)Draws a multi-controlled X gate acting on sites qubits at step i.
QuantumCircuitDraw.CNOT — MethodCNOT(i::Int, control::Int, target::Int)Draws a CNOT gate at step i with control and target qubits.
QuantumCircuitDraw.CCNOT — MethodCCNOT(i::Int, control1::Int, control2::Int, target::Int)Draws a CCNOT gate at step i with control1, control2, and target qubits.
QuantumCircuitDraw.CCX — MethodCCX(i::Int, control1::Int, control2::Int, target::Int)Same as CCNOT.
QuantumCircuitDraw.Swap — MethodSwap(i::Int, j1::Int, j2::Int)Draws a SWAP gate at step i between qubits j1 and j2.
QuantumCircuitDraw.Measurement — MethodMeasurement(i::Int, j::Int)Draws a measurement gate at step i on qubit j.
QuantumCircuitDraw.CX — MethodCX(i::Int, control::Int, target::Int)Draws a controlled X gate at step i with control and target qubits.
QuantumCircuitDraw.CY — MethodCY(i::Int, control::Int, target::Int)Draws a controlled Y gate at step i with control and target qubits.
QuantumCircuitDraw.CZ — MethodCZ(i::Int, control::Int, target::Int)Draws a controlled Z gate at step i with control and target qubits.