Abstract
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 and 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 into a low-level qubit circuit language like OpenQASM, proving the realizability of our design.
- T Altenkirch and J Grattage. 2005. A functional quantum programming language. In 20th Annual IEEE Symposium on Logic in Computer Science (LICS’ 05). IEEE, Chicago, IL. 249–258. https://doi.org/10.1109/LICS.2005.1 arxiv:quant-ph/0409065.
Google Scholar
Digital Library
- Andris Ambainis, Andrew M Childs, Ben W Reichardt, Robert Špalek, and Shengyu Zhang. 2010. Any AND-OR formula of size N can be evaluated in time N^1/2+o(1) on a quantum computer. SIAM J. Comput., 39, 6 (2010), 2513–2530. https://doi.org/10.1137/080712167
Google Scholar
Cross Ref
- Matthew Amy, Martin Roetteler, and Krysta M. Svore. 2017. Verified Compilation of Space-Efficient Reversible Circuits. In Computer Aided Verification, Rupak Majumdar and Viktor Kunčak (Eds.). Springer International Publishing, Cham. 3–21. isbn:978-3-319-63390-9 https://doi.org/10.1007/978-3-319-63390-9_1 arxiv:1603.01635.
Google Scholar
Cross Ref
- Pablo Arrighi and Gilles Dowek. 2017. Lineal: A linear-algebraic Lambda-calculus. Logical Methods in Computer Science, 13, 1 (2017), March, https://doi.org/10.23638/LMCS-13(1:8)2017
Google Scholar
Cross Ref
- Sheldon Axler. 2015. Linear Algebra Done Right (third ed.). Springer, Cham. https://doi.org/10.1007/978-3-319-11080-6
Google Scholar
Cross Ref
- Charles H Bennett, Ethan Bernstein, Gilles Brassard, and Umesh Vazirani. 1997. Strengths and Weaknesses of Quantum Computing. SIAM J. Comput., 26, 5 (1997), 1510–1523. https://doi.org/10.1137/S0097539796300933 arxiv:quant-ph/9701001.
Google Scholar
Digital Library
- Benjamin Bichsel, Maximilian Baader, Timon Gehr, and Martin Vechev. 2020. Silq: A High-Level Quantum Language with Safe Uncomputation and Intuitive Semantics. In Proceedings of the 41st ACM SIGPLAN Conference on Programming Language Design and Implementation (PLDI 2020). Association for Computing Machinery, New York. 286–300. isbn:9781450376136 https://doi.org/10.1145/3385412.3386007
Google Scholar
Digital Library
- Costin Bădescu and Prakash Panangaden. 2015. Quantum Alternation: Prospects and Problems. In Proceedings of the 12th International Workshop on Quantum Physics and Logic, Oxford, U.K., July 15-17, 2015, Chris Heunen, Peter Selinger, and Jamie Vicary (Eds.) (Electronic Proceedings in Theoretical Computer Science, Vol. 195). Open Publishing Association, Oxford, UK. 33–42. https://doi.org/10.4204/EPTCS.195.3 arxiv:1511.01567.
Google Scholar
Cross Ref
- Kostia Chardonnet, Marc de Visme, Benoît Valiron, and Renaud Vilmart. 2022. The Many-Worlds Calculus: Representing Quantum Control. arxiv:2206.10234.
Google Scholar
- Andrew M Childs, Ben W Reichardt, Robert Spalek, and Shengyu Zhang. 2007. Every NAND formula of size N can be evaluated in time N^1/2 + o(1) on a quantum computer. arxiv:quant-ph/0703015.
Google Scholar
- Andrew M. Childs and Wim van Dam. 2010. Quantum algorithms for algebraic problems. Rev. Mod. Phys., 82 (2010), Jan, 1–52. https://doi.org/10.1103/RevModPhys.82.1 arxiv:0812.0380.
Google Scholar
Cross Ref
- Andrew W Cross, Lev S Bishop, John A Smolin, and Jay M Gambetta. 2017. Open Quantum Assembly Language. arxiv:1707.03429. https://github.com/Qiskit/openqasm/tree/OpenQASM2.x
Google Scholar
- Andrew W Cross, Ali Javadi-Abhari, Thomas Alexander, Niel de Beaudrap, Lev S Bishop, Steven Heidel, Colm A Ryan, John Smolin, Jay M Gambetta, and Blake R Johnson. 2021. OpenQASM 3: A broader and deeper quantum assembly language. arxiv:2104.14722. https://qiskit.github.io/openqasm/
Google Scholar
- David Deutsch. 1985. Quantum theory, the Church–Turing principle and the universal quantum computer. Proceedings of the Royal Society of London A, 400, 1818 (1985), 97–117. https://doi.org/10.1098/rspa.1985.0070
Google Scholar
Cross Ref
- Peng Fu, Kohei Kishida, and Peter Selinger. 2020. Linear Dependent Type Theory for Quantum Programming Languages. In Proceedings of the 35th Annual ACM/IEEE Symposium on Logic in Computer Science (LICS ’20). Association for Computing Machinery, New York, NY, USA. 440–453. https://doi.org/10.1145/3373718.3394765 arxiv:2004.13472.
Google Scholar
Digital Library
- Daniel Gottesman. 2010. An Introduction to Quantum Error Correction and Fault-Tolerant Quantum Computation. In Quantum Information Science and Its Contributions to Mathematics, Samuel J Lomonaco, Jr (Ed.) (Proceedings of Symposia in Applied Mathematics, Vol. 68). American Mathematical Society, Providence, RI. https://doi.org/10.1090/psapm/068 arxiv:0904.2557.
Google Scholar
Cross Ref
- Jonathan Grattage. 2011. An Overview of QML With a Concrete Implementation in Haskell. In Proceedings of the Joint 5th International Workshop on Quantum Physics and Logic and 4th Workshop on Developments in Computational Models (QPL/DCM 2008). Electronic Notes in Theoretical Computer Science, 270, 1, 165–174. issn:1571-0661 https://doi.org/10.1016/j.entcs.2011.01.015 arxiv:0806.2735.
Google Scholar
Digital Library
- Jonathan James Grattage. 2006. A functional quantum programming language. Ph. D. Dissertation. University of Nottingham. http://eprints.nottingham.ac.uk/10250/
Google Scholar
- Alexander S Green, Peter LeFanu Lumsdaine, Neil J Ross, Peter Selinger, and Benoît Valiron. 2013. Quipper: A Scalable Quantum Programming Language. In Proceedings of the 34th Acm Sigplan Conference on Programming Language Design and Implementation. Association for Computing Machinery, New York, NY. 333–342. isbn:9781450320146 https://doi.org/10.1145/2491956.2462177 arxiv:1304.3390.
Google Scholar
Digital Library
- Robert B. Griffiths and Chi-Sheng Niu. 1996. Semiclassical Fourier Transform for Quantum Computation. Phys. Rev. Lett., 76 (1996), Apr, 3228–3231. https://doi.org/10.1103/PhysRevLett.76.3228 arxiv:quant-ph/9511007.
Google Scholar
Cross Ref
- Teiko Heinosaari and Mário Ziman. 2011. The Mathematical Language of Quantum Theory: From Uncertainty to Entanglement. Cambridge University Press, Cambridge. https://doi.org/10.1017/CBO9781139031103
Google Scholar
Cross Ref
- Gérard Huet. 1980. Confluent Reductions: Abstract Properties and Applications to Term Rewriting Systems. J. ACM, 27, 4 (1980), Oct., 797–821. issn:0004-5411 https://doi.org/10.1145/322217.322230
Google Scholar
Digital Library
- Roshan P. James and Amr Sabry. 2012. Information Effects. In Proceedings of the 39th Annual ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages (POPL ’12). Association for Computing Machinery, New York, NY, USA. 73–84. isbn:9781450310833 https://doi.org/10.1145/2103656.2103667
Google Scholar
Digital Library
- Phillip Kaye, Raymond Laflamme, and Michele Mosca. 2007. An Introduction to Quantum Computing. Oxford University Press, Oxford.
Google Scholar
Digital Library
- E Knill. 1996. Conventions for quantum pseudocode. Los Alamos National Lab. https://doi.org/10.2172/366453
Google Scholar
Cross Ref
- Robin Kothari. 2014. Efficient algorithms in quantum query complexity. Ph. D. Dissertation. University of Waterloo. http://hdl.handle.net/10012/8625
Google Scholar
- Gushu Li, Li Zhou, Nengkun Yu, Yufei Ding, Mingsheng Ying, and Yuan Xie. 2020. Projection-Based Runtime Assertions for Testing and Debugging Quantum Programs. Proc. ACM Program. Lang., 4, OOPSLA (2020), Article 150, nov, 29 pages. https://doi.org/10.1145/3428218 arxiv:1911.12855.
Google Scholar
Digital Library
- Liyi Li, Finn Voichick, Kesha Hietala, Yuxiang Peng, Xiaodi Wu, and Michael Hicks. 2022. Verified Compilation of Quantum Oracles. In Proceedings of the ACM on Programming Languages. 6, Association for Computing Machinery, New York, NY, USA. Article 146, 27 pages. https://doi.org/10.1145/3563309 arxiv:2112.06700.
Google Scholar
Digital Library
- M. H. A. Newman. 1942. On Theories with a Combinatorial Definition of “Equivalence”. Annals of Mathematics, 43, 2 (1942), 223–243. issn:0003486X https://doi.org/10.2307/1968867
Google Scholar
Cross Ref
- Michael A Nielsen and Isaac L Chuang. 2010. Quantum Computation and Quantum Information (10 th anniversary ed.). Cambridge University Press, Cambridge, UK. https://worldcat.org/en/title/700706156
Google Scholar
- Jennifer Paykin, Robert Rand, and Steve Zdancewic. 2017. Qwire: A Core Language for Quantum Circuits. In Proceedings of the 44 th Acm Sigplan Symposium on Principles of Programming Languages. Association for Computing Machinery, New York, NY. 846–858. isbn:9781450346603 https://doi.org/10.1145/3009837.3009894
Google Scholar
Digital Library
- John Preskill. 2018. Quantum Computing in the NISQ era and beyond. Quantum, 2 (2018), Aug., issn:2521-327X https://doi.org/10.22331/q-2018-08-06-79 arxiv:1801.00862.
Google Scholar
Cross Ref
- Robert Rand, Jennifer Paykin, Dong-Ho Lee, and Steve Zdancewic. 2019. ReQWIRE: Reasoning about Reversible Quantum Circuits. In Proceedings of the 15th International Conference on Quantum Physics and Logic (QPL), Halifax, Canada, June 3–7, 2018, Peter Selinger and Giulio Chiribella (Eds.) (Electronic Proceedings in Theoretical Computer Science, Vol. 287). Open Publishing Association, Waterloo, New South Wales. 299–312. https://doi.org/10.4204/EPTCS.287.17 arxiv:1901.10118.
Google Scholar
Cross Ref
- Steven Roman. 2008. Advanced Linear Algebra (third ed.) (Graduate Texts in Mathematics, Vol. 135). Springer, New York. https://doi.org/10.1007/978-0-387-72831-5
Google Scholar
Cross Ref
- Neil Julien Ross. 2015. Algebraic and Logical Methods in Quantum Computation. Ph. D. Dissertation. Dalhousie University. arxiv:1510.02198. https://hdl.handle.net/10222/60819
Google Scholar
- Amr Sabry, Benoît Valiron, and Juliana Kaizer Vizzotto. 2018. From Symmetric Pattern-Matching to Quantum Control. In Foundations of Software Science and Computation Structures, Christel Baier and Ugo Dal Lago (Eds.). Springer International Publishing, Cham, Switzerland. 348–364. isbn:978-3-319-89366-2 https://doi.org/10.1007/978-3-319-89366-2_19 arxiv:1804.00952.
Google Scholar
Cross Ref
- Peter Selinger. 2004. Towards a quantum programming language. Mathematical Structures in Computer Science, 14, 4 (2004), 527–586. https://doi.org/10.1017/S0960129504004256
Google Scholar
Digital Library
- Peter Selinger and Benoît Valiron. 2009. Quantum Lambda Calculus. In Semantic Techniques in Quantum Computation, Simon Gay and Ian Mackie (Eds.). Cambridge University Press, Cambridge, UK. 135–172. https://doi.org/10.1017/CBO9781139193313.005
Google Scholar
Cross Ref
- John van de Wetering. 2020. ZX-calculus for the working quantum computer scientist. arxiv:2012.13966.
Google Scholar
- André van Tonder. 2004. A Lambda Calculus for Quantum Computation. SIAM J. Comput., 33, 5 (2004), 1109–1135. https://doi.org/10.1137/S0097539703432165 arxiv:quant-ph/0307150.
Google Scholar
Digital Library
- Finn Voichick, Liyi Li, Robert Rand, and Michael Hicks. 2022. Qunity: A Unified Language for Quantum and Classical Computing (Extended Version). arxiv:2204.12384.
Google Scholar
- Finn Voichick, Liyi Li, Robert Rand, and Michael Hicks. 2022. Qunity: A Unified Language for Quantum and Classical Computing (Type Checker). https://doi.org/10.5281/zenodo.7150282
Google Scholar
Cross Ref
- David Walker. 2004. Substructural Type Systems. In Advanced Topics in Types and Programming Languages, Benjamin C Pierce (Ed.). The MIT Press, Cambridge, MA.
Google Scholar
- John Watrous. 2009. Quantum Computational Complexity. In Encyclopedia of Complexity and Systems Science, Robert A Meyers (Ed.). Springer, New York, NY. 7174–7201. isbn:978-0-387-30440-3 https://doi.org/10.1007/978-0-387-30440-3_428 arxiv:0804.3401.
Google Scholar
Cross Ref
- W K Wootters and W H Zurek. 1982. A single quantum cannot be cloned. Nature, 299 (1982), 802–803. https://doi.org/10.1038/299802a0
Google Scholar
Cross Ref
- Mingsheng Ying. 2016. Foundations of Quantum Programming. Elsevier Science, Cambridge, MA. https://worldcat.org/en/title/1027777388
Google Scholar
Index Terms
Qunity: A Unified Language for Quantum and Classical Computing
Recommendations
Quantum channels over graph states using generalized measurement-based quantum computation framework
AbstractMeasurement-based quantum computation (MBQC) is an alternative way of quantum information processing that describes the unitary evolution of a quantum state using the cluster state and well-defined sequential measurements. We give a closed form ...
Classical communication and non-classical fidelity of quantum teleportation
In quantum teleportation, the role of entanglement has been much discussed. It is known that entanglement is necessary for achieving non-classical teleportation fidelity. Here we focus on the amount of classical communication that is necessary to obtain ...
Quantum computing
Encyclopedia of Computer ScienceIn a conventional computer, information is represented by quantities that obey the laws of classical physics, such as the voltage levels in a logic circuit. But as the size of microelectronics shrinks, the underlying quantum physics will eventually ...






Comments