pygsti.cptp_penalty¶
-
pygsti.
cptp_penalty
(gateset, include_spam_penalty=True)¶ - The sum of all negative Choi matrix eigenvalues, and
- if include_spam_penalty is True, the rho-vector and E-vector penalties of gateset. A non-zero value indicates that the gateset is not CPTP.
Parameters: - gateset (GateSet) – the gate set to compute CPTP penalty for.
- include_spam_penalty (bool, optional) – if True, also test gateset for invalid SPAM operation(s) and return sum of CPTP penalty with rhoVecPenlaty(...) and effect_penalty(...) for each rho and E vector.
Returns: CPTP penalty (possibly with added spam penalty).
Return type: float