In the present work, we propose the method of state-dependent diagonal
ization to find the energy eigenvalues and eigenstates of a quantum an
harmonic oscillator. The example of a cubic-quartic anharmonic oscilla
tor is used to illustrate its validity. Unlike the conventional exact
diagonalization, this method is shown to be very efficient for calcula
ting the energy eigenvalues of the excited states as well as the corre
sponding eigenfunctions. That is, no huge matrix needs to be diagonali
zed in this approach.