  We discuss the generalized eigenvalue problem for computing energies and
matrix elements in lattice gauge theory, including effective theories such as
HQET. It is analyzed how the extracted effective energies and matrix elements
converge when the time separations are made large. This suggests a particularly
efficient application of the method for which we can prove that corrections
vanish asymptotically as $\exp(-(E_{N+1}-E_n) t)$. The gap $E_{N+1}-E_n$ can be
made large by increasing the number $N$ of interpolating fields in the
correlation matrix. We also show how excited state matrix elements can be
extracted such that contaminations from all other states disappear
exponentially in time. As a demonstration we present numerical results for the
extraction of ground state and excited B-meson masses and decay constants in
static approximation and to order $1/m_b$ in HQET.
