cirq.qis.fidelity

Fidelity of two quantum states.

The fidelity of two density matrices ρ and σ is defined as

trace(sqrt(sqrt(ρ) σ sqrt(ρ)))^2.

The given states can be state vectors or density matrices.

state1 The first state.
state2 The second state.