QT or Quantum Teleportation is a fascinating physical phenomenon. Within a QC or Quantum Computer, think about it as a way to transport the information stored in qubits across registers. In theory, these registers could be lightyears apart, but as per today, we will jump only a few millimeters. Ok, space jump will likely remain in theory as we still need some traditional communication path to achieve QT as we will see later on.
From here on, you need to keep in mind a few concepts that may sound odd but will help you understand today’s topic. First, a qubit stores a lot more information than a classic bit. In addition to the binary information, it encodes virtually an infinite amount of analog information in its amplitude (magnitude and phase). Which, alongside superposition and entanglement fuels the power of quantum computers.
This is why we want to encode into our quantum registers the representation of all the solutions to the problem we try to solve at once. It is as if we could, instead of one unique 64-bit value, store 18,446,744,073,709,551,616 values at the same time in a REAX register. Cool isn’t it? Therefore, with relatively small registers (a few qubits), we can compute on a huge amount of solutions, all at the same time. The problem is, that when we READ a register to access a solution of the computation, it screws it all up, and we lose all the other solutions. As a consequence, the more computation you do between READs, the better you leverage your QC. If you ever wrote SIMD routines in assembler or using compiler intrinsics, it is similar to the technique of hiding the load and store latencies, by maximizing vector computations between memory accesses. Sometimes, the cost of these loads/stores vs. vector processing is so high that it is worthless even trying, and we revert to scalar computation.
The same applies to QC: if you READ, you lose! To make it a bit harder on us, there is one main directive we must follow when designing a quantum circuit: it has to be reversible. What does it mean? Simply that any gate sequence you compose, must be reversible. At any time, you must be able to rewind the computation. This is counter-intuitive if you did classic designs because you are generally unable – and not really interested in –, knowing the inputs’ state of a gate knowing its output. Which input of an OR gate was true if the output is true? There is another big corollary to the destructive nature of reading in QC: you cannot copy quantum information the same way you do with a classic computer. This means, that you cannot perform something like q[4] = q[0]. Not possible. Forget about it. This is why planet Klendathu must be destroyed … Oops, sorry, wrong movie. This is why we need to transport the state of a qubit into another using QT. By the way, once we are done teleporting, the state of the original qubit is gone, gonesky!
Let’s teleport a qubit, shall we? The simplest circuit to do so has three qubits, the source (q[0]), the teleporter (q[2]) – shared between emitter and receiver –, and the destination (q[4]). Note that you can use any of the IBM Quantum Experience backend with at least five qubits (I used ibmq_essex and ibmq_burlington), or a simulator.
The teleportation relies upon entangling (using HAD [Hadamard] and CNOT gates to respectively superpose and entangle) the source with the teleporter and the teleporter with the destination.
h q[2]; // HAD cx q[2],q[4]; // CNOT
Once the source encodes the juicy information to teleport, the emitter teleports the information by applying a CNOT and a HAD between q[0] and q[2], and reads q[0] and q[2].
h q[0]; // HAD h q[2]; // HAD cx q[2],q[0]; // CNOT h q[2]; measure q[0] -> c[0]; measure q[2] -> c[2];
This of course irremediably destroys the information in q[0] and q[2], but the magic of entanglement makes it readily available in the q[4]. FYI, Albert Einstein famously described entanglement as spooky action at a distance. So, no worries if you think that all this doesn’t make any sense. You are not alone.
Nonetheless, at this point, we want to know the juicy information we just received (and likely do something useful with it). As always, the problem is in the readout. Remember when at the beginning I mentioned that we still need some classic data transmission mechanism to do QT? This is where the output of the READ operations the emitter performed is needed (c[0] and c[2]). Indeed, we may have to apply a HAD and a phase change to select the right result in q[4]. These operations must be applied if the result of the reads we received in a classic way is true. Et voila! But, because the IBM chip doesn’t allow such conditional operations, both are applied and only the correct results are kept. This remembers me of the use of the predicate registers in the EPIC architecture of the Itanium processors, where it is sometimes cheaper to compute simultaneously the two branches of a test, and then, in the end, use a predicate register to keep the right branch and discard the wrong one.
Intel Horse Ridge, the new cryogenic control chip.