design.jl

Public functions

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

Private functions

QuantumACES.calc_consistency_setMethod
calc_consistency_set(mapping_set::Vector{Mapping})

Returns a list for each mapping in mapping_set of all other mappings with which it is simultaneously preparable and measurable, and hence tuple-consistent.

source
QuantumACES.calc_covariance_dictMethod
calc_covariance_dict(c::AbstractCircuit, mapping_set::Vector{Mapping}, experiment_set::Vector{Vector{Int}}, full_covariance::Bool)

Returns a dictionary with the requisite information to calculate the sparse circuit eigenvalue estimator covariance matrix for the arranged circuit c, with mappings mapping_set, when estimated by the experiments in experiment_set. If full_covariance is true, then this constructs the full covariance matrix, whereas if full_covariance is false, then this constructs only the diagonal terms of the covariance matrix.

source
QuantumACES.calc_experiment_setMethod
calc_experiment_set(mapping_set::Vector{Mapping}, consistency_set::Vector{Vector{Int}})

Returns a set of experiments which simultaneously estimate the circuit eigenvalues corresponding to the mappings in mapping_set, whose tuple-consistency relations are described by consistency_set.

source
QuantumACES.calc_mapping_setMethod
calc_mapping_set(c::AbstractCircuit)

Returns a vector of Mapping objects for each single-qubit Pauli on the qubits in the circuit c, and each two-qubit Pauli supported on some gate in the circuit c.

source
QuantumACES.get_experiment_layersMethod
get_experiment_layers(c::AbstractCircuit, mapping_set::Vector{Mapping}, experiment_set::Vector{Vector{Int}})

Returns circuit layers that prepare and measure the initial and final Paulis as given by the mappings in mapping_set, for each experiment in experiment set. If c has a partition field, this is used to generate all necessary sign configurations for the preparation layers.

source
QuantumACES.get_meas_layerMethod
get_meas_layer(final::Pauli, final_support::Vector{Int})

Returns a layer which measures the Pauli final, supported on the qubits in final_support.

source
QuantumACES.get_pauli_prep_setMethod
get_pauli_prep_set(gates::Vector{Gate}, n::Int)

Returns all weight-1 Paulis on all n qubits, as well as the weight-2 Paulis supported on some gate in gates.

source
QuantumACES.get_prep_layerMethod
get_prep_layer(initial::Pauli, initial_support::Vector{Int})

Returns a layer which prepares the Pauli initial, supported on the qubits in initial_support.

source
QuantumACES.update_design_row!Method
update_design_row!(design_row::Vector{Int}, pauli::Pauli, l::Layer, gate_index::Dict{Gate, Int})

Updates the design matrix row design_row according to the Pauli pauli for each gate in the layer l, using the gate index gate_index.

source