pygsti.tools.optools.average_gate_fidelity#
- average_gate_fidelity(a, b, mx_basis='pp', is_tp=None, is_unitary=None)#
Computes the average gate fidelity (AGF) between two gates.
Average gate fidelity (F_g) is related to entanglement fidelity (F_p), via:
F_g = (d * F_p + 1)/(1 + d),
where d is the Hilbert space dimension. This formula, and the definition of AGF, 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).
- Returns:
AGI – The AGI of a to b.
- Return type:
float