-
Better than classical? The subtle art of benchmarking quantum machine learning models
Authors:
Joseph Bowles,
Shahnawaz Ahmed,
Maria Schuld
Abstract:
Benchmarking models via classical simulations is one of the main ways to judge ideas in quantum machine learning before noise-free hardware is available. However, the huge impact of the experimental design on the results, the small scales within reach today, as well as narratives influenced by the commercialisation of quantum technologies make it difficult to gain robust insights. To facilitate be…
▽ More
Benchmarking models via classical simulations is one of the main ways to judge ideas in quantum machine learning before noise-free hardware is available. However, the huge impact of the experimental design on the results, the small scales within reach today, as well as narratives influenced by the commercialisation of quantum technologies make it difficult to gain robust insights. To facilitate better decision-making we develop an open-source package based on the PennyLane software framework and use it to conduct a large-scale study that systematically tests 12 popular quantum machine learning models on 6 binary classification tasks used to create 160 individual datasets. We find that overall, out-of-the-box classical machine learning models outperform the quantum classifiers. Moreover, removing entanglement from a quantum model often results in as good or better performance, suggesting that "quantumness" may not be the crucial ingredient for the small learning tasks considered here. Our benchmarks also unlock investigations beyond simplistic leaderboard comparisons, and we identify five important questions for quantum model design that follow from our results.
△ Less
Submitted 14 March, 2024; v1 submitted 11 March, 2024;
originally announced March 2024.
-
Using word embeddings to analyse audience effects and individual differences in parenting Subreddits
Authors:
Melody Sepahpour-Fard,
Michael Quayle,
Maria Schuld,
Taha Yasseri
Abstract:
Human beings adapt their language to the audience they interact with. To study the impact of audience and gender in a natural setting, we choose a domain where gender plays a particularly salient role: parenting. We collect posts from the three popular parenting Subreddits (i.e., topical communities on Reddit) r/Daddit, r/Mommit, and r/Parenting. These three Subreddits gather different audiences,…
▽ More
Human beings adapt their language to the audience they interact with. To study the impact of audience and gender in a natural setting, we choose a domain where gender plays a particularly salient role: parenting. We collect posts from the three popular parenting Subreddits (i.e., topical communities on Reddit) r/Daddit, r/Mommit, and r/Parenting. These three Subreddits gather different audiences, respectively, self-identifying as fathers and mothers (ostensibly single-gender), and parents (explicitly mixed-gender). By selecting a sample of users who have published on both a single-gender and a mixed-gender Subreddit, we are able to explore both audience and gender effects. We analyse posts with word embeddings by adding the username as a token in the corpus. This way, we are able to compare user-tokens to word-tokens and measure their similarity. We also investigate individual differences in this context by comparing users who exhibit significant changes in their behaviour (high self-monitors) with those who show less variation (low self-monitors). Results show that r/Parenting users generally discuss a great diversity of topics while fathers focus more on advising others on educational and family matters. Mothers in r/Mommit distinguish themselves from other groups by primarily discussing topics such as medical care, sleep and potty training, and food. Both mothers and fathers celebrate parenting events and describe or comment on the physical appearance of their children with a single-gender audience. In terms of individual differences, we find that, especially on r/Parenting, high self-monitors tend to conform more to the norms of the Subreddit by discussing more of the topics associated with the Subreddit. In conclusion, this study shows how mothers and fathers express different concerns and change their behaviour for different group-based audiences.
△ Less
Submitted 1 August, 2023; v1 submitted 22 March, 2023;
originally announced March 2023.
-
Transfer learning in hybrid classical-quantum neural networks
Authors:
Andrea Mari,
Thomas R. Bromley,
Josh Izaac,
Maria Schuld,
Nathan Killoran
Abstract:
We extend the concept of transfer learning, widely applied in modern machine learning algorithms, to the emerging context of hybrid neural networks composed of classical and quantum elements. We propose different implementations of hybrid transfer learning, but we focus mainly on the paradigm in which a pre-trained classical network is modified and augmented by a final variational quantum circuit.…
▽ More
We extend the concept of transfer learning, widely applied in modern machine learning algorithms, to the emerging context of hybrid neural networks composed of classical and quantum elements. We propose different implementations of hybrid transfer learning, but we focus mainly on the paradigm in which a pre-trained classical network is modified and augmented by a final variational quantum circuit. This approach is particularly attractive in the current era of intermediate-scale quantum technology since it allows to optimally pre-process high dimensional data (e.g., images) with any state-of-the-art classical network and to embed a select set of highly informative features into a quantum processor. We present several proof-of-concept examples of the convenient application of quantum transfer learning for image recognition and quantum state classification. We use the cross-platform software library PennyLane to experimentally test a high-resolution image classifier with two different quantum computers, respectively provided by IBM and Rigetti.
△ Less
Submitted 8 October, 2020; v1 submitted 17 December, 2019;
originally announced December 2019.
-
Stochastic gradient descent for hybrid quantum-classical optimization
Authors:
Ryan Sweke,
Frederik Wilde,
Johannes Meyer,
Maria Schuld,
Paul K. Faehrmann,
Barthélémy Meynard-Piganeau,
Jens Eisert
Abstract:
Within the context of hybrid quantum-classical optimization, gradient descent based optimizers typically require the evaluation of expectation values with respect to the outcome of parameterized quantum circuits. In this work, we explore the consequences of the prior observation that estimation of these quantities on quantum hardware results in a form of stochastic gradient descent optimization. W…
▽ More
Within the context of hybrid quantum-classical optimization, gradient descent based optimizers typically require the evaluation of expectation values with respect to the outcome of parameterized quantum circuits. In this work, we explore the consequences of the prior observation that estimation of these quantities on quantum hardware results in a form of stochastic gradient descent optimization. We formalize this notion, which allows us to show that in many relevant cases, including VQE, QAOA and certain quantum classifiers, estimating expectation values with $k$ measurement outcomes results in optimization algorithms whose convergence properties can be rigorously well understood, for any value of $k$. In fact, even using single measurement outcomes for the estimation of expectation values is sufficient. Moreover, in many settings the required gradients can be expressed as linear combinations of expectation values -- originating, e.g., from a sum over local terms of a Hamiltonian, a parameter shift rule, or a sum over data-set instances -- and we show that in these cases $k$-shot expectation value estimation can be combined with sampling over terms of the linear combination, to obtain "doubly stochastic" gradient descent optimizers. For all algorithms we prove convergence guarantees, providing a framework for the derivation of rigorous optimization results in the context of near-term quantum devices. Additionally, we explore numerically these methods on benchmark VQE, QAOA and quantum-enhanced machine learning tasks and show that treating the stochastic settings as hyper-parameters allows for state-of-the-art results with significantly fewer circuit executions and measurements.
△ Less
Submitted 20 January, 2021; v1 submitted 2 October, 2019;
originally announced October 2019.
-
PennyLane: Automatic differentiation of hybrid quantum-classical computations
Authors:
Ville Bergholm,
Josh Izaac,
Maria Schuld,
Christian Gogolin,
Shahnawaz Ahmed,
Vishnu Ajith,
M. Sohaib Alam,
Guillermo Alonso-Linaje,
B. AkashNarayanan,
Ali Asadi,
Juan Miguel Arrazola,
Utkarsh Azad,
Sam Banning,
Carsten Blank,
Thomas R Bromley,
Benjamin A. Cordier,
Jack Ceroni,
Alain Delgado,
Olivia Di Matteo,
Amintor Dusko,
Tanya Garg,
Diego Guala,
Anthony Hayes,
Ryan Hill,
Aroosa Ijaz
, et al. (43 additional authors not shown)
Abstract:
PennyLane is a Python 3 software framework for differentiable programming of quantum computers. The library provides a unified architecture for near-term quantum computing devices, supporting both qubit and continuous-variable paradigms. PennyLane's core feature is the ability to compute gradients of variational quantum circuits in a way that is compatible with classical techniques such as backpro…
▽ More
PennyLane is a Python 3 software framework for differentiable programming of quantum computers. The library provides a unified architecture for near-term quantum computing devices, supporting both qubit and continuous-variable paradigms. PennyLane's core feature is the ability to compute gradients of variational quantum circuits in a way that is compatible with classical techniques such as backpropagation. PennyLane thus extends the automatic differentiation algorithms common in optimization and machine learning to include quantum and hybrid computations. A plugin system makes the framework compatible with any gate-based quantum simulator or hardware. We provide plugins for hardware providers including the Xanadu Cloud, Amazon Braket, and IBM Quantum, allowing PennyLane optimizations to be run on publicly accessible quantum devices. On the classical front, PennyLane interfaces with accelerated machine learning libraries such as TensorFlow, PyTorch, JAX, and Autograd. PennyLane can be used for the optimization of variational quantum eigensolvers, quantum approximate optimization, quantum machine learning models, and many other applications.
△ Less
Submitted 29 July, 2022; v1 submitted 12 November, 2018;
originally announced November 2018.
-
Continuous-variable quantum neural networks
Authors:
Nathan Killoran,
Thomas R. Bromley,
Juan Miguel Arrazola,
Maria Schuld,
Nicolás Quesada,
Seth Lloyd
Abstract:
We introduce a general method for building neural networks on quantum computers. The quantum neural network is a variational quantum circuit built in the continuous-variable (CV) architecture, which encodes quantum information in continuous degrees of freedom such as the amplitudes of the electromagnetic field. This circuit contains a layered structure of continuously parameterized gates which is…
▽ More
We introduce a general method for building neural networks on quantum computers. The quantum neural network is a variational quantum circuit built in the continuous-variable (CV) architecture, which encodes quantum information in continuous degrees of freedom such as the amplitudes of the electromagnetic field. This circuit contains a layered structure of continuously parameterized gates which is universal for CV quantum computation. Affine transformations and nonlinear activation functions, two key elements in neural networks, are enacted in the quantum network using Gaussian and non-Gaussian gates, respectively. The non-Gaussian gates provide both the nonlinearity and the universality of the model. Due to the structure of the CV model, the CV quantum neural network can encode highly nonlinear transformations while remaining completely unitary. We show how a classical network can be embedded into the quantum formalism and propose quantum versions of various specialized model such as convolutional, recurrent, and residual networks. Finally, we present numerous modeling experiments built with the Strawberry Fields software library. These experiments, including a classifier for fraud detection, a network which generates Tetris images, and a hybrid classical-quantum autoencoder, demonstrate the capability and adaptability of CV quantum neural networks.
△ Less
Submitted 18 June, 2018;
originally announced June 2018.
-
Quantum ensembles of quantum classifiers
Authors:
Maria Schuld,
Francesco Petruccione
Abstract:
Quantum machine learning witnesses an increasing amount of quantum algorithms for data-driven decision making, a problem with potential applications ranging from automated image recognition to medical diagnosis. Many of those algorithms are implementations of quantum classifiers, or models for the classification of data inputs with a quantum computer. Following the success of collective decision m…
▽ More
Quantum machine learning witnesses an increasing amount of quantum algorithms for data-driven decision making, a problem with potential applications ranging from automated image recognition to medical diagnosis. Many of those algorithms are implementations of quantum classifiers, or models for the classification of data inputs with a quantum computer. Following the success of collective decision making with ensembles in classical machine learning, this paper introduces the concept of quantum ensembles of quantum classifiers. Creating the ensemble corresponds to a state preparation routine, after which the quantum classifiers are evaluated in parallel and their combined decision is accessed by a single-qubit measurement. This framework naturally allows for exponentially large ensembles in which -- similar to Bayesian learning -- the individual classifiers do not have to be trained. As an example, we analyse an exponentially large quantum ensemble in which each classifier is weighed according to its performance in classifying the training data, leading to new results for quantum as well as classical machine learning.
△ Less
Submitted 7 April, 2017;
originally announced April 2017.
-
Simulating a perceptron on a quantum computer
Authors:
Maria Schuld,
Ilya Sinayskiy,
Francesco Petruccione
Abstract:
Perceptrons are the basic computational unit of artificial neural networks, as they model the activation mechanism of an output neuron due to incoming signals from its neighbours. As linear classifiers, they play an important role in the foundations of machine learning. In the context of the emerging field of quantum machine learning, several attempts have been made to develop a corresponding unit…
▽ More
Perceptrons are the basic computational unit of artificial neural networks, as they model the activation mechanism of an output neuron due to incoming signals from its neighbours. As linear classifiers, they play an important role in the foundations of machine learning. In the context of the emerging field of quantum machine learning, several attempts have been made to develop a corresponding unit using quantum information theory. Based on the quantum phase estimation algorithm, this paper introduces a quantum perceptron model imitating the step-activation function of a classical perceptron. This scheme requires resources in $\mathcal{O}(n)$ (where $n$ is the size of the input) and promises efficient applications for more complex structures such as trainable quantum neural networks.
△ Less
Submitted 11 December, 2014;
originally announced December 2014.