Quantum hardware continues to improve to the point where we can actually see real-world use cases over the next few years, so it's probably not surprising that we are also witnessing a steady increase in projects. research that focus on the best way to program these machines. . One of the most recent efforts in this space is Silq, a high-level programming language for quantum computers from ETH Zurich in Switzerland.
The emphasis here is on "high-level programming language" because the researchers behind the language note that the existing quantum languages for programmers still operate at a very low level of abstraction, which makes the life of quantum programmers much more difficult than necessary.
"The story of the project is that we wanted to solve a central problem in quantum computing," explained Martin Vechev, associate professor at ETH. "And if you want to solve a central problem in quantum computing, for example, if you want to analyze and reason about quantum programs, you must have a language in which these problems are expressed - and there are existing languages. We looked at various quantum computing issues, but what always came up as a fundamental issue was that we looked at the programs and the way they are expressed - and you see that this is not ideal, what is not optimal. "

So the team started studying the different languages that people are currently using, including Microsoft Q # and SDK like IBM Qiskit.
"Originally, we didn't think we would need to create a new language," says Vechev's Ph.D. Benjamin Bichsel, student, added. "And we didn't even consider that at the very beginning. We wanted to solve much more advanced problems in quantum computing. We thought, okay, quickly choose a language, and then work with it. And then we realized that the Existing languages are completely inadequate for the type of higher level properties that we wish to reason about. "
One of the co-authors of the article on Silq that the team is presenting this week at PLDI 2020 (which includes Timon Gehr and Maximilian Baader, as well as Bichsel and Vechev, as co-authors), even said that 'He would not work with any of the existing languages because they were too boring for him.
So what is the problem with existing languages? "A great way to start entering this field is to examine one of the fundamental challenges of quantum computing that does not appear in classical languages, which is that of non-computing," Vechev noted. In fact, non-calculus is at the heart of Silq's approach and natively integrated. Although there is a classic analog of non-calculus, it is not necessarily the most intuitive of concepts.

"In classical languages, if you calculate" A OR B OR C ", you must first calculate" A OR B ", then use it to calculate"[the result of this] OR C, "and just forget about that temporary value you calculated in the meantime," said Bichsel. "If you do this in quantum, you get unexpected side effects. [...] In the end, what you expect will not happen in this case. So you have to deal with it one way or another. And what this means for practically all existing quantum languages is that you are forced to work at a very low level of abstraction, where you have to think of all the temporary values. And that essentially prevents any kind of high-level thinking. "
This means that even if you want to do something relatively trivial, like adding to integers, on a quantum machine, you have to think of all the temporary values you create in the process and manage them explicitly.
"For quantum calculation, because you always have to manage this waste, like the temporary values that you have to eliminate - you always have to manage that. And it makes it extremely boring to work in these languages, "said Bichsel. Current quantum languages try to get around this problem, but in a relatively convoluted way, while Silq allows automatic, safe and ready-to-use calculation.
Vechsel also added that writing low-level programs is more prone to errors and makes it harder to understand what the algorithm actually does. In addition, the Silq compiler also tries to prevent programmers from committing common errors. The team also looked at recent developments in classical languages (such as property types, linear type systems, etc.) and implemented them in the context of quantum computing - something that is also a first in Silq.
So it's probably not surprising that the team found that their language produced significantly shorter programs than those written in Q # and Quipper, for example, and used far fewer quantum primitives.
For the moment, Silq is still a research project that does not yet work on existing quantum hardware platforms. Instead, the researchers wrote their own quantum emulator to test their hypotheses. "In our case, because we are more high-level, we see compilation as a two-step process, where you first express your high-level intention and then it is the job of the compiler to decide on which architecture it will work and how to optimize for a particular architecture, "said Bichsel.
If you want to delve into all the details of Silq, the teams' paper is now available here.
