pygsti.extras.paritybenchmarking.disturbancecalc.compute_residual_tvds

pygsti.extras.paritybenchmarking.disturbancecalc.compute_residual_tvds#

compute_residual_tvds(n_bits, data_ref, data_test, confidence_percent=68.0, max_weight=4, maxiters=20, search_tol=0.1, reltol=1e-05, abstol=1e-05, solver='CLARABEL', initial_treg_factor=0.001, verbosity=1)#

Compute the weight-X residual TVDs between two data sets (including error bars).

Parameters:
  • 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.

  • confidence_percent (float or None, optional) – The confidence level desired for the computed error bars. Note that this number can range between 0 and 100, not 0 and 1. If None, then no error bars are computed.

  • max_weight (int, optional) – The maximum weight residual TVD to compute. Typically this is the same as n_bits.

  • 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.

  • 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).

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

Returns:

A list of the residual TVDs by weight. The lists i-th element is a (residual_tvd, errorbar_length) tuple for the weight (i+1) residual TVD. That is, the weight (i+1) residual TVD = residual_tvd +/- errorbar_length.

Return type:

list