merit.jl

Public functions

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

Private functions

QuantumACES.calc_covarianceMethod
calc_covariance(d::Design, eigenvalues::Vector{Float64}, gate_eigenvalues::Vector{Float64}; warning::Bool = true)
calc_covariance(d::Design, eigenvalues::Vector{Float64}; warning::Bool = true)
calc_covariance(d::Design; warning::Bool = true)

Returns the circuit eigenvalue estimator covariance matrix for the design d with circuit eigenvalues eigenvalues and gate eigenvalues gate_eigenvalues. 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_eigenvalues_covarianceMethod
calc_eigenvalues_covariance(d::Design; warning::Bool = true)

Returns the circuit eigenvalues and circuit eigenvalue estimator covariance matrix 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_covarianceMethod
calc_gls_covariance(d::Design, covariance_log::SparseMatrixCSC{Float64, Int})

Returns the gate eigenvalue estimator covariance matrix 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_covarianceMethod
calc_ls_covariance(d::Design, covariance_log::SparseMatrixCSC{Float64, Int}, ls_type::Symbol)

Returns the gate eigenvalue estimator covariance matrix 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_ols_covarianceMethod
calc_ols_covariance(d::Design, covariance_log::SparseMatrixCSC{Float64, Int})

Returns the gate eigenvalue estimator covariance matrix 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_covarianceMethod
calc_wls_covariance(d::Design, covariance_log::SparseMatrixCSC{Float64, Int})

Returns the gate eigenvalue estimator covariance matrix for the weighted least squares (WLS) estimator corresponding to the design d with circuit log-eigenvalue estimator covariance matrix covariance_log.

source
QuantumACES.nrmse_momentsMethod
nrmse_moments(cov_eigenvalues::Vector{Float64})

Returns the expectation and variance of the normalised RMS error, as determined by the eigenvalues cov_eigenvalues of the gate eigenvalue estimator covariance matrix.

source
QuantumACES.nrmse_pdf_integrandMethod
nrmse_pdf_integrand(u::Float64, x::Float64, norm_cov_eigenvalues::Vector{Float64})

Returns the integrand of the Imhof method CDF for the distribution of the NRMSE.

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

source
QuantumACES.sparse_covariance_invMethod
sparse_covariance_inv(covariance_log::SparseMatrixCSC{Float64, Int}, mapping_lengths::Vector{Int})

Returns the inverse of the sparse block diagonal circuit log-eigenvalue estimator covariance matrix covariance_log, where the block sizes are specified by mapping_lengths.

source