Monday, 6 June 2016

11 - Anyons in the Toric Code

This is part of a project to get people involved with quantum error correction. See here for more info.

Previously in this series on quantum error correction, we looked at the toric code. This is a fairly simple quantum code for us to understand, but not so simple to actually build. Making a bunch of qubits and then using them as the icing on a doughnut would not be the easiest of things for experimentalists to do. They would be much happier if everything was flat. Fortunately, by flattening out the toric code we can get the so-called planar code, which is just as good (or half as good, depending on how you measure goodness).

But this post is not going to be about the planar code. First we will look at a nice story that can be told about these codes, that can help us understand them without needing to pore over all the little details. This is the story of anyons.

Rule-breakers in the toric code

The toric code is a bunch of qubits sitting on a grid. For each big white square in that grid, there is a rule. When errors happen, rules get broken. These traces left by the errors are what we use to find and correct them.

How exactly do errors cause broken rules? In the picture below, an error has happened on a single qubit: the one shown in red. This has caused two rules to be broken: those for the big white squares either side.



This happens wherever we get a single, isolated error. It always causes the two neighbouring rules to be broken.

What happens in more complicated examples, where some rules are already broken?

The rules state that the numbers around each big white square should add up to an even number. Every error flips the two neighbouring squares, from odd to even or even to odd. This means it flips the squares from being rule-obeyers to rule-breakers, or vice-versa.

So suppose another error happens around one of the rule-breaking squares from before.


The previously rule-breaking square now obeys the rules again. But another square is made to break the rules. So the new error has effectively moved the broken rule, from one place to a neighbouring place.

How about an error that happens between two rule-breakers? If an error flipped the pink 0 below to a 1, both of the rule-breaking squares will be be turned back into law-abiding citizens.


This is the exact opposite of when errors create a pair of rule-breakers. Here it effectively moves them together, causing them to cancel each other out.

Particles in real-life

As you probably already know, things are made out of atoms. And atoms are made out of protons, neutrons and electrons. And protons and neutrons are made out of quarks. So everything we know and love, like chips and stars, are made out of electrons and quarks. As far as we know, electrons and quarks aren't made out of anything. They are known as elementary particles.

Another important elementary particle is the photon. This is a particle of light. Unlike electrons and quarks, photons have no mass and no electric charge. They just zip around at the speed of light, hardly interacting with anything unless they bash into it. Then whatever they hit absorbs all their energy, and there's no more photon. This makes photons more like little blobs of energy than a 'proper' particle, like electrons and quarks are¹. You can't make chips out of photons!

The electron has a brother. An evil twin. The positron. If an electron and positron ever get too close too each other, they annihilate. All their mass and energy disappear in a burst of light.

The opposite can happen too. If a couple of pretty energetic photons meet, that energy can turn into an electron and a positron. This all might seem a bit like getting something from nothing. But because those two somethings add up to nothing, the universe seems to think it's okay.

The positron is the antiparticle of the electron, and the electron is the antiparticle of the positron. All particles have antiparticles. For some, like electrons and positrons, their antiparticle is a different type of particle. For others, the antiparticle is any other particle of their own kind. So if these ever meet a particle like themselves, they will instantly annihilate!

Rule-breakers as particles

So what have we seen so far? Broken rules in the toric code are created in pairs and can be moved around. If two are moved together, they cancel each other out and disappear.

Particles are also created in pairs, and can be moved around. If a particle and antiparticle are moved together, they cancel each other out and disappear.

So broken rules in a toric code behave a lot like particles. The antiparticle of a broken rule is simply another broken rule.

Of course, they are not 'real' particles in the same way that electrons (or even photons) are. They are examples something we call quasiparticles. They are just things that we can understand by telling the story they they are particles. They won't pop out of the toric code and start interacting with real-life electrons any more than Harry Potter will jump out of a book. But within their own little universe of the toric code, it makes perfect sense to think of them as particles.

Bosons, fermions, or something else?

All particles in our universe are either bosons or fermions. Electrons, positrons and quarks are fermions. Photons are bosons, as are Higgs bosons as I'm sure you won't be surprised to learn.

What about our rule-breakers? A little analysis shows them to be bosons, the most boring type of particle². But we should remember that the blue squares have rules too.


These are another kind of particle that live in the toric code. If we look at how the blue square rule-breakers play with the white square rule-breakers, we will find some strange things happening. Things that particles in our own universe never do. They aren't bosons or fermions. They are anyons!

But what is an anyon? That'll have to wait until next time.

Notes

1. I am making the distinction between electrons and photons here because it suits the story that I want to tell. For other stories, it is more suitable to think of them as equally 'proper'. So please forgive my racism against the gauge bosons.

2. Apologies again for my particle racism. I am in fact very appreciative of all that bosons do to mediate interactions in our universe.

Thursday, 19 May 2016

Quantum Error Correction: The Puzzle

Tutorial in 5 seconds!
  • Do a Z10 easy game.
  • Numbers appear in small groups.
  • Each adds up a multiple of 10.
  • Guess the groups.
  • Work out what numbers are in the ? squares.

Extended tutorial for the
10 Puzzles (
auch auf Deutsch verfügbar.)  
The puzzles are based on a grid with numbers in small groups. We need to get rid of the numbers. The best way is to push all numbers from the same group together. But how do we find the groups? For this we can use two facts: every group adds up to a multiple of 10 and the groups are normally small.

Here's an example.

Here it's easy to find the groups. There is an 8 and a 2 together. They are neighbours and add up to 10. So probably this pair is its own group. The 6 and 4 are also neighbours that add up to 10. The 9 and 1 aren't neighbours, but they are close to each other. Presumably they form a group too, and so on.


Here the groups are all shown in different colours.


Sometimes we'll make a mistake in finding these groups. Small errors aren't a problem, but how big is too big? How can we find out whether our method is good enough?


Here is the same number as before, but without two of the numbers. Instead of the top-left and bottom-right numbers, we have question marks.


What is the top-left number, hiding behind the question mark? Of course we already know that it's an 8. But it is still obvious even without that knowledge. The other numbers already have their own groups. Only the 2 is alone. It needs an 8 nearby, so the top-left must provide it. No numbers need the bottom-left, so it must be empty. 

To help you keep track of the groups, you can colour them yourself. Simply click on them to cycle through a range of colours. And when the different colours run out, it'll go through them again but in italics, allowing you to distinguish between over 20 different groups.

The Φ-Λ Puzzles 

The Φ-Λ puzzles are pretty much the same as 10. The only difference is that you get less information about the numbers.

The squares hold either a Φ or a Λ, which are the Greek letters Phi and Lambda. If you have a Λ, you know that that the square holds a 5. If it is a Φ, you only know that it is something else: a 1, 2, 3, 4, 6, 7, 8, or 9. So the puzzle above would instead look like this



You can do science!

Our puzzles take place in a quantum computer, which are unfortunately pretty noisy things. They have far too many errors to solve even the simplest of problems. But we can help them. We can find clues about the errors that have happened and work out where they are and how to get rid of them.

It's a quantum puzzle, but it's not a complicated one. You don't need a PhD to solve it. Anyone can help. So you can find a good method and share it with us. And you could win a prize in our competition.

For more information on the science behind our puzzles, as well as their sister games, see here. You can also check out our main website.

Credits

This blog and the puzzle were developed by me, Dr James Wootton. I'm a scientist at the University of Basel, where I do research on quantum error correction. The project is supported by the NCCR QSIT, which supports research on quantum technologies in Switzerland. See here for more information on the Decodoku project.

Monday, 9 May 2016

A couple of little things...

This is part of a project to get people involved with quantum error correction. See here for more info.

I won't have time for a proper post this week, but I'll give you something to keep you going.

As you may have heard, our game is not the only quantum game out there. There are other ways for you to contribute to quantum computation research, such as the great Quantum Moves game. I also recently gave a short talk about this. You can find the slides for this here.

Next week's post will introduce the wonderful world of anyons, which will give us some shortcuts in understanding the planar code. I gave a short talk on anyons a few weeks ago at FameLab in Basel. So if you want to get some idea of what they are about in only three minutes, check out the video here.

Wednesday, 20 April 2016

Fun measurements for pairs of qubits

This is part of a project to get people involved with quantum error correction. See here for more info.

If you have one qubit, you can do fun stuff. With two, you can do all that stuff twice. But you can also do more fun stuff, that's only possible with two. This can create entanglement: a special kind of correlation only possible for quantum objects. In this post we'll look at two qubit measurements that can create this valuable resource. Then in this post, we use them for teleportation.

You should probably familiarize yourself with one qubit before we move on to two. You can do that by checking out our post on the maths of qubits. Or you can also look at the summary at the beginning of the post with the teleportation.

Two qubits are better than one

Now we are up to speed with the maths of one qubit, lets move on to two.

Each qubit has two possible states: up and down. So two qubits have four possible states: both up, both down, the first one up and the second one down and vice-versa. Let's call these uu, dd, ud and du.

The state of a qubit can be any superposition of these four states. So it has what we'll call an uuness, a ddness, an udness and a duness. Some state T for two qubits can then be written

T = uuness x uu + udness x ud + duness x du + ddness x dd .

We can go through all the stuff about overlaps from the last post and find that, again

uunees2 + udness2 + duness2 + ddness2 = 1

And, again, these numbers turn out to be the probabilities that we get these results if we measure whether the two qubits are up or down.

We can also think of our two qubits as having the four states ll, lr, rl and rr, where l is left and r is right. Our state T can also be written using these.

T = llness x ll + lrness x lr + rlness x rl + rrness x rr

Describing two qubits as two qubits

Suppose we have a qubit, that we call qubit A. It is in a state we'll call SA. We also have qubit B in state SB.

SA = (upness of SA) x up + (downness of SA) x down
SB = (upness of SB) x up + (downness of SB) x down

What is the combined state of the two qubits? How do we combine the upness and downness of the two to get the uuness, etc?

Two options seem sensible. One is to add them.

uuness = upness of SA + upness of SB,   etc.

The other is to multiply them.

uuness = upness of SA x upness of SB,   etc.

We need only look at a one simple example to see which makes more sense. Suppose both qubits are in state up. So (upness of SA) = (upness of SA) = 1, and (downness of SA) = (downness of SA) = 0. It's clear then that the state of the two should be uu, because both are up. This means that the uuness should be 1, and the udness, duness and ddness should all be zero.

If we go by the adding method, we get

uuness = upness of SA + upness of SB = 2
udness = upness of SA + downness of SB = 1
duness = downness of SA + upness of SB = 1
ddness = downness of SA + downness of SB = 0

That's almost completely wrong. The uuness is too high, and the udness and duness are not zero when they should be. How about the multplying method?

uuness = upness of SA x upness of SB = 1
udness = upness of SA x downness of SB = 0
duness = downness of SA x upness of SB = 0
ddness = downness of SA x downness of SB = 0

This is completely right. So multiplying is definitely the way to do things.

Asking the right questions

If we want to measure our two qubits, we could ask them both if they are up or down. Or we could also then if they are left or right. Or we could ask one about up and down and the other about left or right. They are all valid options, but they are also pretty boring. Can we do something more interesting with two qubits than just a couple of single qubit measurements?

Measuring both the qubits tells us about both the qubits, obviously. But it also tells us
everything about them. Is there a way to measure the pair that only gives us a bit of information, and allows it to retain some air of mystery?

One possibility is to ask whether the state of the two qubits is the same, or different. But that's not yet a well defined question. Qubits can be thought of as being in the states up or down, or thought of as being in the states left and right. Which ones are we talking about?

First, let's use up and down. What we want is a measurement that tells us 'same' if it sees uu, dd or any superposition of them. And also, it should not give is any more information than that. For the state ud, du or any superposition thereof, we should similary get the result 'different'.
 

It's important to think about how a measurement like this might actually be possible. One way to do it is to get another qubit that is simply in the state up. Qubits like this are just to help us do other stuff are called ancillas. To do the measurement we get the first qubit to interact with the ancilla. This interaction should do nothing if the first qubit is up, but make the ancilla flip between the up and down states if the first qubit is down. Then we interact the second qubit with the ancilla in the same way.

If the pair of qubits is in the state uu, the interation won't have made the ancilla flip at all. If the state is dd, the ancilla will have flipped twice: from up to down, and then down to up again. Either way, the ancilla ends up in the state down. The same is true for a superposition of uu and dd.

 If the pair of qubits is the state ud, du or some superposition, the interactions will have caused the ancilla to flip exactly once. This means it'll end up in the state down rather than up. So by measuring the ancilla and seeing if it is up or down, we learn about whether our pair of qubits had the same or different up/down states.

What if we have the more general state

T = (uuness x uu + ddness x dd) + (udness x ud + duness x du) ?

This is a superposition of a part where everything is the same, and a part where everything is different. When we make the measurement, it must decide which to be.

Suppose the qubits decide to be the same. The state after measurement would then just be the bits that are consistent with that1
uuness x uu + ddness x dd

and for different, the state would become

udness x ud + duness x du

We'll be using this measurement a lot in this post, so we'd probably be better off giving it a name. Let's call it a ZZ measurement. Why? Well, we won't get into that. But its a nice name, so let's give it a go.

Another interesting question we could ask of two qubits is to look at whether they are left or right, and tell us if they are the same or different. That would then just be the same as the above, but with left and right. We'll call this an XX measurement.

Complementary and commuting measurements

If we have a single qubit, the measurement of whether it is up or down, and the measurement of whether it is left or right, do not play well with each other.

The only way to have a state that we are sure is going to have the result up for an up/down measurement is one with upness2 = 1. The ony way to always get right for a right/left measurement is to have a state with a rightness2 = 1. There is no superposition we can write down for which both is true, so no state can be certain to be both up and right.

Also, suppose we have a qubit in state up. If we do an up/down measurement, we will always get the result up. If we then do a right/left measurement, we will randomly get the result right or left. 

But suppose we did the right/left measurement first. We would again get a random result, and the state afterwards would be either left or right. Since both are a superposition of up and down, the following up/down measurement would also give a random result. So the results we get depend on the order in which we do the measurements.

Measurements like this, which block each others certainty and mess each others results up, are called complementary. It seems like an odd name, because they seem more likely to insult each other than complement. But that's nevertheless what they are called.

Some types of measurement do play together nicely. For example, with two qubits we could do an up/down measurement for both or we could do an ZZ measurement. Since both are based on whether qubit states are up or down, by preparing the states uu, ud, du or dd we can have definite outcomes for both measurements. Also, no matter what state we use, it won't matter which order we do them in.

Measurements that work like this are called commuting. This has nothing to do with how they travel to work. It's just a mathsy way of saying that the order doesn't matter.

ZZ and XX commute!

The ZZ measurement is built on a foundation of the up and down, and XX is built on a foundation of right and left. Since these are complementary, you'd probably expect ZZ and XX to be complementary too. But they aren't! They commute, and that commutation allows us to do some quantum magic.

If we want a state that is certain to come out with the answer 'same' when we make a ZZ measurement, its state will be

uuness x uu + ddness x dd

for some choice of the uuness and ddness.

For a state that is certain of getting the result 'same' for an XX measuremnt, the state will be

llness x ll + rrness x rr .

If I'm right that these measurements aren't complementary, there should exist a state that is certain of both. So there should be some choice of uuness, ddness, llness and rrness such that

uuness x uu + ddness x dd = llness x ll + rrness x rr .

Let's not do all the maths needed to solve this. Instead I'll just tell you the answer and we'll show that it's right. The state we need is the one with

uuness = ddness = llness = rrness = √½ .

Which means

½ x uu + √½ x dd = √½ x ll + √½ x rr = √½ x (uu + dd) = √½ x (ll + rr).

In this, the whole multplying by √½ thing turns out to be just something we need to do to make the probabiities work. The important thing is that

uu + dd = ll + rr .

To see if this is really true, let's rewrite the left hand side of the equation using the up and down states.

The state rr is the state of two qubits that are both in the right state. We need to write this as a superposition of ups and downs. The first step towards this is to remember how right itself can be written with up and down

right = √½ x up + √½ x down .

And we can also use what we found out earlier, about how uuness and so on can be calculated

uuness = upness of SA x upness of SB,   etc

With this we find that

uuness = √½ x √½ = ½,

and the same for udness, duness and ddness. So

rr = ½ x uu + ½ x ud + ½ x du + ½ x dd = ½ x (uu + ud + du + dd) .

Doing the same trick with ll means that we have to contend with a couple of minus signs, but in the end we get

ll = ½ x uu + (-½) x ud + (-½) x du + ½ x dd = ½ x (uu - ud - du + dd) .

So now lets add these up to see what rr + ll is

rr + ll = ½ x (uu + ud + du + dd + uu - ud - du + dd)
= ½ x ( 2 x uu + 2 x dd)
= uu + dd

See, its true! So the state

½ x uu + √½ x dd

Is exactly the same as the state

½ x ll + √½ x rr

They are just two different ways of writing the same thing. If we have this state S, and do an ZZ measurement, it'll look at the ups and downs and see they are the same. If we do an XX measurement, it'll also look at the lefts and rights and see they are the same. This state is sure of the answers to both. It's a special state which deserves a special name. We'll call it Φ, because Greek letters are cool.

It has three friends

Φ' = √½ x uu + (-√½) x dd = √½ x lr + √½ x rl
Ψ = √½ x ud + √½ x du√½ x ll + (-√½) x rr
Ψ' = √½ x ud + (-√½) x du√½ x lr + (-√½) x rl .

Φ' will always answer 'same' for a ZZ measurement but 'different' for XX, and so on. Both Ψ and Ψ' will answer 'different' for ZZ, but Ψ answers 'same' for XX and Ψ' answers 'different'.

All these states have correlations between the two qubits. With Φ, for example, if you look at either qubit on its own, they don't know whether to be up or down. But they do know that whenever one is up, the other is up too. And when one is down, so is the other. The left and right states are also correlated at the same time. This is a kind of correlation that only quantum systems can do. It's entanglement!

Footnotes
1. The udness and duness should also be divided by the square root of the probability of 'different', so that their squares add up to 1 again. But who can be bothered with that?