The Time-independent schrodinger equation states that H | ψ ⟩ = E | ψ ⟩ {\displaystyle H|\psi \rangle =E|\psi \rangle } , and substituting for | ψ ⟩ {\displaystyle |\psi \rangle } in terms of the basis states from above, and premultiplying both sides by ⟨ 1 | {\displaystyle \langle 1|} or ⟨ 2 | {\displaystyle \langle 2|} produces a system of two linear equations that can be written in matrix form