![]() |
Fidelity of two quantum states.
cirq.qis.fidelity(
state1: np.ndarray,
state2: np.ndarray
) -> float
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.
Args | |
---|---|
state1
|
The first state. |
state2
|
The second state. |