Skip to main content

expectation_value_kernel

Function expectation_value_kernel 

Source
pub fn expectation_value_kernel(
    state: &HilbertState,
    operator: &Operator,
) -> Result<f64, PhysicsError>
Expand description

Calculates the expectation value: $\langle A \rangle = \langle \psi | A | \psi \rangle$.

§Arguments

  • state - Quantum state $|\psi\rangle$.
  • operator - Observable operator $A$.

§Returns

  • Ok(f64) - Expectation value (Real part of complex result).