Public API

Documentation for the public API of QuantumACES.jl.

To use internal API, which is documented in the internal API section, import the module by running the following.

import QuantumACES as ACES

QuantumACES.jl

QuantumACES.QuantumACESModule

QuantumACES.jl is a package for designing and simulating scalable and performant Pauli noise characterisation experiments for stabiliser circuits with averaged circuit eigenvalue sampling (ACES). It is particularly interested in characterising the noise associated with fault-tolerant gadgets in the context of topological quantum error correcting codes, such as surface code syndrome extraction circuits.

source
QuantumACES.AbstractCircuitType
AbstractCircuit

Circuits should be stored in a subtype T <: AbstractCircuit.

Circuits should be generated by a method of get_circuit, and prepare_circuit is a helpful function for writing such a method.

To specify the preparation of sign configurations for Pauli eigenstates, either provide the partition field or modify get_experiment_layers.

Necessary fields

  • circuit_param::AbstractCircuitParameters: Circuit parameters.
  • circuit::Vector{Layer}: Circuit arranged by the tuple.
  • 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 layer indices of the circuit, which become meaningless and are removed the circuit is arranged by the tuple.
  • 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}: Gates in the original circuit, which includes noisy preparations if add_prep and noisy measurements if add_meas.
  • gate_index::Dict{Gate, Int}: Index of the gate eigenvalues for each gates in the original circuit.
  • N::Int: Number of gate eigenvalues.
  • 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 gate_index.
  • add_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 add_prep and add_meas are true.
  • add_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 add_prep and add_meas are true.

Optional fields

  • partition::Tuple{Vector{Int}, Vector{Int}}: A partition of the qubits into two sets such that two-qubit gates act only between the sets, which allows for easy preparation of sign configurations for Pauli eigenstates; for example, data and ancilla qubits for a syndrome extraction circuit.
source
QuantumACES.AbstractCircuitParametersType
AbstractCircuitParameters

Circuit parameters should be stored in a subtype T <: AbstractCircuitParameters.

Then add a method to get_circuit that generates a circuit according to these parameters. Such a circuit should either be a Circuit type, or a subtype T <: AbstractCircuit.

Necessary fields

  • layer_time_dict::Dict{Symbol, Float64}: Dictionary of the times taken to implement the different types of layers in the circuit, including the time for measurement and reset.
  • circuit_name::String: Name of the circuit, which should implicitly describe parameter settings.
source
QuantumACES.AbstractNoiseParametersType
AbstractNoiseParameters

Noise parameters should be stored in a subtype T <: AbstractNoiseParameters.

Noise models should be generated by a method of get_gate_probabilities, which generates Pauli error probabilities for the supplied gates according to some supplied noise parameters.

Necessary fields

  • noise_name::String: Name of the noise model, which should implicitly describe parameter settings.
source
QuantumACES.AbstractScalingDataType
AbstractScalingData

Scaling data for the figure of merit should be stored in a subtype T <: AbstractScalingData.

Necessary fields

  • circuit_param::AbstractCircuitParameters: Circuit parameters.
  • noise_param::AbstractNoiseParameters: Noise parameters.
  • tuple_set::Vector{Vector{Int}}: Set of tuples which arrange the circuit layers.
  • tuple_set_data::TupleSetData: TupleSetData object that generates the tuple set.
  • shot_weights::Vector{Float64}: Shot weights for each tuple in the set, which add to 1.
  • ls_type::Symbol: Type of least squares estimator for which the scaling is calculated.
source

tableau.jl

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

noise.jl

QuantumACES.DepolarisingParametersType
DepolarisingParameters

Parameterises a depolarising Pauli noise model.

Fields

  • r_1::Float64: Single-qubit gate entanglement infidelity, the sum of all 3 non-identity Pauli error probabilities.
  • r_2::Float64: Two-qubit gate entanglement infidelity, the sum of all 15 non-identity Pauli error probabilities.
  • r_m::Float64: Measurement entanglement infidelity, the measurement error probability.
  • noise_name::String: Noise parameter name for saving data.
source
QuantumACES.LognormalParametersType
LognormalParameters

Parameterises a log-normally random Pauli noise model.

Fields

  • r_1::Float64: Average single-qubit gate entanglement infidelity, the sum of all 3 non-identity Pauli error probabilities.
  • r_2::Float64: Average two-qubit gate entanglement infidelity, the sum of all 15 non-identity Pauli error probabilities.
  • r_m::Float64: Average measurement entanglement infidelity, the measurement error probability.
  • total_std_log::Float64: Approximate standard deviation of the logarithm of the entanglement infidelity across all gate types.
  • seed::UInt64: Random seed used to generate the noise.
  • noise_name::String: Noise parameter name for saving data.
source
QuantumACES.get_dep_paramMethod
get_dep_param(r_1::Float64, r_2::Float64, r_m::Float64)

Return a DepolarisingParameters object that parameterises a depolarising Pauli noise model with single-qubit, two-qubit, and measurement infidelities r_1, r_2, and r_m, respectively.

source
QuantumACES.get_gate_probabilitiesMethod
get_gate_probabilities(total_gates::Vector{Gate}, noise_param::DepolarisingParameters)
get_gate_probabilities(total_gates::Vector{Gate}, noise_param::LognormalParameters)

Returns a dictionary of the Pauli error probabilities for each gate in total_gates generated according to the noise parameters noise_param.

The order in which Pauli stores Pauli operators as bit strings orders the Pauli error probabilities for each gate. For single-qubit gates, the Pauli error probabilities are ordered as I, X, Z, Y. For two-qubit gates, the Pauli error probabilities are ordered as II, XI, IX, XX, ZI, YI, ZX, YX, IZ, XZ, IY, XY, ZZ, YZ, ZY, YY.

source
QuantumACES.get_log_paramMethod
get_log_param(r_1::Float64, r_2::Float64, r_m::Float64, total_std_log::Float64; seed::Union{UInt64, Nothing} = nothing)

Return a LognormalParameters object that parameterises a log-normally random Pauli noise model with average single-qubit, two-qubit, and measurement infidelities r_1, r_2, and r_m, respectively, approximate standard deviation of the logarithm of the entanglement infidelity total_std_log, and random seed seed, which is randomly generated if not supplied.

source

circuit.jl

QuantumACES.CircuitType
Circuit

Circuit information, including noise parameters.

Fields

  • circuit_param::AbstractCircuitParameters: Circuit parameters.
  • circuit::Vector{Layer}: Circuit arranged by the tuple.
  • 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 layer indices of the circuit, which become meaningless and are removed the circuit is arranged by the tuple.
  • 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}: Gates in the original circuit, which includes noisy preparations if add_prep and noisy measurements if add_meas.
  • gate_index::Dict{Gate, Int}: Index of the gate eigenvalues for each gates in the original circuit.
  • N::Int: Number of gate eigenvalues.
  • 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 gate_index.
  • add_prep::Bool: Whether to treat preparations as noisy and characterise the associated noise, defaulting to false; a full-rank design cannot be produced if both add_prep and add_meas are true.
  • add_meas::Bool: Whether to treat measurements as noisy and characterise the associated noise, defaulting to true; a full-rank design cannot be produced if both add_prep and add_meas are true.
source
QuantumACES.RotatedPlanarCircuitType
RotatedPlanarCircuit

Syndrome extraction circuit for a rotated surface code.

Fields

  • circuit_param::RotatedPlanarParameters: Circuit parameters.
  • circuit::Vector{Layer}: Circuit arranged by the tuple.
  • 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 layer indices of the circuit, which become meaningless and are removed the circuit is arranged by the tuple.
  • 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}: Gates in the original circuit, which includes noisy preparations if add_prep and noisy measurements if add_meas.
  • gate_index::Dict{Gate, Int}: Index of the gate eigenvalues for each gates in the original circuit.
  • N::Int: Number of gate eigenvalues.
  • 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 gate_index.
  • add_prep::Bool: Whether to treat preparations as noisy and characterise the associated noise, defaulting to false; a full-rank design cannot be produced if both add_prep and add_meas are true.
  • add_meas::Bool: Whether to treat measurements as noisy and characterise the associated noise, defaulting to true; a full-rank design cannot be produced if both add_prep and add_meas are true.
  • partition::Tuple{Vector{Int}, Vector{Int}}: Partition of the qubits (data, ancilla), allowing for easy preparation of sign configurations for Pauli eigenstates.
  • qubits::Vector{Tuple{Int, Int}}: Code qubit lattice locations.
  • 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.
  • qubit_layout::Matrix{String}: Diagram of the layout of the code qubits.
source
QuantumACES.RotatedPlanarParametersType
RotatedPlanarParameters

Parameters for the syndrome extraction circuit of a rotated surface code.

Fields

  • vertical_dist::Int: Vertical (Z) distance of the code.
  • horizontal_dist::Int: Horizontal (X) distance of the code.
  • check_type::Symbol: Type of stabiliser used in the circuit, either :xzzx or :standard.
  • gate_type::Symbol: Type of two-qubit gate used in the circuit, either :cx or :cz.
  • dynamically_decouple::Bool: Whether to dynamically decouple the circuit; true is currently only supported for :xzzx and :cz.
  • pad_identity::Bool: Whether to pad layers with single-qubit identity gates.
  • layer_time_dict::Dict{Symbol, Float64}: Dictionary of layer times.
  • circuit_name::String: Name of the circuit used for saving data.
source
QuantumACES.UnrotatedPlanarCircuitType
UnrotatedPlanarCircuit

Syndrome extraction circuit for a unrotated surface code.

Fields

  • circuit_param::UnrotatedPlanarParameters: Circuit parameters.
  • circuit::Vector{Layer}: Circuit arranged by the tuple.
  • 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 layer indices of the circuit, which become meaningless and are removed the circuit is arranged by the tuple.
  • 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}: Gates in the original circuit, which includes noisy preparations if add_prep and noisy measurements if add_meas.
  • gate_index::Dict{Gate, Int}: Index of the gate eigenvalues for each gates in the original circuit.
  • N::Int: Number of gate eigenvalues.
  • 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 gate_index.
  • add_prep::Bool: Whether to treat preparations as noisy and characterise the associated noise, defaulting to false; a full-rank design cannot be produced if both add_prep and add_meas are true.
  • add_meas::Bool: Whether to treat measurements as noisy and characterise the associated noise, defaulting to true; a full-rank design cannot be produced if both add_prep and add_meas are true.
  • partition::Tuple{Vector{Int}, Vector{Int}}: Partition of the qubits (data, ancilla), allowing for easy preparation of sign configurations for Pauli eigenstates.
  • qubits::Vector{Tuple{Int, Int}}: Code qubit lattice locations.
  • 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.
  • qubit_layout::Matrix{String}: Diagram of the layout of the code qubits.
source
QuantumACES.UnrotatedPlanarParametersType
UnrotatedPlanarParameters

Parameters for the syndrome extraction circuit of an unrotated surface code.

Fields

  • vertical_dist::Int: Vertical (Z) distance of the code.
  • horizontal_dist::Int: Horizontal (X) distance of the code.
  • gate_type::Symbol: Type of two-qubit gate used in the circuit, which must be :cx.
  • pad_identity::Bool: Whether to pad layers with single-qubit identity gates.
  • layer_time_dict::Dict{Symbol, Float64}: Dictionary of layer times.
  • circuit_name::String: Name of the circuit used for saving data.
source
QuantumACES.get_circuitMethod
get_circuit(rotated_param::RotatedPlanarParameters, noise_param::AbstractNoiseParameters; kwargs...)
get_circuit(unrotated_param::UnrotatedPlanarParameters, noise_param::AbstractNoiseParameters; kwargs...)

Returns a circuit object, a subtype T <: AbstractCircuit, parameterised by the supplied circuit and noise parameters.

Arguments

  • rotated_param::RotatedPlanarParameters: Parameters for a rotated surface code.
  • unrotated_param::UnrotatedPlanarParameters: Parameters for an unrotated surface code.
  • noise_param::AbstractNoiseParameters: Noise parameters for the circuit.

Keyword arguments

  • add_prep::Bool = false: Whether to treat preparations as noisy and characterise the associated noise, defaulting to false; a full-rank design cannot be produced if both add_prep and add_meas are true.
  • add_meas::Bool = true: Whether to treat measurements as noisy and characterise the associated noise, defaulting to true; a full-rank design cannot be produced if both add_prep and add_meas are true.
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 measurement and reset at the end.

source
QuantumACES.get_rotated_paramMethod
get_rotated_param(vertical_dist::Int, horizontal_dist::Int; kwargs...)
get_rotated_param(dist::Int; kwargs...)

Returns a RotatedPlanarParameters object that parameterises the syndrome extraction circuit of a rotated surface code.

Default gate layer times are estimated from Suppressing quantum errors by scaling a surface code logical qubit by Google Quantum AI (2023).

Arguments

  • vertical_dist::Int: Vertical (Z) distance of the code.
  • horizontal_dist::Int: Horizontal (X) distance of the code.
  • dist::Int: Distance of the code; this is equivalent to setting vertical_dist = dist and horizontal_dist = dist.

Keyword arguments

  • check_type::Symbol = :xzzx: Type of stabiliser used in the circuit, either :xzzx or :standard.
  • gate_type::Symbol = :cz: Type of two-qubit gate used in the circuit, either :cx or :cz.
  • dynamically_decouple::Bool = true: Whether to dynamically decouple the circuit; true is currently only supported for :xzzx and :cz.
  • pad_identity::Bool = true: Whether to pad layers with single-qubit identity gates.
  • single_qubit_time::Float64 = 29.0: Time taken to implement a single-qubit gate in nanoseconds.
  • two_qubit_time::Float64 = 29.0: Time taken to implement a two-qubit gate in nanoseconds.
  • meas_reset_time::Float64 = 660.0: Time taken to perform measurement and reset at the end of the circuit in nanoseconds.
  • dynamical_decoupling_time::Float64 = 29.0: Time taken to implement a dynamical decoupling layer in nanoseconds.
source
QuantumACES.get_unrotated_paramMethod
get_unrotated_param(vertical_dist::Int, horizontal_dist::Int; kwargs...)
get_unrotated_param(dist::Int; kwargs...)

Returns an UnrotatedPlanarParameters object that parameterises the syndrome extraction circuit of a unrotated surface code.

Default gate layer times are estimated from Suppressing quantum errors by scaling a surface code logical qubit by Google Quantum AI (2023).

Arguments

  • vertical_dist::Int: Vertical (Z) distance of the code.
  • horizontal_dist::Int: Horizontal (X) distance of the code.
  • dist::Int: Distance of the code; this is equivalent to setting vertical_dist = dist and horizontal_dist = dist.

Keyword arguments

  • gate_type::Symbol = :cx: Type of two-qubit gate used in the circuit, which must be :cx.
  • pad_identity::Bool = true: Whether to pad layers with single-qubit identity gates.
  • single_qubit_time::Float64 = 29.0: Time taken to implement a single-qubit gate in nanoseconds.
  • two_qubit_time::Float64 = 29.0: Time taken to implement a two-qubit gate in nanoseconds.
  • dynamical_decoupling_time::Float64 = 29.0: Time taken to implement a dynamical decoupling layer in nanoseconds.
  • meas_reset_time::Float64 = 660.0: Time taken to perform measurement and reset at the end of the circuit in nanoseconds.
source
QuantumACES.prepare_circuitMethod
prepare_circuit(circuit::Vector{Layer}, qubit_num::Int, layer_types::Vector{Symbol}, layer_times::Vector{Float64}, noise_param::AbstractNoiseParameters; add_prep::Bool = false, add_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.
  • qubit_num::Int: Number of qubits in the 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, including measurement and reset at the end.
  • noise_param::AbstractNoiseParameters: Noise parameters.

Keyword arguments

  • add_prep::Bool = false: Whether to treat preparations as noisy and aim to characterise them.
  • add_meas::Bool = true: Whether to treat measurements as noisy and aim to characterise them.

Returns

  • circuit::Vector{Layer}: Circuit with labelled gates.
  • unique_layer_indices::Vector{Int}: Indices of the unique layers in the circuit.
  • gates::Vector{Gate}: Gates in the circuit.
  • total_gates::Vector{Gate}: Total gates in the circuit, including preparations if add_prep and measurements if add_meas.
  • gate_index::Dict{Gate, Int}: Index of the gate eigenvalues for each gate in the original circuit.
  • N::Int: Number of gate eigenvalues.
  • 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 gate_index.
source
QuantumACES.update_noiseMethod
update_noise(c::AbstractCircuit, noise_param::AbstractNoiseParameters)

Returns a copy of c where the circuit has been updated with noise generated according to noise_param.

source

tuples.jl

QuantumACES.TupleSetDataType
TupleSetData

Data parameterising a tuple set.

Fields

  • tuple_set::Vector{Vector{Int}}: The main tuple set, whose tuples are not repeated.
  • repeat_tuple_set::Vector{Vector{Int}}: The repeated tuple set, whose tuples are repeated repeat_numbers times.
  • repeat_numbers::Vector{Int}: The number of repetitions for each tuple in the repeated tuple set repeat_tuple_set.
  • repeat_indices::Vector{Int}: Indexes the repetition number in repeat_numbers that describes the number of repetitions for each tuple in repeat_tuple_set.
source
QuantumACES.get_tuple_set_dataMethod
get_tuple_set_data(c::AbstractCircuit; init_scaling::Float64 = 0.2)
get_tuple_set_data(c::AbstractCircuit, tuple_set::Vector{Vector{Int}}; init_scaling::Float64 = 0.2)

Returns the tuple set data corresponding to the circuit c, with the non-repeated tuples either being the supplied tuple_set or the basic tuple set for c. The repeat numbers are initialised to be inversely proportional to the average noise on the gates in the layers, implicitly assuming depolarising noise, scaled by a factor init_scaling which is empirically helpful.

source

design.jl

QuantumACES.DesignType
Design

Experimental design for a noise characterisation experiment for a circuit.

Fields

  • c::AbstractCircuit: Circuit characterised by the design.
  • full_covariance::Bool: If true, generates parameters to construct the full covariance matrix in covariance_dict_ensemble, else if false, only generates parameters to construct the terms on the diagonal.
  • matrix::SparseMatrixCSC{Int32, Int32}: Sparse M x N design matrix, corresponding to M circuit eigenvalues and N gate eigenvalues.
  • tuple_set::Vector{Vector{Int}}: Set of tuples which arrange the circuit layers.
  • tuple_set_data::TupleSetData: TupleSetData object that generates the tuple set.
  • mapping_ensemble::Vector{Vector{Mapping}}: Vector of the Mapping objects for each of the circuit eigenvalue for the Paulis corresponding to that tuple, for each tuple in the set.
  • experiment_ensemble::Vector{Vector{Vector{Int}}}: Vector of the experiments that index Mapping objects, which correspond to simultaneously preparable and measurable circuit eigenvalues, for each tuple in the set.
  • covariance_dict_ensemble::Vector{Dict{CartesianIndex{2}, Tuple{Mapping, Int}}}: Dictionary of Mapping objects describing the non-zero entries of the sparse circuit eigenvalue estimator covariance matrix, alongside the number of times the entry is estimated by the experiment set, for each tuple in the set.
  • prep_ensemble::Vector{Vector{Vector{Layer}}}: Vector of Layer objects that prepare qubits in Pauli eigenstates for each experiment in the set, indeed a vector preparing the necessary sign configurations, for each tuple in the set.
  • meas_ensemble::Vector{Vector{Layer}}: Vector of Layer objects that measure qubits in Pauli bases for each experiment in the set, for each tuple in the set.
  • tuple_times::Vector{Float64}: Time taken to implement the circuit arranged by each tuple in the set, normalised according to the time factor for the basic tuple set.
  • shot_weights::Vector{Float64}: Shot weights for each tuple in the set, which add to 1.
  • experiment_numbers::Vector{Int}: Number of experiments for each tuple in the set.
  • experiment_number::Int: Total number of experiments.
  • calculation_times::Matrix{Float64}: Time taken to generate components of the design for each tuple, which correspond to generating: the mappings, the sets of tuple-consistent Pauli preparations, the experiment sets, the covariance matrix dictionary, and the circuits.
  • overall_time::Float64: Overall time taken to generate the design.
  • optimisation_time::Float64: Time taken to optimise the design.
  • ls_type::Symbol: Type of least squares for which the shot weights were optimised.
source
QuantumACES.MappingType
Mapping

Mapping of a Pauli operator by some circuit.

Fields

  • initial::Pauli: Initial Pauli operator before the action of the circuit.
  • final::Pauli: Final Pauli operator after the action of the circuit.
  • design_row::SparseVector{Int32, Int32}: Design matrix row for the circuit eigenvalue corresponding to the initial Pauli and the circuit used for the mapping.
  • spread_track::Vector{Vector{Int16}}: Track of the support of the Pauli as it is acted upon by the layers of the circuit.
source
QuantumACES.PauliType
Pauli

Boolean representation of a Pauli operator.

Fields

  • pauli::Vector{Bool}: The Pauli operator stored as a Boolean vector. The first qubit_num elements represent Pauli X on each qubit, the next qubit_num elements represent Pauli Z on each qubit, and the final element represents the sign.
  • qubit_num::Int16: The number of qubits on which the Pauli operator acts; the length of the vector is 2 * qubit_num + 1.
source
QuantumACES.complete_designMethod
complete_design(d::Design; diagnostics::Bool = false)

Returns a copy of the design d where the covariance matrix dictionary generates the full covariance matrix. Prints diagnostics if diagnostics is true.

source
QuantumACES.generate_designMethod
generate_design(c::AbstractCircuit, tuple_set::Vector{Vector{Int}}; kwargs...)
generate_design(c::AbstractCircuit, tuple_set_data::TupleSetData; kwargs...)
generate_design(c::AbstractCircuit; kwargs...)

Returns a Design object containing all relevant information describing the experimental design, including the design matrix.

Arguments

  • c::AbstractCircuit: Circuit for which the design matrix is to be generated.
  • tuple_set::Vector{Vector{Int}}: Tuple set arranging the circuit layers that is used to generate the experimental design.
  • tuple_set_data::TupleSetData: TupleSetData object that generates the tuple set.

Keyword arguments

  • shot_weights::Union{Vector{Float64}, Nothing} = nothing: Shot weights for each tuple in the set, which must add to 1. When nothing, automatically generates the default shot weights.
  • full_covariance::Bool = true: If true, generates parameters to construct the full covariance matrix, else if false, only generates parameters to construct the terms on the diagonal.
  • N_warn::Int = 3 * 10^4: Number of circuit eigenvalues above which to warn the user about certain keyword argument choices.
  • diagnostics::Bool = false: Whether to print diagnostic information.
  • save_data::Bool = false: Whether to save the design data.
source
QuantumACES.update_noiseMethod
update_noise(d::Design, noise_param::AbstractNoiseParameters)

Returns a copy of design where the circuit has been updated with noise generated according to noise_param.

source

merit.jl

QuantumACES.MeritType
Merit

Merit parameters for an experimental design.

Fields

  • circuit_param::AbstractCircuitParameters: Circuit parameters.
  • noise_param::AbstractNoiseParameters: Noise parameters.
  • ls_type::Symbol: Type of least squares estimator for which the merit is reported.
  • tuple_set::Vector{Vector{Int}}: Set of tuples which arrange the circuit layers.
  • tuple_set_data::TupleSetData: TupleSetData object that generates the tuple set.
  • tuple_times::Vector{Float64}: Time taken to implement the circuit corresponding to each tuple, normalised according to the basic tuple set.
  • shot_weights::Vector{Float64}: Shot weights for each tuple in the set, which add to 1.
  • experiment_numbers::Vector{Int}: Number of experiments for each tuple in the set.
  • experiment_number::Int: Total number of experiments.
  • G::Int: Total number of gates.
  • N::Int: Number of gate eigenvalues.
  • expectation::Float64: Expected normalised RMS error for the gate eigenvalue estimator vector.
  • variance::Float64: Normalised RMS error variance for the gate eigenvalue estimator vector.
  • eigenvalues::Vector{Float64}: Eigenvalues of the gate eigenvalue estimator covariance matrix.
  • cond_num::Float64: Condition number of the design matrix, the ratio of the largest and smallest singular values.
  • pinv_norm::Float64: Pseudoinverse norm of the design matrix, the inverse of the smallest singular value.
source
QuantumACES.calc_covariance_logMethod
calc_covariance_log(d::Design; warning::Bool = true)

Returns the covariance matrix of the circuit log-eigenvalues for the design d. If warning is true, warns that if d.full_covariance is false this will only generate the diagonal of the covariance matrix.

source
QuantumACES.calc_gls_momentsMethod
calc_gls_moments(d::Design, covariance_log::SparseMatrixCSC{Float64, Int})

Returns the expectation and variance of the normalised RMS error for the generalised least squares (GLS) estimator corresponding to the design d with circuit log-eigenvalue estimator covariance matrix covariance_log.

source
QuantumACES.calc_ls_meritMethod
calc_ls_merit(d::Design, ls_type::Symbol)

Returns the Merit object for the least squares estimator specified by ls_type (:gls, :wls, or :ols) corresponding to the design d.

source
QuantumACES.calc_ls_momentsMethod
calc_ls_moments(d::Design, covariance_log::SparseMatrixCSC{Float64, Int}, ls_type::Symbol)

Returns the expectation and variance of the normalised RMS error for the least squares estimator specified by ls_type (:gls, :wls, or :ols) corresponding to the design d with circuit log-eigenvalue estimator covariance matrix covariance_log.

source
QuantumACES.calc_merit_setMethod
calc_ls_merit(d::Design, ls_type::Symbol)

Returns Merit objects for all three least squares estimators (generalised, weighted, and ordinary least squares) corresponding to the design d.

source
QuantumACES.calc_ols_momentsMethod
calc_ols_moments(d::Design, covariance_log::SparseMatrixCSC{Float64, Int})

Returns the expectation and variance of the normalised RMS error for the ordinary least squares (OLS) estimator corresponding to the design d with circuit log-eigenvalue estimator covariance matrix covariance_log.

source
QuantumACES.calc_wls_momentsMethod
calc_wls_moments(d::Design, covariance_log::SparseMatrixCSC{Float64, Int})

Returns the expectation and variance of the normalised RMS error for the weighted least squares (WLS) estimator corresponding to the design d with circuit log-eigenvalue estimator covariance matrix covariance_log.

source
QuantumACES.nrmse_pdfMethod
nrmse_pdf(cov_eigenvalues::Vector{Float64}, nrmse_values::Vector{Float64}; epsilon::Float64 = 1e-5)

Returns the probability density function (PDF) for the normalised RMS error (NRMSE) of the gate eigenvalue estimator vector, which follows a generalised chi-squared distribution and whose covariance matrix has eigenvalues cov_eigenvalues, at the coordinates specified by nrmse_values. Does not calculate values when the normal approximation to the PDF is less than a factor of epsilon of its maximum value.

Calculation follows Eq. 3.2 of Computing the distribution of quadratic forms in normal variables by J. P. Imhof (1961).

source

weights.jl

QuantumACES.compare_ls_optimise_weightsMethod
compare_ls_optimise_weights(d::Design, covariance_log::SparseMatrixCSC{Float64, Int}; gls_options::OptimOptions = OptimOptions(; ls_type = :gls), wls_options::OptimOptions = OptimOptions(; ls_type = :wls), ols_options::OptimOptions = OptimOptions(; ls_type = :ols))

Returns versions of the design d and circuit log-eigenvalue estimator covariance matrix covariance_log after optimising the shot weights with respect to the figure of merit, alongside the figure of merit values at each step and the final merits, for all three least squares estimator types. The optimisation for each is parameterised by the OptimOptions objects gls_options, wls_options, and ols_options, respectively.

source
QuantumACES.gls_optimise_weightsMethod
gls_optimise_weights(d::Design, covariance_log::SparseMatrixCSC{Float64, Int}; options::OptimOptions = OptimOptions())

Returns versions of the design d and circuit log-eigenvalue estimator covariance matrix covariance_log after optimising the shot weights with respect to the generalised least squares (GLS) figure of merit, alongside the figure of merit values at each step. The optimisation is parameterised by the OptimOptions object options.

source
QuantumACES.ols_optimise_weightsMethod
ols_optimise_weights(d::Design, covariance_log::SparseMatrixCSC{Float64, Int}; options::OptimOptions = OptimOptions())

Returns versions of the design d and circuit log-eigenvalue estimator covariance matrix covariance_log after optimising the shot weights with respect to the ordinary least squares (OLS) figure of merit, alongside the figure of merit values at each step. The optimisation is parameterised by the OptimOptions object options.

source
QuantumACES.optimise_weightsMethod
optimise_weights(d::Design, covariance_log::SparseMatrixCSC{Float64, Int}; options::OptimOptions = OptimOptions())

Returns versions of the design d and circuit log-eigenvalue estimator covariance matrix covariance_log after optimising the shot weights with respect to the figure of merit, alongside the figure of merit values at each step. The optimisation is parameterised by the OptimOptions object options, which in particular specifies the least squares estimator type for which the figure of merit is calculated.

source
QuantumACES.wls_optimise_weightsMethod
wls_optimise_weights(d::Design, covariance_log::SparseMatrixCSC{Float64, Int}; options::OptimOptions = OptimOptions())

Returns versions of the design d and circuit log-eigenvalue estimator covariance matrix covariance_log after optimising the shot weights with respect to the weighted least squares (WLS) figure of merit, alongside the figure of merit values at each step. The optimisation is parameterised by the OptimOptions object options.

source

optimise.jl

QuantumACES.optimise_designMethod
optimise_design(c::AbstractCircuit; options::OptimOptions = OptimOptions())
optimise_design(c::AbstractCircuit, tuple_set_data::TupleSetData; options::OptimOptions = OptimOptions())

Returns an optimised experimental design for the circuit c initialised with the tuple set data tuple_set_data. The optimisation is parameterised by the OptimOptions object options.

source
QuantumACES.optimise_repetitionsMethod
optimise_repetitions(c::AbstractCircuit, tuple_set_data::TupleSetData; options::OptimOptions = OptimOptions())

Returns the tuple set data after optimising the repetition numbers in the supplied tuple set data tuple_set_data for the circuit c. The optimisation is parameterised by the OptimOptions object options.

source
QuantumACES.optimise_tuple_setMethod
optimise_tuple_set(d::Design, covariance_log::SparseMatrixCSC{Float64, Int}; options::OptimOptions = OptimOptions())

Returns versions of the design d and circuit log-eigenvalue estimator covariance matrix covariance_log after optimising the tuple set of the design with repeated excursions that grow and prune the tuple set. The optimisation is parameterised by the OptimOptions object options.

source

scaling.jl

QuantumACES.DepolarisingPlanarScalingType
DepolarisingPlanarScaling

Scaling data for an experimental design for the syndrome extraction circuit of a surface code with depolarising Pauli noise.

Fields

  • dist_range::Vector{Int}: Code distances.
  • merit_scaling::Vector{Merit}: Merit of the design for a range of code distances.
  • G_fit::Function: Gate number fit.
  • G_params::Vector{Int}: Gate number fit parameters; $a + bd + cd^2$.
  • N_fit::Function: Gate eigenvalue number fit.
  • N_params::Vector{Int}: Gate eigenvalue number fit parameters; $a + bd + cd^2$.
  • trace_fit::Function: Trace of the gate eigenvalue estimator covariance matrix fit.
  • trace_params::Vector{Float64}: Trace of the gate eigenvalue estimator covariance matrix fit parameters; $a + bd + cd^2$.
  • trace_sq_fit::Function: Trace of the gate eigenvalue estimator covariance matrix squared fit.
  • trace_sq_params::Vector{Float64}: Trace of the gate eigenvalue estimator covariance matrix squared fit parameters; $a + bd + cd^2$.
  • expectation_fit::Function: Normalised RMS error expectation fit.
  • variance_fit::Function: Normalised RMS error variance fit.
  • circuit_param::AbstractCircuitParameters: Code parameters.
  • noise_param::DepolarisingParameters: Depolarising noise parameters.
  • tuple_set::Vector{Vector{Int}}: Set of tuples which arrange the circuit layers.
  • tuple_set_data::TupleSetData: TupleSetData object that generates the tuple set.
  • shot_weights::Vector{Float64}: Shot weights for each tuple in the set, which add to 1.
  • ls_type::Symbol: Type of least squares estimator for which the merits were calculated.
  • calculation_times::Matrix{Float64}: Time taken to generate the design and calculate the merit, respectively, for each distance.
  • overall_time::Float64: The overall time taken to calculate the merit scaling data for depolarising noise.
source
QuantumACES.LognormalPlanarScalingType
LognormalPlanarScaling

Scaling data for an experimental design for the syndrome extraction circuit of a surface code with log-normal random Pauli noise.

Fields

  • dist_range::Vector{Int}: Code distances.
  • N_fit::Function: Gate eigenvalue number fit.
  • N_params::Vector{Int}: Gate eigenvalue number fit parameters; $a + bd + cd^2$.
  • expectation_scaling::Vector{Vector{Float64}}: Expected normalised RMS error for a range of code distances.
  • expectation_fit::Function: Mean expected normalised RMS error fit.
  • variance_scaling::Vector{Vector{Float64}}: Normalised RMS error variance for a range of code distances.
  • variance_fit::Function: Mean normalised RMS error variance fit.
  • eigenvalues_scaling::Vector{Vector{Vector{Float64}}}: Eigenvalues of the gate log-eigenvalue estimator covariance matrix for a range of code distances.
  • circuit_param::AbstractCircuitParameters: Code parameters.
  • noise_param::LognormalParameters: Log-normal random noise parameters.
  • seeds::Vector{UInt64}: Seeds for the log-normal noise parameters.
  • tuple_set::Vector{Vector{Int}}: Set of tuples which arrange the circuit layers.
  • tuple_set_data::TupleSetData: TupleSetData object that generates the tuple set.
  • shot_weights::Vector{Float64}: Shot weights for each tuple in the set, which add to 1.
  • ls_type::Symbol: Type of least squares estimator for which the merits were calculated.
  • calculation_times::Matrix{Float64}: The time taken to generate the design and calculate the figures of merit for random instances of log-normal Pauli noise, and for depolarising Pauli noise, respectively.
  • overall_time::Float64: The overall time taken to calculate the merit scaling for log-normal random noise.
source
QuantumACES.calc_depolarising_planar_scalingMethod
calc_depolarising_planar_scaling(d::Design, dist_max::Int; kwargs...)
calc_depolarising_planar_scaling(d::Design, dist_range::Vector{Int}; kwargs...)

Returns the scaling data as a DepolarisingPlanarScaling object for the figure of merit of the design d for the syndrome extraction circuit of a surface code with depolarising Pauli noise, as a function of the distance of the code.

Arguments

  • d::Design: Design for which the merit scaling is calculated.
  • dist_max::Int: Maximum code distance for which the merit scaling is calculated.
  • dist_range::Vector{Int}: Vode distances for which the merit scaling is calculated.

Keyword arguments

  • ls_type::Symbol = :none: Type of least squares estimator used to calculate the merit scaling, which defaults to the least squares estimator type of the design, or if that is not specified, :wls.
  • diagnostics::Bool = true: Whether to print diagnostic information.
  • save_data::Bool = false: Whether to save the merit scaling data.
source
QuantumACES.calc_lognormal_planar_scalingMethod
calc_lognormal_planar_scaling(d::Design, dist_max::Int; kwargs...)
calc_lognormal_planar_scaling(d::Design, dist_range::Vector{Int}; kwargs...)

Returns the scaling data as a LognormalPlanarScaling object for the figure of merit of the design d for the syndrome extraction circuit of a surface code with log-normal random Pauli noise, as a function of the distance of the code.

Arguments

  • d::Design: Design for which the merit scaling is calculated.
  • dist_max::Int: Maximum code distance for which the merit scaling is calculated.
  • dist_range::Vector{Int}: Code distances for which the merit scaling is calculated.

Keyword arguments

  • ls_type::Symbol = :none: Type of least squares estimator used to calculate the merit scaling, which defaults to the least squares estimator type of the design, or if that is not specified, :wls.
  • precision::Float64 = 1e-3: Precision to which the figure of merit is estimated, corresponding to the target standard error of the mean.
  • max_repetitions::Int = 10000: Maximum number of random instances of log-normal Pauli noise over which the figure of merit is calculated.
  • min_repetitions::Int = 100: Minimum number of random instances of log-normal Pauli noise over which the figure of merit is calculated.
  • print_repetitions::Int = 100: Number of random instances of log-normal Pauli noise between printing diagnostics.
  • seed::Union{UInt64, Nothing} = nothing: Seeds used to generate instances of log-normal Pauli noise.
  • diagnostics::Bool = true: Whether to print diagnostic information.
  • save_data::Bool = false: Whether to save the merit scaling data.
source

simulate.jl

QuantumACES.ACESDataType
ACESData

ACES noise characterisation experiment simulation results.

Fields

  • d::Design: Experimental design.
  • budget_set::Vector{Int}: Measurement budgets.
  • shots_set::Vector{Int}: Measurement shots corresponding to the measurement budgets in budget_set.
  • repetitions::Int: Number of times to repeat the ACES estimation procedure.
  • seeds::Vector{UInt64}: Seeds for each of the repetitions.
  • eigenvalues::Vector{Float64}: Circuit eigenvalues.
  • covariance::SparseMatrixCSC{Float64, Int32}: Circuit eigenvalue estimator covariance matrix.
  • est_eigenvalues_coll::Matrix{Vector{Float64}}: Estimated circuit eigenvalues for each of the measurement budgets and repetitions.
  • fgls_gate_eigenvalues_coll::Matrix{Vector{Float64}}: FGLS estimated gate eigenvalues for each of the measurement budgets and repetitions.
  • gls_gate_eigenvalues_coll::Matrix{Vector{Float64}}: GLS estimated gate eigenvalues for each of the measurement budgets and repetitions, which uses the true circuit eigenvalue estimator covariance matrix.
  • wls_gate_eigenvalues_coll::Matrix{Vector{Float64}}: WLS estimated gate eigenvalues for each of the measurement budgets and repetitions.
  • ols_gate_eigenvalues_coll::Matrix{Vector{Float64}}: OLS estimated gate eigenvalues for each of the measurement budgets and repetitions.
  • fgls_gate_probabilities_coll::Matrix{Dict{Gate, Vector{Float64}}}: FGLS estimated gate probability distributions for each of the measurement budgets and repetitions.
  • gls_gate_probabilities_coll::Matrix{Dict{Gate, Vector{Float64}}}: GLS estimated gate probability distributions for each of the measurement budgets and repetitions.
  • wls_gate_probabilities_coll::Matrix{Dict{Gate, Vector{Float64}}}: WLS estimated gate probability distributions for each of the measurement budgets and repetitions.
  • ols_gate_probabilities_coll::Matrix{Dict{Gate, Vector{Float64}}}: OLS estimated gate probability distributions for each of the measurement budgets and repetitions.
  • fgls_gate_norm_coll::Matrix{Float64}: Normalised RMS error between the FGLS estimated gate eigenvalues and the true gate eigenvalues for each of the measurement budgets and repetitions.
  • gls_gate_norm_coll::Matrix{Float64}: Normalised RMS error between the GLS estimated gate eigenvalues and the true gate eigenvalues for each of the measurement budgets and repetitions.
  • wls_gate_norm_coll::Matrix{Float64}: Normalised RMS error between the WLS estimated gate eigenvalues and the true gate eigenvalues for each of the measurement budgets and repetitions.
  • ols_gate_norm_coll::Matrix{Float64}: Normalised RMS error between the OLS estimated gate eigenvalues and the true gate eigenvalues for each of the measurement budgets and repetitions.
  • calculation_times::Matrix{Float64}: Time taken to simulate sampling and estimate the gate eigenvalues with FGLS, GLS, WLS, and OLS for each repetition.
  • overall_time::Float64: Overall time taken to simulate ACES across all repetitions.
source
QuantumACES.simulate_acesMethod
simulate_aces(d::Design, budget_set::Vector{Int}; kwargs...)

Simulates ACES noise characterisation experiments for the experimental design d across each of the measurement budgets in budget_set.

WARNING: Seeding has the same features as in Stim. The behaviour of the same random seed will differ across different versions of Stim. Also, when measurement shots are sampled in batches, which occurs when max_samples is exceeded, the results will differ from when all shots are sampled at once.

Arguments

  • d::Design: Experimental design.
  • budget_set::Vector{Int}: Measurement budgets for which to simulate ACES.

Keyword arguments

  • repetitions::Int = 1: Number of simulation repetitions.
  • seed::Union{UInt64, Nothing} = nothing: the seed to use for the random number generator.
  • N_warn::Int = 3 * 10^4: Number of circuit eigenvalues above which to warn the user about certain keyword argument choices.
  • max_samples::Int = 10^10: Maximum number of Stim samples collected in a single simulation.
  • force_gc::Bool = false: Whether to force garbage collection before and after each Stim simulation; this was added to prevent occasional segfaults but massively slows down the simulation, and currently does not appear to be necessary.
  • diagnostics::Bool = true: Whether to print diagnostics.
  • detailed_diagnostics::Bool = false: Whether to print detailed diagnostics.
  • save_data::Bool = false: Whether to save the data.
  • save_interval::Int = 50: Repetition interval at which to save the data.
  • clear_design::Bool = false: Whether to clear the saved design data after saving the full simulation data.
source

kwargs.jl

QuantumACES.OptimOptionsType
OptimOptions

Keyword arguments for optimise_design, and specifically the optimisation functions within it, including for the gradient descent function optimise_weights, the repetition number optimisation function optimise_repetitions, and the tuple set optimisation function optimise_tuple_set.

General options

  • ls_type::Symbol = :wls: The type of least squares estimator for which we optimise the design, which can be :gls, :wls, or :ols.
  • save_data::Bool = false: Whether to automatically save the optimised design.

Gradient descent options

  • learning_rate::Float64 = (ls_type == :ols ? 1.0 : 10.0^(3/4)): Learning rate for the gradient descent algorithm.
  • momentum::Float64 = 0.99: Momentum for the gradient descent algorithm.
  • learning_rate_scale_factor::Float64 = 10.0^(1/4): Factor by which to reduce the learning rate if the gradient descent algorithm repeatedly steps in directions that reduce the figure of merit.
  • shot_weights_clip::Float64 = 1e-5: If any tuple has shot weight below this threshold, the algorithm greedily considers pruning it from the tuple set.
  • max_steps::Int = 400: Maximum number of gradient descent steps to take.
  • convergence_threshold::Float64 = 1e-5: Convergence threshold for the gradient descent algorithm.
  • convergence_steps::Int = 5: Number of steps over which to check convergence.
  • grad_diagnostics::Bool = false: Whether to display gradient descent diagnostics.

Reptition number optimisation options

  • max_cycles::Int = 50: Maximum number of cycles to use in the cyclic coordinate descent algorithm for optimising repetition numbers.
  • rep_diagnostics::Bool = true: Whether to display repetition number optimisation diagnostics.

Tuple set optimisation options

  • excursion_number::Int = 5: Number of excurisons used to optimise the tuple set.
  • excursion_length::Int = 5: Number of tuples added by each excursion past the max_tuple_number, so that at the end of an excursion the tuple set will have up to max_tuple_number + excursion_length tuples.
  • max_tuple_number::Int = 35: Maximum number of tuples in the optimised tuple set.
  • max_tuple_length::Int = 20: Maximum length of random tuples.
  • tuple_length_zipf_power::Float64 = 1.0: Zipf power to use when Zipf-randomly choosing the length of random tuples.
  • repeat_zipf_powers::Vector{Float64} = [Inf; 2.0]: Zipf power to use, chosen uniformly at random from the vector, when Zipf-randomly choosing how many times to repeat entries that will be appended to the end of a random tuple during its generation.
  • mirror_values::Vector{Bool} = [false; true]: Whether to mirror the tuple, chosen uniformly at random from the vector, when generating random tuples.
  • trial_factor::Int = 20: Number of random tuples trialled for each tuple the excursion needs to add to the tuple set to grow it to the max_tuple_number.
  • grow_greedy::Bool = true: Whether the excursions add tuples to the set greedily according to the figure of merit, or to add them even if this reduces the figure of merit.
  • seed::Union{UInt64, Nothing} = nothing: Seed used to randomly generate tuples.
  • tuple_diagnostics::Bool = true: Whether to display tuple set optimisation diagnostics.
source

utils.jl

QuantumACES.get_mapping_stringMethod
get_mapping_string(m::Mapping, c::AbstractCircuit; two_qubit_only::Bool = false)

Returns the string representation of the mapping m for the circuit c, including eigenvalues.

source
QuantumACES.pretty_printMethod
pretty_print(aces_data::ACESData, merit_set::Tuple{Merit, Merit, Merit})

Prints the z-scores of the normalised RMS errors of the gate eigenvalue estimator vector for the GLS, WLS, and OLS estimators in aces_data using the predicted means and variances for each in merit_set.

source

io.jl

QuantumACES.aces_data_filenameMethod
aces_data_filename(aces_data::ACESData)
aces_data_filename(d::Design, budget_set::Vector{Int})
aces_data_filename(circuit_param::AbstractCircuitParameters, noise_param::AbstractNoiseParameters, tuple_number::Int, repeat_numbers::Vector{Int}, full_covariance::Bool, ls_type::Symbol, budget_set::Vector{Int})

Returns a string describing the filename corresponding to the ACES data.

source
QuantumACES.design_filenameMethod
design_filename(d::Design)
design_filename(circuit_param::AbstractCircuitParameters, noise_param::AbstractNoiseParameters, tuple_number::Int, repeat_numbers::Vector{Int}, full_covariance::Bool, ls_type::Symbol)

Returns a string describing the filename corresponding to the supplied design data.

source
QuantumACES.load_acesMethod
load_aces(d::Design, budget_set::Vector{Int})
load_aces(circuit_param::AbstractCircuitParameters, noise_param::AbstractNoiseParameters, tuple_number::Int, repeat_numbers::Vector{Int}, full_covariance::Bool, ls_type::Symbol, budget_set::Vector{Int})

Loads the ACES data whose filename is specified by the supplied variables.

source
QuantumACES.load_designMethod
load_design(circuit_param::AbstractCircuitParameters, noise_param::AbstractNoiseParameters, tuple_number::Int, repeat_numbers::Vector{Int}, full_covariance::Bool, ls_type::Symbol)

Loads the design whose filename is specified by the supplied variables.

source
QuantumACES.load_scalingMethod
load_scaling(d::Design, ls_type::Symbol)
load_scaling(circuit_param::AbstractCircuitParameters, noise_param::AbstractNoiseParameters, tuple_number::Int, repeat_numbers::Vector{Int}, ls_type::Symbol)

Loads the scaling data whose filename is specified by the supplied variables.

source
QuantumACES.save_acesMethod
save_aces(aces_data::ACESData; clear_design::Bool = false)

Saves the ACES data aces_data with the appropriate filename, and deletes the design file if it exists and clear_design is true.

source
QuantumACES.save_scalingMethod
save_scaling(scaling_data::AbstractScalingData)

Saves the scaling data scaling_data with the appropriate filename.

source
QuantumACES.scaling_filenameMethod
scaling_filename(scaling_data::AbstractScalingData)
scaling_filename(d::Design, ls_type::Symbol)
scaling_filename(circuit_param::AbstractCircuitParameters, noise_param::AbstractNoiseParameters, tuple_number::Int, repeat_numbers::Vector{Int}, ls_type::Symbol)

Returns a string describing the filename for the scaling data corresponding to the supplied design data.

source