Could quantum programming finally be leaving the dark ages? (Image: f8 Imaging/Hulton/Getty)

Quantum software has finally left the dark ages with the creation of the first practical, high-level programming language for quantum computers. Although today’s devices are not ready for most practical applications, the language, called Quipper, could guide the design of these futuristic machines, as well as making them easier to program when they do arrive.

“It does all the nice features of a modern classical programming language, adapted to quantum computing,” says Bob Coecke of the University of Oxford, who was not involved in the work. “It’s a tour de force.”

An important feature of a quantum computer is that its bits – known as qubits – can take the values 0 and 1 at the same time. This allows the computer to perform two or more computations simultaneously. But designing computer algorithms that make use of this quantum parallelism is tough.


So quantum programming has so far been mostly low-level, concerned with instructing the quantum logic gates that control the qubits.

Quantum java

Now Peter Selinger of Dalhousie University in Halifax, Canada, and colleagues have brought the field up to speed by creating Quipper, the first high-level quantum programming language. Quipper is designed to express instructions in terms of bigger concepts, and to make it easy to bring together multiple algorithms in a modular way. High-level languages for classical computers such as Java do most of the heavy lifting in modern computation.

Quipper is based on a classical programming language called Haskell, which is particularly suited to programming for physics applications. What Selinger’s team has done is to customise it to deal with qubits.

They have also produced a library of Quipper code to carry out seven existing quantum algorithms, including an algorithm for estimating the ground-state energy of molecules. They hope that others will add to the library by writing more algorithms, creating a resource that will allow quantum programmers to build software by sticking modules together, as classical programmers do with Java.

“Having a well-designed programming language helps structure your thinking and informs the way you think about a problem,” says Selinger. “It may become a useful tool in the design of new quantum algorithms.”

Thorsten Altenkirch of the University of Nottingham, UK, who was not involved in the work, agrees. “People can use languages like Quipper as a test bed for ideas and understanding for how to write quantum software,” he says.

Selinger’s team released their outline of the language, together with their preliminary library, at the Programming Language Design and Implementation conference in Seattle, Washington, last month.

Influencing the future

It may seem strange to create a language for a quantum computer, given that the hardware is still rudimentary. But developing the software – which is tested by simulating a quantum computer on a classical one – could influence the design of future quantum computers.

Quipper’s creation was funded by IARPA, the US Intelligence Advanced Research Projects Agency, in order to pin down how many bits a quantum computer would need in order to outperform a classical one on certain tasks. Writing programs in Quipper makes the hardware requirements of an algorithm clearer and that has already led to some surprises. “It will take a lot more resources than people had thought,” says Selinger, who can’t talk about specific results.

He expects that with advances in engineering, such as reducing noise, the number of qubits necessary for a practical quantum computer will decrease over time.

The team made their estimates based on various existing forms of quantum hardware, including devices that use ion traps and photons.However, they did not include the only quantum computer in the market today, the D-wave computer. It uses a novel approach called adiabatic quantum computing and so is not currently compatible with Quipper.

References: arxiv.org/abs/1304.5485 and arxiv.org/abs/1304.3390