A new language for quantum computing | MIT News

Crystals of time. Microwave. diamonds What do these three disparate things have in common?

Quantum computing. Unlike traditional computers that use bits, quantum computers use qubits to encode information as zeros or ones, or both at the same time. Coupled with a cocktail of forces from quantum physics, these refrigerator-sized machines can process a vast amount of information, but they’re far from perfect. Just like our normal computers, we need to have the correct programming languages ​​to compute correctly on quantum computers.

Programming quantum computers requires awareness of something called “entanglement,” a computational multiplier for qubits of all kinds, which translates into a lot of power. When two qubits are entangled, actions on one qubit can change the value of the other, even when they are physically separated, giving rise to Einstein’s characterization of “spooky action at a distance.” But that power is equal parts a source of weakness. When programming, discarding one qubit without considering its entanglement with another qubit can destroy data stored on the other, jeopardizing the correctness of the program.

Scientists in Computer Science and Artificial Intelligence (CSAIL) at MIT tried to unravel a bit by creating their own programming language for quantum computing called Twist. Twist can describe and verify which pieces of data are entwined in a quantum program, through a language that a classical programmer can understand. The language uses a concept called purity, which enforces the absence of clutter and results in more intuitive programs, ideally with fewer bugs. For example, a programmer can use Twist to say that temporary data generated as garbage by a program is not interleaved with the program’s response, so it is safe to discard.

While the nascent field may seem a bit flashy and futuristic, with images of gigantic stringy gold machines springing to mind, quantum computers have potential for computational advances in classically unsolvable tasks such as cryptographic and communication protocols, search, and physics. and computational chemistry. One of the key challenges in computer science is dealing with the complexity of the problem and the amount of computation required. While a classical digital computer would need an exponentially large number of bits to run such a simulation, a quantum computer could potentially do so using a very small number of qubits, given the right programs.

“Our Twist language allows a developer to write safer quantum programs by explicitly indicating when one qubit should not be entangled with another,” says Charles Yuan, an MIT electrical and computer engineering doctoral student and lead author of a new report. paper about Twist. “Because understanding quantum programs requires understanding entanglement, we hope that Twist paves the way for languages ​​that make the unique challenges of quantum computing more accessible to programmers.”

Yuan co-wrote the paper with Chris McNally, an electrical engineering and computer science doctoral student affiliated with MIT’s Electronics Research Laboratory, as well as MIT Assistant Professor Michael Carbin. They presented the research at last week’s Symposium on Programming Principles 2022 conference in Philadelphia.

Untangling quantum entanglement

Imagine a wooden box with a thousand cables sticking out on one side. You can pull any cable out of the box or push it all the way in.

After doing this for a while, the wires form a pattern of bits (zeroes and ones) depending on whether they are in or out. This box represents the memory of a classic computer. A program for this computer is a sequence of instructions on when and how to pull the wires.

Now imagine a second identical looking box. This time, you pull on a wire and see as it emerges, a couple more wires go back in. Clearly, inside the box, these cables are somehow entangled with each other.

The second box is an analogy for a quantum computer, and understanding the meaning of a quantum program requires understanding the entanglement present in its data. But detecting the entanglement is not easy. You can’t see into the wooden box, so your best bet is to try and pull the wires and reason carefully about which ones are tangled. In the same way, quantum programmers today have to reason by hand about entanglement. This is where Twist’s design helps massage some of those interlocking pieces.

Scientists designed Twist to be expressive enough to write programs for known quantum algorithms and identify bugs in their implementations. To test Twist’s design, they modified the programs to introduce some kind of bug that would be relatively subtle for a human programmer to detect, and showed that Twist could automatically identify bugs and reject programs.

They also measured how well the programs performed in practice in terms of execution time, which had less than 4 percent overhead over existing quantum programming techniques.

For those wary of quantum technology’s “sleazy” reputation for its potential to crack encryption systems, Yuan says it’s still not well understood to what extent quantum computers will actually be able to deliver on their performance promises in practice. “There is a lot of ongoing research in post-quantum cryptography, which exists because even quantum computing is not all-powerful. So far, there is a very specific set of applications where people have developed algorithms and techniques where a quantum computer can outperform classical computers.”

An important next step is to use Twist to create high-level quantum programming languages. Most quantum programming languages ​​today still resemble assembly language, stringing together low-level operations, disregarding things like data types and functions, and what is typical of classical software engineering.

“Quantum computers are error-prone and difficult to program. By presenting and reasoning about the ‘purity’ of program code, Twist goes a long way toward making quantum programming easier by ensuring that quantum bits in pure code cannot be altered by bits not in that code,” says Fred Chong, Seymour Goodman Professor of Computer Science at the University of Chicago and chief scientist at Super.tech.

The work was supported, in part, by the MIT-IBM Watson AI Lab, the National Science Foundation, and the Office of Naval Research.

Leave a Reply

Your email address will not be published. Required fields are marked *