DEV Community

Cover image for Beginners guide to quantum computers
Anjan Shomooder
Anjan Shomooder

Posted on

Beginners guide to quantum computers

Quantum computers are machines that use the properties of quantum physics to store data and perform computations. This can be extremely advantageous for certain tasks where they could vastly outperform even our best supercomputers.

In this blog, I will try to explain quantum computers from a perspective of a person who knows very little about physics.

I will explain:

  • Why do quantum computers exist?
  • How does quantum computer works abstractly?


I am not a physicist or studying science at a university. But I want to learn more about physics especially quantum physics. I have a passion for quantum computers. So, I am trying to learn about physics and quantum computers. I have a basic understanding of how a quantum computer works. Though I am not 100% correct or accurate, I will still try to explain it to you. I might be wrong but that's fine. Please let me know if I make any mistakes.

Why do quantum computers exist?

We know classical computers have completely changed our world and have enabled us a lot of opportunities. Our modern computers are super fast. They can finish a lot of tasks in a short amount of time.
But even the most powerful supercomputers are not fast enough for large problems. They can solve the smaller version of the problem.

What sort of problems can not be solved by a classical computer?

The answer is an Exponential problem or when the size of the problem goes bigger and bigger very quickly. We can divide them into two categories.

  • Optimization
  • Chemistry


For example, there are 10 chairs and 10 people in the room. How many ways you can uniquely organize the people?

The answer is 10 factorial (10!)

10! === 3628800
Enter fullscreen mode Exit fullscreen mode

That is a giant number. Number 10 is small but 10 factorial(10!) is an enormous number. Trying out all possible solutions will need a huge amount of computation power.

But you might say that supercomputers can handle this kind of operation. So. let's add another chair.

Now, the answer is 11 factorial (11!)

10! === 3628800
11! === 39916800
Enter fullscreen mode Exit fullscreen mode
Have you noticed the growth of the problem?

We have just increased the problem size by 1.

Let's add more.

Total chair Total ways to organize
10 3628800
11 39916800
12 479001600
13 6227020800
14 87178291200
15 1.3076744e+12

Image description

You can see that it is growing very rapidly and even our fastest supercomputer will fall quickly.


Image description

On the bottom, you can see some molecules. They are not much complicated. The left molecule is the biggest molecule that our fastest supercomputer can simulate. Because when you add another atom to the molecule, the problem grows exponentially.

Let me give you another example.

Let's take a look at a binary tree.

Binary trees with number of nodes in a level
If you don't know anything about Binary trees you can learn it from my blog

In a binary tree, every parent can have at most 2 children.

The maximum number of nodes on every level is 2^l where l is the level number.

The number of nodes grows exponentially like this:

Level Total Node
0 1
1 2
2 4
3 8
4 16
5 32
6 64
7 128
8 256
10 1024
15 32768
20 1048576
25 33554432
35 34359738368
50 1.1258999e+15

Let's see how our computer will handle this.

A computer works with bits. A bit has to be either 0 or 1. To visit a node we need 1 bit.

  • To visit 0 the level you need 1 bit.
  • For level 1 you need 2 bits. And it grows like this.
Level Total Node Total bit
0 1 1
1 2 2
2 4 4
3 8 8
4 16 16
5 32 32
6 64 64
7 128 128
8 256 256
10 1024 1024
15 32768 32768
20 1048576 1048576
25 33554432 33554432
35 34359738368 34359738368
50 1.1258999e+15 1.1258999e+15

So, to visit all the nodes in a level you need 2^l amount of bits where l is the level number.

You can see that quickly we will run out of our computational power. So,

How can we solve the problem?

Quantum computers can solve this for us. Let's create a new type of bit and call it a Qubit.
A classical bit has to be either 0 or 1. But our qubit is neither 0 nor 1. Qubits are at the superposition of 0 and 1.

Qubit Superposition simply means a qubit is both 0 and 1 at the same time. Now, I know it sounds bizarre but that's how quantum mechanics works. It works with uncertainty.

Image description

So, with the superposition, we can visit two children at the same time and we are only going to be needed only 1 qubit. So,

  • for level 0 we need 1 qubit to visit one node.
  • 1 qubit again for level 1 to visit 2 nodes.
  • Level 2 will need 2 qubits to visit 4 nodes.
  • Level 3 will need 3 qubits to visit 8nodes.

And it grows linearly like this:

Level Total Node Total bit Total Qubits
0 1 1 1
1 2 2 1
2 4 4 2
3 8 8 3
4 16 16 4
5 32 32 5
6 64 64 6
7 128 128 7
8 256 256 8
10 1024 1024 10
15 32768 32768 15
20 1048576 1048576 20
25 33554432 33554432 25
35 34359738368 34359738368 35
50 1.1258999e+15 1.1258999e+15 50

So, we only need l amount qubits where l is the number of nodes.
You can see that how quantum computers can be super fast than classical computers. And it is not just qubits, we have to use quantum entanglement.

Quantum entanglement is a very hard concept and I don't even understand it correctly.

Image description
Image description

Entanglement means connected. If two quantum particles, for example, electrons are entangled or you can say connected, they can communicate with each other instantly like there is no space between them. Even if one particle is on earth another particle is on another galaxy.

If we have two qubits entangled, then one qubit will communicate to the next qubit and will tell what to do. I don't understand how entanglement will be used in quantum computers but it is needed.

So, this is very clear that quantum computer will be really fast and it will revolutionize our world.


Why haven't we built it?

Well, building a quantum computer is not easy. It has several problems.
For example, to make the qubits work you need to make the temperature 0.015 kelvin which is colder than outer space. That is hard to build and very expensive.

But a lot of company has started their mission like Google, IBM, Intel, and many other companies. And they have earned a lot of success.

When will we have a quantum computer on our desk?

Well, not so fast. It might take decades. Or maybe in the next decade. Who knows what happens in the future. So, we have to wait. And as a developer, you need to be prepared for that. Because

Quantum computers are the future.

So that's all I know about quantum computers. I am always happy to share my knowledge. Please let me know if I have made any mistakes.

Shameless Plug

I have made a video about how to build a carousel postcard with React, Material-UI, and Swiper.js.
If you are interested you can check the video.

You can also demo the application form here

Screenshot of Insta Carousel

Please like and subscribe to Cules Coding. It motivates me to create more content like this.

If you have any questions, please comment down below.
You can reach out to me on social media as @thatanjan .
Stay safe. Goodbye.

About me

Why do I do what I do?

The Internet has revolutionized our life. I want to make the internet more beautiful and useful.

What do I do?

I ended up being a full-stack software engineer.

What can I do?

I can develop complex full-stack web applications like social media applications or e-commerce sites.

What have I done?

I have developed a social media application called Confession. The goal of this application is to help people overcome their imposter syndrome by sharing our failure stories.
Alt Text

I also love to share my knowledge. So, I run a youtube channel called Cules Coding where I teach people full-stack web development, data structure algorithms, and many more. So, Subscribe to Cules Coding so that you don't miss the cool stuff.

Want to work with me?

I am looking for a team where I can show my ambition and passion and produce great value for them.
Contact me through my email or any social media as @thatanjan . I would be happy to have a touch with you.


Blogs you might want to read:

Videos might you might want to watch:

Discussion (2)

ashokraju105605 profile image

quantum entanglement is used for sending data securely and with zero transmit delay.
and data cannot be snooped. which is why people are more interested in pursuing this. quantum computing doesn't make our regular spread sheets, word documents any better. quantum computing only solves niche problems domains like cryptography which are based on the premise that some problems cannot be solved quickly , like one way cryptographic functions,

thatanjan profile image
Anjan Shomooder Author

Hey, thank you very much for the information.
I agree with you. Things like Microsoft word is fast enough for us. We only need quantum computer for larger problems