  We present a new method for calculating electronic states in low-dimensional
semiconductor heterostructures, which is based on the real-space Hamiltonian in
the envelope function approximation. The numerical implementation of the method
is extremely simple; all subband energy levels and envelope functions are
directly obtained by a single evaluation of the heterostructure Hamiltonian
matrix. We test the method in the 6- and 8-band k \cdot p models as well as in
a simple parabolic one-band model and demonstrate its great accuracy. The
method can be straightforwardly generalized to a general n-band k \cdot p
model. We describe three different approaches within the method which make it
possible to investigate the origin and removal of the spurious or unphysical
solutions, which has long been an important issue in the community.
