tableau.jl

Public functions

QuantumACES.GateType
Gate

A gate in a stabiliser circuit.

Fields

  • type::String: String describing the gate type.
  • index::Int32: The index labelling the unique layer occurrences of the gate in a circuit.
  • targets::Vector{Int16}: The qubit target or targets of the gate.

Supported gates

  • H: Hadamard gate.
  • S: Phase gate.
  • CX or CNOT: Controlled-X gate; the first qubit is the control and the second qubit is the target.
  • CZ: Controlled-Z gate.
  • I: Identity gate.
  • Z: Pauli Z gate.
  • X: Pauli X gate.
  • Y: Pauli Y gate.
  • II: Two-qubit identity gate.
  • AB: Two-qubit Pauli gate, where A and B are Paulis Z, X, or Y.
  • SQRT_AB: Two-qubit Pauli rotation, where A and B are Paulis Z, X, or Y.
  • SQRT_AB_DAG : Two-qubit Pauli rotation, where A and B are Paulis Z, X, or Y.
  • PZ+: Prepare the Pauli +Z eigenstate.
  • PZ-: Prepare the Pauli -Z eigenstate.
  • PX+: Prepare the Pauli +X eigenstate.
  • PX-: Prepare the Pauli -X eigenstate.
  • PY+: Prepare the Pauli +Y eigenstate.
  • PY-: Prepare the Pauli -Y eigenstate.
  • M or MZ: Measure in the computational Pauli Z basis.
  • MX: Measure in the Pauli X basis.
  • MY: Measure in the Pauli Y basis.
  • R: Reset to the computational Z basis.
source
QuantumACES.LayerType
Layer

A layer of gates in a stabiliser circuit. Gates in a layer are simultaneously implemented by the device, and act on disjoint sets of qubits such that they trivially commute with each other.

Fields

  • layer::Vector{Gate}: The gates in the layer.
  • qubit_num::Int16: The number of qubits in the circuit.
source
QuantumACES.TableauType
Tableau

A tableau representation of a stabiliser state.

Stabiliser circuit simulations follow Improved simulation of stabilizer circuits by S. Aaronson and D. Gottesman (2004).

Fields

  • tableau::Matrix{Bool}: The tableau representation of the stabiliser state.
  • qubit_num::Int16: The number of qubits in the stabiliser state.
source
QuantumACES.apply!Method
apply!(t::Tableau, l::Layer; return_measurements::Bool = false)

Perform on the tableau t all gates in the layer l, and return the list of measurement outcomes if return_measurements is true.

source
QuantumACES.make_layerMethod
make_layer(gate_type::String, range::Vector{Int}, n::Int)

Returns a layer of single-qubit gate_type gates acting on the qubits in range, where the layer acts on n qubits.

source
QuantumACES.make_layerMethod
make_layer(gate_type::String, range_set::Vector{Vector{Int}}, n::Int)

Returns a layer of gate_type gates, each acting on the qubits in range_set, where the layer acts on n qubits.

source
QuantumACES.make_layerMethod
make_layer(gate_types::Vector{String}, ranges::Vector{Vector{Int}}, n::Int)

Returns a layer of single-qubit gates, with gate types specified by gate_types and the qubits upon which they act specified by ranges, where the layer acts on n qubits.

source
QuantumACES.pad_layerMethod
pad_layer(l::Layer)

Returns a copy of the layer l padded by single-qubit identity gates that act on each of the qubits not already acted upon by some gate in the layer.

source

Private functions

QuantumACES.cx!Method
cx!(t::Tableau, control::Integer, target::Integer)

Perform a controlled-X gate on the tableau t with control qubit control and target qubit target.

source
QuantumACES.cz!Method
cz!(t::Tableau, control::Integer, target::Integer)

Perform a controlled-Z gate on the tableau t with control qubit control and target qubit target. The gate is symmetric, so the control and target qubits can be swapped.

source
QuantumACES.hadamard!Method
hadamard!(t::Tableau,target::Integer)

Perform a Hadamard gate on the tableau t with target qubit target.

source
QuantumACES.measure!Method
measure!(t::Tableau, target::Integer)

Measure the tableau t at the target qubit target, and return the measurement outcome.

source
QuantumACES.phase!Method

phase!(t::Tableau,target::Integer)

Perform a phase gate on the tableau t with target qubit target.

source
QuantumACES.reset!Method
reset!(t::Tableau, target::Integer)

Reset the tableau t at the target qubit target by measuring in the computational basis and flipping the phase if the measurement outcome is -1.

source
QuantumACES.row_sum!Method
row_sum!(t::Tableau, target::Integer, control::Integer)

In the tableau t, add the control row control to the target row target, while tracking the phase bit of the target row.

source
QuantumACES.sqrt_zz!Method
sqrt_zz!(t::Tableau, control::Integer, target::Integer)

Perform a π/2 ZZ Pauli rotation gate on the tableau t with control qubit control and target qubit target. The gate is symmetric, so the control and target qubits can be swapped.

source
QuantumACES.sqrt_zz_dag!Method
sqrt_zz_dag!(t::Tableau, control::Integer, target::Integer)

Perform a -π/2 ZZ Pauli rotation gate on the tableau t with control qubit control and target qubit target. The gate is symmetric, so the control and target qubits can be swapped.

source
QuantumACES.x!Method
x!(t::Tableau,target::Integer)

Perform a Pauli X gate on the tableau t with target qubit target, noting that $X = H S^2 H$.

source
QuantumACES.y!Method
y!(t::Tableau,target::Integer)

Perform a Pauli Z gate on the tableau t with target qubit target, noting that $Y = S H S^2 H S^3$.

source
QuantumACES.z!Method
z!(t::Tableau,target::Integer)

Perform a Pauli Z gate on the tableau t with target qubit target, noting that $Z = S^2$.

source