pygsti.tools.optools.entanglement_fidelity

pygsti.tools.optools.entanglement_fidelity#

entanglement_fidelity(a, b, mx_basis='pp', is_tp=None, is_unitary=None)#

Returns the “entanglement” process fidelity between gate matrices.

This is given by:

F = Tr( sqrt{ sqrt(J(a)) * J(b) * sqrt(J(a)) } )^2

where J(.) is the Jamiolkowski isomorphism map that maps a operation matrix to it’s corresponding Choi Matrix.

When the both of the input matrices a and b are TP, and the target matrix b is unitary then we can use a more efficient formula:

F= Tr(a @ b.conjugate().T)/d^2

Parameters:
  • a (array or gate) – The gate to compute the entanglement fidelity to b of. E.g., an imperfect implementation of b.

  • b (array or gate) – The gate to compute the entanglement fidelity to a of. E.g., the target gate corresponding to a.

  • mx_basis ({'std', 'gm', 'pp', 'qt'} or Basis object) – The basis of the matrices. Allowed values are Matrix-unit (std), Gell-Mann (gm), Pauli-product (pp), and Qutrit (qt) (or a custom basis object).

  • 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