qgrad_qutip.fidelity

qgrad_qutip.fidelity(a, b)

Computes fidelity between two states (pure or mixed).

Note

a and b can either both be kets or both be density matrices, or anyone of a or b may be a ket or a density matrix. Fidelity has private functions to recognize kets and density matrices.

Parameters
  • a (jnp.ndarray) – State vector (ket) or a density matrix.

  • b (jnp.ndarray) – State vector (ket) or a density matrix.

Returns

fidelity between the two input states

Return type

float