  Classical algorithms for predicting the equilibrium geometry of strongly
correlated molecules require expensive wave function methods that become
impractical already for few-atom systems. In this work, we introduce a
variational quantum algorithm for finding the most stable structure of a
molecule by explicitly considering the parametric dependence of the electronic
Hamiltonian on the nuclear coordinates. The equilibrium geometry of the
molecule is obtained by minimizing a more general cost function that depends on
both the quantum circuit and the Hamiltonian parameters, which are
simultaneously optimized at each step. The algorithm is applied to find the
equilibrium geometries of the $\mathrm{H}_2$, $\mathrm{H}_3^+$,
$\mathrm{BeH}_2$ and $\mathrm{H}_2\mathrm{O}$ molecules. The quantum circuits
used to prepare the electronic ground state for each molecule were designed
using an adaptive algorithm where excitation gates in the form of Givens
rotations are selected according to the norm of their gradient. All quantum
simulations are performed using the PennyLane library for quantum
differentiable programming. The optimized geometrical parameters for the
simulated molecules show an excellent agreement with their counterparts
computed using classical quantum chemistry methods.
