circuit.jl

Public functions

QuantumACES.CircuitType
Circuit

Circuit information, including noise parameters.

Fields

  • circuit_param::AbstractCircuitParameters: Circuit parameters.
  • circuit::Vector{Layer}: Circuit.
  • circuit_tuple::Vector{Int}: Tuple which arranges the order of the circuit layers; this is initialised as trivial.
  • qubit_num::Int: Number of qubits in the circuit.
  • unique_layer_indices::Vector{Int}: Unique non-measurement gate layer indices of the circuit.
  • layer_types::Vector{Symbol}: Types of the layers in the circuit, used for layer times and dynamical decoupling.
  • layer_times::Vector{Float64}: Times taken to implement each layer in the circuit, as well as measurement and reset.
  • gates::Vector{Gate}: Gates in the circuit arranged by the tuple.
  • total_gates::Vector{Gate}: Total gates in the circuit, including preparations if noisy_prep and measurements if noisy_meas.
  • gate_data::GateData: Gate data for the circuit.
  • noise_param::AbstractNoiseParameters: Noise parameters.
  • gate_probabilities::Dict{Gate, Vector{Float64}}: Pauli error probabilities for each gate, stored as a dictionary.
  • gate_eigenvalues::Vector{Float64}: Eigenvalues for each gate, stored as a vector whose order is determined by the gate order in total_gates and indexed by gate_data.
  • noisy_prep::Bool: Whether to treat preparations as noisy and characterise the associated noise, which should default to false; a full-rank design cannot be produced if both noisy_prep and noisy_meas are true.
  • noisy_meas::Bool: Whether to treat measurements as noisy and characterise the associated noise, which should default to true; a full-rank design cannot be produced if both noisy_prep and noisy_meas are true.
  • extra_fields::Dict{Symbol, Any}: Extra data for the circuit, including code parameters for syndrome extraction circuits stored as a :code_param field which is a CodeParameters object.
source
QuantumACES.CodeParametersType
CodeParameters

Code parameters for syndrome extraction circuits.

Note that these expect the qubits to be arranged such that the data qubits are first, followed by the ancilla qubits, and these parameters should be checked with check_code_parameters.

Fields

  • qubits::Vector{Tuple{Int, Int}}: Code qubit lattice locations.
  • qubit_layout::Matrix{String}: Diagram of the layout of the code qubits.
  • inverse_indices::Dict{Tuple{Int, Int}, Int}: Inverse mapping from the qubit lattice locations to their indices.
  • data_indices::Vector{Int}: Data qubit indices.
  • ancilla_indices::Vector{Int}: Ancilla qubit indices.
  • ancilla_x_indices::Vector{Int}: Ancilla X check qubit indices.
  • ancilla_z_indices::Vector{Int}: Ancilla Z check qubit indices.
  • check_x_indices::Vector{Tuple{Vector{Int}, Vector{Int}}}: Pairs of (ancilla, data) qubit indices for each of the X checks.
  • check_z_indices::Vector{Tuple{Vector{Int}, Vector{Int}}}: Pairs of (ancilla, data) qubit indices for each of the Z checks.
  • init_x_indices::Vector{Int}: Logical X initialisation qubit indices for which to initialise in the X basis.
  • init_z_indices::Vector{Int}: Logical Z initialisation qubit indices for which to initialise in the X basis.
  • logical_x_indices::Vector{Int}: Logical X operator qubit indices.
  • logical_z_indices::Vector{Int}: Logical Z operator qubit indices.
source
QuantumACES.get_circuitMethod
get_circuit(circuit::Vector{Layer}, layer_types::Vector{Symbol}, layer_times::Vector{Float64}, noise_param::AbstractNoiseParameters; kwargs...)

Returns a Circuit object given the supplied circuit and noise parameters.

Arguments

  • circuit::Vector{Layer}: Circuit.
  • layer_types::Vector{Symbol}: Types of the layers in the circuit.
  • layer_times::Vector{Float64}: Times taken to implement each layer in the circuit, as well as measurement and reset.
  • noise_param::AbstractNoiseParameters: Noise parameters for the circuit.

Keyword arguments

  • circuit_param::AbstractCircuitParameters = EmptyCircuitParameters(): Circuit parameters.
  • extra_fields::Dict{Symbol, Any} = Dict{Symbol, Any}(): Extra fields, including for CodeParameters.
  • noisy_prep::Bool = false: Whether to treat preparations as noisy and characterise the associated noise; a full-rank design cannot be produced if both noisy_prep and noisy_meas are true.
  • noisy_meas::Bool = true: Whether to treat measurements as noisy and characterise the associated noise; a full-rank design cannot be produced if both noisy_prep and noisy_meas are true.
  • combined::Bool = haskey(noise_param.params, :combined) ? noise_param.params[:combined] : false,: Whether to treat Pauli X, Y, and Z basis SPAM noise as the same.
  • strict::Bool = false: Whether to be strict about which gates count as estimable to relative precision.
source
QuantumACES.get_combined_circuitMethod
get_combined_circuit(c::AbstractCircuit)

Returns a copy of the circuit c where the three parameters describing Pauli X, Y, and Z basis measurements have been combined into a single parameter for each qubit.

source
QuantumACES.get_layer_timesMethod
get_layer_times(layer_types::Vector{Symbol}, layer_time_dict::Dict{Symbol, Float64})

Returns the times taken to implement each layer in the circuit based on their types in layer_types and the times specified in `layertimedict, including the time for final measurement and reset.

source
QuantumACES.update_noiseMethod
update_noise(c::AbstractCircuit, noise_param::AbstractNoiseParameters)
update_noise(c::AbstractCircuit, gate_probabilities::Dict{Gate, Vector{Float64}})

Returns a copy of c where the circuit has been updated with noise generated according to noise_param, or the gate probabilities gate_probabilities.

source

Private functions

QuantumACES.apply_tupleMethod
apply_tuple(c::AbstractCircuit, circuit_tuple::Vector{Int})

Returns a copy of the circuit c arranged by the tuple circuit_tuple.

source
QuantumACES.check_circuitMethod
check_circuit(circuit::Vector{Layer}, circuit_tuple::Vector{Int}, qubit_num::Integer, layer_types::Vector{Symbol}, layer_times::Vector{Float64})

Checks the provided circuit parameters are consistent with each other.

source
QuantumACES.get_gatesMethod
get_gates(circuit::Vector{Vector{Gate}})
get_gates(circuit::Vector{Layer})

Returns the unique gates in the circuit circuit.

source
QuantumACES.get_total_gatesMethod
get_total_gates(circuit::Vector{Layer}, noisy_prep::Bool, noisy_meas::Bool)

Returns the total gates in the circuit circuit, including preparations if noisy_prep and measurements if noisy_meas each on all of the qubits, as well as a separate list of the added measurement gates.

source
QuantumACES.label_circuitMethod
label_circuit(circuit::Vector{Vector{Gate}})
label_circuit(circuit::Vector{Layer})

Returns a labelled copy of the circuit circuit, with indices indicating the unique layer appearances of each gate in the circuit. This function should only be applied to the original circuit before it is arranged by a tuple.

source
QuantumACES.prepare_circuitMethod
prepare_circuit(circuit::Vector{Layer}, noise_param::AbstractNoiseParameters; noisy_prep::Bool = false, noisy_meas::Bool = true)

Returns a labelled copy of the circuit as well as a number of required fields for subtypes T <: AbstractCircuit.

Arguments

  • circuit::Vector{Layer}: Circuit.
  • noise_param::AbstractNoiseParameters: Noise parameters.

Keyword arguments

  • noisy_prep::Bool = false: Whether to treat preparations as noisy and aim to characterise them.
  • noisy_meas::Bool = true: Whether to treat measurements as noisy and aim to characterise them.
  • combined::Bool: Whether to treat Pauli X, Y, and Z basis SPAM noise as the same.
  • strict::Bool = false: Whether to be strict about which gates count as estimable to relative precision.

Returns

  • circuit::Vector{Layer}: Circuit with labelled gates.
  • unique_layer_indices::Vector{Int}: Unique non-measurement gate layer indices of the circuit.
  • gates::Vector{Gate}: Gates in the circuit.
  • total_gates::Vector{Gate}: Total gates in the circuit, including preparations if noisy_prep and measurements if noisy_meas.
  • gate_data::GateData: Gate data for the circuit.
  • gate_probabilities::Dict{Gate, Vector{Float64}}: Pauli error probabilities for each gate, stored as a dictionary.
  • gate_eigenvalues::Vector{Float64}: Eigenvalues for each gate, stored as a vector whose order is determined by the gate order in total_gates and indexed by gate_data.
source
QuantumACES.unwrap_circuitMethod
unwrap_circuit(circuit::Vector{Layer})

Returns a copy of the circuit circuit where each layer has been unwrapped into a vector of gates.

source