current years, quantum computing has attracted rising curiosity from researchers, companies, and the general public. “Quantum” has change into a buzzword that many use to draw consideration. As this discipline has gained reputation, quantum machine studying (QML) has emerged as an space the place quantum computing and machine studying meet.
As somebody with an curiosity in machine studying and a deep love for math and quantum computing, I discovered the idea of quantum machine studying very interesting. However as a researcher within the discipline, I used to be additionally considerably skeptical in regards to the near-term purposes of QML.
At this time, machine studying powers instruments similar to suggestion methods and medical diagnostics by discovering patterns in information and making predictions. Quantum computing, in distinction, processes data otherwise by leveraging results similar to superposition and entanglement.
The sector of quantum machine studying explores this risk and seeks to reply this query.
Can quantum computer systems assist us study from information extra successfully?
Nonetheless, as with something associated to quantum computing, it’s necessary to set clear expectations. Quantum computer systems at the moment are defective and incapable of working large-scale packages. That being stated, they’re able to offering a proof of idea on the utility of QML in numerous purposes.
Furthermore, QML isn’t meant to switch classical machine studying. As an alternative, it seems to be for elements of the training course of the place quantum methods would possibly supply a bonus, similar to information illustration, exploring advanced characteristic areas, or optimization.
With that in thoughts, how can an information scientist or a machine studying engineer dip their toe within the pool that’s QML? Any machine studying algorithm (quantum or classical) requires information. Step one is at all times information preparation and cleansing. So, how can we put together the information to be used in a QML algorithm?
This text is all about QML workflows and information encoding.
Quantum Machine Studying Workflows
Earlier than we soar into information, let’s take a fast pause and briefly outline what quantum machine studying is. At a excessive stage, quantum machine studying refers to algorithms that use quantum methods to carry out machine studying duties, together with:
1. Classification
2. Regression
3. Clustering
4. Optimization
Most approaches at present fall into what we name hybrid quantum-classical fashions, by which classical computer systems deal with information enter and optimization, whereas quantum circuits are a part of the mannequin.
A useful means to consider that is: Classical machine studying focuses on designing options, whereas quantum machine studying typically focuses on encoding options into quantum states.
Since information can take many types, QML workflows might look completely different relying on the kind of enter and algorithm.
If we now have classical information and a classical algorithm, that’s our typical machine studying workflow. The opposite three choices are the place issues get considerably attention-grabbing.
1. Quantum Information with a Quantum Mannequin (Totally Quantum)
Essentially the most easy strategy is to have some quantum information and use it with a quantum mannequin. In concept, what would this workflow appear like?
1- Quantum Information Enter: The enter is already a quantum state: ∣ψ⟩
2- Quantum Processing: A circuit transforms the state: U(θ)∣ψ⟩
3- Measurement
The info we’re working with would possibly come from:
1. A quantum experiment (e.g., a bodily system being measured).
2. A quantum sensor.
3. One other quantum algorithm or simulation.
As a result of the information is already quantum, there is no such thing as a want for an encoding step. At a conceptual stage, that is the “purest” type of quantum machine studying, so we would count on the strongest type of quantum benefit right here!
However, this workflow continues to be restricted in observe resulting from some challenges, together with:
1. Entry to Quantum Information: Most real-world datasets (pictures, textual content, tabular information) are classical. Actually, quantum information is way more durable to acquire.
2. State Preparation and Management: Even with quantum information, getting ready and sustaining the state ∣ψ⟩ with excessive constancy is difficult resulting from noise and decoherence.
3. Measurement Constraints: Whereas we delay measurement till the top, we nonetheless face limitations, similar to we solely extract partial data from the quantum state, and we want cautious design of observables.
In the sort of workflow, the purpose is to study instantly from quantum methods.
2. Quantum Information with Classical Algorithms
Up to now, we now have centered on workflows by which quantum information is utilized in a quantum system. However we also needs to contemplate the state of affairs the place we now have quantum information, and we wish to use it with a classical ML algorithm.
At first look, this looks as if a pure extension. If quantum methods can generate wealthy, high-dimensional information, why not use classical machine studying fashions to research it?
In observe, this workflow is possible, however with an necessary limitation.
A quantum system is described by a state similar to:
which incorporates exponentially many amplitudes. Nonetheless, classical algorithms can not instantly entry this state. As an alternative, we should measure the system to extract classical data, for instance, via expectation values:
These measured portions can then be used as options in a classical mannequin.
The problem is that measurement essentially limits the quantity of knowledge we are able to extract. Every measurement gives solely partial details about the state, and recovering the complete state would require an impractical variety of repeated experiments.
That being stated, classical machine studying can play a helpful position in analyzing noisy measurement information, figuring out patterns, or enhancing sign processing.
Therefore, most quantum machine studying approaches purpose to maintain information within the quantum system for so long as attainable—bringing us again to the central problem of this text:
How will we encode classical information into quantum states within the first place?
So, let’s speak in regards to the ultimate workflow.
3. Classical Information with a Quantum Mannequin (Hybrid QML)
That is the commonest workflow used at present. Principally, it’s a mannequin the place we encode classical information into quantum states after which apply QML to acquire outcomes. Hybrid QML algorithms like this have 5 steps:
1- Classical Information Enter
Information begins in a well-known type:
2- Encoding Step
The info is mapped right into a quantum state:
3- Quantum Processing
A parameterized circuit processes the information:
4- Measurement
Outcomes are extracted as expectation values:
5- Classical Optimization Loop
Parameters θ are up to date utilizing classical optimizers.
This workflow brings a brand new problem that isn’t present in classical machine studying:
How will we effectively encode classical information right into a quantum system?
That’s what we’ll reply subsequent!

Classical Information Encoding
If we step again and evaluate these workflows, one factor turns into clear: the principle structural distinction is the encoding step.
As a result of most real-world purposes use classical datasets, this step is often needed. So, how will we characterize classical information in a quantum system?
In classical computing, information is saved as numbers in reminiscence.
In quantum computing, information should be represented as a quantum state:
For a number of qubits:
The place: are advanced amplitudes . So, in easy phrases, encoding means: Taking classical information and mapping it into the amplitudes, phases, or rotations of a quantum state.
Now, let’s take a deeper take a look at the several types of information encoding.
1. Foundation Encoding (Binary Mapping)
That is the only strategy to encoding classical information. Principally, we characterize classical binary information instantly as qubit states.
Qiskit Instance
from qiskit import QuantumCircuit
qc = QuantumCircuit(3)
qc.x(0) # 1
qc.x(2) # 1
qc.draw('mpl')
Right here, every bit maps on to a qubit, and no superposition is used. This strategy solely works if the dataset we’re utilizing is easy. and it’s often utilized in demonstrations and instructing fairly than precise implementation of QML.
In the sort of information encoding, you would wish one qubit per characteristic, which doesn’t scale nicely to bigger, extra practical issues.
2. Angle Encoding
To have a richer encoding, as an alternative of turning values into 0 or 1, we use rotations to encode our classical information. Quantum information might be rotated in three instructions, X, Y, and Z.
In angle encoding, we take a classical characteristic x and map it onto a quantum state utilizing a rotation:
, the place α∈{x, y, z}.
So in precept, you should utilize Rx(x), Ry(x), or Rz(x).
However not all of them encode information in the identical means. Typically, Rx or Ry is used for information encoding.
Qiskit Instance
from qiskit import QuantumCircuit
import numpy as np
x = [0.5, 1.2]
qc = QuantumCircuit(2)
qc.ry(x[0], 0)
qc.ry(x[1], 1)
qc.draw('mpl')
Angle encoding can, in precept, be carried out utilizing rotations about any axis (e.g., Rx, Ry, Rz). Nonetheless, rotations in regards to the Y- and X-axes instantly have an effect on measurement chances, whereas Z-rotations encode data in section and require extra operations to change into observable.
Once we use rotation to encode information, steady information are dealt with naturally, leading to a compact illustration that’s simple to implement. By itself, this technique is generally linear except we add entanglement.
3. Amplitude Encoding
That is the place issues begin to really feel “quantum.” In amplitude encoding, the information is encoded into the amplitudes of a quantum state.
With n qubits, we are able to encode values, which implies we get exponential compression.
Qiskit Instance
from qiskit import QuantumCircuit
from qiskit.quantum_info import Statevector
import numpy as np
x = np.array([1, 1, 0, 0])
x = x / np.linalg.norm(x)
qc = QuantumCircuit(2)
qc.initialize(x, [0,1])
qc.draw('mpl')
The problem with this strategy is that state preparation is dear (circuit-wise), which might make circuits deep and noisy. So, although amplitude encoding appears highly effective in concept, it’s not at all times sensible with present {hardware}.
4. Characteristic Maps (Increased-Order Encoding)
Up to now, we’ve largely simply loaded classical information into quantum states. Characteristic maps go a step additional by introducing nonlinearity, capturing characteristic interactions, and leveraging entanglement.
The construction of this encoding would appear like:
Meaning options don’t simply act independently; they work together with one another.
Qiskit Instance
from qiskit import QuantumCircuit
x1, x2 = 0.5, 1.0
qc = QuantumCircuit(2)
qc.ry(x1, 0)
qc.ry(x2, 1)
qc.cx(0, 1)
qc.rz(x1 * x2, 1)
qc.draw('mpl')
The sort of encoding is the quantum equal of polynomial options or kernel transformations. This lets the mannequin discover advanced relationships within the information.
You’ll be able to consider characteristic maps as reworking information into a brand new area, a lot as kernels do in classical machine studying. As an alternative of mapping information right into a higher-dimensional classical area, QML maps it right into a quantum Hilbert area.

Ultimate Ideas
Though quantum computer systems are usually not totally there, hardware-wise, there’s a lot we are able to do with them at present. One of the vital promising purposes of quantum computer systems is quantum machine studying. If there’s one concept price holding onto from this text, it’s this:
In quantum machine studying, the way you encode the information typically issues as a lot because the mannequin you’re utilizing.
This might sound stunning at first, however it’s really much like classical machine studying. The distinction is that in QML, encoding isn’t simply preprocessing; it’s a part of the mannequin itself.
And, similar to the broader discipline of quantum computing, this space continues to be growing. We don’t but know the “best” encoding methods. The {hardware} constraints form what’s sensible at present, and new approaches are nonetheless being explored.
So for those who’re seeking to get into quantum computing, quantum machine studying is among the most impactful locations to start out. Not by leaping straight into advanced algorithms, however by beginning with a a lot less complicated query: How can my information work together with a quantum system?
Answering that query permits us to completely make the most of the facility of the quantum computer systems we now have at present.
References & Additional Studying
- Schuld, M., & Petruccione, F. (2018). Supervised studying with quantum computer systems (Vol. 17, p. 3). Berlin: Springer.
- Havlíček, V., Córcoles, A. D., Temme, Okay., Harrow, A. W., Kandala, A., Chow, J. M., & Gambetta, J. M. (2019). Supervised studying with quantum-enhanced characteristic areas. Nature, 567(7747), 209-212.
- Qiskit Documentation:
- Schuld, M., & Killoran, N. (2019). Quantum machine studying in characteristic Hilbert areas. Bodily Overview Letters, 122(4), 040504.



