  We present a generalization of the variational principle that is compatible
with any Hamiltonian eigenstate that can be specified uniquely by a list of
properties. This variational principle appears to be compatible with a wide
range of electronic structure methods, including mean-field theory, density
functional theory, multi-reference theory, and quantum Monte Carlo. Like the
standard variational principle, this generalized variational principle amounts
to the optimization of a nonlinear function that, in the limit of an
arbitrarily flexible wave function, has the desired Hamiltonian eigenstate as
its global minimum. Unlike the standard variational principle, it can target
excited states and select individual states in cases of degeneracy or
near-degeneracy. As an initial demonstration of how this approach can be useful
in practice, we employ it to improve the optimization efficiency of excited
state mean field theory by an order of magnitude. With this improved
optimization, we are able to demonstrate that the accuracy of the corresponding
second-order perturbation theory rivals that of singles-and-doubles
equation-of-motion coupled cluster in a substantially broader set of molecules
than could be explored by our previous optimization methodology.
