Simulating molecules with variational quantum eigensolvers
Abstract
Departamento de Teoría de la Señal y Comunicaciones e Ingeniería Telemática
Full text
Trabajo Fin de Máster Máster en Física Simulating Molecules with Variational Quantum Eigensolvers Autora: Nonia Vaquero Sabater Tutor: Juan Carlos García Escartín
Abstract During this work, we have reviewed the theory on which variational quantum eigensolvers are based. Applying this type of algorithms, we have seen how to obtain the ground state of a molecule with a quantum computer. Using two programs, one we have developed and other provided by Qiskit, we have been able to study some of the properties of these algorithms. Starting with the H2molecule, we have tested two types of ans¨atze based on quantum circuits. We have verified that for each program one of the ans¨atze gave a more accurate result. We have also tried one of the chemistry-inspired ans¨atze, the U CCSD, which has been proven to be very sensitive to noise. Afterwards, a simulation has been executed for each program and each type of ansatz but trying different mappings. We have come to the conclusion that the only one that generated good results is the Bravyi-Kitaev mapping with one of the ansatz here proposed. Finally, we have focused on the study of bigger molecules using Qiskit packages to simulate the LiH molecule. We have found that fermionic based ans¨atze give better results than circuit based ans¨atze. Abstract En este trabajo se ha revisado la teor´ıa en la que se basan los algoritmos cu´anticos variacionales aplicados a la b´usqueda de autoestados de un Hamiltoniano. Aplicando estos algoritmos, hemos visto c´omo calcular el estado fundamental de una mol´ecula usando un ordenador cu´antico. Para ello, hemos utilizando un programa creado por nosotros y uno predeterminado proporcionado por Qiskit, que nos han permitido estudiar algunas de las propiedades de estos algoritmos. Empezando con una mol´ecula de H2, hemos probado dos tipos de ans¨atze basados en circuitos cu´anticos, comprobando que para cada programa, hab´ıa uno m´as preciso que el otro. Tambi´en hemos probado uno de los ans¨atze basados en la qu´ımica, el U CCSD, que ha demostrado ser muy sensible al ruido. Despu´es, se han ejecutado, para cada programa y cada tipo de ansatz, simulaciones para cada tipo de mapeado presentado en el trabajo. Hemos llegado a la conclusi´on de que solamente el mapeado de Bravyi-Kitaev con uno de los ans¨atze que est´abamos probando nos proporciona buenos resultados. Finalmente, nos hemos centrado en el estudio de mol´eculas de mayor tama˜no, utilizando los paquetes de Qiskit para simular una mol´ecula de LiH. Hemos encontrado que los ans¨atze basados en sistemas fermi´onicos dan mejores resultados que aquellos basados en circuitos cu´anticos. 1
Contents 1 Introduction 5 2 Introduction to Quantum Mechanics 6 2.1 The Postulates of Quantum Mechanics . . . . . . . . . . . . . . . . . . . . . . . . 7 2.2 The spectral decomposition . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8 3 Introduction to Quantum Computing 9 3.1 Whatisaqubit? .................................... 9 3.2 QuantumStates .................................... 10 3.3 QuantumGates..................................... 11 4 What are Variational Quantum Eigensolvers? 12 4.1 Hamiltonian Ground State . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12 4.2 Introduction to VQE algorithms . . . . . . . . . . . . . . . . . . . . . . . . . . . 12 4.3 Minimum energy estimation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14 4.4 Preparation of the molecular Hamiltonian . . . . . . . . . . . . . . . . . . . . . . 16 4.4.1 Secondquantization .............................. 17 4.4.2 Orbitalsremoval ................................ 18 4.4.3 Fermion to qubit mapping . . . . . . . . . . . . . . . . . . . . . . . . . . . 18 4.5 Ansatzselection .................................... 24 5 Experiments 27 5.1 First experiment for H2................................ 28 5.2 Second experimemt for H2............................... 31 5.3 Differentmappings................................... 33 5.4 BiggerMolecules .................................... 36 6 Discussion 38 2
Resumen Uno de los campos en los que se espera obtener supremac´ıa cu´antica es en la qu´ımica computacional. Simular grandes sistemas ha supuesto siempre un reto para la computaci´on cl´asica ya que la cantidad de recursos necesitados escala exponencialmente con el tama˜no del sistema. Aprovechando las propiedades de los ordenadores cu´anticos, el objetivo es ser capaces de simular alg´un d´ıa grandes sistemas de manera eficaz. Una de las maneras que se est´an estudiando actualmente para conseguir esto son los Variational Quantum Eigensolvers algorithms. Estos algoritmos son capaces de hallar el estado y energ´ıa fundamentales de mol´eculas. Su funcionamiento se basa en proponer un estado inicial de prueba (ansatz) expresado en funci´on de ciertos par´ametros y mediante un optimizador cl´asico hallar el valor de los par´ametros que minimiza el valor de la energ´ıa. Para ello es necesario proponer una expresi´on del Hamiltoniano que sea ejecutable en un ordenador cu´antico. La energ´ıa ser´a el valor esperado de este Hamiltoniano. Vemos que la principal caracter´ıstica de estos algoritmos es la combinaci´on de la parte cu´antica, con el c´alculo del valor esperado del Hamiltoniano, con la parte cl´asica, con la optimizaci´on del estado. El principal objetivo de este trabajo era crear un programa que bas´andose en el ansatz propuesto en [1], fuera capaz de simular una m´olecula de H2, hallando la energ´ıa para distintas distancias entre ´atomos. Hallando as´ı la distancia para la energ´ıa m´ınima que corresponde con el estado fundamental. Esto se consigui´o y fuimos capaces de ejecutar el programa tanto en ordenadores cl´asicos con paquetes que simulan el comportamiento de un ordenador cu´antico como directamente en ordenadores cu´anticos. Esto nos ha permitido estudiar diferentes caracter´ısticas de estos algortimos, como la infuencia de la elecci´on del ansatz o del tipo de mapeado sobre la soluci´on. La ejecuci´on en ordenadores cu´anticos se realiz´o gracias a IBM Quantum, una plataforma que permite lanzar programas tanto a simuladores de ordenadores cu´anticos como a los ordenadores cu´anticos reales que IBM tiene disponibles. Todos los programas han sido ejecutados en Qiskit, un software abierto creado para trabajar con ordenadores cu´anticos y compatible con IBM Quantum. Las primeras simulaciones lanzadas fueron las del programa que hab´ıamos creado para distintos ans¨atze, siendo uno de ellos el propuesto por el paper citado anteriormente. Se lanzaron simulaciones suponiedo un comportamiento ideal del ordenador y simulaciones suponiendo ruido. Se encontr´o que el programa funcionaba adecuadamente con una precisi´on cercana a la qu´ımica. Los mejores resultados hallados fueron los calculados con el ansatz del paper. Al ejecutar estos programas en el ordenador cu´antico, se encontraron los mismos resultados, con la ´unica diferencia de que esta vez los datos obtenidos con los dos tipos de ans¨atze eran bastante menos precisos. Tambi´en se aprovecharon los paquetes de Qiskit que proporcionan algoritmos cu´anticos variacionales ya programados. De la misma manera, los ejecutamos en simulaciones no ruidosas, ruidosas y en ordenadores cu´anticos. Se encontr´o que la precisi´on de el programa que nosotros hicimos es similar a la precisi´on del programa de Qiskit al realizar una simulaci´on ruidosa. Sin embargo, al ejecutar estos programas en un ordenador cu´anticos, se hallaron muy buenos resultados con uno de los ans¨atze utilizados, llamado ansatz universal. La precisi´on de este entra dentro de la precisi´on qu´ımica, cosa que no pasaba con nuestro programa. Como antes se mencion´o, se necesita hacer un mapeado para pasar del Hamiltoniano cuantizado a qubits. Esto se puede hacer de diferentes maneras, hasta ahora hemos utilizado una forma en concreto de codificar la informac´on en los qubits, llamado parity mapper. Hemos realizado todas estas simulaciones para los otros dos tipos que hemos estudiado, obteniendo que solo uno 3
de ellos daba buenos resultado y adem´as solamente con un tipo de ansatz. Solo hemos mostrado estos resultados ya que eran los ´unicos coherentes. En este caso hemos comparado para el mismo ansatz, el funcionamiento de nuestro programa y del de Qiskit. Hemos visto que aunque nuestro programa no da malos resultados para la simulaci´on sin ruido, aunque no lo suficientemente precisos, mientras que el programa de Qiskit alcanza la precisi´on qu´ımica en este caso. Sin embargo, a la hora de ejecutarlos en un ordenador cu´antico, la precisi´on de ambos no es muy buena. Hoy en d´ıa, se han podido simular con eficiencia mol´eculas de mayor tama˜no, estas son LiH, BeH2yH6. Hemos utilizado los paquetes de Qiskit para comprobar la eficiencia de dos tipos de ansatz en el caso de simulaci´on no ruidosa, comparando su precisi´on y tiempo de ejecuci´on. Hemos concluido que en el caso de mol´eculas grandes los ans¨atze basados en circuitos cu´anticos tienen dificulatdes para hallar el estado m´ınimo de energ´ıa, siendo los circuitos fermi´onicos una mejor opci´on. Hemos comparado tambi´en c´omo afecta la elecci´on del optimizador cl´asico al programa cuando se est´a trabajando con ans¨atze basados en circuitos cu´anticos, viendo que los de gradient descent no presentaban una gran ventaja y utilizando finalmente un optimizador cl´asico de aproximaci´on lineal. 4
1 Introduction It was in the early 1980s when the idea of quantum computing was heard for the first time. Yuri Manin was the first to mention this in the introduction of his book Computable and Uncomputable[2]. At the same time, Paul Benioff constructed a microscopic quantum mechanical Hamiltonian as a model of Turing machines [3]. Shortly after, in 1981, a conference on the Physics of Computation was organised by the MIT and IBM. It gathered several scientists that had been working in quantum computing. The talks that were given during this meeting were published the following year in the International Journal of Theoretical Physics. It is here where the famous Feynman conference [4], which has been credited for the birth of the quantum computation and simulation, can be found. From that time on we have witnessed the creation of the first quantum computers, together with the development of several quantum algorithms. The main idea is to use a controllable quantum system to study another less controllable or accessible quantum system since simulating quantum mechanics with a classical computer is a really difficult computational problem. The applications of quantum computing can be found in different fields, such as physics, chemistry or biology. In this work we are going to focus on quantum computational chemistry. Classical simulations of chemical systems have greatly helped us to understand the structural, physical, and chemical characteristics of molecules, but the systems soon become intractable on a conventional computer. When simulating molecules, the resources needed scale exponentially with the number of atoms, therefore an exact solution requires too many computational resources. Since quantum computers are able to simulate quantum systems, they are capable of solving this problem in a much more efficient and accurate way. Solving the Schr¨odinger equation on a quantum computer is a well-studied and highly important challenge. Different algorithms have been created to tackle this problem, the one we are going to use is the Variational Quantum Eigensolver (VQE) [5], which allows us to calculate the eigenstates and eigenvalues of the Hamiltonian using an acceptable number of qubits for small molecules (this is an important aspect to take into account since the leading quantum processors contain around a few hundred qubits, and the errors in the results increase with the number of gates used during the simulation). The first two sections, (2, 3), contain a brief introduction to quantum mechanics and quantum computing. Followed by an explanation, step by step, of how the VQE algorithm works (4). We are going to apply two different VQE algorithms to a H2molecule and a LiH molecule, obtaining their ground state for different configurations. We will analyse how changes in the type of ansatz, classical optimizer and type of mapping affect the results. The experiments will be carried out in a noisless simulator, a noisy simmulator, and finally, in a quantum computer. The results will be presented in section (5). 5
2 Introduction to Quantum Mechanics The basic notions of quantum mechanics needed to understand the fundamentals of quantum computing presented in this work can be found in books such as Nielsen and Chuang [6] or Cohen-Tannoudji [7]. This section begins with an explanation of the notation that is going to be used, followed by a brief mention of the postulates of Quantum Mechanics and ending with the spectral theorem. In quantum mechanics, the state of a system is given by a wave function. Since the probabilistic interpretation requires it to be square-integrable, the set of these functions have the structure of a Hilbert space (ε). A Hilbert space meets the conditions of a vector space. We are going to call each element of this space a ket and it is going to be represented by |ψ⟩, where ψ is the wave function. In conclusion, each quantum state of a particle will be characterised by a state vector, belonging to a vector space ε, called the state space of a particle. The elements of the dual space of ε, symbolized by ε∗, are called bras and are denoted by ⟨ψ|. When dealing with a finite dimension n, kets and bras can be represented as matrices in an orthonormal basis of the space ε. The chosen basis must satisfy the following conditions: •Orthonormalization relation. A set of kets |ui⟩is said to be orthonormal if they satisfy the relation ⟨ui|uj⟩=δij i, j ∈ {1, ..., n},(1) where ⟨ϕ|ψ⟩denotes the scalar product between kets |ϕ⟩and |ψ⟩. •Closure relation. The basis elements |ui⟩must follow the relation n X i=1 |ui⟩⟨ui|= 1 i, j ∈ {1, ..., n}.(2) In the |ui⟩basis the ket |ψ⟩is represented by the set of its components (⟨ui|ψ⟩), which can be arranged forming a one-column matrix as follows |ψ⟩= ψ1 ψ2 . . . ψn = n X i=1 ψi|ui⟩.(3) On the other hand, bras are represented by one-row matrices. The last thing we need to define are linear operators. A linear operator Aassociates with every ket |ψ⟩ ∈ εanother ket |ψ′⟩ ∈ ε, the correspondence being linear (|ψ′⟩=A|ψ⟩). In the |ui⟩ basis they are represented by matrices whose structure is A= A11 A12 . . . A1j. . . A21 A22 . . . A2j. . . . . .. . .. . . Ai1Ai2. . . Aij . . . . . .. . .. . . ,(4) where Aij =⟨ui|A|uj⟩. Kets and bras are normalized, so in order to preserve the norm, all the matrices are unitary. 6
2.1 The Postulates of Quantum Mechanics Once the notation is known we can briefly enunciate the postulates of quantum mechanics [7]. We are going to consider a finite discrete spectrum. First Postulate: At a fixed time t0, the state of a physical system is defined by specifying a ket |ψ(t0)⟩belonging to the state space ε. Second Postulate: Every measurable physical quantity Ais described by an operator A acting in ε, this operator is an observable. Third Postulate: The only possible result of the measurement of a physical quantity Ais one of the eigenvalues of the corresponding observable A. Fourth Postulate (case of a discrete spectrum): When the physical quantity Ais measured on a system in the normalized state |ψ⟩, the probability P(an) of obtaining the eigenvalue anof the corresponding observable Ais P(an) = gn X i=1 |⟨ui n|ψ⟩|2 where gnis the degree of degeneracy of anand {ui n}(i= 1,2, ..., gn) is an orthonormal set of vectors which forms a basis in the eigensubspace εnassociated with the eigenvalue an of A. Fifth Postulate: If the measurement of the physical quantity Aon the system in the state |ψ⟩gives the result an, the state of the system immediately after the measurement is the normalized projection, Pn|ψ⟩ p⟨ψ|Pn|ψ⟩, of |ψ⟩onto the eigensubspace associated with an. We can define the projector operator Pn=|un⟩⟨un|when referring to a discrete nondegenerate case. In the general case of a discrete spectrum the projector operator is defined by Pn=Pn i=1 |ui n⟩⟨ui n|. Sixth Postulate: The time evolution of the state vector |ψ(t)⟩is governed by the Schr¨odinger equation i¯hd dt|ψ(t)⟩=H(t)|ψ(t)⟩, where His the Hamiltonian operator of the system. Notice that an observable is by definition an Hermitian operator. These operators are their own hermitian conjugate, which implies that their eigenvalues are always going to be real numbers. This last result makes sense considering that a physical variable must have real expectation values. One last concept we should keep in mind is the definition of mean value. The mean value of the observable Ain the state |ψ⟩, which is denoted by <A>ψ, is defined as the average of the results obtained when a large number Nof measurements are performed on the state |ψ⟩. If |ψ⟩ is normalized, < A >ψis given by the expression ⟨A⟩ψ=⟨ψ|A|ψ⟩= N X n=1 anP(an).(5) The last equality is true when N→ ∞, being Nthe number of experiments performed. P(an) represents the probability of getting the eigenvalue anwhen measuring the observable A. 7
2.2 The spectral decomposition In this work we will only need to consider Hermitian matrices. Spectral theorem for Hermitian matrices. For a Hermitian matrix all eigenvalues are real, the eigenvectors corresponding to distinct eigenvalues are orthogonal and there exists an orthogonal basis of the whole space, consisting of eigenvectors. This means that all Hermitian matrices are diagonalizable. Moreover, for every Hermitian matrix A, there exists a unitary matrix Usuch that AU =UΛ, where Λ is a real diagonal matrix. The diagonal entries of Λ are the eigenvalues of A, and the columns of Uare eigenvectors of A. A Hermitian matrix A∈ C n×nhas northonormal eigenvectors. This result makes it possible to express any Hermitian matrix as the sum of all the eigenvalues multiplied by the projector operator of each eigenvector. If |φi⟩is an eigenvector of Aand aiit’s eigenvalue, we have A= n X i=1 ai|φi⟩⟨φi|,(6) being nthe number of eigenvectors which corresponds to the dimension. 8
make the Xand YPauli gates diagonal in the computational basis and make the measurements of these new diagonal matrices. In other words, the idea is to rotate the qubit so that the x or y components can be accessed by measuring in the computational basis, rotating the standard basis frame to make it lie along the corresponding axis and obtain the correct results when measuring in the standard basis. It can be proven that measuring the expectation value of the XPauli gate in the basis given by its eigenvalues gives the same result as applying a Hadamard gate and then performing the measurement. This means that if we want to measure for example the expectation vale from XX, we need to build the following circuit: Figure 3: Measurement circuit for ⟨XX⟩. The fact that measuring our state in the basis of the eigenvectors of Xis equivalent to applying a Hadamard gate and measuring in the computational basis can be proven in the following way. Let |+⟩and |−⟩ be the eigenvectors of X(with eigenvalues 1 and −1), with the following form |+⟩=1 √2(|0⟩+|1⟩), |−⟩ =1 √2(|0⟩−|1⟩), (21) and the state that is going to be measured |q⟩=α|0⟩+β|1⟩.(22) The first procedure that is going to be used is measuring the previous state in the basis formed by the eigenvectorsof X. Applying the spectral decomposition theorem, we have the following expression for the XPauli gate ⟨X⟩=⟨q|X|q⟩=⟨q|+⟩⟨+|q⟩−⟨q|−⟩⟨−|q⟩.(23) Knowing that: ⟨q|+⟩= (α∗⟨0|+β∗⟨1|)|+⟩= (α∗⟨0|+β∗⟨1|)1 √2(|0⟩+|1⟩) = α∗+β∗ √2(24) and applying the same reasoning to the other eigenvector ⟨q|−⟩ = (α∗⟨0|+β∗⟨1|)|−⟩ = (α∗⟨0|+β∗⟨1|)1 √2(|0⟩−|1⟩) = α∗−β∗ √2,(25) 15
then we finally have ⟨X⟩=|⟨q|+⟩|2−|⟨q|−⟩|2= α∗+β∗ √2 2 − α∗−β∗ √2 2 .(26) On the other hand, the other procedure makes us apply a Hadamard gate before measuring in the computational basis. This is |q′⟩=H|q⟩=1 √21 1 1−1α β=1 √2α+β α−β=α+β √2|0⟩+α−β √2|1⟩.(27) Measuring this state in the computational basis we get ⟨q′|0⟩⟨0|q′⟩−⟨q′|1⟩⟨1|q′⟩= α∗+β∗ √2 2 − α∗−β∗ √2 2 ,(28) which matches the other result. Once this circuit has been built, we only have to repeat the measure several times in order to get the expectation value. The same reasoning applies when building the circuit of the YPauli gate. In this case, performing the measures in the basis formed by the eigenvalues of the YPauli matrix gives the same result as taking these measures of the gates S†Hin the computational basis. This can be proved in the same way as we did with the Xgate. This means that if we want to measure the expectation value of Y Y , we need to built the following circuit. Figure 4: Measurement circuit for ⟨Y Y ⟩. 4.4 Preparation of the molecular Hamiltonian In order to obtain the Hamiltonian written in terms of Pauli gates, we need to apply several transformation to the original molecular one. The molecular Hamiltonian has the following expression [12] H=− N X i=1 1 2∇2 ri− M X A=1 1 2MA∇2 RA− N X i=1 M X A=1 ZA |RA−ri|+ +X j>i 1 |ri−rj|+X B>A ZAZB |RA−RB|=Te+Tn+Vne +Vee +Vnn ,(29) 16
where riis the position of the electrons, Miits mass, RAthe nuclear positions, MAits mass and ZAthe atomic number. In order to simplify this expression the Born-Oppenheimer approximation is introduced. It is based on the fact that the nucleus is much heavier than the electrons and, consequently its velocity is much smaller. This makes possible to consider static nucleus surrounded by moving electrons. This implies that some of the terms of the previous Hamiltonian can be neglected, resulting in H=− N X i=1 1 2∇2 ri− N X i=1 M X A=1 ZA |RA−ri|+X j>i 1 |ri−rj|=Te+Vne +Vee .(30) Now we are just dealing with a problem of interacting electrons. 4.4.1 Second quantization The next step is the quantization, as mentioned before, we are going to transform the molecular Hamiltonian to the second quantized formulation [12]. It is known that fermions are represented by anti-symmetric states. Slater determinants are used to write these states, for example in the case we have nfermions, we can write |ψ⟩n=1 √n! |χ1⟩1. . . |χ1⟩n . . .. . .. . . |χn⟩1. . . |χn⟩n .(31) Where |χ1⟩1represents the first particle being in the first state. In general, |χj⟩jdenotes a spin-orbital. This can be written in a simpler way, |ψ⟩n=|χ0. . . χN−1⟩,(32) where χj∈ {0,1}due to the Pauli exclusion principle, with 0 meaning that the orbital is unoccupied and 1 meaning that it is occupied. This is called the occupation number formalism. The subspace spanned by these anti-symmetric states is known as the Fock space. In the case we have a Fock space of Norbitals, it will be spanned by 2Nstates. It is noticeable that the number of states of Nqubits is also 2N, this is how we start to think about mapping this Fock space to the space of Nqubits. In order to do so, we define creation and annihilation operators in the Fock space. Their action is defined by the following equations, a† j=|χ0. . . χj−10χj+1 . . . χN−1⟩= (−1)Pj−1 s=0 χs|χ0. . . χj−11χj+1 . . . χN−1⟩,(33) a† j=|χ0. . . χj−11χj+1 . . . χN−1⟩= 0 ,(34) aj=|χ0. . . χj−11χj+1 . . . χN−1⟩= (−1)Pj−1 s=0 χs|χ0. . . χj−10χj+1 . . . χN−1⟩,(35) aj=|χ0. . . χj−10χj+1 . . . χN−1⟩= 0 ,(36) following the anti-commutation relations [aj, ai]=0,[a† j, a† i] = 0 ,[aj, a† i] = δji .(37) 17
In the second quantization, we enforce the anti-symmetry needed thorough the construction of the operators. This is why we are using annihilation and creation operators. Any operator in our Fock space can be expressed as a linear combination of products of creation and annihilation operators, so since the Hamiltonian defined in equation (30) is an operator acting in the Fock space, we are going to be able to write it in terms of a† jand aj. This is done in the following way, H=X p,q hpqa† paq+1 2X p,q,r,s hpqrsa† pa† qaras,(38) where hpq and hpqrs are one and two body integrals given by hpq =⟨χp|Te+Vne|χq⟩=Zdxχ∗ p(x) −1 2∇2−X A ZA |RA−ri|!χq(x),(39) hpqrs =⟨χpχq|Vee|χrχs⟩=Zdx1dx2 χ∗ p(x1)χ∗ q(x2)χr(x2)χs(x1) |r1−r2|,(40) which are easily computed classically. 4.4.2 Orbitals removal In order to lower the number of qubits needed to simulate the system, another approximation in applied. It is called the frozen core approximation. It consists in just considering the outer electrons and assuming that the rest do not change their state. In other words, it considers a core composed of the nucleus and the inner electrons, this is why it is called frozen core approximation. Once this approximation has been applied, there is one more manipulation that will reduce the number of qubits needed, the removal of some fermionic orbitals. With the lower energy orbitals (the ones which are filled with the inner electrons whose state does not change) removed, we just have the active space (this is the space where the outer electrons move) and the high energy orbitals. Due to the fact that we are looking for the state that gives us the ground energy, the high energy orbitals are not going to be used, so they can also be removed. So the only orbitals that are going to be simulated are the ones whose state may vary, affecting the solution. 4.4.3 Fermion to qubit mapping Now we have to transform electronic states and operators to states and operations of qubits. Three of the most common techniques are going to be briefly described in this section, the Jordan-Wigner mapping, the parity mapping and the Bravyi-Kitaev mapping [13], [14], [15]. Jordan-Wigner mapping: This mapping is based on the occupation number formalism, the state of each qubit represents if an orbital is occupied or not. This can be visualized in the following way, |χN−1. . . χ1χ0⟩→|qN−1⟩. . . ⊗|q1⟩⊗|q0⟩,(41) where Nis the number of fermionic states and χj=qj∈ {0,1}. For example, if the ith orbital is occupied (χi= 1), then the ith qubit will be in the state |1⟩(the same happens if the orbital is unoccupied (χi= 0), the state will then be |0⟩). Once the states have been mapped, the only thing left is the action of the creation and annihilation operators. We need a set of operators that have the following effect on the qubits Q†|0⟩=|1⟩, Q†|1⟩= 0 , Q|1⟩=|0⟩, Q|0⟩= 0 .(42) 18
It can be proven that the following operators fulfill this requirements: Q+=0 0 1 0=|1⟩⟨0|, Q−=0 1 0 0=|0⟩⟨1|.(43) Comparing the action of these operators with the action of creation and annihilation operators in equations (35,33), we can see that the phase shift still remains to be added. This is solved by including strings of Zoperators in the previous definitions of Q±. The effect of the ZPauli matrix is to multiply by −1 every time the occupation of the fermionic mode is 1 (if it is 0 it multiplies by 1), so an operator which has the same effect as the phase (−1)Pj<i njon the ith qubit is the product of Zoperators in all the qubits that precede it. In conclusion, in Jordan-Wigner transformation the mapping from fermion operators to qubits is a† i→ Y j<i Zj Q+ i= Y j<i Zj 1 2(Xi−iY i),(44) ai→ Y j<i Zj Q− i= Y j<i Zj 1 2(Xi+iYi).(45) The major drawback of this transformation is that the number of Zgates needed scale linearly with the size of the system, it scales as O(N). The parity mapping: Whereas in the previous transformation the state of each qubit indicated if the orbital was occupied or unoccupied, now the information encoded by each qubit is different. We will have |0⟩jif the number of orbitals up to and including the jth that are occupied is even and |1⟩jif it is odd. This means that if we have the fermionic state |χN−1. . . χ1χ0⟩, the mapping to qubits will be qN−1 qN−2 . . . q0 = 1 1 . . . 1 0 1 . . . 1 . . .. . ..... . . 0 0 . . . 1 χN−1 χN−2 . . . χ0 = χN−1+χN−2+. . . +χ0 χN−2+. . . +χ0 . . . χ0 ,(46) so that the first qubit informs us of the parity of the total number of particles. Apart from the parity, this mapping also gives us information about the occupation of the orbitals. If an orbital is occupied the value of the qubit will change with respect to the previous one (that is if we have either |0⟩j−1and |1⟩jor |1⟩j−1and |0⟩j). On the other hand, if it is unoccupied, it will remain the same. The values of the qubits, determined by equation (46), can be summarized in the following expression, being the fermionic state |χN−1. . . χ1χ0⟩, and the qubit state |qN−1. . . q1q0⟩: qj=X i≤j χi(mod 2) .(47) The only thing lacking is mapping the action of creation and annihilation operators. The first thing to implement is the phase change present in the expressions of creation and annihilation operators (35,33). The phase change of the jth qubit depends on the parity of all the j−1 qubits, but in this mapping, luckily, the parity of the j−1 qubits is given directly by the value of the j−1th qubit. This means we introduce the necessary phase just by applying a ZPauli gate on the j−1th qubit. For example, if the parity of all the qubits with index lower than jis 19
1, then the Zgate will introduce a −1 on qubit j. Due to the fact that the state of each qubit no longer means if the orbital is occupied, the next step is looking for an alternative to the operators Q+and Q−. As mentioned before, to know the occupation of the jth orbital, we need to take into account the value of the j−1th qubit. If we have |0⟩j−1, then the value of qubit jwill accurately reflect the occupation of orbital j, being |0⟩jif it is unoccupied and |1⟩jif it is occupied. This implies that in this case we can directly apply Q+when simulating a† j. On the other hand, if the previous qubit is |1⟩j−1, and the jth qubit is occupied (then |0⟩j), to simulate a† j, we will have to apply Q−on qubit jth. Then the operator Q±is represented by P± j=Q± j⊗|0⟩⟨0|j−1−Q∓ j⊗|1⟩⟨1|j−1=1 2(Xj⊗Zj−1∓iYj).(48) One last thing that must be taken into account is the fact that changing the occupation number of the jth qubit changes the parity of all the qubits with index bigger than j. We then need to update the value of all these qubits. This is accomplished by a string of Xoperators acting on all qubits with index greater than j. Then the creation and annihilation operators in the parity mapping are simulated as follows, a† j→X← j+1 ⊗P+ j=1 2(X← j+1 ⊗Xj⊗Zj−1−iX← j+1 ⊗Yj),(49) aj→X← j+1 ⊗P− j=1 2(X← j+1 ⊗Xj⊗Zj−1+iX← j+1 ⊗Yj),(50) where X← i=XN−1⊗XN−2⊗. . . Xi+1 ⊗Xi,(51) which is called the update operator. We were trying to reduce the number of Pauli gates needed respect to the Jordan-Wigner mapping but we have just exchanged a string of Zgates for a string of Xoperators. This mapping also scales linearly with the size of the system, it scales as O(N). The Bravyi-Kitaev mapping: While in the Jordan-Wigner mapping the occupancy was stored locally (with locally meaning that we knew if an orbital was occupied just by looking at the corresponding qubit) and the parity was stored non-locally (with non-locally meaning that in order to know the parity of an orbital we had to look at the state of all the qubits with lower index than the corresponding qubit), in parity mapping the occupancy was stored non-locally and the parity was stored locally. This transform tries a different approach, where both, occupancy and parity, are stored non-locally. It can be understood as a halfway point. Instead of storing part of the information locally and the rest completely non-locally, having then to add strings of gates that affect all the remaining qubits, it tries to find a balance between the locality and non-locality of the occupation and parity information in order to improve the efficiency. The basic idea is that some qubits (|qj⟩) store partial sums (Pl s=kχs) of occupation numbers. It can also be understood as if a qubit stored a set of orbitals, meaning that it stores the parity of the set of occupation numbers corresponding to that set of orbitals. First, we are going to see the structure of the matrix which allows to transform a fermionic state to a qubit state in this mapping, it is built in a recursive way, its structure is the following: 20
Figure 5: Bravyi-Kitaev matrix [15]. Following this structure, the matrix of the transformation in the case x= 1, knowing that β1= 1, when x= 0, is β2=1 1 0 1.(52) Following the structure shown in figure (5), matrices for x= 1,2 will be β22= 1111 0100 0011 0001 , β23= 11111111 01000000 00110000 00010000 00001111 00000100 00000011 00000001 .(53) We can see that only odd indexes store information of other orbitals, for an odd value of j, it also stores information of orbitals with index less than j. Qubits with even value of jonly hold the occupation state of orbital j. This can be seen in the following equation, being |χ3χ2χ1χ0⟩ the fermionic state that we want to encode, we have 1111 0100 0011 0001 χ3 χ2 χ1 χ0 = χ3+χ2+χ1+χ0 χ1 χ1+χ0 χ0 .(54) Reconstructing the creation and anihilation operators is not as trivial as in the previous methods. To extract the information from this coding we need to define three sets of qubits, the parity set, the update set and the flip set. 1. The parity set. One thing we need to know when simulating the action of creation and anihilation operators is whether or not it is necessary to introduce the phase −1 when acting on orbital j. The parity set of a qubit jis the set of qubits in the Bravyi-Kitaev basis that will tell us if this change of −1 is needed. The parity of this set of qubits has the same parity as the set of qubits with index less than j, this is why this set is called the parity set, denoted as P(j). The parity of a qubit jis determined by the sum of the states of all the previous qubits, then the matrix determining the parities will have the following structure: [πn]ij =1 if i>j 0 otherwise (55) 21
This matrix is very similar to the one that gives us the parity mapping but with 0 in the diagonal. This matrix must be applied onto the fermionic states, so we will have pn=πnχn=πnβ−1 nqn. Being β−1the matrix that maps qubit strings in the Bravyi- Kitaev basis to the occupation number basis. The parity of a qubit jis given by the set of qubits with non-zero entries on the jth row. In the case of n= 8 we would have: p8q8=π8β−1 8q8= 01101000 00101000 00011000 00001000 00000110 00000010 00000001 00000000 q7 q6 q5 q4 q3 q2 q1 q0 = q6+q5+q3 q5+q3 q4+q3 q3 q2+q1 q1 q0 0 .(56) So for example the parity set of qubit with index 6 is P(6) = {q5, q3}. 2. The update set. In the same way when applying the parity mapping we had to include a string of Xgates to update the parity of all the qubits with index greater than jwhen the occupation number of jchanged, now when the occupation of a qubit changes we also have to update a set of qubits. This set of qubits that must be changed is called the update set, denoted by U(j). Any qubit that stores information involving qubit j, this means that include partial sums depending on the occupation number j, is going to be included in the update set of index j. Since the transformation matrix is upper triangular, only qubits with index i > j will be affected. Besides this, as mentioned before, even qubits do not store information of other orbitals. This means that only odd qubits will be part of the update set. This can be visualized in the transformation matrix. The update set of qubit with index j,U(j), is formed by the non-zero entries in column jabove the main diagonal. For example if we want to know U(1) we would have: 7 11111111 6 01000000 5 00110000 4 00010000 3 00001111 2 00000100 1 00000011 0 00000001 ⇒U(1) = {q3, q7}. (57) 3. The flip set. This is the set of qubits that determine whether qubit jand orbital jare equal or opposite. This happened also in the parity mapping, when the gate that was gonna be applied (either +or −) to jdepended on the value of the previous qubit. So we had two options, for example if the orbital jwas occupied, so χj= 1, if qubit j−1 is |0⟩j−1, then |1⟩j, being equal the value of the qubit and the orbital. But if we had |1⟩j−1, 22
then |0⟩j, being the value the opposite. This is what the flip set help us to determine. It is denoted by F(j). Since qubits with even index store just the information of the orbital with same index, then their flip set is empty. However, for odd indexes, we need to know which occupation states are included in each partial sum to transform back to the occupation state. This is done by looking at the inverse transformation matrix, defined by β−1= 76543210 11101000 01000000 00110000 00010000 00001110 00000100 00000011 00000001 q7 q6 q5 q4 q3 q2 q1 q0 = q7+q6+q5+q3 q6 q5+q4 q4 q3+q2+q1 q2 q1+q0 q0 .(58) In order to know if the occupation state of qubit jhas the same value as the occupation of the orbital, we need to take into account the rest of qubits that contribute to the qubit state j. This would be for example in the case of j= 7, F(7) = {q6, q5, q3}. Once all these sets have been determined, it is possible to represent the creation and annihilation operators in the Bravyi-Kitaev basis. In the case of a qubit with even jit is simple. The first thing is to apply Q±as usual (Q+for a†and Q−for a). Then, update the update set with a bit flip (as in the previous mapping, this is accomplished by applying Xgates) and finally, introduce or not a negative sign depending on the value of the parity set (by introducing Zgates). This is a† j=XU(j)⊗Q+ j⊗ZP(j)=1 2(XU(j)⊗Xj⊗ZP(j)−iXU(j)⊗Yj⊗ZP(j)),(59) aj=XU(j)⊗Q− j⊗ZP(j)=1 2(XU(j)⊗Xj⊗ZP(j)+iXU(j)⊗Yj⊗ZP(j)).(60) The size of U(j) and P(j) scales as O(log j)≤O(log n). Simulating the creation and annihilation operators for odd indexes is not that easy. While for even indexes the flip set was the empty set, now it may have non-zero parity. In the case where the parity is non-zero, we would have to apply the creation operator to the qubit state where the annihilation operation is applied to the fermionic state and vice versa. It is necessary to define the following operators onto the even and odd states of a set Sin order to take this into account ES=1 2(I+ZS),(61) OS=1 2(I−ZS).(62) We are now able to define how the operator Q±is represented in the Bravyi-Kitaev basis for odd indexes, this is Π± j=Q± j⊗EF(j)−Q∓ j⊗OF(j)=1 2(Xj⊗ZF(j)∓iYj).(63) 23
As in the case of even index, the update set of jhas to be updated, it is done in the same way, with Xgates. The only thing left is whether is it necessary to multiply by −1 depending on the parity of the parity set. P(j) and F(j) are not disjoint, and we need to take into account the parity of the qubits that belong to P(j) but not to F(j). The reason is that the relative sign in the Π± joperator implicitly calculates the parity of the subset of the parity set that is also in the flip set of index j. We need to introduce the set R(j), defined by R(j) = P(j)\F(j).(64) This equation means that the set R(j) is composed of all the qubits that belong to P(j) but not to F(j). Then the representation of the creation and annihilation operators in the Bravyi-Kitaev mapping for odd indexes will be a† j=XU(j)⊗Π+ j⊗ZR(j)=1 2(XU(j)⊗Xj⊗ZP(j)−iXU(j)⊗Yj⊗ZR(j)),(65) aj=XU(j)⊗Π− j⊗ZR(j)=1 2(XU(j)⊗Xj⊗ZP(j)+iXU(j)⊗Yj⊗ZR(j)).(66) It is noticeable that the only difference between the anihilation and creation operators for even and odd indexes is the subset in which the Zgates are applied. Then we can summarize all these results in the following expressions ρj=P(j) if j even R(j) if j odd (67) and finally a† j=1 2(XU(j)⊗Xj⊗ZP(j)−iXU(j)⊗Yj⊗Zρ(j)),(68) aj=1 2(XU(j)⊗Xj⊗ZP(j)+iXU(j)⊗Yj⊗Zρ(j)).(69) We can see that instead of applying gate string to all the qubits of the system, this method focuses on sets of qubits whose size scales as O(log(N)). This is what makes this mapping more efficient that the other two, instead of scaling as O(N), it scales as O(log(N)). 4.5 Ansatz selection The choice of ansatz is crucial to get a good solution as it limits the accuracy of the simulation result. Choosing an ansatz that does not cover the solution of the problem will give us an invalid solution. The objective is to obtain an ansatz which provides high accuracy with few parameters (so that the classical optimizer works) and shallow circuits (the less circuits the less error due to noise we will have). There exist different ways of creating an ansatz, divided in two main groups, chemistry-inspired ansatz and hardware-efficient ansatz, in this subsection the more important ones are going to be shorty explained, a good review can be found in [16]. Chemistry-inspired ansatz They are based on quantum chemistry, meaning that every term in the ansatz describes a certain electron configuration. The first ansatz of this type studied is the Unitary Coupled Cluster Single and Double (UCCSD). It takes an initial state, usually a Hartree-Fock state, and makes it evolve using the exponenciated excitation operator. 24
5.2 Second experimemt for H2 As mentioned before, Qiskit provides with a package with VQE algorithms already programmed. This program is going to be called Program 2. In this section we are going to study its performance both with the perfect behaviour and with the noisy simulation. In this case, appart from using the same ans¨atze as in the previous section, we are going to use the UCCSD ansatz. This is eventually going to be executed in a real quantum computer. Figure (14) shows the ground energy found for each bond length and each ansatz. Figure 14: H2 molecule simulations with parity mapper and VQE python package. We can see that the UCCSD result for the noisy simulation does not give good results. The errors can be seen in figure (15) Figure 15: Energy differences from the exact solution with parity mapper and my program. In the case of the noiseless simulation, all ans¨atze work perfectly around the ground state and 31
chemical accuracy is reached. On the other hand, noisy simulations are too inaccurate, especially the one performed with the UCCSD ansatz. Lastly, the simulations have been executed in a quantum computer, in this case only the ansatz from the paper and the universal ansatz have been used. Figure (16) shows the results, comparing the energy found at each distance for both ans¨atze. Figure 16: H2molecule simulations in quantum computer with parity mapper and the VQE Python package. Again, the accuracy of these last simulation is shown in figure (17). Figure 17: Energy differences from the exact solution with parity mapper and the VQE Python package (log units). 32
EXECUTION TIME (min) Ansatz Paper Universal Ansatz UCCSD Simulation 18.93 11.66 11.84 Noisy simulation 37.29 99.67 52.64 Quantum computer 95.57 3.67 Table 3: Comparison of the simulation execution time for different methods. GROUND STATE ENERGY Ansatz Paper Universal Ansatz UCCSD (Hartree) Simulation −1.13731 −1.13731 −1.13731 Noisy simulation −1.09377 −1.09355 −1.04435 Quantum computer −1.09663 −1.13712 BOND LENGTH (˚ Angstrom) Ansatz Paper Universal Ansatz UCCSD Simulation 0.735 0.735 0.735 Noisy simulation 0.715 0.755 0.685 Quantum computer 0.800 0.750 Table 4: Simulation results (estimated ground state energy and bond length) for the different tested methods. We can see that the ansatz proposed in [1] does not work well, while the universal ansatz gives really good results. This can be due to the fact that the universal ansatz spans all states space, so it is easier to find the ground state. The following tables show a comparison of the execution times of each program, together with the ground state energy and bond length found. 5.3 Different mappings We have also executed these simulations with the Jordan-Wigner and the Bravyi-Kitaev mapping. We have seen that Parity and Bravyi-Kitaev mapping generate a Hamiltonian with the same number of Pauli gates, but, on the other hand, the Hamiltonian produced by the Jordan-Wigner mapping is longer. We would expect it to give less accurate results due to the increase of noise with the number of gates. All the previous simulations with each type of ansatz have been run with each of the mappings, showing that the only one that find a good solution, besides from the Parity mapping, is the Bravyi-Kitaev mapping with the universal ansatz. It is not worthwhile showing all the failed results, so we are just going to look at this last one mentioned. Figure (18) shows the ground energy found at each distance comparing Program 1 with Program 2, both with noisy and noiseless simulations. 33
Figure 18: H2 molecule simulations with the Bravyi-Kitaev mapping and the Universal Ansatz. The accuracy of these results is shown in figure (19). Figure 19: Energy differences from the exact solution with the Bravyi-Kitaev mapper and the Universal Ansatz comparing both programs. We can see that with perfect behaviour the VQE python package gives really good results, while in the noisy simulation neither of them reaches chemical accuracy. These simulations has also been run in a real quantum computer, the results are shown in figure (20). 34
Figure 20: H2molecule simulations in quantum computer with the Bravyi-Kitaev mapper and both programs using the Universal Ansatz. Here, Program 1 does not work very, maybe this could be because it is not being able no find the state that minimizes the energy. Its accuracy can be seen in figure (21) Figure 21: Energy differences from the exact solution with Bravyi-Kitaev mapper and Universal Ansatz comparing both programs. Finally, we have the tables comparing the execution times and ground states found. We can see that the execution time of Program 2 is smaller. The accuracy, however, is similar with both programs, at least for larger bond lengths. 35
Program 1 Execution Time (min) Ground State Energy (Hartree) Bond Length (˚ A) Simulation 151.47 −1.1357398010788513 0.750 Noisy simulation 801.45 −1.009965704394788 0.850 Quantum computer 1865.92 −1.0415796647509152 1.05 Program 2 Execution Time (min) Ground State Energy (Hartree) Bond Length (˚ A) Simulation 8.20 −1.137306029434759 0.735 Noisy simulation 104.63 −1.0085601307952317 0.805 Quantum computer 911.42 −1.0526563913799243 1.05 Table 5: Comparison of the simulation results (estimated ground state energy and bond length) and efficiency (execution time) for the different methods. 5.4 Bigger Molecules Two atoms of hydrogen were the first atoms simulated with this type of programs. Lately, bigger molecules have been simulated, these have been LiH,BeH2and H6. Using the Qiskit package, we have been able to simulate a molecule of LiH and study some of the properties of this program. One of these properties has been the influence of the ansatz on the solution. We have executed a noiseless simulation using a circuit based ansatz and a fermionic based ansatz. The ans¨atze used are a chemistry-inspired one, UCCSD, and a hardware-efficient one, RyRxwith linear entanglemen,t defined in section (4.5). The results can be seen in figure (22) Figure 22: LiH molecule simulations in quantum computer with parity mapper using the VQE Python package. The precision of the previous data can be seen in figure (23). 36
Figure 23: Energy differences from the exact solution with parity mapper using the VQE Python package. It is clear that the UCCSD ansatz gives way better results, it reaches chemical accuracy. We have seen that no chemical inspired ans¨atze seem to have difficulties finding the ground state when dealing with bigger molecules. Another thing that should be mentioned is that the execution time of the program using UCCSD ansatz is three hours, while the one using RyRxansatz is 45 min. This shows that the RyRx ansatz is executed easily but gives less precise results. Since this executions took a lot of time, different classical optimizers were also tested for the case of circuit based programs. We tried a couple of them based on gradient descent methods, but we did not see any improvement. Eventually, we used COBYLA, a linear approximation optimizer. 37
6 Discussion During this work we have analysed in depth how variational quantum eigensolvers work. Starting from the basic concepts such as the definition of a qubit, we have been able to make a good revision of its major points. The original idea was to reproduce the results from [1] and, from there, to study the influence of the choice of ansatz, optimizer and encoding. Having understood the mechanism of this algorithms, we managed to create a program that simulated a H2molecule and obtained its ground state and ground state energy. We have executed this program with different ans¨atze in order to study its efficiency. We found out that assuming perfect behaviour, the ansatz from [1] gave better results than the universal ansatz. In fact, the accuracy of the ansatz from the paper is near the limit of the chemical accuracy. We have seen that although the universal ansatz covers all the state space, it gives worse results. This can be related to the ability of the classical optimizer to find the minimum value of the energy since this ansatz has 24 parameters. There is a huge difference with the ansatz from the paper, which has just one parameter. When introducing the noisy simulation, again, the universal ansatz gives worse results. Now, this can also be caused by the fact that this ansatz is constructed with many more gates, so the noise will be bigger. When executing the program in a real quantum computer, we verified that the ansatz from the paper gives better results, although not good enough to reach chemical accuracy. As mentioned before, the fact that the universal ansatz gives worse results could be caused by the number of parameters involved or to the number of gates needed. In conclusion, we have managed to develop a program that calculates the ground state of the H2molecule quite properly but not with the enough precision to be chemically accurate. Afterward, we used the VQE python package, which includes the functions that allow us to execute VQE algorithms. Using these functions we have calculated the ground state of the H2 molecule. Again, simulation this molecule, we have been able to study how different ans¨atze behave, now including the chemistry-inspired ansatz UCCSD explained in section (4.5). We found out that when assuming perfect behaviour all of them reach chemical accuracy (at least around the minimum of the energy), but when making the noisy simulation, the results obtained are not good, especially with the UCCSD ansatz. The precision of the circuit based ans¨atze in the noisy simulation is similar to the precision we obtained with the program we developed. The fermionic based ansatz, UCCSD, seems to be very sensitive to noise, giving very inaccurate results. The simulation with the universal ansatz and the ansatz from the paper has been also launched in a quantum computer. Now, the results obtained with the universal ansatz are better than the ones obtained with the ansatz from the paper, reaching chemical accuracy. This could be because it samples better the state space so it finds better solutions. On the other hand, maybe this program behaves better with the noise and is more easily optimized than the program we developed. This would explain the difference in the results. We also executed all these simulations with the other two types of mapping introduced in section (4.4.3), finding that the Bravyi-Kitaev mapping with the universal ansat was the only one that worked properly. Again, the simulations were executed assuming perfect behaviour and then using a noisy simulator. When assuming perfect behaviour only Program 2 reached chemical accuracy, although our program did not give bad solutions. On the other hand, when using a noisy simulator, the results were far from chemical accuracy. Finally, these programs were launched in a quantum computer. For the lowest bond lengths, the results are not good, but eventually an approximated value of the ground state is reached. The 38
results are not considered chemically accurate. In conclusion, when executing the programs in a real device, while Program 1 shows better results when using the ansatz from the paper [1], Program 2 finds a better solution with the universal ansatz. We have also seen that UCCSD ansatz is too sensitive to the noise. Finally, universal ansatz is the only one that works for Bravyi-Kitaev mapping. We have also studied the simulation of a LiH molecule, analysing how the type of ansatz and classical optimizer chosen affects the result. This has been done by using the Qiskit VQE algorithms. First, we compared the accuracy of two different types of ansatz, the UCCSD (chemistryinspired) and the RyRxwith linear entanglement (hardware-efficient). Both are described in section (4.5). We found that the UCCSD assuming perfect behaviour gives way better results than the RyRx. In fact, it reaches chemical accuracy. It seems that when dealing with big molecules, hardware-efficient ans¨atze struggle with finding the ground state. Future research could be focused on looking for more efficient ans¨atze, maybe trying to implement the newest ones (ADAPT-VQE for example). Trying to make the programs work when considering different mappings could be another way of continuing this work. Other option could be focusing on bigger molecules, studying the properties of different ans¨atze when using VQE python package in a real quantum computer. A different thing that has not been mentioned in this work but that can be a good topic to study is the classical optimizer. Trying to look for a faster and more efficient method to optimize the function when having a large number of parameters is also a big challenge. 39
References [1] O’Malley, P., Babbush, R., Kivlichan, I., Romero, J., McClean, J., Barends, R., Kelly, J., Roushan, P., Tranter, A., Ding, N., Campbell, B., Chen, Y., Chen, Z., Chiaro, B., Dunsworth, A., Fowler, A., Jeffrey, E., Lucero, E., Megrant, A., . . . Martinis, J. (2016). Scalable Quantum Simulation of Molecular Energies. Physical Review X, 6(3). [2] Mathematics as Metaphor. Selected Essays of Yuri I. Manin 77–78 (American Mathematical Society, 2007). [3] Benioff, P. (1980). The computer as a physical system: A microscopic quantum mechanical Hamiltonian model of computers as represented by Turing machines. Journal of Statistical Physics, 22(5), 563–591. [4] Feynman, R. P. (1982). Simulating physics with computers. International Journal of Theoretical Physics, 21(6–7), 467–488. [5] Peruzzo, A., McClean, J., Shadbolt, P., Yung, M. H., Zhou, X. Q., Love, P. J., Aspuru-Guzik, A., O’Brien, J. L. (2014). A variational eigenvalue solver on a photonic quantum processor. Nature Communications, 5(1). [6] Nielsen, M. A., Chuang, I. L. (2010). Quantum Computation and Quantum Information (10th Anniversary ed.). Cambridge University Press. [7] Cohen-Tannoudji, C., Diu, B., Laloe, F. (1991). Quantum Mechanics, Volume 1 (Volume 1 ed.). Wiley-Vch. [8] Aspuru-Guzik, A., Dutoi, A. D., Love, P. J. Head-Gordon, M. (2005). Simulated Quantum Computation of Molecular Energies. Science, 309(5741), 1704-1707. [9] Cerezo, M., Arrasmith, A., Babbush, R., Benjamin, S. C., Endo, S., Fujii, K., McClean, J. R., Mitarai, K., Yuan, X., Cincio, L., Coles, P. J. (2021). Variational quantum algorithms. Nature Reviews Physics, 3(9), 625–644. [10] McClean, J. R., Romero, J., Babbush, R., Aspuru-Guzik, A. (2016).The theory of variational hybrid quantum-classical algorithms. New Journal of Physics, 18(2), 023023. [11] Maupin, O. G., Baczewski, A. D., Love, P. J., Landahl, A. J. (2021). Variational Quantum Chemistry Programs in JaqalPaq. Entropy, 23(6), 657. [12] Tilly, J., Chen, H., Cao, S., Picozzi, D., Setia, K., Li, Y., Grant, E., Wossnig, L., Rungger, I., Booth, G. H. Tennyson, J. (2021). The Variational Quantum Eigensolver: a review of methods and best practices. arXiv:2111.05176 [quant-ph] [13] Tranter, A., Sofia, S., Seeley, J., Kaicher, M., McClean, J., Babbush, R., Coveney, P. V., Mintert, F., Wilhelm, F., Love, P. J. (2015). The Bravyi-Kitaev transformation: Properties and applications. International Journal of Quantum Chemistry, 115(19), 1431–1441. [14] Tranter, A., Love, P. J., Mintert, F., Coveney, P. V. (2018). A Comparison of the Bravyi–Kitaev and Jordan–Wigner Transformations for the Quantum Simulation of Quantum Chemistry.Journal of Chemical Theory and Computation, 14(11), 5617–5630. [15] Seeley, J. T., Richard, M. J., Love, P. J. (2012). The Bravyi-Kitaev transformation for quantum computation of electronic structure. The Journal of Chemical Physics, 137(22), 224109. 40
ang =ret.x[0] # The results are stored in arrays in order to graphically represent them␣ ,→later bond_length.append(dist) energies.append(val) angles.append(ang) # Let's print the results print('For the bond length ', dist, 'the ground state energy is',val) print('The minimum of the energy is reached when the ansatz takes the␣ ,→parameter', ang) 6