The Ritz method is a variational method named after Walter Ritz, in which the ansatz function is a linear combination of N known basis functions , parametrized by unknown coefficients:
With a known hamiltonian, we can write its expected value as
.
The basis functions are usually not orthogonal, so that the overlap matrixS is has nonzero diagonal elements. Either or (the conjugation of the first) can be used to minimze the expectation value. For instance, by making the partial derivatives of over zero, the following equality is obtained for every k = 1,2,...,N:
In the above equations, energy and the coefficients are unknown. With respect to c, this is a homogeneous set of linear equations, which has a solution when the determinant of the coefficients to these unknowns is zero:
,
which in turn is true only for N values of . Furthermore, since the hamiltonian is a hermitian operator. matrix H is also hermitian and the values of will be real. The lowest value among (i=1,2,..,N), , will be the best approximation to the ground state for the basis functions used. The remaining N-1 energies are estimates of excited state energies. An approximation for the wave function of state i can be obtained by finding the coefficients from the corresponding secular equation.