Classically Approximating Variational Quantum Machine Learning with Random
Fourier Features
Jonas Landman,1, 2 Slimane Thabet,3, 4 Constantin Dalyac,3, 4 Hela Mhiri,3, 5 and Elham Kashefi1, 3
1School of Informatics, University of Edinburgh, 10 Crichton Street, Edinburgh, United Kingdom
2QC Ware, Palo Alto, USA and Paris, France
3Laboratoire d’Informatique de Paris 6, CNRS, Sorbonne Universit´e, 4 Place Jussieu, 75005 Paris, France
4PASQAL SAS, 7 avenue L´eonard de Vinci, 91300 Massy, France
5ENSTA Paris, Institut polytechnique de Paris
(Dated: October 25, 2022)
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 may closely approximate a VQC with Hamiltonian encoding,
given only the description of its architecture. It uses the seminal proposal of Random Fourier
Features (RFF) and the fact that VQCs can be seen as large Fourier series. We provide general
theoretical bounds for classically approximating models built from exponentially large quantum
feature space by sampling a few frequencies to build an equivalent low dimensional kernel, and we
show experimentally that this approximation is efficient for several encoding strategies. 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) [1,2],
and in particular for solving machine learning (ML)
tasks. VQCs are trained using classical optimization of
their gates’ parameters, a method borrowed from clas-
sical neural networks. Many early works have shown
promising results, both empirically and in theory [3–5].
However, whether these variational methods can provide
a quantum advantage in the general case with a scaling
number of qubits has not been proven.
What would make VQCs advantageous compared to
classical algorithms for machine learning on classical
data? The most common and intuitive answer 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
[6], and most importantly, knowing how we can exploit its
size is an important question for this field. When it comes
to trainability, it has been shown that these exponential
spaces are in fact drawbacks [7]. Regarding expressivity,
it is crucial to understand what kind of functions VQCs
can learn better than a classical algorithm.
One of the biggest challenges we face while trying to
answer these questions is to find the fair comparison be-
tween VQCs and classical ML algorithms. Recent works
[6,8,9] have shown equivalence between VQCs and both
Fourier series and kernel methods. In fact, VQCs are ex-
tremely powerful Fourier series: the functions they can
learn are predetermined by a set of frequencies which can
become numerous with the dimension of the input, and
the number and complexity of the quantum gates used.
In this work, we adapt Random Fourier Features
(RFF) [10], a successful classical sampling algorithm
aimed at efficiently approximating some large classical
kernel methods. We designed three different RFF strate-
gies to approximate VQCs. For each one, we analyze
its efficiency in reproducing results obtained by a VQC.
To do so, we have studied in details the expressivity of
VQCs, understood where their power could come from,
and compared 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, we show that
the large quantum feature space is not fully exploited,
making RFF even more efficient. If the number of fre-
quencies 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. Some
hope resides for VQCs with non-diagonalizable encoding
Hamiltonians, preventing the use of usual RFF. However,
even in this case, we provide an alternative RFF strategy,
along with theoretical approximation bounds.
Our conclusion is that, despite the potentially expo-
nential number of frequencies in the functions that a
VQC can create, Random Fourier Features can be used
to approximate the same resulting function on a given
dataset, in many cases. This restrains the regime in
arXiv:2210.13200v1 [quant-ph] 24 Oct 2022