Squared expectation value

Calculate the squared expectation value of an arbitrary Operator with regard to an arbitrary state. 

for input $\hat{O}$ and $\psi$ calculates $\langle \psi | \hat{O}^2 | \psi \rangle$.

Inputs

  • $\hat{O}$: Operator - the operator to calculate the squared expectation value of
  • $\psi$: state - the state the with regard to which to calculate the squared expectation value.

Outputs

  • Scalar: real number - the resulting squared expectation value¬†$\langle \hat{O}^2 \rangle =\langle \psi | \hat{O}^2 | \psi \rangle$

Content

For convenience, the node displays its result directly.