Skip to main content

expval

Method of RealMPO.

expval(const RealMPS operator) -> real​

Compute the expectation value ⟨ψ∣O^∣ψ⟩\langle \psi | \hat{O} | \psi \rangle of a quantum operator in state ∣ψ⟩|\psi\rangle in a Matrix Product State (MPS) encoded state.

note

This function computes ⟨ψ∣O^∣ψ⟩\langle \psi | \hat{O} | \psi \rangle. Only valid with open boundary condition MPS and MPO.

Parameters​

  • operator: The matrix product operator (MPO) representing the quantum operator.

Returns​

The expectation value as a scalar.