Accelerate quantum computation from a classical approach — A simple, efficient, and robust optimizer for NISQ devices

QunaSys Tech Blog
5 min readOct 1, 2020

“Nature isn’t classical, dammit, and if you want to make a simulation of nature, you’d better make it quantum mechanical, and by golly, it’s a wonderful problem because it doesn’t look so easy.” A famous description said by Richard Feynman in 1982 brings us a concept of building a quantum machine to handle the non-classical computations. As Feynman points out, it is not easy. Even now, the quantum computers are limited in accuracy because they do not have error-correcting functionality and the experimental error accumulates over time without a systematic correction. The number of qubits, or quantum bits, ready for executing a non-trivial quantum algorithm is limited to a few dozen for now. We call a machine consisting of several ten or hundred qubits without error correction the noisy intermediate-scale quantum (NISQ) devices.

To make the best use of the tremendous advantage of quantum computers with a limited scale, or the NISQ devices, a quantum-classical hybrid algorithm has been proposed. In the quantum-classical hybrid algorithm, quantum computers prepare a quantum state by executing a quantum circuit instructed by classical computers and output classical data like measurement outcomes of the prepared state. Classical computers, in turn, process the output data and give feedback to quantum computers.

One of the most commonly used quantum-classical hybrid algorithms is Variational Quantum Eigensolver (VQE, learn this in https://grove-docs.readthedocs.io/en/latest/vqe.html and http://docs.qulacs.org/en/latest/apply/6.2_vqe.html), a solution for finding the eigenvalues of Hamiltonian H of a target system based on the variational principle. A typical structure includes a quantum subroutine that runs inside a classical optimization loop, a parameterized quantum circuit, and its optimization based on an observed cost function. The quantum subroutine has two fundamental steps:

1. generate an ansatz state |ψ(θ)⟩ with the parameter θ from a parameterized quantum circuit U(θ) on quantum devices;

2. measure the expectation value of the given Hermitian operator, ⟨H(θ)⟩ = ⟨ψ(θ)|H|ψ(θ)⟩.

On classical computers, the parameters θ will be optimized to minimize the ⟨H(θ)⟩ through an optimizer for non-linear problems until it converges.

Figure 1. Variational quantum eigensolver.

Improving the efficiency of the classical optimization process is, therefore, the key to accelerating the overall performance of the VQE. Typically, the optimization is based on the gradient method (left panel of Figure 2). In the gradient method, the optimization proceeds step by step following the direction of the gradient. This method requires a lot of evaluation of the cost function, ⟨H(θ)⟩, and highly depends on the initial input; the worse the initial guess is, the slower the optimization will be. It becomes natural to wonder if we can find another method with a smaller number of evaluations of ⟨H(θ)⟩ and less initial value dependence.

Figure 2. Comparison between the gradient method and the NFT optimizer.

In 2019, Ken Nakanishi (intern at QunaSys Inc.), Keisuke Fujii (currently Professor at Osaka University), and Synge Todo (Professor at the University of Tokyo) proposed a new optimization method for the VQE to speed up the convergence. The proposed optimization method is hyperparameter-free, has faster convergence, has less dependence on the initial choice of the parameters, and is robust against the error in the function evaluation. In this method, the optimization is performed exactly with respect to certain chosen parameters at each step by using the characteristic structure of the typical parameterized quantum circuits. In fact, as shown in the right side of Figure 2, the cost function behaves as a simple trigonometric function, or a sine curve with period 2π with respect to the parameter θ while the other parameters are fixed, when the parameterized quantum circuit U(θ) consists of a set of unitary gates exp(iθ/2*A) being subject to A*A = I. Because of this special property, we can determine the parameter θ that provides the exact minimum of the cost function by evaluating the cost function at only three independent points with respect to the parameter. By repeatedly performing this procedure, we can optimize all the parameters so that the cost function becomes as small as possible.

This optimization method, which we call NFT optimizer after the names of the authors, allows us to update each parameter with fewer measurements than the gradient-based methods. The update of the parameters is deterministic if the order of the parameters is provided, so NFT optimizer is hyperparameter-free.

As a simple demonstration of the advantage of NFT optimizer, we applied it to calculate the energy of a hydrogen molecule and compared it with other optimizers. The convergence efficiencies are compared among NFT optimizer, the Nelder-Mead optimizer, and COBYLA optimizer under the “RYRZ” variational circuit (see top left panel of Figure 3). In two bottom panels of Figure 3, the horizontal axis is the total number of evaluations of the function ⟨H(θ)⟩ during the optimization and the vertical one is the function value. The bottom left panel of Figure 3 contains the results in an ideal situation where no noise is considered, and it shows clearly that the result obtained using NFT optimizer shown as the red curve is more than two times faster than the Nelder-Mead optimizer and COBYLA optimizer.

As mentioned before, the NISQ devices suffer from noise. Is NFT optimizer better even in this case? The bottom right panel of Figure 3 contains the results of simulating a noisy situation where the value of the function fluctuates as a result of 32 shots measurements and the noise model mimicking the actual NISQ devices made of the superconducting qubits. NFT optimizer is still much more efficient and reliable than the other two optimizers.

Figure 3. Simulation results of a hydrogen molecule.

In summary, an intern at QunaSys and collaborators have proposed a hyperparameter-free optimizer for quantum-classical hybrid algorithms using parameterized quantum circuits. NFT optimizer seems to have better convergence efficiency even in the presence of the inevitable noise in the NISQ devices. With this new method, NISQ devices will be more practical in quantum computation.

Written by Youyuan Zhang and Yuya O. Nakagawa

Reference:
[1] Ken M. Nakanishi, Keisuke Fuji, and Synge Todo, https://journals.aps.org/prresearch/abstract/10.1103/PhysRevResearch.2.043158
[2] Implementation by K. Nakanishi is given in https://github.com/ken-nakanishi/nftopt

QunaSys keeps developing efficient quantum algorithms to accelerate various applications of quantum computers. Our mission is to enthusiastically develop technologies that bring out the maximum potential of quantum computers and to continually deliver innovations to society.

--

--

QunaSys Tech Blog

Blogs about quantum algorithm developments written by a bunch of quantum native people. Follow to catch up with the most recent quantum news.