Memory Compression with Quantum Random-Access Gates

Authors Harry Buhrman, Bruno Loff, Subhasree Patro, Florian Speelman

Thumbnail PDF


  • Filesize: 0.77 MB
  • 19 pages

Document Identifiers

Author Details

Harry Buhrman
  • QuSoft, CWI Amsterdam, The Netherlands
  • University of Amsterdam, The Netherlands
Bruno Loff
  • University of Porto, Portugal
  • INESC-Tec, Porto, Portugal
Subhasree Patro
  • QuSoft, CWI Amsterdam, The Netherlands
  • University of Amsterdam, The Netherlands
Florian Speelman
  • QuSoft, CWI Amsterdam, The Netherlands
  • University of Amsterdam, The Netherlands


We would like to thank Robin Kothari and Ryan O'Donnell for helpful discussions.

Cite AsGet BibTex

Harry Buhrman, Bruno Loff, Subhasree Patro, and Florian Speelman. Memory Compression with Quantum Random-Access Gates. In 17th Conference on the Theory of Quantum Computation, Communication and Cryptography (TQC 2022). Leibniz International Proceedings in Informatics (LIPIcs), Volume 232, pp. 10:1-10:19, Schloss Dagstuhl – Leibniz-Zentrum für Informatik (2022)


In the classical RAM, we have the following useful property. If we have an algorithm that uses M memory cells throughout its execution, and in addition is sparse, in the sense that, at any point in time, only m out of M cells will be non-zero, then we may "compress" it into another algorithm which uses only m log M memory and runs in almost the same time. We may do so by simulating the memory using either a hash table, or a self-balancing tree. We show an analogous result for quantum algorithms equipped with quantum random-access gates. If we have a quantum algorithm that runs in time T and uses M qubits, such that the state of the memory, at any time step, is supported on computational-basis vectors of Hamming weight at most m, then it can be simulated by another algorithm which uses only O(m log M) memory, and runs in time Õ(T). We show how this theorem can be used, in a black-box way, to simplify the presentation in several papers. Broadly speaking, when there exists a need for a space-efficient history-independent quantum data-structure, it is often possible to construct a space-inefficient, yet sparse, quantum data structure, and then appeal to our main theorem. This results in simpler and shorter arguments.

Subject Classification

ACM Subject Classification
  • Theory of computation → Quantum complexity theory
  • complexity theory
  • data structures
  • algorithms
  • quantum walk


  • Access Statistics
  • Total Accesses (updated on a weekly basis)
    PDF Downloads


  1. Scott Aaronson, Nai-Hui Chia, Han-Hsuan Lin, Chunhao Wang, and Ruizhe Zhang. On the quantum complexity of closest pair and related problems. In Proceedings of the 35th Computational Complexity Conference, CCC '20, Dagstuhl, DEU, 2020. Schloss Dagstuhl-Leibniz-Zentrum fuer Informatik. URL:
  2. A. Ambainis. Quantum walk algorithm for element distinctness. In 45th Annual IEEE Symposium on Foundations of Computer Science, pages 22-31, 2004. URL:
  3. Daniel J. Bernstein, Stacey Jeffery, Tanja Lange, and Alexander Meurer. Quantum algorithms for the subset-sum problem. In Philippe Gaborit, editor, Post-Quantum Cryptography, pages 16-33, Berlin, Heidelberg, 2013. Springer Berlin Heidelberg. Google Scholar
  4. Harry Buhrman, Bruno Loff, Subhasree Patro, and Florian Speelman. Limits of quantum speed-ups for computational geometry and other problems: Fine-grained complexity via quantum walks, 2021. URL:
  5. Stacey Jeffery. Frameworks for Quantum Algorithms. PhD thesis, University of Waterloo, 2014. Google Scholar
  6. Greg Kuperberg. A subexponential-time quantum algorithm for the dihedral hidden subgroup problem. SIAM J. Comput., 35(1):170-188, July 2005. URL:
  7. María Naya-Plasencia and André Schrottenloher. Optimal merging in quantum -xor and -xor-sum algorithms. In Advances in Cryptology – EUROCRYPT 2020: 39th Annual International Conference on the Theory and Applications of Cryptographic Techniques, Zagreb, Croatia, May 10–14, 2020, Proceedings, Part II, pages 311-340, Berlin, Heidelberg, 2020. Springer-Verlag. URL: