Programming languages—which allow humans to write computer software without worrying about the details of computer hardware—are essential for modern computing. And now is the perfect time to start designing programming languages for quantum computers, according to a postdoctoral researcher at the Joint Center for Quantum Information and Computer Science (QuICS).
“We have the time now and the years of experience with conventional programming,” says Neil Julien Ross, a Hartree Postdoctoral Fellow who arrived at QuICS in September 2015. “We’ll need a language to program quantum computers, so this is a great time to think about it.”
Ross believes that even if large-scale quantum computers remain decades away from being built, designing a programming language now is worth the effort. That’s because modern languages remain tailored to the capabilities of today’s computers. Quantum computers, which use the rules of the microscopic realm to solve some problems faster than conventional computers, will require a programming language that is more aware of their quirks.
Along with a handful of colleagues, Ross has developed Quipper, a quantum programming language that takes into account some of the differences between quantum and conventional computers. For instance, Quipper represents programs using the quantum circuit model, the way that many physicists and computer scientists think about the software run on a quantum computer.
In the circuit model, information is carried on wires, and those wires traverse a sequence of quantum gates—the instructions that make up quantum software. Reversing part or all of a circuit is a common task in many quantum algorithms, and Quipper provides a simple way to achieve this. It also provides simple ways to express other ubiquitous quantum tasks, such as iterating a sequence of instructions many times or controlling the execution of a certain subroutine with a quantum bit.
Ross says that Quipper emerged from an intellectual tradition in the 1960s that recognized the similarities between mathematics—more specifically, logic—and programming. Mathematicians and computer scientists eventually realized that programming computers and proving mathematical statements were two sides of the same logical coin. As Ross puts it, “There’s something intrinsically computational about mathematics.”
This realization, which is known as the Curry-Howard correspondence, changed the way that computer scientists thought about programming. It also led to the design of programming languages that captured this correspondence in their nuts and bolts. One of those languages, called Haskell, is the backbone of Quipper.
Quipper also includes features based on Ross’s other work. For instance, some theoretical models of quantum computers can implement only certain gates, albeit in any sequence. To run an arbitrary quantum program, you first need to find a sequence of available gates that comes close to executing the right program.
This process, which is called quantum compiling, featured in earlier work by Ross, which he carried out as a graduate student at Dalhousie University with his supervisor, Peter Selinger. The two discovered an algorithm that can approximate a quantum program using the smallest number of gates from a particular standard set. Quipper can run this search automatically and find short quantum circuits. Since time on a quantum computer may be precious, minimizing it is a feature built into Quipper.
One future direction for research on Quipper, Ross says, is to shed its reliance on Haskell. That would make it easier to catch errors that, for instance, inadvertently violate the laws of physics.
“Haskell won’t complain about that,” Ross says, “but we know that’s a programmer’s mistake.”
QuICS is a partnership between the University of Maryland and the National Institute of Standards and Technology. It is one of 16 centers and labs in the University of Maryland Institute for Advanced Computer Studies.
—Story by Chris Cesare