# The dirty secret these qubits don’t want you to know

## A gentle introduction to quantum tomography

This lecture was given as part of Quantum Computing Through Comics series on Hackaday organised by Kitty Yeung. Kitty has drawn an amazing comic summary of this lecture as well! The recording of this lecture is available on Kitty’s YouTube channel:

# Who are you?

You’ve done a bit of self-study. You’ve participated in quantum technology lectures. You’ve got an awesome certificate from Kitty — and had it printed on a mug! Maybe you’ve even implemented a quantum algorithm on a cloud-based quantum computer. By all accounts, you’re a quantum coder. That’s great, because I have a problem. Someone gave me this quantum device, but I have no way of proving it really is a quantum device or what it does! Can you help me?

# What’s wrong with this damn quantum computer?!

You’ve seen a circuit like this. Perhaps you recognise it.

Of course, yes, it is the teleportation circuit. Here is what the result of running this circuit should look like.

Have you tried to implement the teleportation circuit? While the abstract description of the circuit uses an arbitrary state |𝜓⟩, when we go to implement quantum teleportation, we need to know what state we want to teleport. Actually, at some point in the future, teleportation will occur where *no one *knows the state! But we’re not there yet.

So here is the result on the real quantum computer.

Oops. That’s not correct. What went wrong? Is it time to debug my code? No! Today quantum devices are *noisy*, meaning that errors happen on the computer chip when trying to execute the instructions given to it. So, is that it, do we just give up? No! We can help build and improve quantum computers *today*!

# You have 5 seconds to tell me the state of this qubit or the cat gets it! Or, maybe not — no one can know for sure

Characterising a quantum device is a gargantuan task — so we are going to simplify the problem a bit. Instead of asking for a full description of the device, we are just going to ask for the *state* at the beginning of operation — a task known as *quantum state tomography*.

Recall: |𝜓⟩ is called the *state* of the qubit. Like the state of a bit, which is only either 0 or 1, the state is *the *information. From a physical standpoint, the state is the complete description of the device at an instant in time. So, we would really like to know that. If we don’t know the state, we cannot create and manipulate information — meaning we can do quantum computation!

Now, you may also recall that determining quantum states is something you do all the time as a quantum programmer — your algorithm starts in the state |00000…⟩ and operators are performed to reach some final state |𝜓⟩ that contains the answer. Easy peasy. So what’s the big deal? Well, starting from a known state and then calculating what the state is, or will become, is the process of *deduction*. That is indeed an easy task — relatively speaking.

But the task of determining the state of your qubits *from scratch* is not deduction, and it requires a lot of work. In particular, it requires a lot of measurements. In an ideal world we would just look at the qubit and read |𝜓⟩, much like we could look at a bit *b *and read 0 or 1. You know however about the uncertainty principle and the fact that *reading* quantum data involves randomness and collapse. Before we get all quantum mystical about this, it’s useful to think about a simple classical analogy: guessing the bias of a coin.

# All’s fair in coins and qubits

Imagine you are going to bet on a coin toss. The first you probably want to do is confirm that it is a *fair* coin — that is, the probability of Heads is ½, 50:50, or 0.5. How would you do this? Beyond looking at it, the best you can do is start flipping it. So, suppose you flip it 10 times and it lands Heads 6 times. Is it a fair coin? Maybe. But, it could be slightly biased. How about if you flipped it 100 times and it landed Heads 60 times? A fair coin could certainly produce such a result, but only rarely. So, you still can’t be *certain *the coin is unfair. The point here is three fold:

- multiple trials are required;
- certainty is never obtained; and,
- there is no
*correct*answer for what the bias of the coin is.

Unlike *de*duction, statistical inference is the problem of *in*duction. The latter two conclusions also have led to endless philosophical debates about things as esoteric as what is the correct probability we should assign to the sun rising tomorrow, but we will not go there. Besides, I’m broadcasting from tomorrow, so you know it’s definitely coming.

The situation in quantum state tomography is very similar. When a qubit’s data is read, the only possible outcomes are 0 or 1 — it’s like a coin toss. This is codified in Holevo’s theorem, which states that *n *qubits can convey at most *n *bits of information. Physically, the idea is exemplified by a photon of light flying through space which smacks into a detector, a “click” is registered, and the photon is destroyed in the process.

From before, three things can be immediately deduced:

- many experiments must performed on identically prepared qubits in order to extract the
*quantum*data; - full infinite precision quantum data cannot be recovered with finite measurements; and,
- there is no
*correct*assignment of the state of a fresh qubit prepared in an identical way.

This is very different from everything we are used to when learning about, well, anything. We always presume when we are learning something, we are given the correct information. And this has not prepared us well to solve the *inverse problem* of quantum state tomography. But that is not going to stop us from going headlong into it!

# Let’s draw

Let’s start with a single qubit. Remember that a qubit can be written |𝜓⟩ = cos(𝜃/2)|0⟩ + exp(*i*𝜙) sin(𝜃/2)|1⟩, where 𝜃 and 𝜙 are the *Bloch angles*. Let’s ignore the *phase* 𝜙 so we can picture the state space as a circle, instead of a sphere — it’s much easier to draw.

The state of the qubit is unknown, but let’s pretend it is located at this point. The probability of obtaining outcome |0⟩ is the square magnitude of the coefficient in front of it, which in this case is cos(𝜃/2)². Measurements could never reveal this number exactly, but let’s pretend they could. The number tells us the distance the true state is to the |0⟩ state. Even so, there are as always two states an equal distance from it. So we need more measurements.

A measurement can be achieved by any pair of orthogonal states, like |0⟩ and |1⟩ of course. Symmetry inspires us to use the |+⟩ and |–⟩ states.

A measurement here tells us the distance to the |+⟩ state. These two pieces of information uniquely identify the state.

If we add back in the 3rd dimension, we get the Bloch sphere, and we’ll need a new kind of measurement to learn about this new parameter.

# Learn all the quantum data

That’s it for a single qubit. If we add more qubits, the dimensions increase exponentially. If *d* is the number of real numbers needed to specify the state, then roughly 2*d *unique measurements are needed to specify it.

As an aside, this should feel a bit uncomfortable. All we are trying to do is read some information. But, we seem to need exponentially many copies of it, and we need exponentially many different ways to look at it (measurements). Why bother at all? This is actually a deep question and it’s a curious thing that quantum data sits at a tipping point between immensely powerful and utterly useless. If the naively assumed power of quantum data — with its continuously infinite capacity to store numbers — was accessible, it would be way too powerful — everything we understand about computation, complexity, and indeed the universe would be turned upside down. So, it’s a good thing that quantum data has some restrictive qualities. It also presents an interesting challenge for those of us who are into that sort of thing 😉.

The state is the quantum data. To characterise what happens to the data is a much more difficult problem — it’s like having to do state tomography at every instant in time. On the other hand, supposing we just wanted to know how far the state is to the |0⟩, we just need that first computational basis measurement. So, there is an entire spectrum of ways to learn about quantum data. We can draw this spectrum like this.

The axes specifies at once both how difficult the task is and how much we learn about the quantum data system.

Filling in the details of this spectrum and figuring out how and when to apply these protocols are intensely active areas of research. One thing I only touched upon is the statistical aspect of the problem. It turns out that this is also very interesting! The structure of quantum mechanics provides an entirely new model of probability which can be studied from even more angles. The Institute of Mathematical Statistics (one of many governing bodies of academic statisticians) boasts 4,000 members alone, and some are already turning their eyes to the quantum.

# Back to the lab

Recall the messy results of my quantum teleportation circuit above. Clearly, the state wasn’t teleported. To learn what state was actually teleported we could use tomography! Of course, quantum state tomography is not enough to fully characterise this particular device. In the lab, they do much more. Sometimes you will find that the device is offline for “maintenance”. This involves an iterative procedure of the characterisation we’ve been discussing and calibration. When this is complete, some of the results are summarised and displayed as part of the service.

Eventually, end users of quantum technology will never even know tomography is happening — perfect operation will just be assumed. If anything goes wrong with your quantum computer, the most likely recommendation will unfortunately be “turn it off and turn it back on again after 10 seconds.”