The first high-level programming language for quantum computers could guide the design of these futuristic machines – and make programming them.
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.
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.
Via Dr. Stefan Gruenwald