Quantum Mechanics— The Small Magic to Change Computing

Taiho Higaki
7 min readNov 23, 2022

--

Quantum computers are being developed every day at companies such as IBM Quantum Computing, D-Wave and Xanadu. There are many techniques to make Quantum Computers function the way they do, and I want to introduce some of them to you. These quantum computers can do amazing things, like break cryptography (and make new security systems!) and solve large-scale graph-related problems, such as the Tail Assignment Problem.

Google’s Sycamore quantum computer at a lab near Santa Barbara, California.

Bits vs Qubits

First, let’s look at the components that quantum computers are made out of. Normally, classical computers (aka Binary Computers, or computers that we normally use) use bits as ways to store information. Bits are the smallest way of storing information on a computer. It can hold a value of either 0 or 1 and only one of those values at a single time. (Fun fact: 8 bits makes 8 bytes, which you would normally see in storage capacity, like 1 kilobyte or 1 megabyte.)

These bits can be seen as the status of a transistor (the simplest data processor in computers that is basically a switch), that’s either on or off. This means that 1 bit could hold 2 states of information (0 or 1), 2 bits could hold 4 states of information (00, 01, 10 or 11) and n bits could hold 2n states of information. Although we have been able to store a large amount of information using this, there are some problems that a classical computer simply cannot solve with limited time (We will talk about this later in the article).

To compensate for this problem, we can use quantum computers. Quantum computers, instead of using bits, use qubits. Qubits can be in a superposition, holding multiple states (one qubit can hold up to 4 states) of information. This, combined with entanglement, or binding one qubit to another to correlate its behaviour, can give quantum computers the power to solve large-scale graphing problems.

Another important note here is the difference between a classical system and a quantum system. A classical system represents the world we see usually, and a quantum system is where qubits would be in play.

Quantum Notation

In quantum physics, we use statevectors to describe the state of our system. For example, if we wanted to describe the position of an object along a track, we could use a variable x:

For this object, the variable x = 4.

This, in a classical system, would be described as x = 4.

Alternatively, we could use a collection of numbers in a vector called a statevector. Each element in the statevector contains the probability (a number between 0 and 1) of finding the object in a certain place:

The statevector doesn’t have to be limited to position: we could also keep a statevector of potential speeds, and all of the possible object colours.

Superposition

One of the most important quantum mechanics is superposition. Classical bits can only be in a state of 0 or 1, but qubits do not have this restriction: a qubit only needs to be in the state of 0 or 1 when it is measured to extract an output. At all other times, it will be a probability of both of the states, called superposition.

To understand this, we will define the two simplest qubit states. For a qubit that will have a definite state of 0 when measured, we will call it |0. On the opposite side, for the qubit that will have a definite state of 1, we will call it |1. These will not have an overlap, since each of these qubits definitely outputs a 0 or 1. One way to represent this with mathematics is to use two orthogonal vectors:

Note: the | and I have been using are part of the bra-ket notation, introduced by Paul Dirac in 1939. It simply represents that the two states we are introducing are vectors.

With the vectors, we can describe more complex states than just |0 and |1. For example, consider the vector

We can describe this vector as a sum of |0 and |1 since they form an orthonormal basis. (We can describe any qubits using this method)

This vector, |q, is called the qubit’s statevector — it tells us everything we could possibly know about this qubit. For now, we can only draw a few conclusions about this statevector: it is not entirely |0 and it is not entirely |1. Instead, this is a linear combination of both of these statevectors. In quantum mechanics, this is called superposition.

The Rule of Measurement

In quantum mechanics, there is a simple rule for measurement. To find the probability of measuring a state |ψin the state |x, we do p(|x) = |⟨x|ψ⟩|². The symbols ⟨, | and tell us that x| is a row vector and that x| is a row vector and |ψ is a column vector. In quantum mechanics, we call the column vectors kets and the row vectors bras. Together, they make up the bra-ket notation mentioned above. Any ket |k has a corresponding bra k|, and we convert between them using the conjugate transpose. In the equation above, |xcan be any qubit state. To find the probability of measuring |x, we take the inner product of |xand the state we are measuring (in this case |ψ) and square the magnitude.

If we look at the state |q₀above, we can see that the probability of measuring |0is 0.5:

This rule governs how information is extracted out of quantum states. Therefore, it is very important for everything we do in quantum computation. It also immediately implies several important facts:

  1. Normalization: The rule shows us that amplitudes are related to probabilities. If we want the probabilities to add up to 1 (which they should!!), we need to ensure that the statevector is normalized. Specifically, we need the magnitude of the statevector to be 1: ψ|ψ = 1. Thus, if |ψ⟩ = α|0⟩ + β|1then, |α|² + |β|² = 1. This explains the factors of √2 you have seen in the |qabove.
  2. Alternative measurement: The measurement rule gives us the probability p(|x) that a state |ψis measured as |x. It doesn’t tell us that |x⟩ can only be either |0⟩ or |1⟩.
  3. Global phase: We know that measuring the state |1will give us the output of 1 with certainty. But, we are also able to write down states that look like this:
    [0 i] = i|1
    To see how this behaves, we apply the measurement rule:
    |⟨
    x|(i|1)|² = |ix|1⟩|² = |⟨x|1⟩|². Here, the factor of i disappears once we take the magnitude of the complex number. It does not matter what measurement we are considering — the probabilities for the state i|1are identical to those for |1⟩. Since measurements are the only way we can extract any information from a qubit, this implies that these two states are equivalent in all ways that are relevant.
    More generally, we refer to any overall factor γ on a state for which |γ| = 1 as a “global phase”. States that differ only by a global phase are physically indistinguishable: |x|(γ|α)|²=|γx|α|²=|x|α|²2
    Note: this is different from the phase difference between terms in a superposition, which is known as the “relative phase”. This becomes relevant once we consider different types of measurement and multiple qubits.
  4. The Observer Effect: We know that the amplitudes of a qubit contain information about the probability of finding the qubit in a specific state, but once we have measured a qubit, we know with certainty what the state of the qubit is. For example, if we measure a qubit in the state |q= α|0 + β|1, and find it in the state |0 if we measure again, there is a 100% chance of finding the qubit in the state |0. This means that the act of measuring changes the states of our qubits.
    We refer to this as “collapsing” the state of the qubit. It is a potent effect, so we need to be careful about when we measure (and collapse) the qubit.

These properties are very interesting in solving many algorithms and cryptography problems, as we will see in the next article.

--

--