Quantum computing is rapidly becoming the field to watch, with dozens of new players entering the market each year.
“It is ridiculous if you look at the number of start-ups that have been created just in the last year in this domain,” said Thomas Häner, PhD, a professor of computational physics at ETH Zurich, in an interview with R&D Magazine. “As investors become more interested in this area it will only continue to grow.”
To help further this field, Häner and a team at ETH Zurich created ProjectQ, a free, open-source software framework for quantum computing that allows users to implement their quantum programs in the high-level programming language Python using a powerful and intuitive syntax. ProjectQ can then translate these programs to any type of back-end, either a simulator run on a classical computer or an actual quantum chip.
The framework was designed to make it simpler for programmers to utilize quantum computing, said Häner.
“Before we started this there were basically no languages for quantum computing around that offered higher level of abstractions that could be compared to classical assembly languages,” he said. “The main idea behind it is that any person working on algorithms only has to implement every gate and subroutine once and then can contribute it to the project, and then other people can reuse those subroutines.”
ProjectQ features a high level language to write quantum programs, a modular and customizable compiler, various hardware and software back-ends, and a library to solve fermionic problems on a quantum computer.
The framework consists of a main compiler engine, which executes a user-defined sequence of compilation steps by sending the circuit through a chain of compiler engines. Each compiler engine manipulates the circuit to reduce the number of gates or quantum bits required to run the quantum program. Engines further down the stack become more back-end-specific and take care of the mapping of the logical circuit to the layout of the back-end.
“ProjectQ’s compiler framework is very easy to get to know, and so, as a contributor you can either work on algorithm and you can also use compiler plug-ins,” explained Häner. “If you have an idea for a new type of optimizer or a better map, where you can map the logical circuits to actual hardware, then you can just pluck that in and see how it performs. You can also run an example that is already available.”
After the circuit has passed through all compiler engines, it gets sent to the back-end. There are several back-end options available as part of ProjectQ. These include a high-performance simulator which allows users to simulate their quantum programs locally and an emulator, which allows users to check the correctness of their quantum algorithms.
Users can also run their quantum program directly on a 5-qubit quantum computer, as ProjectQ is interfaced to the IBM Quantum Experience available through IBM.
“IBM also has a framework, it’s just at a lower level of abstraction so there are people who prefer to use that, and there are people who prefer to use a higher level of abstraction through ProjectQ and just go to the IBM Quantum Experience from there, said Häner. “We have many research groups that use it to test out the algorithms before they publish papers, we have people who are interested in hooking up their hardware, we also have many people who just wanted to try running something on IBM’s Quantum Experience, which we have an interface to.”
Programming quantum algorithms at a higher level of abstraction results in faster development and automatic compilation to low-level instruction sets allows users to compile their algorithms to any available back-end by merely changing one line of code. Because the Python language is already widely used in the quantum community, it isn’t too difficult for programmers to learn how to use the framework, said Häner.
“We gave a seminar last year at ETH Zurich with master students in computer science and they didn’t really have a large background in quantum physics,” he said. “After just a few hours of tutoring they were able to reproduce results from a state-of-the art research paper using our simulator.”