The Rayleigh-Ritz procedure for determining bound-states of the
Schr\"{o}dinger equation relies on spectral representation of the solution as a
linear combination of the basis functions. Several possible extensions of the
method to resonance states have been considered in the literature. Here we
propose the application of the optimized Rayleigh-Ritz method to this end. The
method uses a basis of the functions containing adjustable nonlinear
parameters, the values of which are fixed so as to make the trace of the
variational matrix stationary. Generalization to resonances proceeds by
allowing the parameters to be complex numbers. Using various basis sets, we
demonstrate that the optimized Rayleigh-Ritz scheme with complex parameters
provides an effective algorithm for the determination of both the energy and
lifetime of the resonant states for various one-dimensional and spherically
symmetric potentials. The method is computationally inexpensive since it does
not require iterations or predetermined initial values. The convergence rate
compares favorably to other approaches.Comment: 17 pages, 2 figures, 8 table