An Introduction to Quantum Computing

Lucia Nazzaro
Lucia Nazzaro
Lead Frontend Developer
Published
Reviewed
0 views

Quantum computing here, quantum computing there, quantum computing everywhere! Can we make some sense out of it? I'd like to not feel like completely out of place when people talk about it, so let's figure it out together!

I start this serie of posts about Quantum computing for personal learning, with the sake of understanding the general implications of it in our modern society and how it can impact my day-to-day life with technology. I do not claim to be an expert in the topic and this are more my notes based on what I'm learning reading articles and asking ChatGPT to simplify what I'm reading :D

Quantum computing is a revolutionary new technology that harnesses the principles of quantum mechanics (an intricate branch of physics that explores the wonders of the subatomic realm and tries to explain the nature of particles to discover the fundamental principles that govern our world -- we're not here today for this though) to process information at incredible speeds.

Unlike classical computers, which store and process information using bits that are either 0 or 1, quantum computers use quantum bits, or qubits, which can exist in multiple states simultaneously, meaning that a qubit can be both 0 and 1. ...but how?

Representation of a qubit compared to a typical bit.
Representation of a qubit compared to a typical bit.
Source: Devopedia. Credit: Volkswagen Aktiengesellschaft 2019.

Superposition

Let's talk about the idea of superposition, which describes the ability of a qubit to exist in multiple states at the same time. If a normal bit can have as a state either 0 or 1, the state of qubit can be represented as

1|ψ⟩ = α|0+ β|1

which would require quite some explantation, but to make it briefly:

  1. The symbol |ψ⟩ represents the state of the qubit. ψ is just a variable name, and the |⟩ symbols are like brackets that indicate it's a quantum state.
  2. The α|0⟩ and β|1⟩ terms are probability amplitudes. They represent the chances of finding the qubit in the states |0⟩ and |1⟩
  • α represents the probability amplitude of finding the qubit in the |0⟩ state;
  • β represents the probability amplitude of finding the qubit in the |1⟩ state.

(... and yes because I also had to ask myself, probability amplitudes are quite complex numbers, but the gist of them is that the sum of α and β adds up to 1, meaning that the sum of the probabilities of all possible outcomes is always equal to 1.)

We can picture the state of a qubit like a point on a ball, called the Bloch sphere. The numbers α and β decide where exactly on the ball the qubit's point is. If α and β are regular numbers, then the qubit's point is on the middle of the ball's surface, like the equator. This means the qubit is equally a mix of |0⟩ and |1⟩. But if α and β are complex numbers (read more about complex numbers on Math Is Fun), the qubit's point is somewhere else on the ball's surface. This means the qubit is a more general mix of |0⟩ and |1⟩.

When a qubit is in superposition, it is like it's exploring all possible states at once. However, when we measure the qubit, it collapses into a definite state, either 0 or 1. The act of measurement forces the qubit to choose one of the possibilities, and from that point on, it behaves like a classical bit.

For instance, if |α|^2 = 0.4 and |β|^2 = 0.6, the measurement is more likely to yield the outcome 1, but there is still a chance of obtaining the outcome 0.

Okay but... how do you set a qubit in superposition?

In order to do that, we can use a specific quantum gate known as the Hadamard gate (H gate) (more about what is a quantum gate later :D). The Hadamard gate creates an equal superposition of the |0⟩ and |1⟩ states for a qubit. Here's a simplified explanation of how it works:

  1. Start with a qubit in the |0⟩ state or the |1⟩ state
  2. Apply the Hadamard gate (H gate) to the qubit
  • If the qubit is initially in the |0⟩ state, the H gate will put it into an equal superposition of |0⟩ and |1⟩. The resulting state will be (|0⟩ + |1⟩) / √2, meaning the qubit is in both states simultaneously
  • But, if the qubit is initially in the |1⟩ state, the H gate will again put it into an equal superposition of |0⟩ and |1⟩ but the resulting state will be (|0⟩ - |1⟩) / √2, meaning the qubit is in both states but with a phase shift (which is a far more intricate topic and I am still looking to find good and simple readings about it -- feel free to share in the comment section below!).

Reading the values of multiple qubits works similarly, with each qubit measured individually, and the outcomes combined to form a classical bit string or a quantum state in the case of entanglement. Which leads us to the next point...

Entanglement

Another important concept in quantum computing is entanglement, which describes the phenomenon of two or more qubits being connected in a way that allows them to affect each other's behavior, even if they are separated by large distances. Fundamentally, entanglement creates instantaneous correlations between their measurement outcomes, taking place in three stages:

  • Preparation: two or more qubits are brought together and interact with each other in a specific way through a quantum gate operation (too long of a topic to cover here for now, but Universal Quantum has a great article on Medium about quantum gates).
  • Resulting State: as a result of this interaction, the qubits become entangled and share a joint quantum state, which cannot be expressed as a simple combination of individual qubit states as the entangled state encompasses the entire system as a whole rather than describing each qubit independently.
  • Correlations: the measurement outcomes of one qubit are instantaneously correlated with the measurement outcomes of the other(s). These correlations hold true regardless of the physical separation between the entangled qubits, which is often referred to as non-locality or spooky action at a distance (once again, a topic for another time).

Briefly about Quantum gates

This is where I start to lose it a bit after the Hadamard gate we mentioned before. Sounds like a good place where I should continue reading more until I am confident enough to write notes about the topic 😎 Anyway...

A quantum gate is an instruction (or operation) that we can use to change the state of qubits. Just like how math operations such as addition or multiplication transforms numbers, a quantum gate transforms the quantum state of qubits, each gate having a specific effect on the qubits: rotating the state, flipping it, or putting it in a superposition and whatsoever.

Basically, they are the building blocks that help us manipulate and utilize the power of quantum computing. Once again, Universal Quantum has a great article on Medium about quantum gates and I recommend checking something more by yourself (and if you feel generous, don't be afraid to share some good links with me :D)

Briefly about Challenges

Seems fair to mention, before closing, why this technology is not yet widespread and what are the things that it needs to overcome.

One of the major challenges in building a quantum computer is the delicate nature of qubits. Because they are based on the principles of quantum mechanics, qubits are easily affected by their environment, and can be easily disrupted by outside factors such as temperature, noise, or even light. This makes it difficult to control and manipulate qubits, and to maintain their quantum state for long periods of time.

Despite these challenges, researchers have made significant progress in developing quantum computers in recent years. In 2019, Google announced that its quantum computer had achieved "quantum supremacy" by solving a problem that would be impossible for a classical computer to solve in a reasonable amount of time. This was a major milestone in the development of quantum computing, and showed that the technology is rapidly advancing.


Conclusions

So, what did we learn here?

  • We've learned about qubits, which unlike the binary bits in classical computing, can exist in multiple states at once due to superposition.
  • We've also discovered that a specific quantum gate, the Hadamard gate, can set a qubit in this superposition state.
  • Furthermore, qubits can be entangled, meaning they can affect each other instantaneously irrespective of the distance between them.
  • Lastly, we've had a general discussion about quantum gates, the operations that manipulate the state of qubits, serving as the foundational building blocks of quantum computing.

What next?

I'd love to continue my studies focusing more on:

  • (First of all, brushing up my linear algebra, because it seems to help a lot reading documents online)
  • Quantum gates
  • Quantum algorithms
  • Quantum error correction
  • More about quantum supremacy
  • More about challenges

Thank you for reading so far, if you did, and don't hesitate sharing good resources in the comments below if you feel like!


Sources and inspiration:


More Articles

Level up your Tailwind game

Use Tailwind like you mean it! Whether you're a seasoned developer or just starting out, this article will help you navigate Tailwind CSS and expand your knowledge with advanced practices.

TailwindCSS
+1

Fixing Disqus 'Auto' theme switching when using Next.js + next-themes

So, you want to have both a light and dark theme in your Next.js website, but your Disqus embed doesn't seem to change its theme accordingly... Maybe this will help!

ReactNext.js
+1