To run a program, a computer needs to understand how to perform each operation written in the code. But there are possibly thousands of programming languages which contain extremely many basic operations. How can one computer run them all? It can do so using compilers: Software written in a language the computer understands which can translate programs into instructions the computer knows how to carry out. Compilers can often also optimise the program, by reducing the number of basic operations yet still obtain the same final result. You’re probably viewing this webpage with a device running tens of compilers at once!

But quantum computers run a different kind of program. Quantum programs are written and understood in a very different way to the programs running on your home computer. They therefore need very different methods to compile them, that is shorten them or re-express them using a different set of operations. Many existing quantum compilers use clever maths to find alternate sequences of operations which have an identical effect on the quantum state. However, they run on classical computers, and require the result of these operations on the quantum state are precisely known and are storable in the computer.

But on noisy, near-future quantum computers, we often don’t know precisely what our elementary operations are doing to the quantum state. Sometimes we wish re-express our programs using a new set of operations which cannot precisely recreate the effect on the quantum state, but can bring us pretty close. How can we approximately translate our program?

We recently introduced a new method for performing approximate compilation to optimise the programs written for near-future quantum computers. It recasts the problem of compiling into one of finding the lowest energy state of a quantum system, for which recent developments have shown that near-future quantum computers can be quite good at. Our algorithm can run on real quantum hardware, or be simulated on a classical machine, in order to shorten quantum programs or translate them into different families of instructions.

You can view about our algorithm here (pdf). Furthermore, in line with our open science philosophy, we’re sharing all our code to simulate our algorithm online. We’ve heavily documented the code and done our best to make it readable, runnable and extendable – you can view it here on GitHub.

 


Tyson Jones

Tyson Jones

Studies high performance simulation of quantum computation, and the use of quantum computers to speedup important computational problems