The real magic of quantum computing

By now you have read many articles on quantum computing. Congratulations. You know nothing about quantum computing.

There is a magician on stage. It’s tense. Maybe it’s a primetime TV show and the production value is super high. The celebrity judges look nervous. There is epic build up music as the magician calls their assistant on stage. The assistant climbs into a box that is covered with a velvet blanket. Why a blanket? I mean, isn’t the box good enough? What a pretentious as… forget it, I’m ruining this for myself. OK, so the assistant is in the box with their head and legs sticking out. What the fuck? Who made this box, anyway? Damn it, I’m doing it again. Then—oh shit—is that a saw? What’s going to happen with that? Fuck! No! The assistant’s been cut in half! And then the quantum computer outputs the answer. Wait, what? Where did the quantum computer come from? I don’t know—quantum computing is magic like that.

By now you have read many articles on quantum computing. Congratulations. You know nothing about quantum computing. I know what you are thinking: Whoa, Chris, I wasn’t ready for these truth bombs. Take it easy on us. But I see a problem and I just need to fix it. Or, more likely, call the rental agent to fix it.

You probably think that a qubit can represent a 0 and a 1 at the same time. Or, that quantum computing takes advantage of the strange ability of subatomic particles to exist in more than one state at any time. I can hardly fault you for that. After all, we expect Scientific American and WIRED to be fairly reputable sources. And, I’m not cherry picking here—these were the first two hits after the Wikipedia entry on a Google search of “What is quantum computing?” Nearly every popular account of quantum computing has this “0 and 1 at the same time” metaphor.

I say metaphor because it is certainly not literally true that the things involved in quantum computing—those qubits mentioned above—are 0 and 1 at the same time. Why? Well, for starters, 0 and 1 are defined to be mutually exclusive (that means it’s either one OR the other). Logically, 0 is defined as [NOT 1]. Then 0 AND 1 is equal to [NOT 1] AND 1, which is a false statement. “0 and 1 at the same time” just doesn’t make sense, and it’s false anyway. Next.

OK, so what’s the big deal? We all play fast and loose with words. Surely this little… let me stop you right there, because it gets worse. Much worse.

The Scientific American article linked above then deduces that, “This lets qubits conduct vast numbers of calculations at once, massively increasing computing speed and capacity.” That’s a pretty big logical leap, but I’d say it’s a correct one. Let’s break it down. First, if a qubit can be 0 and 1 at the same time then two qubits can be 00 and 01 and 10 and 11 at the same time. And three qubits can be 000 and 001 and 010 and 011 and 100 and 101 and 110 and 111 at the same time. And… well, you get the picture. Like mold on that organic bread you bought, exponential growth!

The number of possible ways to set some number of bits, say n of them, is 2n—a big number. If n = 300, 2300 is more than the number of atoms in the universe! Think about that. Flip a coin just 300 times and the number of possible ways they could land is unfathomable. And 300 qubits could be all of them at the same time. If you believe that, then it is easy to believe that quantum computers will just calculate every possible solution to your problem at once and pick the right answer. That would be magic. Alas, this is not how quantum computers work.

Lesson 1: don’t take a bad metaphor and draw your own simplistic conclusions from it.

Try this one out from Forbes: “A bit can be at either of the two poles of the sphere, but a qubit can exist at any point on the sphere.” Spot on. This is 100% accurate. But, wait! “So, this means that a computer using qubits can store an enormous amount of information and uses less energy doing so than a classical computer.” The fuck? No. In fact, a qubit cannot be used to store and retrieve more than 1 bit of data. Again, magic, but not how quantum computers work.

Lesson 2: don’t reduce an entire field to one idea and draw your own simplistic conclusions from it.

I can just imagine what you are thinking right now. OK hotshot, how would you explain quantum computing? I’m glad you asked. After bashing a bad analogy, I’m going to use another, better analogy. I like analogies—they are my favorite method of learning. Teaching by analogy is kind of like being in two places at the same time.

Alright, I’m going to tell you the correct analogy between quantum physics and magic. Let’s think about what a magic trick looks like abstractly. The magician, who is highly trained, spends a huge amount of time choreographing a mechanism which is then hidden from the audience. The show begins, the “magic” happens, and we are returned to reality with bafflement. If you are under 20, then you also take a selfie for the Insta #fuckyeahmagic.

Now here is what happens in a quantum computation. A quantum engineer, who is highly trained, spends a huge amount of time choreographing a mechanism which is then hidden from the audience. The show begins, quantum computation happens, and we are returned the answer to our problem. Tada! Quantum computation is magic. Selfie, Insta, #fuckyeahquantum.

Let’s dig into this a bit deeper, though. Why not uncover the quantum computer—open the box—to reveal the mechanism? Well, we can’t. If we “watch” the computation happen, we expose the quantum computer to an environment and this will break the computation. The kind of things a quantum computer needs to do requires complete isolation from the environment. Just like a magician’s trick, if we reveal the mechanism, the magic doesn’t happen.

OK, fine. The “magic” will be lost, but at least I could understand the mechanism, right? Sure, that’s right. But here’s the catch: a magician spends countless hours training and preparing for the trick. Knowing the mechanism doesn’t help you understand how to actually perform the trick. Nor does seeing that the mechanism of quantum computing is some complicated math actually help you understand how it works. And don’t over simplify it—we already know that doesn’t work.

Let’s look at the example of a sword swallowing illusionist. If you don’t know what I’m talking about, it’s exactly how it sounds—a person puts a sword the length of their torso in their mouth down to the handle. How one figures out they have a proclivity for this talent, I don’t want to know. But what’s the explanation? Don’t worry, I already googled it for you, and it’s simple: “the illusionist positions their head up so that his throat and stomach make a straight line.” Oh, is that it? I’m suddenly unimpressed. So now that you too know how to swallow a sword are you going to go and do it? I fucking doubt it. That would be stupid—about as stupid as reading a few sentence description of some “explanation” of quantum computing and then declaring you understand it.

Lesson 3: don’t place your analogy at the level of explanation—place it at the level of the phenomenon. Let your analogy do the work of explanation for you.

If you like figures, I have prepared a lovely summary for you.

Well there you go. Quantum computing isn’t magic, but it can put on a good show. You can learn about how to do the tricks yourself and even perform a few with a little more effort. I suggest starting with the IBM Quantum Experience. Or, start where the real magicians do with Quantum Computing for Babies 😂

Estimation… with quantum technology… using machine learning… on the blockchain

A snarky academic joke which might actually be interesting (but still a snarky joke).

Abstract

A device verification protocol using quantum technology, machine learning, and blockchain is outlined. The self-learning protocol, SKYNET, uses quantum resources to adaptively come to know itself. The data integrity is guaranteed with blockchain technology using the FelixBlochChain.

Introduction

You may have a problem. Maybe you’re interested in leveraging the new economy to maximize your B2B ROI in the mission-critical logistic sector. Maybe, like some of the administration at an unnamed university, you like to annoy your faculty with bullshit about innovation mindshare in the enterprise market. Or, maybe like me, you’d like to solve the problem of verifying the operation of a physical device. Whatever your problem, you know about the new tech hype: quantum, machine learning, and blockchain. Could one of these solve your problem? Could you really impress your boss by suggesting the use of one of these buzzwords? Yes. Yes, you can.

Here I will solve my problem using all the hype. This is the ultimate evolution of disruptive tech. Synergy of quantum and machine learning is already a hot topic1. But this is all in-the-box. Now maybe you thought I was going outside-the-box to quantum agent-based learning or quantum artificial intelligence—but, no! We go even deeper, looking into the box that was outside the box—the meta-box, as it were. This is where quantum self-learning sits. Self-learning is protocol wherein the quantum device itself comes to learn its own description. The protocol is called Self Knowing Yielding Nearly Extremal Targets (SKYNET). If that was hard to follow, it is depicted below.

hypebox
Inside the box is where the low hanging fruit lies—pip install tensorflow type stuff. Outside the box is true quantum learning, where a “quantum agent” lives. But even further outside-the-meta-box is this work, quantum self-learning—SKYNET.

Blockchain is the technology behind bitcoin2 and many internet scams. The core protocol was quickly realised to be applicable beyond digital currency and has been suggested to solve problems in health, logistics, bananas, and more. Here I introduce FelixBlochChain—a data ledger which stores runs of experimental outcomes (transactions) in blocks. The data chain is an immutable database and can easily be delocalised. As a way to solve the data integrity problem, this could be one of the few legitimate, non-scammy uses of blockchain. So, if you want to give me money for that, consider this the whitepaper.

Problem

 

99probs
Above: the conceptual problem. Below: the problem cast in its purest form using the formalism of quantum mechanics.

The problem is succinctly described above. Naively, it seems we desire a description of an unknown process. A complete description of such a process using traditional means is known as quantum process tomography in the physics community3. However, by applying some higher-order thinking, the envelope can be pushed and a quantum solution can be sought. Quantum process tomography is data-intensive and not scalable afterall.

The solution proposed is shown below. The paradigm shift is a reverse-datafication which breaks through the clutter of the data-overloaded quantum process tomography.

fuckyeahquantum
The proposed quantum-centric approach, called self-learning, wherein the device itself learns to know itself. Whoa. 

It might seem like performing a measurement of \{|\psi\rangle\!\langle \psi|, \mathbb I - |\psi\rangle\!\langle \psi|\} is the correct choice since this would certainly produce a deterministic outcome when V = U. However, there are many other unitaries which would do the same for a fixed choice of |\psi\rangle. One solution is to turn to repeating the experiment many times with a complete set of input states. However, this gets us nearly back to quantum process tomography—killing any advantage that might have been had with our quantum resource.

Solution

quantumintensifies
Schematic of the self-learning protocol, SKYNET. Notice me, Senpai!

This is addressed by drawing inspiration from ancilla-assisted quantum process tomography4. This is depicted above. Now the naive looking measurement, \{|\mathbb I\rangle\!\langle\mathbb I |, \mathbb I - |\mathbb I\rangle\!\langle \mathbb I|\}, is a viable choice as

|\langle\mathbb I |V^\dagger U \otimes \mathbb I |\mathbb I\rangle|^2 = |\langle V | U\rangle|^2,

where |U\rangle = U\otimes \mathbb I |\mathbb I\rangle. This is exactly the entanglement fidelity or channel fidelity5. Now, we have |\langle V | U\rangle| = 1 \Leftrightarrow U = V, and we’re in business.

Though |\langle V | U\rangle| is not accessible directly, it can be approximated with the estimator P(V) = \frac{n}{N}, where N is the number of trials and n is the number of successes. Clearly, \mathbb E[P(V)] = |\langle V | U\rangle|^2.

Thus, we are left with the following optimisation problem:
\min_{V} \mathbb E[P(V)] \label{eq:opt},

subject to V^\dagger V= \mathbb I. This is exactly the type of problem suitable for the gradient-free cousin of stochastic gradient ascent (of deep learning fame), called simultaneous perturbation stochastic approximation6. I’ll skip to the conclusion and give you the protocol. Each epoch consists of two experiments and a update rule:

V_{k+1} = V_{k} + \frac12\alpha_k \beta_k^{-1} (P(V+\beta_k \triangle_k) - P(V-\beta_k \triangle_k))\triangle_k.

Here V_0 is some arbitrary starting unitary (I chose \mathbb I). The gain sequences \alpha_k, \beta_k are chosen as prescribed by Spall6. The main advantage of this protocol is \triangle_k, which is a random direction in unitary-space. Each epoch, a random direction is chosen which guarantees an unbiased estimation of the gradient and avoids all the measurements necessary to estimation the exact gradient. As applied to the estimation of quantum gates, this can be seen as a generalisation of Self-guided quantum tomography7 beyond pure quantum states.

To ensure integrity of the data—to make sure I’m not lying, fudging the data, p-hacking, or post-selecting—a blochchain-based solution is implemented. In analogy with the original bitcoin proposal, each experimental datum is a transaction. After a set number of epochs, a block is added to the datachain. Since this is not implemented in a peer-to-peer network, I have the datachain—called FelixBlochChain—tweet the block hashes at @FelixBlochChain. This provides a timestamp and validation that the data taken was that used to produce the final result.

Results

results
SKYNET finds a description of its own process. Each N is a different number of bits per epoch. The shaded region is the interquartile range over 100 trials using a randomly selected “true” gate. The solid black lines are fits which suggest the expected 1/\sqrt{N} performance.

Speaking of final result, it seems SKYNET works quite well, as shown above. There is still much to do—but now that SKYNET is online, maybe that’s the least of our worries. In any case, go download the source8 and have fun!

Acknowledgements

The author thanks the quantum technology start-up community for inspiring this work. I probably shouldn’t say this was financially supported by ARC DE170100421.


  1. V. Dunjko and H. J. Briegel, Machine learning and artificial intelligence in the quantum domain, arXiv:1709.02779 (2017)
  2. N. Satoshi, Bitcoin: A peer-to-peer electronic cash system, (2008), bitcoin.org. 
  3. I. L. Chuang and M. A. Nielsen, Prescription for experimental determination of the dynamics of a quantum black box, Journal of Modern Optics 44, 2455 (1997)
  4. J. B. Altepeter, D. Branning, E. Jerey, T. C. Wei, P. G. Kwiat, R. T. Thew, J. L. O’Brien, M. A. Nielsen, and A. G. White, Ancilla-assisted quantum process tomography, Phys. Rev. Lett. 90, 193601 (2003)
  5. B. Schumacher, Sending quantum entanglement through noisy channels, arXiv:quant-ph/9604023 (1996)
  6. J. C. Spall, Multivariate stochastic approximation using a simultaneous perturbation gradient approximation, IEEE Transactions on Automatic Control 37, 332 (1992)
  7. C. Ferrie, Self-guided quantum tomography, Physical Review Letters 113, 190404 (2014)
  8. The source code for this work is available at https://gist.github.com/csferrie/1414515793de359744712c07584c6990

Milking a new theory of physics

For the first time, physicists have found a new fundamental state of cow, challenging the current standard model. Coined the cubic cow, the ground-breaking new discovery is already re-writing the rules of physics.

A team of physicists at Stanford and Harvard University have nothing to do with this but you are probably already impressed by the name drop. Dr. Chris Ferrie, who is currently between jobs, together with a team of his own children stumbled upon the discovery, which was recently published in Nature Communications*.

sphericalcow2
Image credit: Ingrid Kallick

The spherical theory of cow had stood unchallenged for over 50 yearsand even longer if a Russian physicist is reading this. The spherical cow theory led to many discoveries also based on O(3) symmetries. However, spherical cows have not proven practically useful from a technological perspective. “Spherical cows are prone to natural environmental errors, whereas our discovery digitizes the symmetry of cow,” Ferrie said.

Just as the digital computer has revolutionized computing technology, this new digital cow model could revolutionize innovation disrupting cross-industry ecosystems, or something.

Lead author Maxwell Ferrie already has far-reaching applications for the result. “I like dinosaurs,” he said. Notwithstanding these future aspirations, the team is sure to be milking this new theory for all its worth.

* Not really, but this dumping ground for failed hypesearch has a bar so low you might as well believe it.