tuples.jl
Public functions
QuantumACES.TupleSetData
— TypeTupleSetData
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 repeat tuple set, whose tuples are repeated according to therepeat_numbers
.repeat_numbers::Vector{Int}
: The number of repetitions for tuples in the repeat tuple setrepeat_tuple_set
.repeat_indices::Vector{Tuple{Int, Int}}
: Indexes pairs (repeat_tuple
,repeat_number
) from (repeat_tuple_set
,repeat_numbers
) such that the repeated tuple set consists ofrepeat_tuple
repeatedrepeat_number
times for all indexed pairs.
QuantumACES.get_augmented_tuple_set_data
— Methodget_augmented_tuple_set_data(tuple_set_data::TupleSetData, repeat_points::Integer; initial_shrink_factor::Real = 2^(repeat_points - 1))
Returns an augmented version of the tuple set data tuple_set_data
, where each of the repetition numbers is augmented to have repeat_points
total repetition numbers, spaced logarithmically between the repetition number and the repetition number shrunk by a factor of initial_shrink_factor
.
QuantumACES.get_basic_tuple_set
— Methodget_basic_tuple_set(c::AbstractCircuit)
Returns the basic tuple set for the circuit c
.
QuantumACES.get_circuit_tuple
— Methodget_circuit_tuple(c::AbstractCircuit; include_reset::Bool = false)
Returns the circuit tuple corresponding to the circuit c
, including reset layers if include_reset
is true
.
QuantumACES.get_tuple_set
— Methodget_tuple_set(tuple_set_data::TupleSetData)
Returns the tuple set corresponding to the data tuple_set_data
.
QuantumACES.get_tuple_set_data
— Methodget_tuple_set_data(c::AbstractCircuit; error_target::Real = 0.1, add_circuit::Bool = false)
get_tuple_set_data(c::AbstractCircuit, tuple_set::Vector{Vector{Int}}; error_target::Real = 0.1, add_circuit::Bool = false)
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, which heuristically roughly target an error rate error_target
, and the original circuit is added to the repeat tuples if add_circuit
is true
.
Note that it appears best to use repeat tuples of order 2 (up to Paulis), with odd repeat numbers where this is efficient for measurement (such as repeating the same circuit layer many times), and even repeat numbers otherwise (such as syndrome extraction circuits).
Private functions
QuantumACES.check_tuple!
— Methodcheck_tuple!(c::AbstractCircuit, circuit_tuple::Vector{Int})
check_tuple!(c::AbstractCircuit, tuple_set::Vector{Vector{Int}})
Checks that the tuple circuit_tuple
, or each tuple in the tuple set tuple_set
, is valid for the circuit c
.
QuantumACES.get_basic_experiment_numbers
— Methodget_basic_experiment_numbers(c::AbstractCircuit)
Returns the experiment numbers corresponding to the basic tuple set for the circuit c
.
BEWARE: This currently assumes that circuit eigenvalues for Paulis supported on $n$ qubits require preparing exactly and only $2^n$ sign configurations. Errors will occur if this is not the case, and they are not guaranteed to be noisy. If creating a circuit where this is not the case, you will need to provide new methods for this function.
QuantumACES.get_basic_times_harm_mean
— Methodget_basic_times_harm_mean(c::AbstractCircuit)
Returns the harmonic mean of the experiment times corresponding to the basic tuple set for the circuit c
.
QuantumACES.get_tuple_set_params
— Methodget_tuple_set_params(c::AbstractCircuit, tuple_set::Vector{Vector{Int}}, experiment_numbers::Vector{Int}; weight_experiments::Bool = true)
Returns the time taken to implement each tuple and the default shot weights for each tuple orresponding to the circuit c
with the tuple set tuple_set
and the experiment numbers experiment_numbers
. If weight_experiments
is true
, allocate the same sampling time to each experiment for each tuple; otherwise, allocate the same sampling time to each tuple overall. The default times allocate the same sampling time to each experiment for each tuple; this seems to be more performant than allocating the same sampling time to each tuple overall, as it allocates more samples to tuples that require more experiments.