Concepts of quantum computing
In this blog I hope to cover some of the basic concepts of quantum mechanics, necessary to understand some key quantum algorithms and how quantum computers are going to change the world as we know it. This is the first of a series of posts designed to take you to a point where quantum computing no longer feels like science fiction.
To understand quantum computing you have to start by understanding waves. Waves like sound. Waves can look as simple as a single ripple spreading out from a drop into a still pond. Or they can be intuitive and complicated, such as the shore dump that seems to come out from nowhere and eat you if you try to windsurf at East Runton in Norfolk.
Let’s start with some waves that feel familiar and that have sound mathematical models that we have seen before. Hopefully you recall from high school that the electric and magnetic fields are vector spaces where every point in the vector space has a direction and amplitude. Recall also that a change in the electric field induces a change in the magnetic field. This means that you can create oscillations in the fields as one triggers a change in the other. That change propagates as a wave through the vector fields. This is electromagnetic radiation.
Now we can represent an electromagnetic wave oscillating in a dimension x as a function of time fₓt with a phase shift for the position at time zero, ϕₓ, and the amplitude of the wave Aₓ.
This is the same cosine wave that we’ve seen a million times before, scaled by Aₓ and offset from 0 by ϕₓ
ψ = Aₓ cos(2π fₓt + ϕₓ)
Now suppose the wave is oscillating in two dimensions. We can represent the wave as follows, using kets |↑⟩ to represent the basis for our dimensions x and y.
ψ = Aₓ cos(2π fₓt + ϕₓ) |↑⟩ + Aᵧ cos(2π fᵧt + ϕᵧ) |→⟩
This is a superposition (or weighted sum) representing our wave form: the concept of a superposition is not in any way limited to quantum mechanics. At the moment it is not a quantum superposition, just a sum representing the components of our waves in orthogonal dimensions. We could define a new coordinate system, such as one at 45 degrees to this one, if we wanted and rebase our wave function by calculating new values of A and ϕ if that was convenient and we wanted to rotate our view of the world. The important part here is that we are defining our wave relative to two dimensions, but those dimensions are defined by us and are not an intrinsic property of the wave.
When we listen to music we are hearing a superposition of several different audio waves. We can break down the wave we hear into its components, each one itself a wave defined by its frequency, amplitude and phase. We can determine those using a Fourier Transform.
Equally the waves in the sea are a superposition of many other waves. If we were able to measure the points on the surface of the sea with enough precision we could determine the waves that form the superposition. The height of the water is a linear sum of the constituent waves. The height of the water is not in multiple states at once — it only has one height at any one time, but the height depends on the superposition (aka sum) of its constituent waves. It seems funny to have to say that the sea isn’t in multiple states at the same time, but I want to say it here so that it seems funny when we want to say it later when we talk about quantum states.
Quantum state can be represented as a superposition of wave forms like the sound waves or electromagnetic radiation above, but instead of oscillating in a medium such as air, quantum particles like photons or electrons are oscillations in other properties such as spin, energy or position. When we observe a particle then the wave form collapses and we measure one value, but before measurement the particle exists in a superposition of wave forms. This superposition is a linear combination of quantum states.
So we can think of quantum particles as waves with some very weird and special properties. One of those properties is that we know the probability that a quantum particle will be measured in a quantum state, but we don’t know for certain what state it will be in. The superposition of the quantum particle tells us the probability of measuring the particle in a specific state. Prior to measuring the particle it is in a superposition of states, defined by the wave equation. It is not in one state, nor the other, but has a probability of being in one state or another when we measure it.
But how can a particle be a wave?
This is where the idea of a dot in space is unhelpful. We know that light is quantized into photons, but it is not helpful to think of a photon as a dot wiggling through space. I talk more about this when I describe Bell’s theorem and the slit experiment, but the smallest unit of light is one photon with energy defined by Planks constant. It is not possible to divide light into smaller units.
So let us think of a quantum particle as a wave with properties that we can measure. Those properties may be quantized, which gives us the notion that we are measuring a particle. The property might be energy or mass or position. When we measure the property in the same way multiple times we get the same result. This feels very much like the solid things of our world and gives rise to the idea of a particle, but the way quantum particles behave is governed by the wave form, which is a superposition of measurable states.
Qubits
Qubits are quantum particles that have two basis states |0⟩ and |1⟩ defined for them. Rather like the horizontal and vertical oscillations above, we can define a quantum superposition in terms of quantum states |0⟩ and |1⟩. The states might correspond to spin or position in a real quantum computer. The |0⟩ and |1⟩ states will be different for each quantum computer, but the abstract representations let us work mathematically in a general way in order to develop quantum algorithms. The ket notation generally refers to a pure quantum state, where all the properties of the qubit are known via a set of compatible measurements that do not change the results of other properties.
Since quantum particles oscillate in quantum properties, not space, we use a Hilbert Space to represent multiple dimensions of quantum properties, instead of using three dimensional space to represent the position of our wave as we would with a conventional wave. A Hilbert Space is a complex vector space that may have infinite dimensions, but often has two. A two dimensional Hilbert Space is a Bloch Sphere shown below.
We define the state of the system in terms of points on the surface of that sphere, |ψ⟩. Now finally we end up with a wave form that looks like this where α and β are complex numbers and the probability of measuring |0⟩ is |α|² and the probability of measuring |1⟩ is |β|². The complex values α and β are complex vectors in the Hilbert space.
|ψ⟩ = α |0⟩ + β |1⟩
Commonly a system with n qubits is represented by a complex Hilbert space with 2ⁿ states as basis vectors corresponding to the 2ⁿ values represented by an n digit binary number: |01100110111100…⟩ and the state of the system is a unit vector in the Hilbert space.
By defining the system in this way we are able to perform linear algebra on the higher dimensional space across all our qubits. Don’t think of the Hilbert space as the kind of space we move around in. You can draw the Bloch sphere for one qubit, but the picture breaks down if we have multiple qubits. Think of the Hilbert space instead as a way of representing and manipulating the many possible states of our system.
You can build quantum computers from different sorts of particles, not just photons. To turn a particle into a qubit one must capture it, cool it to near absolute zero, build control and measurement circuitry, and define states that correspond to |0⟩ and |1⟩. Once you have define states that correspond to the mathematical model of the system you can apply binary-like arithmetic on the state of the system in theory, and you can perform the corresponding changes to the real system using quantum gates, which I will discuss in another blog.
Entanglement
Now that we’ve got to grips with particles as waves and binary basis states of our quantum computer, it is time to talk about entanglement. Entanglement is critical in quantum computing to ensure that when we manipulate and measure our qubits we get something likely to be the right answer.
Entanglement of two particles is about combining them in such a way that the result of measuring one is correlated to the result of measuring the other. This will be true no matter how far apart they are, their observed state will correlate provided they are measured on the same basis. For example, it is possible to entangle two electrons such that if one has an upwards spin, the other has a downwards spin and vice versa. The state might not be the same, but if the particles are fully entangled, the state of one will determine the state of the other. This is called maximal co-ordination. Entanglements cannot be shared. If two particles are maximally entangled, then no other particle can be entangled with those two. This is called monogamy of entanglement.
When we come to look at Bell’s theorem later it will feel like entanglement leads to faster than light communication: two particles affected by each other simultaneously. In fact it is better to think of Entanglement as the quantum superposition of more than one object. Entanglement doesn’t feel so weird if you think of the particles as a single wave. Remember that waves can be spread out in space. By defining two particles with a single wave function, we allow them to spread out in space, but when they are measured they have a single shared state.
Key take away
It is easy to talk about the particle as being in multiple states at once, such as having different positions or amounts of energy, but this is unhelpful. It is better to think of the qubit as a wave with a high potential to be some states and a lower potential of being in others. It is not until we measure the particle in a specific state that the particle is in that state.