calculate_fidelity

Function calculate_fidelity 

Source
pub fn calculate_fidelity(
    state1: &[Complex64],
    state2: &[Complex64],
) -> Result<f64>
Expand description

Calculates the fidelity between two quantum states

Fidelity measures how close two quantum states are to each other. A value of 1.0 means the states are identical.

§Arguments

  • state1 - The first state’s amplitudes
  • state2 - The second state’s amplitudes

§Returns

The fidelity between the states (0.0 to 1.0)