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)
Example block output

Documentation

QuantumCircuitDraw.circuit_plotMethod
circuit_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.

source
QuantumCircuitDraw.ControlledMethod
Controlled(i::Int, control::Int, target::Int, name::String)

Draws a controlled gate with control qubit and target qubit at step i.

source
QuantumCircuitDraw.MCXMethod
MCX(i::Int, controls::Vector{Int}, target::Int)

Draws a multi-controlled X gate acting on sites qubits at step i.

source
QuantumCircuitDraw.CCNOTMethod
CCNOT(i::Int, control1::Int, control2::Int, target::Int)

Draws a CCNOT gate at step i with control1, control2, and target qubits.

source
QuantumCircuitDraw.CXMethod
CX(i::Int, control::Int, target::Int)

Draws a controlled X gate at step i with control and target qubits.

source
QuantumCircuitDraw.CYMethod
CY(i::Int, control::Int, target::Int)

Draws a controlled Y gate at step i with control and target qubits.

source
QuantumCircuitDraw.CZMethod
CZ(i::Int, control::Int, target::Int)

Draws a controlled Z gate at step i with control and target qubits.

source