# Understanding quantum computing through the random walk of drunken people

Quantum computing is the biggest revolution in computing since … computing. Our world consists of quantum information, but we perceive the world as classical information. That is, a lot is happening on a small scale beyond the reach of our normal senses. As humans, we have evolved to process classical information, not quantum information: our brains are programmed to think about saber-toothed cats, not Schrödinger’s cats. We can easily encode our classical information with zeros and ones, but what about accessing the additional available information that makes up our universe? Can we use the quantum nature of reality to process information? Of course, otherwise we would have to end this post here, and that would not satisfy us all. Let’s explore the possibilities of quantum computing and then start writing our own quantum code.

The starting point for studying quantum computing is to understand that while many principles are contrary to common sense, the classical universe that we know and love is just a shadow of the quantum fabric of reality. Part of getting used to a quantum is getting used to the limitations of our own perception. This limitation is similar to drawing a 3D object on a 2D piece of paper. Take a look at the wireframe below. It can be either a box (we can illustrate this with a glass on top), an angle (we can place the bottle inside so we can see the angle).

We are forced to see either one or the other, and not both at the same time. We can swap them back and forth, but since we’re stuck in a 2D view, we can only see one or the other. Two dimensions are not enough to perfectly represent a three-dimensional object. In the same way, the world of classical information in its simplest coding is represented in bits, zeros and ones. However, this is not enough to describe the quantum world. In the quantum world, we need quantum bits or qubits to describe our information. Just like putting a drink on a box or in a corner, we can take a measurement that will make our qubit tell us a classic beat, but there is more information that we can use.

Quantum computers will use the rest of the information to achieve more processing power. It will change everything in applications in pharmaceuticals, new green materials, logistics, finance, big data and more. For example, quantum computing will better calculate the energy of molecules because it is fundamentally a quantum problem. So, if you can imagine the molecular industry, you can imagine the application of quantum computing. Often times, people want to know if quantum computers will be faster, and while they can perform computations faster, this is not because they are doing the same thing with a lot of cycles. Instead, quantum computers use a fundamentally different way of processing information. To get a feel for this fundamental difference, we’ll look at an example that helps illustrate the power of quantum computing.

### Meet the quantum drunkard

Let’s do a thought experiment. In the classic drunken walk (sometimes called a casual walk) we have a drunk who comes out of the closet and tries to find his friend at the bar.

Everyone looks the same in the bar, our drunkard has drunk too much, so he walks up to a random person sitting at the bar. When he discovers that the first person he disturbed is not his friend, he randomly moves to the next stool, either to the left or to the right. We can simulate our drunken walker by tossing a coin and saying that if heads come out, he will go to the right, if tails – to the left.

The next person will also not be the desired friend, but the memory of our drunkard is short, so he will move left or right with equal probability. This will continue until security is called to drive him out.

The security service loves physics, so they decided each time to figure out where to finally catch up with a drunk person. Here’s what the security service sees:

The shape is bell-shaped, and an interesting feature of the bell-shaped curve is that the spread in the middle (the most likely place to find a drunkard) is the square root of the number of steps a drunken walker takes. When the drunkard passes nine bar stools, the spread of the curve is three; security will probably find them within three barstools of where the drunkard originally sat. When the drunkard makes 100 attempts, security will most likely find the drunkard within 10 stools of where the drunk started. These statistics help security forces know where they are most likely to find the drunk walker, which is somewhere near the starting point.

Security now has a model they can use to keep up with classic drunks, but unfortunately there are also quantum drunks in this bar. Whereas the classic drunkard is a simple toss of a coin for each direction, for the quantum drunkard the coin is quantum and can be in a superposition of heads and tails at the same time. The quantum drunkard follows a trajectory that is a superposition of the left and right steps of each bar stool.

Superposition is one of the fundamental concepts of quantum mechanics and one of the tools to distinguish between quantum information and classical information. For more fun with superpositions, read this post by Strangeworks some basics of qubits

The quantum drunkard will walk in a superposition of left and right at the same time without a specific location until security finds him.

When the security service looks at the distribution of positions where the quantum drunkard is, they find a completely different result from the classical drunkard.

In contrast to the smooth bell-shaped distribution, they will exhibit the canine distribution shown below:

What’s happening? Where is the quantum drunkard? Why should the distribution peaks be outside? Why are there areas inside with a very low probability and others with a higher probability? The quantum drunkard has new properties.

The drunkard tends to be farther from the center and less likely to be closer to the center. Some paths are less likely due to interference, and some are more likely. The overall spread is also very different. Rather than referring to the square root of the spread, the spread is linearly related to the number or steps. A quantum drunkard taking ten steps is likely to be found on the outside of ten bar stools, as wide as the distribution of a classic drunkard taking 100 steps.

So how can we use this to our advantage? Is there a problem we can solve better with quantum drunks than with classical drunks? Well, I’m glad you asked, because yes there is! To verify this, we are going to put the drunks on the passage of the maze. We choose a specific maze that will demonstrate the power of quantum drunks. In this task, we have a tree structure that is mirrored and then glued together.

On the left is the entrance to the labyrinth, and on the right is the exit. We want to see how well our drunken walkers find their way out. Remember that the classic drunkard will flip a coin at every node, while the quantum drunkard will create a superposition of every path at every node. Drunkards tend to get stuck at random spots in the middle and take longer to find their way out.

Since quantum drunks are more common, it is easier for them to avoid getting stuck. This is why quantum drunks find their way out faster than classical drunks.

As we send more and more drunks out, quantum ones will handle this problem exponentially better than classical ones!

This is the power of quantum computing. Even though this is a simple example, all quantum algorithms work in the same way: by means of using quantum spread in clever ways that fit the structure of the problem. There are many applications for quantum algorithms, so now is the time to start learning quantum programming.

In the near future, the best applications will be the development of pharmaceuticals and the development of new materials. Many of these applications in chemistry are fundamentally quantum mechanical. This is because calculating the electron energy for different molecules is more efficient using a quantum computer. Optimization issues are another area where quantum computing will have an impact in the not too distant future. This class of logistics concerns includes optimizing storage (hello FedEx, give us a call) or distribution of goods such as vaccines. Financial risk management can be carried out using similar algorithms. In addition, technologies exist to create a quantum Internet that will replace some of our cryptographic systems to ensure privacy and security.

### Start programming quantum computers

You can get started with quantum computing right now (without getting drunk with quantum drunkenness or challenging a classic alcoholic to a maze race)! At Strangeworks, we’re lowering the barriers to programming quantum computing so you can be part of this exciting open source community. You can explore our ever-growing library of content, or create your own as a member of the Strangeworks community. You can run the code right here, without installation, and see the result. Explore many different quantum programming languages ​​and platforms.

Here are some great starting points:

Play around with the code for simplified quantum random walk

This post details how to encode a four-node quantum random pedestrian. Starting with a simplified task will help you get started writing quantum code right away without the big overhead of the complexity of the problem. The insight that you will have from this post will be enough to make sense of what is happening, while the actual code and description of the quantum circuit will acquaint you with the minutest details of creating programs for quantum computers.

Getting Started with the Strangeworks Platform

If you just want to dive into the world of quantum computing, there is nothing better than taking a tour of the Strangeworks platform Quantumcomputing.com. This guide is the ideal starting point for this new computing paradigm.

Our servers can be used for calculations.

Register using the link above or by clicking on the banner and get a 10% discount for the first month of renting a server of any configuration!