simulate.jl

Public functions

QuantumACES.ACESDataType
ACESData

ACES noise characterisation experiment simulation results.

Fields

  • d::Design: Experimental design.
  • noise_est_coll::Matrix{NoiseEstimate}: Noise estimates for each repetition and measurement budget.
  • noise_error_coll::Matrix{NoiseError}: Noise errors for each repetition and measurement budget.
  • budget_set::Vector{Int}: Measurement budgets.
  • shots_set::Vector{Int}: Measurement shots corresponding to the measurement budgets in budget_set.
  • repetitions::Int: Repetitions of simulating an ACES noise characterisation experiment.
  • seed::UInt64: Seed used to generate the random seeds for each repetition.
  • seeds::Vector{UInt64}: Seeds for each of the repetitions.
  • calculation_times::Matrix{Float64}: Time taken to simulate sampling, and to estimate the gate eigenvalues and project them into the probability simplex, for each repetition.
  • overall_time::Float64: Overall time taken to simulate ACES across all repetitions.
source
QuantumACES.get_model_violationMethod
get_model_violation(aces_data::ACESData; projected::Bool = false)

Returns the noise model violation z-score for the generalised residual sum of squares corresponding to the noise estimates stored in aces_data, given the design also stored in aces_data, calculating with the projected gate eigenvalues if projected is true.

source
QuantumACES.get_noise_scoreMethod
get_noise_score(aces_data::ACESData, merit::Merit)

Returns the z-scores for the supplied normalised root-mean-square error (NRMSE) data in the noise errors stored in aces_data, given the merit merit.

source
QuantumACES.simulate_acesMethod
simulate_aces(d::Design, budget_set::Vector{Int}; kwargs...)

Returns simulated ACES noise characterisation experiment results as an ACESData object 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::Integer = 1: Number of simulation repetitions.
  • seed::Union{UInt64, Nothing} = nothing: Seed to use for random number generation.
  • N_warn::Integer = 10^5: Number of circuit eigenvalues above which to warn the user about certain keyword argument choices.
  • max_samples::Integer = 10^9: Maximum number of Stim samples collected in a single simulation.
  • min_eigenvalue::Real = 0.1: Circuit eigenvalues below this threshold are omitted from the estimation procedure.
  • clip_warning::Bool = false: Whether to warn the user about clipped eigenvalues.
  • N_warn_split::Integer = 5 * 10^3: Number of circuit eigenvalues above which to warn the user about if split is false.
  • split::Bool = (d.c.gate_data.N < N_warn_split ? false : true): Whether to split the gate eigenvalue projection across gates or simultaneously project all gate eigenvalues.
  • precision::Real = 1e-8: Precision of the solver for projecting noise estimates into the probability simplex.
  • diagnostics::Bool = true: Whether to print diagnostics.
  • detailed_diagnostics::Bool = false: Whether to print detailed diagnostics for Stim simulations.
  • save_data::Bool = false: Whether to save the data.
  • save_interval::Integer = 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
QuantumACES.simulate_stim_estimateMethod
simulate_stim_estimate(d::Design, shots_set::Vector{Int}; kwargs...)

Returns simulated estimated circuit eigenvalues, covariance circuit eigenvalues, and corresponding circuit eigenvalue pairs, for the experimental design d across each of the measurement shots in shots_set.

Keyword arguments

  • seed::Union{UInt64, Nothing} = nothing: Seed controlling the random seeds for Stim.
  • max_samples::Integer = 10^9: Maximum number of samples to take in a single Stim simulation.
  • detailed_diagnostics::Bool = false: Whether to print diagnostic information about the simulation.
source

Private functions

QuantumACES.stim_sampleMethod
stim_sample(stim_circuit_string::String, shots::Integer; stim_seed::Union{UInt64, Nothing} = nothing)

Returns bit-packaged measurement outcomes from simulating the circuit stim_circuit_string over shots measurement shots using the Python package Stim. While the seed stim_seed can be fixed, Stim guarantees inconsistency when using the same seed on different versions.

source