DEV Community

Cover image for Approaching quantum computing basics, bit by qubit
Hunter Johnson for Educative

Posted on • Updated on • Originally published at educative.io

Approaching quantum computing basics, bit by qubit

Quantum computing may be one of the most exciting topics in computer science today. It's essentially computing based on the laws of quantum mechanics. In quantum computing, we use what we know about how the tiniest physical entities behave to solve real-world problems.

Just as classical computers were in their early days of development, quantum computers are expensive to build and fragile to maintain. Still, companies and research institutions have worked hard to develop this technology because it could offer impressive processing power for certain complex problems. While these quantum machines are held in restricted facilities, quantum computers are now more accessible to the public than ever before. You won't find a quantum computer lab at the local library, but you can start computing on a quantum processor today over the cloud, from the comfort of your own home (optionally: in your pajamas).

Today, we'll discuss the wonders of quantum computing and the curious laws of physics upon which it was built.

We'll cover:

Stay tuned for our next post on quantum computing concepts! This piece is a high-level introduction to get you comfortable with the subject before diving deeper.

Understanding quantum systems

Quantum physical systems behave much differently than larger scale, classical physical systems. Every physical entity, on its smallest scale, is composed of atoms and subatomic particles. The way that these smallest physical entities interact are predicted by the principles of quantum mechanics.

Quantum physical systems are two-state systems, where a particle can be in either of these states:

  • Pure state: A fixed and single state, like in a classical system
  • Quantum state: Multiple states at once

The quantum state is also known as the superposition state. The special thing about the superposition state is that it can't be observed. In fact, any measurement of a quantum system makes it collapse into a pure state. This means we can only observe quantum systems in a classical state, although they can be in superposition before we perform measurements.

We can think of an entity in superposition as a penny spinning on a table. While it's spinning, it's in superposition, suspended between probabilities of being heads or tails. Upon measurement, it collapses into a pure state of heads or tails.

"Fundamentally, in particle physics, **everything is everywhere at the same time. That's what superposition is like. Quantum reality is a superposition of all possibilities." – Hrant Gharibyan, Quantum Scientist at CalTech

Another principle of quantum mechanics that we harness in quantum computing is quantum entanglement. Quantum entanglement is a phenomenon linking two or more particles in a dependent relationship. Entangled particles can influence each other across long distances (even billions of light years).

As humans, our large size won't allow us to harness superposition to simultaneously be on a beach and in a meeting room. But as programmers, we can do the next best thing: harness the principles of quantum mechanics to perform powerful computations.

At first, the principles of quantum mechanics can feel counterintuitive. They challenge what we see with our naked eye. But the breakthroughs of quantum mechanics have been tried and tested, and have revolutionized technology today. We've leveraged these breakthroughs to create nuclear energy, engineer classical transistors, and continue to use them for quantum computation.

If you're curious, you can try these games to help you better understand the principles of quantum mechanics:

  • Quantum Chess: Try playing chess with pieces that are superposed and entangled
  • Q-PATHS: Use this tool to help you understand quantum entanglement

Basics of quantum computing

In quantum computing systems, we'll find quantum counterparts for many of our familiar friends in classical computing systems:

  • Bit → Quantum bit (qubit)
  • Transistor → Quantum transistor
  • Central processing unit (CPU) → Quantum processing unit (QPU)
  • Logic gate → Quantum logic gate
  • Circuit → Quantum circuit
  • Algorithm → Quantum algorithm

Because they're governed by quantum mechanics, the components of quantum computing systems operate far differently from those of classical computing systems.

Some of the quirks of quantum computing systems include:

  • Quantum logic gates are always invertible, unlike classical logic gates
  • Quantum bits can take on two or more values at once, unlike classical bits

Let's get a bit more familiar with the building block of quantum computers: the qubit. Like bits, qubits are the smallest units of storage in a quantum computer.

So, if quantum systems concern the world on a subatomic scale, you may be wondering, Just how tiny must a qubit be -- and how could we possibly make them?

Qubits are indeed the smallest things in which we know how to store some information.

Qubits can be:

  • Naturally occurring materials (e.g., photons or atoms)
  • Engineered materials (e.g., superconducting circuits)

If you're curious, the following table represents some of the most common materials currently used as qubits[1] (as well as their respective states for data representation):

Qubits and their corresponding states

Qubits are engineered differently than bits. But that's certainly not all that's different.

A qubit is a quantum physical system, so applying what we learned earlier, a qubit can be in either:

  • Pure state: 0 or 1
  • Quantum state (i.e. superposition): Multiple values at once

This means, that unlike the classical bit, qubits can leverage quantum effects such as superposition to take on multiple values at once. This allows quantum computers to consider exponentially more possibilities before fetching a result. This is one of the reasons why quantum computations can solve a subset of complex problems at speeds that would embarrass classical computers (provided they could feel).

We can leverage quantum algorithms to do powerful computations, some of which include:

  • Shor's algorithm for factoring a single large number
  • Grover search algorithm for searching a large data set such as an unordered list

For an interactive quiz, check out our original post on the Educative blog.

Why learn quantum computing?

Many companies have been trying to prove quantum supremacy, the notion that a quantum computer can solve problems that classical computers can't solve in a reasonable computation time. While quantum computers have outclassed classical computers in some cases, they'll never be faster than classical computers for all cases.

However, there are still immense benefits to learning quantum computing. With quantum computers more accessible than ever before, it's never been a better time to get involved in the field.

Quantum computing use cases can be found across various disciplines, including:

  • Cryptography: Breaking encryption at devastating speeds
  • Physics: Creating simulations of real-world quantum systems
  • Machine learning and artificial intelligence: Helping machines learn faster with quantum computing

Wrapping up and next steps

At first, quantum computing may seem intimidating. However, you don't need to be a quantum physicist to get started. Now that you know a bit about the quantum mechanics behind quantum computing, you can start learning how to perform powerful quantum computations for various use cases.

If you're interested in the intersection of quantum computing and machine learning, check out our course: Hands-on Quantum Machine Learning with Python on Educative. This course covers the basics of quantum computing and machine learning, and will help you leverage Python to perform more powerful computations than ever before.

If machine learning isn't your thing, but quantum computing is, check out The Fundamentals of Quantum Computing. This course will help you get a strong foundation in quantum mechanics and computing.

Like this piece? Keep an eye out for our upcoming blog on key quantum computing concepts -- and scroll down to subscribe to our blog newsletter below!

Happy learning!

Continue learning about quantum computing on Educative

Start a discussion

What do you enjoy most about quantum computing? Was this article helpful? Let us know in the comments below!

Top comments (0)