When I learned about the variational method in quantum mechanics and the variational quantum eigensolver (VQE), I was told that this method is used to prepare the ground state of a quantum system. I wonder if we could also use this method to estimate/prepare the highest energy state? Can we make an ansatz and then turn the question into a maximization problem? Thanks!
Yes, of course.
That is, assuming your system has a maximum energy, which isn't always the case. But if it does, the same logic used to find the minimum can be applied just as easily to the maximum.
Quick Summary of that Logic, for Completeness
Any quantum observable has a set of eigenstates, whose expectation values are the eigenstate's eigenvalues. For a Hamiltonian, these eigenvalues are the energies. We presume quantum mechanics is linear, meaning any quantum state can be written as a superposition (ie. a normalized linear combination) of these eigenstates. The expectation value of the observable is therefore a weighted average of all the eigenvalues. This weighted average can never exceed the maximum eigenvalue, and is obtained exactly only when the system is prepared in a highest-"energy" state. So, you can vary an ansatz to maximize its energy. The result approximates an eigenstate with the highest possible eigenvalue, subject to the flexibility of your ansatz and the accuracy of your maximization procedure.
Unfortunately, "VQE" is practically synonymous with a ground-state solution. As epelaaez's answer suggests, it can be quite a lot more flexible, and Mauricio's answer provides an easy way to adapt a standard implementation of VQE, which finds the ground state of a user-defined qubit observable, to find the maximum state instead. Simply multiply your observable by -1 to reflect the spectrum. Don't forget to multiply your result by -1 again, to un-reflect!
If you have control over how the optimization is performed, you could simply choose to maximize a cost function instead of minimizing it. Everything else works identically.
As Mauricio has explained, VQE is especially popular among chemists, whose systems of study are infinite and do not have a maximum. You absolutely can follow the steps above to maximize rather than minimize a VQE run, even for molecular systems, but the result is a numerical artifact, the maximum value of the Hamiltonian when approximated in the finite basis you've selected. The complete (computationally-inaccessible) Hamiltonian will certainly have other eigenvalues higher than the one you've found. Moreover, most standard bases are designed to be most accurate for the lowest energies and aren't especially useful for very excited energy predictions. The highest energy is unlikely to have much physical meaning at all in most molecular VQE runs.
I'm not completely aware of the details and implementations of this, but it may be worth looking into the following papers that talk about VQE-type algorithms for excited states:
- Variational Quantum Computation of Excited States.
- Variational quantum algorithms for discovering Hamiltonian spectra.
- Subspace-search variational quantum eigensolver for excited states.
- Hybrid quantum-classical hierarchy for mitigation of decoherence and determination of excited states.
- Quantum Computation of Electronic Transitions Using a Variational Quantum Eigensolver.
Most of times it is not possible. Most problems of interest for VQE (atoms and molecules) do not have a highest energy state. The spectrum usually has an infinite number of states. You could try to find the ionization energy but I think that would correspond to a different algorithm as you cannot even choose a set of states to start with.
In principle you could use VQE for a discrete finite basis. If you can find the groundstate for a Hamiltonian $H$ using VQE, then it suffices to invert the energy spectrum and find the groundstate of $-H$ (possibly with a different ansatz) which will correspond to the highest energy state of $H$ for the finite basis chosen.