qgrad_qutip.fidelity¶
-
qgrad_qutip.fidelity(a, b)¶ Computes fidelity between two states (pure or mixed).
Note
aandbcan either both be kets or both be density matrices, or anyone ofaorbmay 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