CLASSICALLY APPROXIMATING VARIATIONAL QUAN-TUM MACHINE LEARNING WITH RANDOM FOURIER FEATURES

Abstract

Many applications of quantum computing in the near term rely on variational quantum circuits (VQCs). They have been showcased as a promising model for reaching a quantum advantage in machine learning with current noisy intermediate scale quantum computers (NISQ). It is often believed that the power of VQCs relies on their exponentially large feature space, and extensive works have explored the expressiveness and trainability of VQCs in that regard. In our work, we propose a classical sampling method that can closely approximate most VQCs with Hamiltonian encoding, given only the description of their architecture. It uses the seminal proposal of Random Fourier Features (RFF) and the fact that VQCs can be seen as large Fourier series. We show theoretically and experimentally that models built from exponentially large quantum feature space can be classically reproduced by sampling a few frequencies to build an equivalent low dimensional kernel. Precisely, we show that the number of required samples grows favorably with the size of the quantum spectrum. This tool therefore questions the hope for quantum advantage from VQCs in many cases, but conversely helps to narrow the conditions for their potential success. We expect VQCs with various and complex encoding Hamiltonians, or with large input dimension, to become more robust to classical approximations.

INTRODUCTION

Many applications of quantum computing in the near term rely on variational quantum circuits (VQCs) (Bharti et al. (2021) ; Cerezo et al. ( 2021)), and in particular for solving machine learning (ML) tasks. VQCs are trained using classical optimization of their gates' parameters, a method borrowed from classical neural networks. Although the term VQCs encompasses various methods for different ML tasks, in this paper we refer to VQCs as a family of quantum models for supervised learning on classical data, as defined in B.1. Many early works have shown promising results, both empirically and in theory (Cong et al. (2019); Huang et al. (2021) ). However, whether these variational methods can provide a quantum advantage in the general case with a scaling number of qubits has yet to be proved. The notion of quantum advantage with respect to classical methods is plural and can be defined as advantage in trainability (Larocca et al. ( 2021)), expressivity (Schuld et al. (2021) ) or generalization (Caro et al. (2022) ). In this paper, we focus on the expressive power of VQCs as it is crucial to understand the capacity of VQCs to generate models that would be hard to do with classical approaches. The most common and intuitive answer for expressive power of VQCs is the formation of a large feature space, due to the projection of data points in an exponentially large Hilbert space. Understanding what is happening in this Hilbert space, and most importantly, knowing how we can exploit its size is an important question for this field. Regarding expressivity, Fair comparison In this work, we adapt Random Fourier Features (RFF) from Rahimi & Recht (2009), a classical sampling algorithm aimed at efficiently approximating some large classical kernel methods. We design three different RFF strategies to approximate VQCs. For each one, we analyze its efficiency in reproducing results obtained by a VQC. To do so, we study in detail the expressivity power of VQCs and compare it each time with RFF. Our method consists in analyzing the encoding gates of the VQC to extract the final frequencies of its model and sample from them. Notably, if the VQCs possesses simple encoding gates such as Pauli gates (e.g. R Z ), we show that the large quantum feature space is not fully exploited, making RFF even more efficient. If the number of frequencies in the VQC grows exponentially, the number of samples required by RFF grows only linearly. Finally, we have empirically compared VQCs and RFF on real and artificial use cases. On these, RFF were able to match the VQC's answer, and sometimes outperform it. As a whole, the novelty of our work is to identify cases where the quantum model emanating from a VQC can be classically approximated, albeit the VQC being non-classically simulatable. We therefore reduce the hope for expressive advantage of VQCs in such cases. In practice, our method is limited by several parameters: inputs with very large dimension, encoding Hamiltonians that are hard to diagonalize, large depths and others (see Appendix F). We can therefore use the limitations of our method as a recipe to build VQCs that are resilient to classical approximation.

1. SPECTRAL PROPERTIES OF VARIATIONAL QUANTUM CIRCUITS (VQCS)

In this Section, we succinctly recall some properties of VQCs in the context of machine learning, which will be useful for this work. We invite readers that are not familiar with VQCs to consult instead the detailed definitions and explanations provided in the Appendix B. VQCs are quantum circuits with parametrized gates. In this paper the encoding gates are unitary matrices of the form exp(-ix j H), where H is a Hamiltonian that the quantum computer can implement, and x = (x 1 , • • • , x d ) ∈ R d is some input data. The other class of gates are trainable gates and use parameters θ that are optimized during the learning phase. At the end of the circuit, measurements are performed and yield a classical output called the quantum model f .



Figure1: Random Fourier Features as a classical approximator of quantum models. Instead of training a Variational Quantum Circuit by using a quantum computer, we propose to train a classical kernel built by sampling a few frequencies of the quantum model. These frequencies can be derived from the quantum circuit architecture, in particular from the encoding gates. Using Random Fourier Features, one can build a classical model which performs as good as the quantum model with a bounded error and a number of samples that grows nicely.

