  Electronic excited states of molecules are central to many physical and
chemical processes, and yet they are typically more difficult to compute than
ground states. In this paper we leverage the advantages of quantum computers to
develop an algorithm for the highly accurate calculation of excited states. We
solve a contracted Schr\"odinger equation (CSE) -- a contraction (projection)
of the Schr\"odinger equation onto the space of two electrons -- whose
solutions correspond identically to the ground and excited states of the
Schr\"odinger equation. While recent quantum algorithms for solving the CSE,
known as contracted quantum eigensolvers (CQE), have focused on ground states,
we develop a CQE based on the variance that is designed to optimize rapidly to
a ground or excited state. We apply the algorithm in a classical simulation
without noise to computing the ground and excited states of H$_{4}$ and BH.
