pygsti.objects.ConfidenceRegion¶
-
class
pygsti.objects.
ConfidenceRegion
(gateset, hessian, confidenceLevel, hessianProjection='std', tol=1e-06, maxiter=10000, nonMarkRadiusSq=0)¶ Encapsulates a hessian-based confidence region in gate-set space.
A ConfidenceRegion computes and stores the quadratic form for an approximate confidence region based on a confidence level and a hessian, typically of either loglikelihood function or its proxy, the chi2 function.
-
__init__
(gateset, hessian, confidenceLevel, hessianProjection='std', tol=1e-06, maxiter=10000, nonMarkRadiusSq=0) Initializes a new ConfidenceRegion.
Parameters: - gateset (GateSet) – the gate set point estimate that maximizes the logl or minimizes the chi2, and marks the point in gateset-space where the Hessian has been evaluated.
- hessian (numpy array) – A nParams x nParams Hessian matrix, where nParams is the number of dimensions of gateset space, i.e. gateset.num_params()
- confidenceLevel (float) – The confidence level as a percentage, i.e. between 0 and 100.
- hessianProjection (string, optional) –
Specifies how (and whether) to project the given hessian matrix onto a non-gauge space. Allowed values are:
- ‘std’ – standard projection onto the space perpendicular to the gauge space.
- ‘none’ – no projection is performed. Useful if the supplied hessian has already been projected.
- ‘optimal gate CIs’ – a lengthier projection process in which a numerical optimization is performed to find the non-gauge space which minimizes the (average) size of the confidence intervals corresponding to gate (as opposed to SPAM vector) parameters.
- tol (float, optional) – Tolerance for optimal Hessian projection. Only used when hessianProjection == ‘optimal gate CIs’
- maxiter (int, optional) – Maximum iterations for optimal Hessian projection. Only used when hessianProjection == ‘optimal gate CIs’
- nonMarkRadiusSq (float, optional) – When non-zero, “a non-Markovian error region” is constructed using this value as the squared “non-markovian radius”. This specifies the portion of 2*(max-log-likelihood - gateset-log-likelihood) that we attribute to non-Markovian errors (typically the previous difference minus it’s expected value, the difference in number of parameters between the maximal and gateset models). If set to zero (the default), a standard and thereby statistically rigorous conficence region is created. Non-zero values should only be supplied if you really know what you’re doing.
Methods
__init__
(gateset, hessian, confidenceLevel)Initializes a new ConfidenceRegion. get_effect_fn_confidence_interval
(...[, ...])Compute the confidence interval for a function of a single POVM effect. get_gate_fn_confidence_interval
(fnOfGate, ...)Compute the confidence interval for a function of a single gate. get_gateset
()Retrieve the associated gate set. get_gateset_fn_confidence_interval
(fnOfGateset)Compute the confidence interval for a function of a GateSet. get_prep_fn_confidence_interval
(fnOfPrep, ...)Compute the confidence interval for a function of a single state prep. get_profile_likelihood_confidence_intervals
([label])Retrieve the profile-likelihood confidence intervals for a specified gate set object (or all such intervals). get_spam_fn_confidence_interval
(fnOfSpamVecs)Compute the confidence interval for a function of spam vectors. -