Algorithms for Near-term Quantum computers
As of 2022, IBM has designed and developed five generations of quantum computers and placed around 29 Quantum computers on the cloud, starting from a five qubit machine in 2016, which is the first ever quantum machine available to public as a cloud service, to the 127 qubit machine in 2021, which is the first 100+ qubit quantum computer ever made. While the industry has been ramping up in the research of quantum technology, we have been delivering to our ambitious development roadmap on a full-stack quantum computer, and deploy them via cloud. The quantum computers with hundreds of qubits are called near-term quantum computers and while it might not have ground breaking applications right away, the pace of Quantum research indicates the imminent achievement of the advantage over classical computers. Our roadmap puts us on a course towards the future’s quantum processors with hundreds of thousands of qubits thanks to industry-leading technology, multidisciplinary teams, and agile methodology which enables us innovating across the stack. While these near-term quantum computers have a middling number of qubits, limited connectivity of the qubits, incur errors, this enables a very interesting research direction on how to best leverage these quantum devices while working around the challenges.
Variational Quantum Algorithms(VQA) have emerged as the most popular class of algorithms to work around the challenges that the near term quantum computers pose. VQAs can be thought of as the quantum counterparts of classical neural networks as they are trained in a similar manner to neural networks, by means of gradient-descent type algorithms iteratively to find optimal parameters of the quantum model. There are many applications that researchers envision for VQAs, but we can categorize these applications to the eight broad areas shown in Figure 1: machine learning, dynamic simulations, finding ground states, mathematical applications, combinatorial applications, compilation, error-correction and new frontiers of Quantum science. Under machine learning there are plethora of classifiers and generative models that can be created using variants of variational algorithms. Finding ground states of a system can help both condensed matter physics problems as well as for chemistry applications. VQAs can be used to solve mathematical problems such as factoring, principal components, system of equations etc.
Figure 1: Applications of VQA. Image From:Cerezo, M., Arrasmith, A., Babbush, R. et al. Variational quantum algorithms. Nat Rev Phys 3, 625–644 (2021)
VQE
The theory of variational quantum eigensolver (VQE) needs no introduction. It is the most popular type of VQA that has been widely used since it was first proposed in [4] in 2014. A survey on VQE can be found in [2]. We will introduce VQE and explain how it is used to find the ground state energies of molecules. VQE is a hybrid method of computation where there is a segment comprising of quantum computation and another segment comprising a classical computation segment. The quantum segment estimates the expectation value of a Hamiltonian operator for a given ansatz, while the classical segment tries to optimize the parameterized ansatz to maximize/minimize this expectation value. Fig. 2 gives the schematic of a VQE.
Figure 2: VQE principle
From variational principle [6], the expectation of a given ansatz can neither be less than the lowest eigenvalue nor can it be greater than the largest eigenvalue of the Hamiltonian operator H. If the eigenvalues of the Hamiltonian (comprising of the eigenstates) are given by
then
In (1), θ denotes the vector of variables that parameterizes the ansatz |ψ?. The variational principle ensures that on optimizing the expectation, E = ?ψ(θ)|H|ψ(θ)?, with respect to θ, we will get close to the lowest (largest) eigenvalues of H but never violate the inequality given in equation (1). In our problem the lowest eigenstate is the ground state of the molecule for a given geometry and the lowest eigenvalue is the energy value of that state. The minimization of our Hamiltonian expectation will take our ansatz closer to the lowest eigenstate and the expectation value to the ground state energy.
Realizing the Hamiltonian
In a quantum computer, the Hamiltonian operator J is expressed as a summation of several Kronecker products of Pauli X, Y , Z and I gates. However, for measurement, all instances of X and Y are transformed to the ±Z computational basis through the use of Hadamard (H) and Rz(π/2) rotation gates. Hamiltonian J can be expressed as follows.
In (2), the Hamiltonian J is expressed as a sum of m terms, each with a coefficient cj . Each term is a Kronecker product of n Pauli terms Pji for i ∈ [1, n]. The expectation of the overall Hamiltonian is a sum of the expectations of these m terms. Here, n is dependent on the number of qubits used to realize the ansatz. To given an example, a single term of J in a 4 qubit system could be Jj = I1 · Z2 · X3 · Y4. The expectation of this term would be due to the measurement resulting from the observable I acting on the first qubit, the observable Z acting on the second qubit, the observables X and Y acting on the third and the fourth qubits respectively. As mentioned above, the measurement is always done in the Z computational basis. This would result in the measurements being either +1 or ?1, corresponding to the eigenvalues of ±1 of the Z Pauli matrix. The expectation of this term would be given as equation (3) below.
If we consider the expectation for the measurement in the third qubit, the observable is X. To convert it into the Z basis, the transformation X = HZH is used. Similarly, when the observable is Y, the transformation Y = Rz(π/2) HZH Rz(π/2) is used.
Ansatz preparation
The ansatz is ideally a good guess of the ground state. The closer the ansatz is to the ground state, the closer the expectation value is to the lowest eigenvalue of the Hamiltonian. The ansatz is generally given by a transformation from a reference state (|0×n?, Hartree-Fock state in the electronic structure problem, etc.). Broadly speaking, there are two types of ansatzes,
Domain inspired Ansatz preparation
Domain inspired ansatz is built around ideas borrowed from classical computation. An example of a domain inspired ansatz is the Unitary Coupled Cluster ansatz. This is a unitary version of the coupled cluster method used in classical variational algorithms. In a series of unitary operations, the initial reference state is taken closer to the desired eigenstate. A unitary operation is given by the following expression.
Here, P is a product (Kronecker product) of Pauli operators (also known as a Pauli string), θ is the parameter and i is the imaginary number. The matrix U is unitary. This satisfies the requirement of a quantum computing operator. U can be expanded as follows.
I in the above expression is the identity matrix. U above can be realized by a combination of a series of controlled NOT (CNOT) gates and a single rotation gate on one of the qubits. It can be shown that a rotation applied over a Kronecker product of Pauli operators involving multiple qubits is equivalent to applying the rotation over one qubit and connecting the other qubits with CNOT gates. As an example, if we consider the following
The circuit implementation would be as shown in Fig. 3. Pauli strings consisting of X and Y terms can be converted to the Z term by using the transformations given in the previous section. A Pauli string of the form P = Y1 ? X2 ? Z3 can be implemented as given in Fig. 4.
Figure 3: Circuit implementation when P = Z1 ? Z2
Figure 4: Circuit implementation when P = Y1 ? X2 ? Z3
领英推荐
Hardware efficient Ansatz preparation
Domain specific ansatzes suffer from large circuit depths and large number of parameters. This motivated the development of hardware efficient and low depth ansatzes. These ansatzes contain combinations of single qubit rotations and two qubit entangling gates in several layers. Fig. 5 gives the structure of a hardware efficient ansatz for a 2 qubit system. In the figure, the ansatz has been created by application of the parameterized rotations Ry and Rz, followed by an entangler (CNOT gate). This process has been repeated for 3 layers.
Figure 5: Hardware efficient ansatz
Hardware efficient ansatzes are characterized by their expressibility and entangling capacity [5]. Although, the art of choosing ansatzes for a given application is based mostly on experience and lots of experimentation, the above measures give us some idea about the capabilities of an ansatz in terms of the richness (variedness) of the states that it can generate. The states that an ansatz can generate can be visualized using a bloch sphere. A bloch sphere is a unit sphere (r = 1) and the state of a qubit can be visualized in it by considering that every single qubit state can be represented as follows.
Here, r = 1, θ and ? are the coordinates in a spherical coordinate system. Fig. 6 gives the states that the ansatz given in 5 could generate in a single layer in 500 runs. The first and the second bloch sphere represent the first qubit after the rotation operations. The last two bloch spheres represent each of the qubits after the CNOT operation. A single Ry rotation (rotation around the Y axis) generates states only in the X ? Z plane. A further Rz rotation is able to generate almost all the states possible in the bloch sphere. However, after entanglement (CNOT operation), we see correlated states that are limited over a certain region. A clever mix of rotations and entanglements can create the right set of states that are close to our desired eigenstate.
Figure 6: Bloch sphere representation of the states generated by rotations and entanglement
Classical optimizer
The classical optimizer is the classical segment of the VQE. The expectation value of the Hamiltonian is optimized by finding the optimal parameter values in the ansatz. Several, methods have been proposed to optimize these parameters. The methods can broadly be classified into two types, direct search algorithms and variants of gradient descent based algorithms. One can find several algorithms in Qiskit [1] and in Python in general, that can be readily used in conjunction with VQE algorithms. Direct search methods have generally been found to be more robust to noise than gradient based methods. One can find a survey of these methods and how they perform, along with their references in [3].
Summary
Let us recap the high-level steps of a variational algorithm:
1. Decide the ansatz based on the problem definition.
(a) Decide to whether to use a domain inspired ansatz or a hardware efficient ansatz.
(b) If it is a hardware efficient ansatz, take care that no preservation rules are violated.
(c) Make sure the depth is commensurate with the T1 and T2 parameters of the hardware.
2. Decide the input or the reference state. For Chemistry it could be a Hartree Fock state. For some other applications it could simply be a |0??n.
3. Design the Hamiltonian for the problem
(a) Come up with a measurement strategy to get the expectation of the Hamiltonian.
(b) Expectations involving operators Pauli X and Y is transformed to Pauli Z.
(c) The Hamiltonian should ideally be broken down into the least number of commuting groups possible to minimize the number of circuit executions.
4. Run it multiple times
(a) Pick a suitable classical optimizer for the problem that can minimize the expectation of the Hamiltonian, with multiple calls to the function involving the Quantum hardware.
(b) A stopping criteria has to be built in to ensure we don’t end up with endless number of iterations or stop when there is convergence.
Research directions
The quantum research community believes that the first generation of quantum algorithms that provide an advantage over their classical counterparts will be aware of the underlying hardware characteristics, and not just operate over perfect qubits. With variational algorithms being able to run on quantum hardware with intermediate number (100s-1000s) of qubits, this has been a very active area of research. Some interesting research directions are as follows:
References
[1] Qiskit - open source quantum development. https://qiskit.org/.
[2] D. A. Fedorov, B. Peng, N. Govind, and Y. Alexeev. Vqe method: A short survey and recent developments. arXiv preprint arXiv:2103.08505v1, Mar 2021.
[3] S. McArdle et al. Quantum computational chemistry. arXiv preprint arXiv:1808.10402v3, Jan 2020.
[4] A. Peruzzo et al. A variational eigenvalue solver on a photonic quantum processor. Nature communications, 5:4213, 2014.
[5] S. Sim, P. D. Johnson, and A. Aspuru-Guzik. Expressibility and entangling capability of parameterized quantum circuits for hybrid quantum-classical algorithms. Advanced Quantum Technologies, 2(12), oct 2019.
[6] A. Szabo and N. S. Ostlund. Modern Quantum Chemistry. Dover Publications, INC., New York, 1989.