In a prior post, we took a broad look at what quantum machine learning (QML) was about. We saw QML can be broken down into 4 subcategories:
CC: quantum-inspired methods
CQ: quantum-enhanced machine learning
QC: Machine learning for physics
QQ: Quantum Learning
In a series of posts, I’d like to share a DIY self-study guide on one of these subcategories; namely, quantum-enhanced machine learning (CQ). This guide is based on a series of seminars I hosted the summer of 2022 as part of a the Extreme Blue internship program at IBM. (Major thanks to fellow IBMer Tom Ward for bringing me into the project!) The interns’ project included looking at the use of quantum-enhanced ML in the context of flash flood prediction; see this Qiskit blog post for details. To help get the interns up to speed on the subject, I created a variant of the guide you are reading. I’m updating, re-mixing, and sharing it in hopes it is useful to you.
This guide’s purpose is to help you dip your toes into the water, so to speak. It trades off going super-deep into the weeds in favor of a broader overview. I plan to cover 4 main topics:
Data encoding methods (this article)
Quantum neural networks (here)
Quantum generative adversarial networks (here)
This guide is structured around research papers, blog posts, and videos. I’ve tried to select papers which are (relatively) easy to pick up and understand, and supplement them with the blog posts or videos to present the concepts covered in a different manner. In addition, I make extensive use of learning materials freely available via the Qiskit website, including the Qiskit textbook, and content from the 2021 Qiskit Global Summer School (which covered the topic of QML), and other content from other sources.
Note the Qiskit textbook includes interactive code examples, which may or may not be of interest.
For today’s post, we cover some background on quantum computing, and discuss the first core topic; namely, how to encode classical data into quantum states.
Warm-Up: Preliminaries of Quantum Computing
This warm-up reviews the relevant principles of quantum mechanics which enable quantum computation, allowing you to get a handle on what quantum states, gates, and circuits are. Feel free to skip this section if you feel you have a good handle on these concepts, though you are encouraged to take a look at the content in the 2nd bullet point below (quantum circuits). Now obviously, there are entire classes devoted to quantum computing; the point of this warm-up is to introduce some of the core concepts which are necessary for what follows in the guide. This necessitates picking and choosing topics.
Read the Qiskit textbook chapter The Case for Quantum Computers to learn about the notion of algorithm time complexity. Some quantum algorithms offer reductions in time complexity, meaning they can speed up – in a well-defined sense – certain computational problems, as compared to classical algorithms.
Read the Qiskit textbook chapter What is Quantum? .
Read the Qiskit textbook chapter Quantum Circuits, paying attention to the 4 components of a circuit. Quantum circuits are the fundamental unit of computation.
The following two videos are a bit more mathematical in nature.
Watch the 2020 Qiskit Summer School video Qubits and Quantum States, Quantum Circuits, Measurements - Part 1 for an overview of quantum states; the lecture notes are here.
A further resource on quantum states and measurements is the Qiskit textbook chapter Representing Qubit States.
Watch the Qiskit 2020 Summer School video Qubits and Quantum States, Quantum Circuits, Measurements - Part 2 for an overview of quantum circuits & gates; the lecture notes are here.
If you are curious about how a problem’s structure relates to whether a quantum speedup exists, see the paper How Much Structure is Needed for Huge Quantum Speedups?
Data Encoding
Recall that, in quantum-enhanced ML, we encode classical data into quantum states, using the action of a parameterized quantum circuit (PQC). Here, “parameterized” means the gates in the circuit have adjustable parameters;these parameters are set by the classical data point(s) being encoded. In this section, we take a look at PQCs, common data encoding methods, and begin to explore how to use quantum circuits for quantum-enhanced ML. Note that the component of a quantum circuit which does the data encoding might also be referred to as a ‘quantum feature map’.
Read the Qiskit textbook chapter Parameterized Quantum Circuits. Notice how parameters influence circuits (via the action of parameterized gates).
Read the Qiskit textbook chapter Data Encoding, paying attention to the similarities and differences between the 4 methods presented. In particular, consider how the Arbitrary Encoding approach could be combined with hardware-efficient circuits.
Watch Using Quantum Circuits as Machine Learning Models. Notice how quantum circuits provide a unifying perspective on quantum kernels, quantum neural networks, and quantum generative adversarial networks.
A supplemental paper is Quantum Machine Learning in Feature Hilbert Spaces. Figure 3 in particular is helpful – we can use quantum circuits either explicitly or implicitly as models.
For a supplemental video on this topic, check out QSI Seminar: Dr Maria Schuld, Xanadu, Encoding Classical Data into Quantum States for ML, 05/06/2020. This video presents some of the same ideas as the above one, but also gives a bit more detail.
In the next post, we’ll take a look at one particular quantum-enhanced machine learning algorithm: quantum kernels.
What do you think of both this post, and the idea of such a guide in general? Let me know in the comments!