Quantum nature of Devs

Is the Universe deterministic or is your destiny what you make it? When her boyfriend vanishes after starting a new job at the secretive Devs division of tech company Amaya, software engineer Lily (Sonoya Mizuno) begins to suspect that his disappearance may not be as clear-cut as it seems. Devs, the FX series, explores the world of Amaya and their quantum computing lab run by Forest (Nick Offerman) along with Katie (Alison Pill).

Lily (Sonoya Mizuno) in FX’s masterpiece Devs

The series was directed by Alex Garland, shot by Rob Hardy and the visual effects were supervised by Andrew Whitehurst.  The majority of the visual effects were created by DNEG in London. The show is both visually stunning and it embodies one of the most interesting plots on television. The show questions the nature of being through the plot device of a computer that can see into time through quantum computing.  But the series is far from standard time travel show.

The series digs deep into the nature of what fate is and how it is defined. DNEG has a long history in dealing with Sc-Fi content with respect and tremendous visual fidelity. Films such as Inception and Interstellar have gained the company both Oscars and genuine respect from the science community. They have done this by not talking down to audiences but instead producing material that truly serves the plot while extending the thematic range of the program. Devs adds to that remarkable body of work.

Director Alex Garland on set

In Devs, the onset golden quantum computer prop was a practical build and quite substantial, weighing approximately half a ton. The onset design referenced real Quantum computer systems from companies such as IBM, and Google, except in the real world, the ‘chandelier’ would be encased in a cooling box since most of the gold apparatus one sees is related to cooling the quantum computer not any actual computation. “It was massive, but all of that quantum computer is practical. That prop should now be in an art gallery. It was stunning,” says Whitehurst. The quantum computer’s “baroque art deco stuff is all cooling. When you look at a picture of a quantum computer, you’ve got this incredible chandelier -all of that’s cooling and the quantum computer is just a small chip at the very bottom. It’s inside a jar, inside a jar, inside the jar. But a small block with some wires coming out of it is not as visually arresting as a beautiful baroque industrial gold chandelier.” There are a few different ways to create a quantum computer. One method uses superconductivity to create and maintain a quantum state. To do this the computer must be kept very cold, normally using dilution refrigeration. Any heat in the system can introduce error via noise, which is why quantum computers operate at temperatures close to absolute zero. Quantum computers often run at as cold as 0.1 Kelvin, colder than the vacuum of space, although just last month research teams have lifted this to 1.5 Kelvin. (For reference: 0 Kelvin is −273.15 °C or −459.67 °F).

The practical prop

In some respects, one can think of a quantum computer today as being analogous to an analog computer from years ago. The cooling is key to reduce energy and thus vibration in the system. If a quantum computer is run for too long the processor heats up and the noise in the results increases. So sensitive is the computer to heat or vibration that at the $150 million Nanoscience Hub at Sydney University, scientists have to use stairs rather than the lifts because the quantum computer would feel the vibration of the lifts in the building and produce meaningless results. Thus in Devs, the quantum computer main lab space is depicted as a suspended hovering isolated block, inside a bunker style building. This art directed visual feature, like so many in Devs, had one foot in reality and another in fiction.

Computing systems rely on the ability to store and manipulate information. Current computers manipulate individual bits, which store information as binary 0 and 1 states. Quantum computers leverage quantum mechanical phenomena to manipulate information. To do this, they rely on quantum bits or qubits and microwave pulses control them. Currently, there is no such thing as quantum storage, only quantum processing qubits. Qubits have very short coherence time, currently around 200 nanoseconds. This means big data type problems are poorly suited to quantum computing. A real quantum computer is built as an adjunct to a physically larger digital computer, which works in every respect as a traditional computer. This digital computer deals with much of the data and has, in effect, a subroutine or special section that is handed off to the quantum computer. The results are then returned to the main computer. This is why in Devs, the lab had a vast computer room built above the main entrance area of the bunker’s cube. “When we designed the upper and lower levels of the cube, which were all done in CG, we took that into account,” comments Whitehurst. “There’s a couple of shots where you can see it, there is a big reactor on the ground floor in the middle, that’s what’s generating the power needed. There is cooling ducting that runs all the way through the structure and then there’s a massive server farm up on the top deck.”

Menger sponge design overlaid on the digital set

The art direction of the exterior of the inner cube is based on a Menger Sponge, which is a three-dimensional fractal mathematical object. “The story of that really goes back to Annihilation (2018) and obviously there’s a lot of fractal imagery in that film, especially Mandelbrot,” Whitehurst comments referring to Director Alex Garland’s previous film. “That film was still in the back of everybody’s mind… I cannot recall whether the actual screenplay describes the cube as being a Menger Sponge or not? But certainly, I don’t think there was ever any discussion of it being anything else.” The horizontal midsection was built on a set in Manchester and DNEG extended it up and down digitally.  On the set, there was also a large trolly that could be pulled back and forth to provide the basis of the capsule that floats across the gap. “Everything above and below that was a very elaborate set extension. Because the lighting is changing the whole time, it was incredibly complicated to do,” explains Whitehurst. The only exception is the major capsule drop in the finale. “That crash is all CG because it had to be,” he explains. “Even for the fully CG shots, wherever we could, we’d get Rob (Hardy : DOP) to operate some sort of camera move to give us something to work with. In those rare cases where we couldn’t do that,” says Whitehurst. “I’ve known Rob long enough that I think I can do a recently good Rob Hardy impersonation of moving a CG camera around!” Hardy and Whitehurst, have both worked many times with Director Garland.

Whitehurst is quick to praise the overall production design by Mark Digby on the Devs project. “It’s an absolute triumph of production design. I’ve been on a lot of very fancy film sets and Devs is absolutely up there with the most breathtaking sets I’ve ever been to… the first morning we walked on the set,… as the lights went on, I was like, ‘Oh wow, this is something very, very special’. And I had already seen it during construction.”

The power of a quantum computer centers around the size or number of qubits. In Devs, the number of qubits is skipped with an off-hand remark about it being vast: “a number that it is meaningless to state,” says the Forest character. In the real world, the number of Qubits in prototype quantum computers is still small. The current maximum number of qubits was set by Google by linking together 53 qubits. For reference, a 32 qubits computer can be simulated on a Laptop. By most metrics, real-world research labs are still at the Univac stage of quantum computing. Unlike the Devs mega computer.

A quantum computer running a standard algorithm would be as fast as a normal computer but a classical Von Numan computer has a lot more gates. But there is a class of problems that can only be solved using the quantum circuits and for those problems, a quantum computer can be vastly faster than its digital equivalent.

Stephen McKinley Henderson as Stewart

Superposition

A ‘motto’ at the core of the enigma that is quantum reality, is that what we see when we look at the world is seeming very different from what reality is. Take an atom, the classical view most of us have is a planetary type system with an electron circling a central proton/neutron. Almost all art and graphical diagrams of atoms reinforce this simple representation when in reality it works as a quantum electron wave function, and the best we can do is predict a probability of seeing an electron somewhere with a particular velocity.  Superposition is a key aspect of quantum physics that states subatomic particles appear to exist in multiple different states simultaneously and not as the orbiting electron image you have in your head from High School, – which is a child-like stick figure compared to the actual complexity of atomic quantum mechanics. Superposition is the key to many new quantum algorithms.

Nick Offerman as Forest.

Devs seeing all past and futures

At the core of Devs is the notion that their Quantum computer could reconstruct the past based on extrapolation from a single point. This is a notion borrowed from French mathematician Pierre-Simon Laplace. In principle, Laplace stated a vast intellect could know literally the state of every object in the universe, from which it could deduce everything that would happen in the future, as well as everything that had happened in the past. But Laplace died on 5 March 1827. His argument was a thought experiment based not on quantum but rather classical mechanics. His profound  ‘Laplace’s Demon’ was based on the Newtonian laws of forces balancing and reacting in a deterministic clockwork universe. One could argue that what is interesting about Devs and real quantum computing is the notion that one might solve problems with an assumption of parallel universes, and not the 19th-century idea that a deterministic universe consists of causal chains that link past, present, and future in an unbreakable bond.

While the size of Quantum computing is small today, the nature of quantum computing research means there is a hope that one day major advances will allow much larger computers able to solve problems way beyond what a digital computer can do currently. In Devs, this power is used to extrapolate into both the past and the future. The visual window into this aspect of the show is an important plot device that changes over the course of the series from early snowy images to final high fidelity windows into time. Whitehurst himself did the early testing in Houdini on his laptop using a Kinect that he bought on eBay. “I did a bunch of tests where we broke everything up into voxels and it kind of ended up making everything look like Minecraft, which was not quite what we wanted,” he jokes. Whitehurst then moved to imagery inspired by the way modern ray tracers work, with early sparse point sampling that gets refined over time. “We had this narrative requirement that the simulation needs to look fairly grotty at the beginning and get progressively better and better as the technology is refined. That approach actually seemed to be a very easily understandable by people who aren’t technologically minded, but also plausible to people who are technologically minded and it also actually has an interesting aesthetic.” The creative team wanted some softness to the imagery so Whitehurst added movement to the particles to develop the final look. In production, the footage was shot as normal and then went into a pipeline, not unlike a stereo conversion, where everything was roto-ed. It was then put on cards or geometry in Houdini. “When we had our point clouds we could move the points and stick points to the appropriate object or have them drift away. We had slider control of how much drift was happening. We brought the color in later.  It ended up being a mixture of narratively that makes sense.” This screen imagery was used on set about 70% of the time, so the actors had something to properly react to, but some setups especially in the final episode could not be done that way, as they needed to be tightly adjusted for continuity and timing. Whenever the team could they would play footage on the screens, even if it was just rushes, so everyone could get their timings correct.

The first view of the past

For the final complex void sequence inside the simulation, the action required the actors to work together from separate rooms. “The cleverest setup was the void sequence where Katie and Forest are talking to one another. For that, we built the ‘white room’ set off to the side in the studio. We had a camera on Nick (Offerman) in there. He was wearing an in-ear, headphone device so that he could hear Alison (Pill). Alison was also wearing one so she could hear Nick.  Jay Patel, the DIT, worked out a fiendishly complicated way of getting the 4k imagery in sync, with cables running from one set, up to the projector and from another camera so we could shoot those scenes live. It was amazing to see, particular in terms of emotional performance the actors gave.”

Inside a real IBM Quantum Computer

Real-world Quantum researchers are all aiming for what is known as ‘Quantum Supremacy’, where a quantum computer can outperform a digital computer.  Google partially claimed that they had reached quantum supremacy recently.  A claim heavily disputed by IBM. In Devs, it is assumed that Amaya is well-passed quantum supremacy. But it is important to understand that quantum technology is not just a faster computer. It is a different class of problem-solving. It is not that a computer could process faster, it is there are new solutions to problems that might be able to be solved with quantum computers using new quantum algorithms that cant be feasibly solved with digital computers using traditional algorithms. This becomes a key story point in Devs. The team solves the ‘resolution’ of their predictive window into time with a whole new algorithmic approach. While their fictitious solution is fully explained, we can explain one current real problem that illustrates the multi-verse approach.

Breaking all encryption

Quantum computers are often promoted in the popular press as a way to break encryption. The populist retelling of this is that the quantum computer can do in hours what a digital computer would do in years, if not centuries… because it is faster. But that is not the reason.

Much modern encryption replies on the factoring of prime numbers. The digital computer takes a seemingly never-ending amount of time to solve what the two prime factors are of a very large whole number. Yet this is something that can be done very quickly with the correct cryptography public key. The theory is that the world’s information, banking, and transactions are safe as the computer power needed to break these big encryptions is not just a few years off – but centuries away, even with Moore’s Law of annually increasing computational power. But that assumes one tries to factor prime numbers the current ‘digital computer way’. The race to build quantum computers began in the mid-1990s, when Professor Peter Shor at MIT, developed an algorithm that used quantum computers, which at that time existed only in theory, to solve the mathematical problem of finding the prime factors of any integer N.

A normal computer can easily multiply two primes numbers together, but reversing the process is extremely time-consuming as the main number gets bigger. Shor’s algorithm was published in 1994, not just showing that it was possible to factor a prime integer with a quantum computer, but it actually provided step-by-step instructions on how to do it. This led the world’s computer companies and many agencies such as the NSA to become very interested in quantum computing. If someone could build a quantum computer big enough, and overcome quantum noise and other quantum decoherence problems, they could crack most of the world’s secrets.

 

Shor’s algorithm

Shor’s algorithm can be said to do this with a notion of parallel universes.

Central to Shor’s algorithm is not speed but an algorithm that tackles integer prime factorization in a completely new and ‘quantum way’. Almost all traditional approaches just aim to solve this by simply trying every pair of numbers until something works. They have no special tricks or insight, unlike Shor’s approach. The writer’s device often used in entertainment when deploying quantum mechanics is that there are parallel universes and in one of these the answer is somehow obvious. But even if this was taken at face value, and you had a magical multiverse set of computers, and one said ‘pick any two random numbers and in one universe you will guess right’… how would you find the right universe? If there is one answer in an infinite haystack of universes – how would you see it, how would it stand out? You would never find it in all the multi-verses as it would be drowned out in noise or just too hard to find.

Shor’s algorithm uses what could be described as a cross between ‘quantum Fourier transforms and a dartboard’, to solve that problem. Scott Aaronson, a theoretical computer scientist, came up with a brilliant way of explaining Shor’s algorithm that most people with reasonable maths can follow (and which we will paraphrase here). It relies on the fact that there is only one solution, one set of two numbers that are the exact and only answer. Imagine there was a property of all numbers, in all universes that we could use. If there was a pattern and we could see the pattern, then we could use it. Any repeating pattern has a ‘period’ the number until it repeats.

If one takes the numbers 2 to the nth power, ie. :  2, 4, 8, 16, 32, 64, 128, 256, 512 etc

Now observe the results of the powers of 2 “mod 15”. In other words, the remainder when 15 divides each power of 2,

the answer is : 2, 4, 8, 1, 2, 4, 8, 1, 2, 4, 8, 1, 2, 4,..etc

Dividing the powers of 2 by ‘mod 15’ gives a periodic sequence, whose period is 4. it repeats every 4 times

If one tries another and divides the powers of 2 by ‘mod 21’

The answer is:  2, 4, 8, 16, 11, 1, 2, 4, 8, 16, 1, 2, 4,…etc

This time the period is 6.

This is incredibly important.  The mathematician Euler in the 1760’s discovered that if you have a number N which is the product of two prime numbers, p and q, and you consider the sequence

x mod N, x2 mod N, x3 mod N, x4 mod N, …

Then provided x is not divisible by p or q, the above sequence will repeat with some period that evenly divides (p-1)(q-1). In other words, all other numbers will behave differently.

An example that Aaronson uses is if N=15, then the prime factors of N are p=3 and q=5, then
(p-1)(q-1)=8.
and indeed, the period of the sequence was 4,
which divides 8.

If N=21, then p=3 and q=7, so (p-1)(q-1)=12. …And indeed, the period was 6, which divides 12.

“Now, I want you to step back and think about what this means. It means that if we can find the period of the sequence.   x mod N, x2 mod N, x3 mod N, x4 mod N, …then we can learn something about the prime factors of N(!)  In particular, we can learn a divisor of (p-1)(q-1). Now, I’ll admit that’s not as good as learning p and q themselves, but grant me that it’s something. Indeed, it’s more than something: it turns out that if we could learn several random divisors of (p-1)(q-1) (for example, by trying different random values of x), then with high probability we could put those divisors together to learn (p-1)(q-1) itself. And once we knew (p-1)(q-1), we could then use some more little tricks to recover p and q, the prime factors we wanted.”

The problem is while x mod N, x2 mod N, x3 mod N, x4 mod N, …will eventually start repeating itself, the number of steps before it repeats could be almost as large as N itself. And thus digital computer programmers ignored this mathematical path forward. Except Shor had the brilliant idea to take this idea and apply it to quantum computing.

Shor reasoned that if one could create an enormous quantum superposition over all the numbers in our sequence: x mod N, x2 mod N, x3 mod N, etc. Then maybe there’s some quantum operation we could perform on that superposition that would reveal the period. The key point is that we’re no longer trying to find a needle in an exponentially-large haystack of universes, something we know is hard even for a quantum computer. Instead, we’re now trying to find the period of a sequence, which is a global property of all the numbers in the sequence taken together. And that makes a big difference.

If we could find the period of the sequence using quantum computers, then we would have a short cut and some key information on the prime numbers of N. It turns out there is exactly such a quantum short cut and it is not an exponential problem as it is in normal digital computers.

If you think about quantum computing in terms of Dev’s parallel universes, there’s no feasible way to detect a single universe that’s different from all the rest. Such a lone voice in the wilderness would be drowned out. But what one can hope to detect is a joint property of all the parallel universes together.

Shor’s quantum algorithm depends on quantum mechanics. To find out the repeating period value, Shor uses something called the Quantum Fourier Transform, or QFT. This is where the dartboard idea comes in. If one throws darts at a board some would go high some low… some left some right. Now if measured how far they are from the bullseye, (and called the left high positive and the bottom right negative) and added up all these ‘distances to the bullseye’ they would cancel out. After some time, one would have as many left as right, as many up as down, and they all average each other out. In theory, this is what Shor does with his transformation and superposition, except that every ‘parallel universe’ corresponding to an element of the maths sequence contributes some value to every ‘parallel universe’ corresponding to a possible period of the sequence. The catch is, as Aaronson writes, “for all periods other than the “true” one, these contributions point in different directions and therefore cancel each other out. Only for the “true” period do the contributions from different universes all point in the same direction. And that’s why, when we measure at the end, we’ll find the true period with high probability”.In other words, while every number combination that is wrong eventually cancels out, the two key numbers don’t, they repeat and thus stand out and can be recorded.

Another way to frame how Shor’s QFT works is in terms of interference. A key point about quantum mechanics that is it different from classical probability theory is that, whereas probabilities are always nonnegative, amplitudes in quantum mechanics can be positive or negative. Because of this, the amplitudes corresponding to different ways of getting a particular answer can “interfere destructively” and cancel each other out.

In Devs, the multiverse is not only referenced as a plot device but shown as a motion control composite of the hero characters branching into a set of possible futures, some which meant that Forest family was never killed and the Devs program was never started. Likely for audiences, that future was not the future that the script chooses to follow.