Read Quantum computing in machine learning part 1 here!
Still here?
For those few of my readers who are lingering, the question I’d scratch my head over if I was you would be the magical part. The part where I wrote “let nature i.e. physics do the calculation”. That is the long known, but still head-spinning, part in my opinion.
The part is the quantum computing promise. Here is how I think about it.
At the core of the magic, we have that nature is really good at solving a particular type of equation. The equation is the engine of reality, the Schrodinger equation. It basically says that the change of things depends on the state of things. It is akin to saying that if a ball is high in the air and about to fall down, the change in height — the velocity — is much less than when the ball is halfway down. Then the ball moves fast. That kind of reasoning. Using that analogy, we can say that both the velocity and height is dependent on time. If I throw the ball up in the air, there is a formula that gives me both height and velocity at any time afterwards. The Schrodinger equation is that kind of formula, only that it works on quantum states and energy instead. For our purposes the magic part is that it is a computation engine. You nudge reality to be in a particular state, you start the stopwatch and you observe after a time lapse. What you observe is the computation of the formula over time. The engine is blindingly fast, has truly negligible footprint and is high fidelity.
That means that if we can express any type of computational problem on the form that the Schrodinger equation requires, we have a physical quantum-scale computer that can solve it. Classic computers have gotten really good at many problems so it will not solve all or even a majority of computing problems probably, but it might solve some that the classic approach struggles with. Like fine-tuning a large language model capturing all the subtleties in the data, efficiently and effortlessly at the same time.
We want a quantum version of a classical bit that is minimal, it has two states. And which fits how the Schrodinger equation works. This later equation forces our hand , and the simplest way to satisfy these constraints is to define a qubit state as a combination of two parameters each governing their state, state 0 and state 1. A qubit state can be thought of as a point on a sphere. The north pole represents 1 and the south pole represents 0. Any other place represents a combination of the the two states, and that is the quantum part — the qubit state can be a combination of the two.

As I mentioned initially, we want to do element-wise multiplication using Schrodinger, nature’s own computation engine. With qubits. Physically, we can only do two things.
We can rotate the point on the sphere. The microwave pulse generator puts everything in place. And Schrodinger does the rotation. That’s what nature does.

And we can read where the point is. When we read, we might get different results each time, even though the state is the same. That is part of how quants work. The state is defined and not uncertain, but quantum states are such that they aren’t locked into one outcome. Such states hold many possibilities at once. It is hard to wrap one’s mind around, but that is the quantum states’s true form. When we measure, we force a choice and get one particular result.
So to approximate a multiplication, we code the numbers as start angles on the sphere, we wait for a short time (nanoseconds) for Schrodinger to do its work and then we read. We repeat many times, say a thousand times as I mentioned before. After having read a thousand times we have a fairly good idea of the probability of each state. And it transpires that this probability is correlated with the multiplication of the two numbers. Given quite a set of assumptions and constraints. But that is the essence.
Earlier I argued that quality wise we might preserve more of the nonlinear, subtle parts of the data with a quantum multiplication, than with a classic lora approach where these are lost. To achieve that we need to represent the vectors we are multiplying in different qubits. So the multiplication we just went through with the rotations need to be done over several qubits. The reason why that preserves better the subtle parts of the data is because the qubits effect each other when rotating. The are linked. The effect, called entanglement, takes into account a fuller interaction between the numbers in the vectors we’re multiplying. And that in sum makes the fine tuning make a better, higher resolution decision surface. That decision surface is what makes the large language model choose a more appropriate word over others when producing text.
(part 3)
Quantum computing in machine learning (part 2) was originally published in Compendium on Medium, where people are continuing the conversation by highlighting and responding to this story.


