Skip to main content

expval

Method of ComplexMPO.

expval(const ComplexMPS operator) -> complex

Compute the expectation value ψO^ψ\langle \psi | \hat{O} | \psi \rangle of a quantum operator in state ψ|\psi\rangle with Complex 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.