Abstract
Emerging quantum algorithms for problems such as element distinctness, subset sum, and closest pair demonstrate computational advantages by relying on abstract data structures. Practically realizing such an algorithm as a program for a quantum computer requires an efficient implementation of the data structure whose operations correspond to unitary operators that manipulate quantum superpositions of data.
To correctly operate in superposition, an implementation must satisfy three properties --- reversibility, history independence, and bounded-time execution. Standard implementations, such as the representation of an abstract set as a hash table, fail these properties, calling for tools to develop specialized implementations.
In this work, we present Core Tower, the first language for quantum programming with random-access memory. Core Tower enables the developer to implement data structures as pointer-based, linked data. It features a reversible semantics enabling every valid program to be translated to a unitary quantum circuit.
We present Boson, the first memory allocator that supports reversible, history-independent, and constant-time dynamic memory allocation in quantum superposition. We also present Tower, a language for quantum programming with recursively defined data structures. Tower features a type system that bounds all recursion using classical parameters as is necessary for a program to execute on a quantum computer.
Using Tower, we implement Ground, the first quantum library of data structures, including lists, stacks, queues, strings, and sets. We provide the first executable implementation of sets that satisfies all three mandated properties of reversibility, history independence, and bounded-time execution.
Supplemental Material
Available for Download
Appendices of paper.
- Scott Aaronson. 2002. Quantum Lower Bound for Recursive Fourier Sampling. https://doi.org/10.48550/ARXIV.QUANT-PH/0209060 arxiv:0209060.
Google Scholar
- Scott Aaronson, Nai-Hui Chia, Han-Hsuan Lin, Chunhao Wang, and Ruizhe Zhang. 2019. On the Quantum Complexity of Closest Pair and Related Problems. arxiv:1911.01973.
Google Scholar
- Héctor Abraham. 2019. Qiskit: An Open-source Framework for Quantum Computing.
Google Scholar
- Daniel S. Abrams and Seth Lloyd. 1997. Simulation of Many-Body Fermi Systems on a Universal Quantum Computer. Phys. Rev. Lett., 79 (1997), Sep, https://doi.org/10.1103/PhysRevLett.79.2586
Google Scholar
Cross Ref
- T. Altenkirch and J. Grattage. 2005. A Functional Quantum Programming Language. In IEEE Symposium on Logic in Computer Science. https://doi.org/10.1109/LICS.2005.1
Google Scholar
Digital Library
- Andris Ambainis. 2003. Quantum walk algorithm for element distinctness. arxiv:0311001.
Google Scholar
- Srinivasan Arunachalam, Vlad Gheorghiu, Tomas Jochym-O’Connor, Michele Mosca, and Priyaa Varshinee Srinivasan. 2015. On the robustness of bucket brigade quantum RAM. New Journal of Physics, 17, 12 (2015), Dec, https://doi.org/10.1088/1367-2630/17/12/123010
Google Scholar
Cross Ref
- Holger Bock Axelsen and Robert Glück. 2013. Reversible Representation and Manipulation of Constructor Terms in the Heap. In Reversible Computation, Gerhard W. Dueck and D. Michael Miller (Eds.).
Google Scholar
- Sumeet Bajaj, Anrin Chakraborti, and Radu Sion. 2016. Practical Foundations of History Independence. IEEE Transactions on Information Forensics and Security, 11, 2 (2016), https://doi.org/10.1109/TIFS.2015.2491309
Google Scholar
Digital Library
- Adriano Barenco, André Berthiaume, David Deutsch, Artur Ekert, Richard Jozsa, and Chiara Macchiavello. 1997. Stabilization of Quantum Computations by Symmetrization. SIAM J. Comput., 26, 5 (1997), https://doi.org/10.1137/S0097539796302452
Google Scholar
Digital Library
- J. S. Bell. 1964. On the Einstein Podolsky Rosen paradox. Physics, 1 (1964), Nov, https://doi.org/10.1103/PhysicsPhysiqueFizika.1.195
Google Scholar
Cross Ref
- C. H. Bennett. 1973. Logical Reversibility of Computation. IBM Journal of Research and Development, 17, 6 (1973), https://doi.org/10.1147/rd.176.0525
Google Scholar
Digital Library
- Charles H. Bennett. 1989. Time/Space Trade-Offs for Reversible Computation. SIAM J. Comput., 18, 4 (1989), Aug, https://doi.org/10.1137/0218053
Google Scholar
Digital Library
- Charles H. Bennett and Gilles Brassard. 2014. Quantum cryptography: Public key distribution and coin tossing. Theoretical Computer Science, 560 (2014), https://doi.org/10.1016/j.tcs.2014.05.025
Google Scholar
Digital Library
- Daniel J. Bernstein, Stacey Jeffery, Tanja Lange, and Alexander Meurer. 2013. Quantum Algorithms for the Subset-Sum Problem. In Post-Quantum Cryptography.
Google Scholar
- Dominic W. Berry, Mária Kieferová, Artur Scherer, Yuval R. Sanders, Guang Hao Low, Nathan Wiebe, Craig Gidney, and Ryan Babbush. 2017. Improved techniques for preparing eigenstates of fermionic Hamiltonians. npj Quantum Information, 4 (2017), https://doi.org/10.1038/s41534-018-0071-5
Google Scholar
Cross Ref
- Benjamin Bichsel, Maximilian Baader, Timon Gehr, and Martin Vechev. 2020. Silq: A High-Level Quantum Language with Safe Uncomputation and Intuitive Semantics. In ACM SIGPLAN Conference on Programming Language Design and Implementation. https://doi.org/10.1145/3385412.3386007
Google Scholar
Digital Library
- Aaron Bohannon, J. Nathan Foster, Benjamin C. Pierce, Alexandre Pilkiewicz, and Alan Schmitt. 2008. Boomerang: Resourceful Lenses for String Data. In ACM SIGPLAN Symposium on Principles of Programming Languages. https://doi.org/10.1145/1328438.1328487
Google Scholar
Digital Library
- Kyle E. C. Booth, Bryan O' Gorman, Jeffrey Marshall, Stuart Hadfield, and Eleanor Rieffel. 2021. Quantum-accelerated constraint programming. Quantum, https://doi.org/10.22331/q-2021-09-28-550
Google Scholar
Cross Ref
- William Bowman, Roshan James, and Amr Sabry. 2011. Dagger Traced Symmetric Monoidal Categories and Reversible Programming. In Workshop on Reversible Computation.
Google Scholar
- Harry Buhrman, Bruno Loff, Subhasree Patro, and Florian Speelman. 2021. Limits of quantum speed-ups for computational geometry and other problems: Fine-grained complexity via quantum walks. arxiv:2106.02005.
Google Scholar
- Harry Buhrman, Bruno Loff, Subhasree Patro, and Florian Speelman. 2022. Memory Compression with Quantum Random-Access Gates. https://doi.org/10.48550/ARXIV.2203.05599 arxiv:2203.05599.
Google Scholar
- Shantanav Chakraborty, András Gilyén, and Stacey Jeffery. 2019. The Power of Block-Encoded Matrix Powers: Improved Regression Techniques via Faster Hamiltonian Simulation. https://doi.org/10.4230/LIPICS.ICALP.2019.33 arxiv:1804.01973.
Google Scholar
Cross Ref
- Lijie Chen and Ramis Movassagh. 2021. Quantum Merkle Trees. https://doi.org/10.48550/ARXIV.2112.14317 arxiv:2112.14317.
Google Scholar
- K-W Cheng and C-C Tseng. 2002. Quantum full adder and subtractor. Electron. Lett., 38 (2002), https://doi.org/10.1049/el:20020949
Google Scholar
Cross Ref
- Mitchell Chiew, Kooper de Lacy, Chao-Hua Yu, Sam Marsh, and Jingbo Wang. 2019. Graph comparison via nonlinear quantum search. Quantum Information Processing, 18 (2019), 08, https://doi.org/10.1007/s11128-019-2407-2
Google Scholar
Digital Library
- Andrew M. Childs, Dmitri Maslov, Yunseong Nam, Neil J. Ross, and Yuan Su. 2018. Toward the first quantum simulation with quantum speedup. Proceedings of the National Academy of Sciences, 115, 38 (2018), https://doi.org/10.1073/pnas.1801723115
Google Scholar
Cross Ref
- D. Coppersmith. 1994. An approximate Fourier transform useful in quantum factoring.
Google Scholar
- Yongshan Ding, Xin-Chuan Wu, Adam Holmes, Ash Wiseth, Diana Franklin, Margaret Martonosi, and Frederic T. Chong. 2020. SQUARE: Strategic Quantum Ancilla Reuse for Modular Quantum Programs via Cost-Effective Uncomputation. In International Symposium on Computer Architecture. https://doi.org/10.1109/ISCA45697.2020.00054
Google Scholar
Digital Library
- Thomas G. Draper. 2000. Addition on a Quantum Computer. arxiv:quant-ph/0008033.
Google Scholar
- Edward Farhi, Jeffrey Goldstone, and Sam Gutmann. 2014. A Quantum Approximate Optimization Algorithm. https://doi.org/10.48550/ARXIV.1411.4028 arxiv:1411.4028.
Google Scholar
- Edward Fredkin and Tommaso Toffoli. 1982. Conservative logic. International Journal of Theoretical Physics, 21 (1982), https://doi.org/10.1007/BF01857727
Google Scholar
Cross Ref
- Craig Gidney. 2022. Quantum Dictionaries without QRAM. https://doi.org/10.48550/ARXIV.2204.13835 arxiv:2204.13835.
Google Scholar
- Vittorio Giovannetti, Seth Lloyd, and Lorenzo Maccone. 2008. Quantum Random Access Memory. Physical Review Letters, 100, 16 (2008), Apr, https://doi.org/10.1103/physrevlett.100.160501
Google Scholar
Cross Ref
- Oded Goldreich and Rafail Ostrovsky. 1996. Software Protection and Simulation on Oblivious RAMs. J. ACM, 43, 3 (1996), May, https://doi.org/10.1145/233551.233553
Google Scholar
Digital Library
- Alexander S. Green, Peter LeFanu Lumsdaine, Neil J. Ross, Peter Selinger, and Benoît Valiron. 2013. Quipper: A Scalable Quantum Programming Language. In ACM SIGPLAN Conference on Programming Language Design and Implementation. https://doi.org/10.1145/2491956.2462177
Google Scholar
Digital Library
- Lov K. Grover. 1996. A Fast Quantum Mechanical Algorithm for Database Search. In ACM Symposium on Theory of Computing. https://doi.org/10.1145/237814.237866
Google Scholar
Digital Library
- Aram W. Harrow, Avinatan Hassidim, and Seth Lloyd. 2009. Quantum Algorithm for Linear Systems of Equations. Physical Review Letters, 103, 15 (2009), Oct, https://doi.org/10.1103/physrevlett.103.150502
Google Scholar
Cross Ref
- Jason D. Hartline, Edwin S. Hong, Alexander E. Mohr, William R. Pentney, and Emily C. Rocke. 2002. Characterizing History Independent Data Structures. In Algorithms and Computation, Prosenjit Bose and Pat Morin (Eds.).
Google Scholar
- Tue Haulund. 2017. Design and Implementation of a Reversible Object-Oriented Programming Language. https://doi.org/10.48550/ARXIV.1707.07845 arxiv:1707.07845.
Google Scholar
- Md Saiful Islam, Muhammad Mahbubur Rahman, Zerina Begum, and Mohd Z Hafiz. 2009. Low cost quantum realization of reversible multiplier circuit. Information technology journal, 8, 2 (2009), https://doi.org/10.3923/itj.2009.208.213
Google Scholar
Cross Ref
- Stacey Jeffery, Robin Kothari, and Frederic Magniez. 2013. Nested Quantum Walks with Quantum Data Structures. In ACM-SIAM Symposium on Discrete Algorithms. https://doi.org/10.1137/1.9781611973105.106
Google Scholar
Cross Ref
- Ivan Kassal, James D. Whitfield, Alejandro Perdomo-Ortiz, Man-Hong Yung, and Alán Aspuru-Guzik. 2011. Simulating Chemistry Using Quantum Computers. Annual Review of Physical Chemistry, 62, 1 (2011), https://doi.org/10.1146/annurev-physchem-032210-103512
Google Scholar
Cross Ref
- Iordanis Kerenidis and Anupam Prakash. 2016. Quantum Recommendation Systems. https://doi.org/10.48550/ARXIV.1603.08675 arxiv:1603.08675.
Google Scholar
- E Knill. 1996. Conventions for quantum pseudocode.
Google Scholar
Cross Ref
- Gushu Li, Li Zhou, Nengkun Yu, Yufei Ding, Mingsheng Ying, and Yuan Xie. 2020. Projection-Based Runtime Assertions for Testing and Debugging Quantum Programs. In ACM Conference on Object-Oriented Programming, Systems, Languages, and Applications. https://doi.org/10.1145/3428218
Google Scholar
Digital Library
- Richard L. Liboff. 1980. Introductory quantum mechanics. Addison-Wesley.
Google Scholar
- Christopher Lutz. 1986. Janus: a time-reversible language. Letter to R. Landauer.
Google Scholar
- Olivia Di Matteo, Vlad Gheorghiu, and Michele Mosca. 2020. Fault-Tolerant Resource Estimation of Quantum Random-Access Memories. IEEE Transactions on Quantum Engineering, 1 (2020), https://doi.org/10.1109/tqe.2020.2965803
Google Scholar
Cross Ref
- Donald R. Morrison. 1968. PATRICIA–Practical Algorithm To Retrieve Information Coded in Alphanumeric. J. ACM, 15, 4 (1968), Oct, https://doi.org/10.1145/321479.321481
Google Scholar
Digital Library
- Moni Naor and Vanessa Teague. 2001. Anti-persistence: History independent data structures. In ACM Symposium on Theory of Computing. https://doi.org/10.1145/380752.380844
Google Scholar
Digital Library
- Michael A. Nielsen and Isaac L. Chuang. 2010. Quantum Computation and Quantum Information: 10th Anniversary Edition. Cambridge University Press.
Google Scholar
Digital Library
- Alexandru Paler, Oumarou Oumarou, and Robert Basmadjian. 2020. Parallelizing the queries in a bucket-brigade quantum random access memory. Physical Review A, 102, 3 (2020), Sep, https://doi.org/10.1103/physreva.102.032608
Google Scholar
Cross Ref
- Anouk Paradis, Benjamin Bichsel, Samuel Steffen, and Martin Vechev. 2021. Unqomp: Synthesizing Uncomputation in Quantum Circuits. In ACM SIGPLAN Conference on Programming Language Design and Implementation. https://doi.org/10.1145/3453483.3454040
Google Scholar
Digital Library
- Jennifer Paykin, Robert Rand, and Steve Zdancewic. 2017. QWIRE: A Core Language for Quantum Circuits. In ACM SIGPLAN Symposium on Principles of Programming Languages. https://doi.org/10.1145/3009837.3009894
Google Scholar
Digital Library
- Romain Péchoux, Simon Perdrix, Mathys Rennela, and Vladimir Zamdzhiev. 2020. Quantum Programming with Inductive Datatypes: Causality and Affine Type Theory. In Lecture Notes in Computer Science. Springer International Publishing. https://doi.org/10.1007/978-3-030-45231-5_29
Google Scholar
Digital Library
- Peter Selinger and Benoît Valiron. 2005. A Lambda Calculus for Quantum Computation with Classical Control. Typed Lambda Calculi and Applications, https://doi.org/10.1017/S0960129506005238
Google Scholar
Digital Library
- Run-Hua Shi. 2021. Quantum Bloom Filter and Its Applications. IEEE Transactions on Quantum Engineering, https://doi.org/10.1109/TQE.2021.3054623
Google Scholar
Cross Ref
- Peter W. Shor. 1997. Polynomial-Time Algorithms for Prime Factorization and Discrete Logarithms on a Quantum Computer. SIAM J. Comput., 26, 5 (1997), Oct, https://doi.org/10.1137/S0097539795293172
Google Scholar
Digital Library
- Krysta Svore, Martin Roetteler, Alan Geller, Matthias Troyer, John Azariah, Christopher Granade, Bettina Heim, Vadym Kliuchnikov, Mariia Mykhailova, and Andres Paz. 2018. Q#: Enabling Scalable Quantum Computing and Development with a High-level DSL. In Real World Domain Specific Languages Workshop. https://doi.org/10.1145/3183895.3183901
Google Scholar
Digital Library
- Michael Kirkedal Thomsen and Holger Bock Axelsen. 2015. Interpretation and Programming of the Reversible Functional Language RFUN. In Symposium on the Implementation and Application of Functional Programming Languages. https://doi.org/10.1145/2897336.2897345
Google Scholar
Digital Library
- Carlin Vieri. 1995. Pendulum–a reversible computer architecture.
Google Scholar
- Xiao Shaun Wang, Kartik Nayak, Chang Liu, T-H. Hubert Chan, Elaine Shi, Emil Stefanov, and Yan Huang. 2014. Oblivious Data Structures. In ACM SIGSAC Conference on Computer and Communications Security. https://doi.org/10.1145/2660267.2660314
Google Scholar
Digital Library
- Dave Wecker, Krysta M. Svore, and Krysta M. Svore. 2014. LIQUi|>: A Software Design Architecture and Domain-Specific Language for Quantum Computing. February.
Google Scholar
- Andrew C. Yao. 1982. Protocols for Secure Computations. In Symposium on Foundations of Computer Science. https://doi.org/10.5555/1382436.1382751
Google Scholar
Digital Library
- Tetsuo Yokoyama and Robert Glück. 2007. A Reversible Programming Language and Its Invertible Self-Interpreter. In ACM SIGPLAN Symposium on Partial Evaluation and Semantics-Based Program Manipulation. https://doi.org/10.1145/1244381.1244404
Google Scholar
Digital Library
- Charles Yuan and Michael Carbin. 2022. Tower: Data Structures in Quantum Superposition. https://doi.org/10.5281/zenodo.6819031
Google Scholar
Digital Library
- Samee Zahur and David Evans. 2013. Circuit Structures for Improving Efficiency of Security and Privacy Tools. In IEEE Symposium on Security and Privacy. https://doi.org/10.1109/SP.2013.40
Google Scholar
Digital Library
Index Terms
Tower: data structures in Quantum superposition
Recommendations
Twist: sound reasoning for purity and entanglement in Quantum programs
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 ...
Ket Quantum Programming
Quantum programming languages (QPL) fill the gap between quantum mechanics and classical programming constructions, simplifying the development of quantum applications. However, most QPL addresses the inherent quantum programming problem, neglecting ...
Quantum Programming With Mixed States
In this paper we offer a programming approach to quantum computation using mixed states. Mixed-state quantum systems generalise standard (pure) quantum systems by allowing the state of the system to be a probabilistic distribution of pure states. We ...






Comments