QML — Understanding Qubits

Somnath Basu Roy Chowdhury
6 min readJan 6, 2019

--

This blog is part of the series aimed at understanding Quantum Machine Learning. In this first part, we aim to understand Qubits.

Qubits are the fundamental computational unit in quantum computing. Qubit store binary information (0 or 1), analogous to a bit in a classical computer. However, qubits can store 0 and 1 together using superposition.

Strange right? Don’t worry, you won’t feel lost by the end of this blog. Quantum computers leverage this feat to encode exponential amount of information leading to more scalable solutions compared to classical computers. Let’s dive in!

Notation

We will go over some basic mathematical notations before diving right into the physics of it. Vectors in quantum mechanics are generally represented using the Dirac bra-ket notation, like |a⟩.

In this notation, the ket |⋅⟩ is analogous to a column vector, and the bra ⟨⋅| is analogous to the complex conjugate transpose of the ket.

source

The bra-ket notation ⟨a|b⟩ denotes the dot product of the braa| with the ket |b⟩. The complete expression is given below

source

The bra-ket operator is linear with respect to its second argument. Also, from the above equation we can deduce this ⟨a|a⟩ = 1

Background

This section is optional and if you know about the basics of quantum physics you can skip over to the next one. Here, I will discuss some notions from quantum physics which will help develop a complete understanding of qubits.

Wave function (|Ψ⟩) is an intrinsic property of an isolated quantum system and define its state. Wave functions cannot be measured directly, but we can apply operators on it to obtain some physical measurements (like position, spin, angular momentum etc).

Wave functions can be added together and multiplied by complex numbers to form new wave functions and form a Hilbert space (refer to my other blog for better understanding). A wave function can be broken down as sum of its orthonormal basis states as shown

source

In the quantum world, measurement is defined as the application of an operator (simply a matrix multiplication) on the wave function. The operator however changes the original state |Ψ⟩ of the quantum system, so we will get a different value if we measure it again.

Imagine determining the position of an electron, the electron has hit a surface or is struck by a photon, both of which changes its momentum therefore its original wave function. This is one of the fundamental postulates of quantum mechanics.

Superposition

Back to qubits again. We will now use all the maths we’ve learnt in describing the model of the qubit. In order to have some physical intuition, let’s say the qubit is an electron and we are interested in its spin only. For simplicity, we consider that the wave function of the qubit only contains information about its spin.

The spin is a linear combination of the possible states, spin up which is denoted as |0⟩ and spin down as |1⟩. |Ψ⟩ of the qubit is given as

Here |0⟩ and |1⟩, are two orthonormal bases (in a complex 2D space) that are encoded as:

It is important to remember that |0⟩ and |1⟩ are orthonormal in a Hilbert Space and not in our regular Euclidean space.

Here, we see the fruition of our initial idea that qubits can store multiple states simultaneously. You maybe thinking that this is all mathematical, what’s the physical significance of this?

When we try to measure the spin in the vertical direction (up/down), if the measurement is |0⟩ it causes the wave function |Ψ⟩ to collapse to |0⟩ and vice-versa. We have touched upon this in the previous section, of how measurements affect the state of a system. This might sound strange given our classical notion, but this has been corroborated by experiments and this is how the nature works.

Schrodinger’s Cat thought experiment (source)

Coming back to measuring the spin, the probability with which the wave function collapses to one of the state depends on its amplitude. Consider a qubit in the following state

The probability of a state is given by the square of its amplitude magnitude. So in this case there’s a 50:50 chance it’ll end up in one of the states. As probabilities always add upto 1, the following holds true

Now that we have gained a basic understanding of superposition of states in a qubit. We will try to relate how this plays out in our physical space and project the qubit model into Euclidian Space.

Bloch Sphere

Bloch Sphere is a geometric representation of a qubit in Euclidean space as points on the surface of a unit sphere. This representation is very useful as it helps visualise operations on qubits on the sphere surface. It appears something like this

This section we will proceed slowly, as Bloch sphere is a very important concept and confusing at the same time. To start off, we will represent the superposition model of the qubit in polar coordinate system. As the amplitudes are complex numbers, the wave function can be written as

We see that there are four free parameters in the above equation. Multiplying the above equation with an arbitrary phase doesn’t change any measurable factors. This can be shown as (α is an arbitrary complex vector here)

Therefore, we shift the phase of the wave function by the negative of the phase of spin up state |0⟩ to obtain this

We see that there are three free parameters in the equation now. This is further reduced to two parameters using the normalization constraint (α²+ β² = 1) introduced in the previous section (probabilities add up to 1).

Using this constraint, the qubit can be represented in a spherical polar coordinate. Corresponding cartesian coordinates are

where r=1. Replacing these into the original equation we get

Comparing this derived equation with the one represented on the sphere is still not the same. As θ in the equation can vary between 0 and π/2, whereas on the sphere varies between 0 ≤θ≤π. Therefore, replacing θ by its half angle θ/2 we get the following

Now, this can be represent all points on the where 0 ≤ θ ≤ π, 0 ≤ φ ≤ 2π

Bloch Sphere Representation

We have completed deriving the Bloch Sphere representation of a qubit. Still there maybe a few questions bugging you. For example, we started off by defining |0⟩ and|1⟩, as orthogonal bases but on the Bloch sphere they lie on the same line.

Recall that |0⟩ and|1⟩ are orthonormal only in Hilbert space, and has nothing to do with 3D euclidian space. What the Bloch space actually represents is the direction in 3D space in which the spin is maximum. This also has been verified experimentally.

Next Steps

Now we have a clear perspective on the working of a qubit. Next steps would be to learn about basic operations on them and how systems involving multiple qubits work.

--

--