Solution (source code)

= Solution

The <quantum variational principle> says that every admissible nonzero trial <wavefunction> obeys
$$
\boxed{\widetilde E=
\frac{\langle\widetilde\Psi|\hat H|\widetilde\Psi\rangle}
{\langle\widetilde\Psi|\widetilde\Psi\rangle}\geq E_0,}
$$
where $E_0$ is the <ground-state energy>. Thus the <Rayleigh quotient> is an upper bound. Equality holds when the trial lies entirely in the <ground-state subspace>.