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 with Real values.

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.