Qunity: A Unified Language for Quantum and Classical Computing (Extended Version)

04/26/2022
by   Finn Voichick, et al.
0

We introduce Qunity, a new quantum programming language designed to treat quantum computing as a natural generalization of classical computing. Qunity presents a unified syntax where familiar programming constructs can have both quantum and classical effects. For example, one can use sum types to implement the direct sum of linear operators, exception handling syntax to implement projective measurements, and aliasing to induce entanglement. Further, Qunity takes advantage of the overlooked BQP subroutine theorem, allowing one to construct reversible subroutines from irreversible quantum algorithms through the uncomputation of "garbage" outputs. Unlike existing languages that enable quantum aspects with separate add-ons (like a classical language with quantum gates bolted on), Qunity provides a unified syntax along with a novel denotational semantics that guarantees that programs are quantum mechanically valid. We present Qunity's syntax, type system, and denotational semantics, showing how it can cleanly express several quantum algorithms. We also detail how Qunity can be compiled to a low-level qubit circuit language like OpenQASM, proving the realizability of our design.

READ FULL TEXT

page 1

page 2

page 3

page 4

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
07/17/2021

Quantum circuits with classical channels and the principle of deferred measurements

We define syntax and semantics of quantum circuits, allowing measurement...
research
04/03/2018

From Symmetric Pattern-Matching to Quantum Control (Extended Version)

One perspective on quantum algorithms is that they are classical algorit...
research
02/03/2023

The Quantum Effect: A Recipe for QuantumPi

Free categorical constructions characterise quantum computing as the com...
research
07/28/2021

Semantics for Variational Quantum Programming

We consider a programming language that can manipulate both classical an...
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
01/23/2022

Quantum Expectation Transformers for Cost Analysis

We introduce a new kind of expectation transformer for a mixed classical...

Please sign up or login with your details

Forgot password? Click here to reset