This article on quantum computing is part of the **Science in Sci-fi, Fact in Fantasy **blog series. Each week, we tackle one of the scientific or technological concepts pervasive in sci-fi (space travel, genetic engineering, artificial intelligence, etc.) with input from an expert.

Please **join the mailing list** to be notified every time new content is posted.

## The Expert: Dan Allen

Dan Allen is a physicist and principal architect at a Bay Area sensor chip maker. He has designed lasers for the government that see through envelopes and (eek!) clothing, lit a three-story electron accelerator on fire, and created nanoparticles in a radioactive hot lab.

He is dad to his five children and husband to his drummer artist wife. You should check out his blog and follow him on Twitter.

## Quantum Computing and Cryptography, Part 1

To understand the basics of quantum computing and quantum cryptography, we need to do a quick dive into the pool of wave mechanics. Then we need to wrap our heads around quantum mechanics—an extension of wave mechanics. Then we get to entanglement and quantum information. We’ll cover all of that in this post.

Then, in my next installment, we will take a walk on the weird side and show how to use it all to do some things that seem like they should be impossible, from searching more items than search queries, to always guessing the prime factors of large number, and sending codes that can’t be intercepted.

It all starts with waves.

**Wave Mechanics**

Video tutorial: https://youtu.be/i3MQxl8CSyI

Waves can be described in two different ways, either by their wave amplitudes at various places or by the frequencies that make up the wave. For example, you can view a wave on an oscilloscope—wavy lines that sometimes show on media players, or you can view a wave on your stereo’s channel equalizer with light-up bars that show whether the sounds have a lot of bass or treble. These two ways of representing the waves are both valid—in fact they define each other.

For some types of waves, like a tsunami, the position of the wave is pretty well-defined—you’ll know when it hits you. A reporter, trying to be clever, might ask a scientist “what was the frequency of the tsunami?” It turns out, the question is rather irrelevant, so the answer isn’t very useful. A tsunami is made up of a whole range of frequencies.

For other kinds of waves, like a radio wave, the wave goes on for a long distance, but it has a well-defined frequency. Someone might ask, “where is the radio wave?” Well it’s everywhere pretty much. This question, too, is rather irrelevant.

Rather than call it something non-mysterious like “the irrelevancy principle”, physicists use the word “uncertainty principle” to describe the way a wave can either be well-defined in its position or its frequency, but not both. Properties which take turns being relevant in different situations are called “non-commuting variables”—and they are really important in quantum mechanics (and your life—oh, you don’t believe me? –just keep reading).

This dual-nature is fundamental to all waves: many waves put end-to-end define a single frequency, and many frequencies summed together make a single wave. **And it isn’t mysterious at all!** You encounter these kinds of non-commuting variables in everyday life.

For example a single event, such as getting dumped, losing your job, discovering a half-eaten sandwich in the fridge, etc. may have many emotions associated with it. If you are in a relationship and get dumped you might feel angry, betrayed, let down, confused, and relieved all at the same time. To isolate a single emotion (such as being depressed) takes a series of events. So one event is defined by a collection of emotions. And one emotion is defined by a series of events.

Consider investing in the stock market. A single stock has a whole gamut of risks or sensitivities. One stock might be sensitive to the strength of the dollar, political stability in Africa, and the price of rice in China. Hedge fund managers put together a portfolio of stocks that cancel out other sensitivities to isolate a particular risk. Stocks and their risk factors are non-commuting variables. There is an uncertainty there. If a stock goes down, we can’t say why. But if a whole set of stocks goes down, we can resolve the cause.

People and the shirts in their closets, individual notes and the chords in different keys in music—there are all kinds of examples of non-commuting variables. So now that we have a basic understanding of wave mechanics, we can apply waves to matter.

**Quantum wave mechanics**

In the first half of the twentieth century, building on the work of Bohr’s discrete energy levels in atoms and Einstein’s discrete packets of light energy called photons, Erwin Schrödinger came up with a very interesting equation that radically changed science and helped us unlock the secrets of the atom, build lasers and begin to develop nanotechnology.

**Editor’s note**: see Dan’s excellent article on writing nanotechnology.

Schrödinger’s equation looks similar to wave equations that describe radio waves or waves in your bath tub, but one side of the equation is imaginary. That means it only becomes “real” or observable when you square it. The imaginary part of each wave is a “phase”. We can’t observe phase directly, but we can see what happens when the phase of two waves differs. We get interference. Schrödinger’s equation predicted that matter would diffract and interfere with itself, and light, too—just like waves.

But wait. Electrons, protons, neutrons, photons—they are all solid chunks of matter (particles), right? Or, are they waves? Or are they both?

Most teachers do a terrible job of explaining this so-called “wave-particle” duality. So let’s cut to the chase.

**Fact: Particles don’t move **

We are used to thinking of electrons, protons, neutrons, photons, molecules, etc. as being like little billiard balls that bounce around. Just let that idea go. Particles don’t move–period. So what is a particle then? A particle is just the collection all the different measurable quantities of a wave that we can discover. Those properties might include momentum and position (noncommuting variables), energy state or time in a state (also noncommuting variables), mass, charge, a kind of magnetization called “spin”, and so on.

Each matter wave, such as an electron, has a fixed amount of mass and charge. That wave propagates, splits, interferes, diffracts and does all the things we are used to seeing waves do in the bath tub or in the ocean. Where the wave amplitude is large, there is a better chance of actually discovering, or measuring, the properties of the wave. It’s purely statistical. We have to take the square of a wave function to get the probability distribution. The electron “orbitals” you may have seen in a chemistry textbook are simply the standing waves electrons form around a nucleus.

Again, let me repeat the thing your teacher never explained: Particles don’t propagate.

**Fact: Quantum wave functions move. **

Quantum wave functions have a phase and an amplitude and a unit or “quantum” of properties that are measurable. Those wave functions respond to forces like the push of an electric or magnetic field and in certain high energy or large mass limits behave just a billiard ball would. On the other hand, at slow speeds or very low masses, they act just like waves.

Some quantum wave functions, like the standing waves around an atom, have a limited number of possibilities. A even simpler case is the “spin” of an electron. In a magnetic field electrons can either be “spin-up” or “spin-down” (like heads or tails). In fact, since the states obey wave mechanics (superposition principle), we can add two waves/states together. What does that mean? It means the electron can have some probability of being in both states. The trick is, the electron doesn’t know which it is. The only way to find out is to somehow interact with it.

Weird? Well, it’s more familiar than you think.

**Dating and Quantum Feedback**

Consider a typical guy, “Bob”. He likes a girl, “Alice”. They went on a date and now Bob wants to know if Alice likes him. (Alice really doesn’t know whether she likes Bob.) If Bob forces a “define the relationship” (DTR) talk, he has some probability of getting a negative or a positive response. Those two answers comprise the “emotion” basis.

Asking a question is an interaction that extracts information from the system. When Bob forces the issue, Alice will suddenly “collapse” into one state or the other and (most likely) decide she just doesn’t like him. The same thing could happen after watching a chic flick with her friends, reading her journal, or a long chat with her mom. She might suddenly realize she loves him, or that she can’t stand him.

Whenever a quantum mechanical state interacts with the environment in such a way that information escapes, the state “collapses”. It has been measured.

If Bob wasn’t such an idiot, instead of asking Alice whether she likes him, he could have asked a question in a different basis—like measuring a vector along a different axis. Recall that events and emotions are non-commuting variables. So asking about events won’t completely measure her emotions. Bob can make a partial measurement of Alice’s emotional state by asking whether she had a nice time on their date. That answer has some overlap with her emotional state and some overlap with the event. By alternately measuring and providing interactions through additional events, Bob can provide “optimal quantum feedback”, or in social circles “emotional intelligence” to guide the relationship toward a desired outcome: either a positive emotional state or a negative emotional state.

Unfortunately, Bob is not a dating master and had a DTR with Alice after the first date. Alice told him she wasn’t ready for commitment and made herself generally unavailable. Sorry, Bob—you should have learned quantum mechanics before dating.

**Interference**

Video tutorial: https://youtu.be/AZ-RKouvuFM

One fun trick to play on people who aren’t sure which state they are in is to interfere them with themselves (like having Alice read her own journal after varied time delays and watching her flip-flop on her opinion of Bob).

Imagine sending atoms into a vacuum chamber and shining a light from the side. We shine a light pulse just long enough that half of the time the atom will absorb the photon (quantum of light) momentum, push an electron to a higher energy orbital, and recoil. The other half of the time it doesn’t absorb the light and continues straight ahead. Now we have two beams. But remember the atoms are not particles that move. That atoms are waves. And waves, in fact, split quite nicely. So part of the wave (the part that thinks it absorbed the photon) is headed away at an angle, and the other part of the wave continues ahead like nothing happened.

Yes, we literally just split an atom’s wave function. What does that mean? It means we have a chance of finding the atom along either path. Then you give each atom a full pulse so they recoil towards each other and what shows up on the screen? You guessed it, an interference pattern that looks just like a wave passing through two openings in a breakwater.

The atom’s wave interferes with itself so that its probability of ending up at some places on the screen is zero and other places is high. There are some places the atoms just can’t be found.

We can do it with molecules, too, and even Buckyballs that contain 60 carbon atoms! The trick is keeping the world from having any kind of interaction that would leak out information. For instance, if we put a detector in one path we have forced at DTR talk with the atom by asking it which way did you go? The wave function collapses into one state or the other and the interference pattern is obviously destroyed. Coherence in the wave—not messing up the wave’s phase—is key.

**Entanglement**

If we have two containers of water, one empty and one full and then connect them water from the high side flows out into the other container, then it sloshes back and forth and so on, until friction slows down the sloshing. The bigger of a tube we use to connect the containers, the faster the sloshing.

In quantum mechanics, when we have two atoms, one in an excited state and the other in a “ground” state, we can turn on an interaction between them—essentially open a gate so they can share energy. After a certain amount of time, one atom will have decayed and the other one will have become excited. They swap.

So what happens if we only let them interact for long enough that they have equal probability of being up or down? It turns out that in this case, so long as we haven’t extracted any information, they are both up and both down. If we measure one and it turns out to be up, the other one is ALWAYS down—even if it is on the other side of the universe. This weirded Einstein out. “How are they secretly arranging with each other ‘under the table’?”

Einstein, Podolsky and Rosen proposed this paradox which was later refined by Bell into a set of inequalities that would allow one to actually prove whether the electrons or atoms knew ahead of time which they were going to be. It turned out Einstein was wrong for once and quantum waves do have this “sixth sense” that allows them to share information through a statistical back channel—always agreeing on their respective states.

So what can we do with this really interesting idea? Stay tuned for my next post: Quantum Computing and Quantum Cryptograpy: Part 2, where we learn how to use quantum information to pass codes that can’t be intercepted and crack secure codes based on prime factorization.

Please share this article:Follow me and you'll never miss a post:

Roxanne says

Great article. Explaining quantum entanglement in a simplistic way is a true feat! Nicely done.

Rose says

Fantastic! Well and clearly explained without being over-simplified. I’m going to head over and read part two immediately.

Also, I will definitely be using “can I get some quantum feedback from you?” whenever I ask someone a question.