scaling.jl

Public functions

QuantumACES.EnsembleFitType
EnsembleFit

Ensemble scaling fit data for an experimental design for a circuit with vertical and horizontal distance parameters under a random noise model.

All pair fit parameters correspond to the trace and trace squared quadratic terms appearing in the expressions for the expectation and variance.

Fields

  • gls_pair::Vector{Float64}: Ordinary GLS pair quadratic fit parameters.
  • gls_expectation_model::Function: Model for the ordinary GLS expectation.
  • gls_variance_model::Function: Model for the ordinary GLS variance.
  • gls_marginal_pair::Vector{Float64}: Marginal GLS pair quadratic fit parameters.
  • gls_marginal_expectation_model::Function: Model for the marginal GLS expectation.
  • gls_marginal_variance_model::Function: Model for the marginal GLS variance.
  • gls_relative_pair::Vector{Float64}: Relative GLS pair quadratic fit parameters.
  • gls_relative_expectation_model::Function: Model for the relative GLS expectation.
  • gls_relative_variance_model::Function: Model for the relative GLS variance.
  • wls_pair::Vector{Float64}: Ordinary WLS pair quadratic fit parameters.
  • wls_expectation_model::Function: Model for the ordinary WLS expectation.
  • wls_variance_model::Function: Model for the ordinary WLS variance.
  • wls_marginal_pair::Vector{Float64}: Marginal WLS pair quadratic fit parameters.
  • wls_marginal_expectation_model::Function: Model for the marginal WLS expectation.
  • wls_marginal_variance_model::Function: Model for the marginal WLS variance.
  • wls_relative_pair::Vector{Float64}: Relative WLS pair quadratic fit parameters.
  • wls_relative_expectation_model::Function: Model for the relative WLS expectation.
  • wls_relative_variance_model::Function: Model for the relative WLS variance.
  • ols_pair::Vector{Float64}: Ordinary OLS pair quadratic fit parameters.
  • ols_expectation_model::Function: Model for the ordinary OLS expectation.
  • ols_variance_model::Function: Model for the ordinary OLS variance.
  • ols_marginal_pair::Vector{Float64}: Marginal OLS pair quadratic fit parameters.
  • ols_marginal_expectation_model::Function: Model for the marginal OLS expectation.
  • ols_marginal_variance_model::Function: Model for the marginal OLS variance.
  • ols_relative_pair::Vector{Float64}: Relative OLS pair quadratic fit parameters.
  • ols_relative_expectation_model::Function: Model for the relative OLS expectation.
  • ols_relative_variance_model::Function: Model for the relative OLS variance.
source
QuantumACES.EnsembleScalingType
EnsembleScaling

Ensemble scaling data for an experimental design for a circuit with vertical and horizontal distance parameters under a random noise model.

Fields

  • d::Design: Design for which the scaling data is calculated.
  • dist_range::Vector{Int}: Circuit distances.
  • merits::Vector{Merit}: Merits of the design for each distance.
  • merit_ensemble::Vector{Vector{Merit}}: Merits of the design across random noise models for each distance.
  • seeds::Vector{UInt64}: Seeds for the random noise parameters.
  • calculation_times::Matrix{Float64}: The time to generate the design, calculate the depolarising merit, and calculate the merit ensemble, for each distance.
  • overall_time::Float64: The overall time taken to calculate the merit ensemble scaling data.
source
QuantumACES.MeritScalingType
MeritScaling

Scaling data for an experimental design for a circuit with vertical and horizontal distance parameters, conventionally under depolarising noise.

Fields

  • d::Design: Design for which the scaling data is calculated.
  • dist_range::Vector{Int}: Circuit distances.
  • merits::Vector{Merit}: Merits of the design for a range of distances.
  • calculation_times::Matrix{Float64}: Time taken to generate the design, and calculate the merit, for each distance.
  • overall_time::Float64: The overall time taken to calculate the merit scaling data for depolarising noise.
source
QuantumACES.ScalingFitType
ScalingFit

Scaling fit data for an experimental design for a circuit with vertical and horizontal distance parameters, conventionally under depolarising noise.

All fit parameters describe a quadratic as $p[1] + p[2] * dist + p[3] * dist^2$.

Fields

  • N::Vector{Int}: Gate eigenvalues quadratic fit parameters.
  • N_model::Function: Quadratic model for the gate eigenvalues.
  • N_marginal::Vector{Int}: Marginal gate eigenvalues quadratic fit parameters.
  • N_marginal_model::Function: Quadratic model for the marginal gate eigenvalues.
  • N_relative::Vector{Int}: Relative gate eigenvalues quadratic fit parameters.
  • N_relative_model::Function: Quadratic model for the relative gate eigenvalues.
  • G::Vector{Int}: Gate number quadratic fit parameters.
  • G_model::Function: Quadratic model for the gate number.
  • gls_tr::Vector{Float64}: Ordinary GLS trace quadratic fit parameters.
  • gls_tr_model::Function: Quadratic model for the ordinary GLS trace.
  • gls_tr_sq::Vector{Float64}: Ordinary GLS trace squared quadratic fit parameters.
  • gls_tr_sq_model::Function: Quadratic model for the ordinary GLS trace squared.
  • gls_expectation_model::Function: Model for the ordinary GLS expectation.
  • gls_variance_model::Function: Model for the ordinary GLS variance.
  • gls_marginal_tr::Vector{Float64}: Marginal GLS trace quadratic fit parameters.
  • gls_marginal_tr_model::Function: Quadratic model for the marginal GLS trace.
  • gls_marginal_tr_sq::Vector{Float64}: Marginal GLS trace squared quadratic fit parameters.
  • gls_marginal_tr_sq_model::Function: Quadratic model for the marginal GLS trace squared.
  • gls_marginal_expectation_model::Function: Model for the marginal GLS expectation.
  • gls_marginal_variance_model::Function: Model for the marginal GLS variance.
  • gls_relative_tr::Vector{Float64}: Relative GLS trace quadratic fit parameters.
  • gls_relative_tr_model::Function: Quadratic model for the relative GLS trace.
  • gls_relative_tr_sq::Vector{Float64}: Relative GLS trace squared quadratic fit parameters.
  • gls_relative_tr_sq_model::Function: Quadratic model for the relative GLS trace squared.
  • gls_relative_expectation_model::Function: Model for the relative GLS expectation.
  • gls_relative_variance_model::Function: Model for the relative GLS variance.
  • wls_tr::Vector{Float64}: Ordinary WLS trace quadratic fit parameters.
  • wls_tr_model::Function: Quadratic model for the ordinary WLS trace.
  • wls_tr_sq::Vector{Float64}: Ordinary WLS trace squared quadratic fit parameters.
  • wls_tr_sq_model::Function: Quadratic model for the ordinary WLS trace squared.
  • wls_expectation_model::Function: Model for the ordinary WLS expectation.
  • wls_variance_model::Function: Model for the ordinary WLS variance.
  • wls_marginal_tr::Vector{Float64}: Marginal WLS trace quadratic fit parameters.
  • wls_marginal_tr_model::Function: Quadratic model for the marginal WLS trace.
  • wls_marginal_tr_sq::Vector{Float64}: Marginal WLS trace squared quadratic fit parameters.
  • wls_marginal_tr_sq_model::Function: Quadratic model for the marginal WLS trace squared.
  • wls_marginal_expectation_model::Function: Model for the marginal WLS expectation.
  • wls_marginal_variance_model::Function: Model for the marginal WLS variance.
  • wls_relative_tr::Vector{Float64}: Relative WLS trace quadratic fit parameters.
  • wls_relative_tr_model::Function: Quadratic model for the relative WLS trace.
  • wls_relative_tr_sq::Vector{Float64}: Relative WLS trace squared quadratic fit parameters.
  • wls_relative_tr_sq_model::Function: Quadratic model for the relative WLS trace squared.
  • wls_relative_expectation_model::Function: Model for the relative WLS expectation.
  • wls_relative_variance_model::Function: Model for the relative WLS variance.
  • ols_tr::Vector{Float64}: Ordinary OLS trace quadratic fit parameters.
  • ols_tr_model::Function: Quadratic model for the ordinary OLS trace.
  • ols_tr_sq::Vector{Float64}: Ordinary OLS trace squared quadratic fit parameters.
  • ols_tr_sq_model::Function: Quadratic model for the ordinary OLS trace squared.
  • ols_expectation_model::Function: Model for the ordinary OLS expectation.
  • ols_variance_model::Function: Model for the ordinary OLS variance.
  • ols_marginal_tr::Vector{Float64}: Marginal OLS trace quadratic fit parameters.
  • ols_marginal_tr_model::Function: Quadratic model for the marginal OLS trace.
  • ols_marginal_tr_sq::Vector{Float64}: Marginal OLS trace squared quadratic fit parameters.
  • ols_marginal_tr_sq_model::Function: Quadratic model for the marginal OLS trace squared.
  • ols_marginal_expectation_model::Function: Model for the marginal OLS expectation.
  • ols_marginal_variance_model::Function: Model for the marginal OLS variance.
  • ols_relative_tr::Vector{Float64}: Relative OLS trace quadratic fit parameters.
  • ols_relative_tr_model::Function: Quadratic model for the relative OLS trace.
  • ols_relative_tr_sq::Vector{Float64}: Relative OLS trace squared quadratic fit parameters.
  • ols_relative_tr_sq_model::Function: Quadratic model for the relative OLS trace squared.
  • ols_relative_expectation_model::Function: Model for the relative OLS expectation.
  • ols_relative_variance_model::Function: Model for the relative OLS variance.
source
QuantumACES.calc_ensemble_scalingMethod
calc_ensemble_scaling(d::Design, dist_max::Integer; kwargs...)
calc_ensemble_scaling(d::Design, dist_range::Vector{Int}; kwargs...)

Returns ensemble scaling data as a EnsembleScaling object for the merit of the design d over random instances of noise models, for a circuit with vertical_dist and horizontal_dist parameters, as a function of these distances.

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

  • precision::Real = 2e-3: Precision to which the figure of merit is estimated, corresponding to the target standard error of the mean.
  • max_repetitions::Integer = 10000: Maximum number of random instances of log-normal Pauli noise over which the figure of merit is calculated.
  • min_repetitions::Integer = 50: Minimum number of random instances of log-normal Pauli noise over which the figure of merit is calculated.
  • print_repetitions::Integer = 50: 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
QuantumACES.calc_merit_scalingMethod
calc_merit_scaling(d::Design, dist_max::Integer; kwargs...)
calc_merit_scaling(d::Design, dist_range::Vector{Int}; kwargs...)

Returns the scaling data as a MeritScaling object for the merit of the design d, for a circuit with vertical_dist and horizontal_dist parameters, as a function of these distances.

Arguments

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

Keyword arguments

  • warning::Bool = true: Whether to print a warning if the noise model is not depolarising.
  • diagnostics::Bool = true: Whether to print diagnostic information.
  • save_data::Bool = false: Whether to save the merit scaling data.
source
QuantumACES.get_ensemble_fitMethod
get_ensemble_fit(ensemble_scaling::EnsembleScaling; precision::Real = 1e-1)

Returns ensemble scaling fit data as a EnsembleFit object for the ensemble scaling data ensemble_scaling, displaying a warning if data is not fit to relative precision precision.

source
QuantumACES.get_scaling_fitMethod
get_scaling_fit(merit_scaling::MeritScaling; precision::Real = 1e-2)
get_scaling_fit(merits::Vector{Merit}, dist_range::Vector{Int}; precision::Real = 1e-2)

Returns merit scaling fit data as a ScalingFit object for the merit scaling data merits fit against the distances dist_range, contained in the scaling data merit_scaling, displaying a warning if data is not fit to relative precision precision.

source

Private functions

QuantumACES.check_modelMethod
check_model(dist_range, model_range, model; precision::Real = 1e-2)

Displays a warning if the model predictions do not match the data to relative precision precision.

source
QuantumACES.expectation_modelMethod
expectation_model(dist, tr_pair_params, N_params)

Model of the expectation as a function of the distance dist with trace pair parameters tr_pair_params, consisting of trace and trace squared quadratic parameters, and gate eigenvalue quadratic parameters N_params.

source
QuantumACES.fit_pair_modelMethod
fit_pair_model(expectation_model::Function, variance_model::Function, dist_range::Vector{Int}, expectation_range::Vector{Float64}, variance_range::Vector{Float64}, param_init::Vector{Float64}; precision::Real = 1e-2)

Returns the pair fit parameters for the expectation and variance models expectation_model and variance_model as functions of the distance dist_range, for the expectation and variance data expectation_range and variance_range, respectively, and initial parameters param_init, displaying a warning if the model predictions do not match the data to relative precision precision.

source
QuantumACES.fit_quadratic_modelMethod
fit_quadratic_model(dist_range::Vector{Int}, quadratic_range::Vector{Float64}; precision::Real = 1e-2)
fit_quadratic_model(dist_range::Vector{Int}, quadratic_range::Vector{Int})

Returns the quadratic fit parameters for the data quadratic_range as a function of the distance dist_range, requiring exact fit for integer data, and displaying a warning if non-integer data is not fit to relative precision precision.

source
QuantumACES.variance_modelMethod
variance_model(dist, tr_pair_params, N_params)

Model of the variance as a function of the distance dist with trace pair parameters tr_pair_params, consisting of trace and trace squared quadratic parameters, and gate eigenvalue quadratic parameters N_params.

source