pygsti.tools.optools.fidelity

Contents

pygsti.tools.optools.fidelity#

fidelity(a, b)#

Returns the quantum state fidelity between density matrices.

This given by:

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

To compute process fidelity, pass this function the Choi matrices of the two processes, or just call entanglement_fidelity() with the operation matrices.

Parameters:
  • a (numpy array) – First density matrix.

  • b (numpy array) – Second density matrix.

Returns:

The resulting fidelity.

Return type:

float