Twist: Sound Reasoning for Purity and Entanglement in Quantum Programs

05/04/2022
by   Charles Yuan, et al.
0

Quantum programming languages enable developers to implement algorithms for quantum computers that promise computational breakthroughs in classically intractable tasks. Programming quantum computers requires awareness of entanglement, the phenomenon in which measurement outcomes of qubits are correlated. Entanglement can determine the correctness of algorithms and suitability of programming patterns. In this work, we formalize purity as a central tool for automating reasoning about entanglement in quantum programs. A pure expression is one whose evaluation is unaffected by the measurement outcomes of qubits that it does not own, implying freedom from entanglement with any other expression in the computation. We present Twist, the first language that features a type system for sound reasoning about purity. The type system enables the developer to identify pure expressions using type annotations. Twist also features purity assertion operators that state the absence of entanglement in the output of quantum gates. To soundly check these assertions, Twist uses a combination of static analysis and runtime verification. We evaluate Twist's type system and analyses on a benchmark suite of quantum programs in simulation, demonstrating that Twist can express quantum algorithms, catch programming errors in them, and support programs that several languages disallow, while incurring runtime verification overhead of less than 3.5

READ FULL TEXT
research
04/11/2023

Static Entanglement Analysis of Quantum Programs

Quantum entanglement plays a crucial role in quantum computing. Entangli...
research
01/22/2021

Static Analysis of Quantum Programs via Gottesman Types

The Heisenberg representation of quantum operators provides a powerful t...
research
06/18/2023

On Refactoring Quantum Programs

Refactoring is a crucial technique for improving the efficiency and main...
research
03/14/2023

Schrödinger as a Quantum Programmer: Estimating Entanglement via Steering

Quantifying entanglement is an important task by which the resourcefulne...
research
09/06/2021

Quantum Hoare Type Theory: Extended Abstract

As quantum computers become real, it is high time we come up with effect...
research
03/01/2018

Q#: Enabling scalable quantum computing and development with a high-level domain-specific language

Quantum computing exploits quantum phenomena such as superposition and e...
research
10/04/2021

LQP: The Dynamic Logic of Quantum Information

The main contribution of this paper is the introduction of a dynamic log...

Please sign up or login with your details

Forgot password? Click here to reset