Then, to find the expectation value of the Hamiltonian: ⟨ H ⟩ = ⟨ ϕ ϕ | H | ϕ ϕ ⟩ = ⟨ ∑ ∑ n c n ψ ψ n | H | ∑ ∑ m c m ψ ψ m ⟩ = ∑ ∑ n ∑ ∑ m ⟨ c n ∗ ∗ ψ ψ n | E m | c m ψ ψ m ⟩ = ∑ ∑ n ∑ ∑ m c n ∗ ∗ c m E m ⟨ ψ ψ n | ψ ψ m ⟩ = ∑ ∑ n | c n | 2 E n .