pygsti.extras.paritybenchmarking.disturbancecalc.ResidualTVDWithConfidence

pygsti.extras.paritybenchmarking.disturbancecalc.ResidualTVDWithConfidence#

class ResidualTVDWithConfidence(weight, n_bits, data_ref, data_test, solver='CLARABEL', initial_treg_factor=0.001)#

Bases: object

Residual TVD with error bars given by an assumed-symmetric confidence-region.

The residual TVD is computed using ResidualTVD. A confidence region is constructed by finding where the ProfileLikelihood is reduced from its maximum by an amount given by the desired confidence level. This locates one side of the confidence region, and it is assumed to be symmetric.

Create a ResidualTVDWithConfidence function object.

Parameters:
  • weight (int) – The weight: all stochastic errors of this weight or below are considered “free”, i.e. contribute nothing, to this residual TVD.

  • n_bits (int) – The number of bits (qubits).

  • data_ref (numpy array) – Arrays of outcome counts from the reference and test experiments, respectively. Each array has one element per 2^n_bits bit string.

  • data_test (numpy array) – Arrays of outcome counts from the reference and test experiments, respectively. Each array has one element per 2^n_bits bit string.

  • solver (str, optional) – The name of the solver to used (see cvxpy.installed_solvers())

  • initial_treg_factor (float, optional) – The magnitude of an internal penalty factor on the off-diagonals of the T matrix (see ResidualTVD).

Methods

__init__(weight, n_bits, data_ref, data_test)

Create a ResidualTVDWithConfidence function object.

__call__(confidence_percent=68.0, maxiters=20, search_tol=0.1, reltol=1e-05, abstol=1e-05, init_log10_alpha=3, verbosity=1)#

Compute the ResidualTVD and its `confidence_percent`% confidence interval.

Parameters:
  • confidence_percent (float) – The confidence level desired for the computed error bars. Note that this number can range between 0 and 100, not 0 and 1.

  • maxiters (int, optional) – The maximum number of alternating-minimization iterations to allow within the profile-loglikelihood computation before giving up and deeming the final result “ok”.

  • search_tol (float, optional) – The tolerance on the log-likelihood used when trying to locate the (residualTVD, logL) pair with logL at the edge of the confidence interval.

  • reltol (float, optional) – The relative tolerance used to within profile likelihood.

  • abstol (float, optional) – The absolute tolerance used to within profile likelihood.

  • init_log10_alpha (float, optional) – The initial log10(alpha) value to use within profile likelihood evaluations. Only change this if you know what you’re doing.

  • verbosity (int, optional) – Sets the level of detail for messages printed to the console (higher = more detail).