Twist: sound reasoning for purity and entanglement in Quantum programs
Open Access
- 12 January 2022
- journal article
- research article
- Published by Association for Computing Machinery (ACM) in Proceedings of the ACM on Programming Languages
- Vol. 6 (POPL) , 1-32
Abstract
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 existing languages disallow, while incurring runtime verification overhead of less than 3.5%.Keywords
All Related Versions
This publication has 66 references indexed in Scilit:
- Testing Product States, Quantum Merlin-Arthur Games and Tensor OptimizationJournal of the ACM, 2013
- Simulating Chemistry Using Quantum ComputersAnnual Review of Physical Chemistry, 2011
- Distribution of bipartite entanglement for random pure statesJournal of Physics A: Mathematical and Theoretical, 2007
- A lambda calculus for quantum computation with classical controlMathematical Structures in Computer Science, 2006
- Experimental determination of entanglement with a single measurementNature, 2006
- Permission accounting in separation logicACM SIGPLAN Notices, 2005
- Towards a quantum programming languageMathematical Structures in Computer Science, 2004
- Teleporting an unknown quantum state via dual classical and Einstein-Podolsky-Rosen channelsPhysical Review Letters, 1993
- Determination of quasiprobability distributions in terms of probability distributions for the rotated quadrature phasePhysical Review A, 1989
- Der Massbegriff in der Theorie der Kontinuierlichen GruppenAnnals of Mathematics, 1933