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%.

Highlights

  • We present two types of purity assertions that state the absence of entanglement in the output of quantum gates: one stating that an expression is pure, and one stating that the two components of a pure entangled pair are individually pure

  • Our work introduces the powerful notion of purity to quantum programming, enabling sound reasoning for entanglement

  • 12 CONCLUSION Quantum computing presents unique challenges to programmers who must reason about phenomena such as entanglement that have no analog in the classical world, and if improperly addressed can result in unintuitive bugs

Read more

Summary

Introduction

Quantum programming languages [Altenkirch and Grattage 2005; Bichsel et al 2020; Clairambault and de Visme 2019; Green et al 2013; Paykin et al 2017; Rand et al 2019; Rennela and Staton 2017; Selinger 2004; Selinger and Valiron 2005; Svore et al 2018; Wecker et al 2014; Ying 2016] allow programmers to utilize the computational primitives enabled by the quantum computers of today and tomorrow. We first define a pure quantum state and the main formalism of quantum mechanics in this work. The basic unit of quantum information is the qubit, a linear combination γ0 |0⟩ + γ1 |1⟩ known as a superposition, where |0⟩ and |1⟩4 are basis states and γ0, γ1 ∈ C are amplitudes satisfying |γ0|2 + |γ1|2 = 1 describing relative weights of basis states. Examples of qu√bits include the class√ical zero bit |0⟩, classical one bit |1⟩, and the superposition states (|0⟩ + |1⟩)/ 2 and (i |0⟩ − |1⟩)/ 2. A 2n-dim√ensional pure quantum state |ψ ⟩ is a superposition over n-bit strings. (|00⟩ + |11⟩)/ 2 is a quantum state over 2 qubits. We may represent any pure state as a state vector, a length-2n vector of normalized complex amplitudes.

Methods
Results
Conclusion
Full Text
Paper version not known

Talk to us

Join us for a 30 min session where you can share your feedback and ask us any queries you have

Schedule a call

Disclaimer: All third-party content on this website/platform is and will remain the property of their respective owners and is provided on "as is" basis without any warranties, express or implied. Use of third-party content does not indicate any affiliation, sponsorship with or endorsement by them. Any references to third-party content is to identify the corresponding services and shall be considered fair use under The CopyrightLaw.