• No results found

Variational quantum eigensolver for quantum chemistry

As detailed in Section 5.1, the variational quantum eigensolver (VQE) is a hybrid quantum- classical algorithm that estimates molecular properties, often the ground state energies, of

quantum systems using the variational principle. Consequently, a promising application of VQE is quantum chemistry. At a high level, VQE allocates subtasks between quantum and classical resources based on the inherent strengths and capabilities of each device. In this framework, the role of the quantum computer is to prepare the parametrized trial quantum state

ψ(~θ) E

(also known as the ansatz ) and estimate the energy with respect to the Hamil- tonian. The ansatz is constructed by applying a variational circuit, that is a parametrized quantum circuit U (~θ) with classical parameters ~θ to an initial or reference state|φ0i. The role

of the classical processor is then to orchestrate the minimization of the energy expectation through feedback to the parameters ~θ. Procedurally, the VQE algorithm can be summarized in the following steps:

1.) prepare the parametrized trial quantum state ψ(~θ)

E

= U (~θ)|φ0i on the quantum

computer,2

2.) estimate the expectation value of energy Dψ(~θ) H

ψ(~θ)

E

using measurements of terms in the Hamiltonian,

3.) update the parameter(s) ~θ of the quantum state using a classical optimization routine, 4.) repeat the previous steps until convergence criteria (e.g. in energy and/or iteration

number) are satisfied.

Often the challenge in VQE is the choice and/or design of the ansatz, which largely influences the performance of the algorithm321. This has motivated numerous studies and

designs of ansatze, several of which are reviewed in Section 5.1.1. For our case of simulating molecular hydrogen, we selected an ansatz based on the unitary coupled cluster (UCC) method, as shown in Figure 12. To construct the ansatz, the Hartree-Fock reference state (i.e.|01i) is first prepared, followed by quantum operations corresponding to the application of the UCC operators. For more detail on the UCC method, the reader should refer to

Section 5.1.1. We note that for the H2 example, this level of theory is equivalent with the

exact solution.

Once the ansatz is selected, its variational circuit implementation is executed on the quantum computer to compute the objective function value, which, in the case of VQE, is the energy expectation. We note that initialization of the variational circuit parameters should ideally be informative. For instance, in the case of unitary coupled-cluster ansatz, the classically computed MP2 amplitudes can be used to initialize the VQE parameters (i.e. UCC amplitudes). The energy expectation can then be estimated using the Hamiltonian averaging procedure. Given that the Hamiltonian is written as a sum of Pauli terms acting on subsets of qubits, we can compute the energy expectation by averaging over the expectation values of the individual Pauli terms, as shown below:

hHi =X

i

hihOii, (109)

where Oi is a Pauli term, a tensor product of Pauli operators (i.e. X, Y , Z, or I) acting on

some subset of qubits, and hi is the corresponding weight.

In the case of molecular hydrogen, the energy expectation expression becomes

hHi = ν0I + ν1hZ1i + ν2hZ2i + ν3hZ1Z2i + ν4hX1X2i + ν5hY1Y2i. (110)

We note that when measuring each Pauli expectation, post-rotations may need to be applied to make measurements in the Z basis. These measurements are then collected and processed to approximate the total energy. In practice, we can only obtain a finite number of measurements, leading to errors in the energy estimation. For a deeper analysis of the sampling error, the reader should refer to Section 5.1.2 or McClean et al.216. While VQE is

a near-term alternative to the quantum phase estimation algorithm due to its low coherence time requirements, the trade-off or cost of the algorithm is the large number of measurements needed to approximate the ground state energy with high precision.

Figure 12: The quantum circuit used in VQE to estimate the ground state energy for molec- ular hydrogen in the minimal basis. After preparing the parametrized quantum state, using the Hartree-Fock reference state followed by the application of the unitary coupled cluster- inspired variational circuit. To estimate the energy expectation, necessary post-rotations (Rt ∈ {RX(−π/2), RY(π/2), I}) are applied before measuring the qubits in the Z basis.

After computing the energy expectation with respect to some values assigned to the pa- rameters, VQE employs a classical optimization routine to update the parameters to ideally reach a quantum state that better approximates the ground state. Section 5.1.3 reviews a number of optimization routines used and benchmarked for VQE in previous studies. Pro- vided that the ansatz can well describe the ground state and the classical optimizer is robust against noise in the cost function landscape, VQE can provide a high-quality estimation for the ground state energy. This is observed for our small example of molecular hydrogen, shown in Figure 13a, in which a simulation of the VQE algorithm was able to compute ground state energies along the energy surface that were numerically equal to the corresponding FCI energy values. Note that we also show the sampling error at a particular geometry in Figure 13b.

Since first presented in 2014, VQE has been widely studied and improved from both the- oretical and experimental standpoints. In particular, VQE was experimentally implemented for molecular systems beyond hydrogen as highlighted in Section 5.1, demonstrating the utility and potential of the algorithm for applications in quantum chemistry even on early quantum computers.

0.0 0.5 1.0 1.5 2.0 2.5 3.0 3.5 Bond length (angstrom)

1.2 1.0 0.8 0.6 0.4 0.2 0.0 0.2 E ner gy (h ar tr ee) FCI VQE

a)

b)

4 3 2 1 0 1 2 3 4 Variational parameter ✓ 1.2 1.0 0.8 0.6 0.4 0.2 0.0 E ner gy (h ar tr ee) exact nsamples= 100

Figure 13: VQE simulation results for molecular hydrogen in the minimal basis (STO-6G). a) Dissociation profile computed using the VQE algorithm. At each bond length, the energy computed using VQE is numerically equal to that of the FCI method. The L-BFGS-B method was used for parameter optimization. b) Energy expectation plotted over a range of parameter values for bond length of 1.2 Angstroms. A parameter scan using a finite number of samples is overlaid with that generated using the wave function simulator. These simulations were implemented using OpenFermion404 and Forest389.