pygsti.tools.optools.average_gate_infidelity#
- average_gate_infidelity(a, b, mx_basis='pp', is_tp=None, is_unitary=None)#
Computes the average gate infidelity (AGI) between two gates.
Average gate infidelity is related to entanglement infidelity (EI) via:
AGI = (d * (1-EI) + 1)/(1 + d),
where d is the Hilbert space dimension. This formula, and the definition of AGI, can be found in Phys. Lett. A 303 249-252 (2002).
- Parameters:
a (array or gate) – The gate to compute the AGI to b of. E.g., an imperfect implementation of b.
b (array or gate) – The gate to compute the AGI to a of. E.g., the target gate corresponding to a.
mx_basis ({"std","gm","pp"} or Basis object, optional) – The basis of the matrices.
is_tp (bool, optional (default None)) – Flag indicating both matrices are TP. If None (the default), an explicit check is performed. If True/False, the check is skipped and the provided value is used (faster, but should only be used when the user is certain this is true apriori).
is_unitary (bool, optional (default None)) – Flag indicating that the second matrix, b, is unitary. If None (the default) an explicit check is performed. If True/False, the check is skipped and the provided value is used (faster, but should only be used when the user is certain this is true apriori).
- Return type:
float