Manuscript Offprint
arXiv:2610.06702Optimal compression with quantum retrieval
Abstract
We consider the following data compression problem. Given a string of Hamming weight at most , compress it into a shorter string so that any bit of can be retrieved without any error using at most quantum queries to the standard oracle encoding of . If queries are allowed to be adaptive we show how optimal compression up to a logarithmic factor can be achieved. If the queries are required to be made non-adaptively, we show schemes whose space is optimal in its dependence on except for a logarithmic factor, and is at most quadratically worse when compared to the optimum in its dependence on .
1 Introduction
We consider the following data compression problem. Given a string of Hamming weight at most , compress it into a shorter string so that any bit of can be recovered without any error using at most quantum queries to the standard oracle encoding of . Note that the problem is interesting only when (say), for otherwise we may take , and match up to constant factors the information-theoretic minimum of which holds for any compression scheme. Let be the minimum such that such a compression is possible. We show the following.
Theorem 1. For all m, and t, we have .
Remarks. (a) This upper bound may be compared with the following lower bound derived in [18, 7] for this problem (valid for ):
The upper bound of Theorem 1 is worse than this lower bound by a factor for .
*Dr. Vishwanath Karad MIT World Peace University, Pune, India. E-mail: shyam.dhamapurkar@mitwpu.edu.in.
The Institute of Mathematical Sciences, Chennai, India. Homi Bhabha National Institute, Mumbai, India. E-mail: garg@imsc.res.in.
Indian Institute of Technology, Hyderabad, India. E-mail: manaswi@cse.iith.ac.in.
International Center for Theoretical Sciences, Tata Institute of Fundamental Research, Bengaluru, India. E-mail: jaikumar.radhakrishnan@icts.res.in.
(b) For , our upper bound reduces to , which matches the lower bound , valid for all values of . The same upper bound for was earlier derived in [16].
In our scheme, the compressed string is probed in superposition times, sequentially or adaptively (see Fig. 1a). Following the classical literature for this problem, we also consider compression schemes where probes into are made in parallel or non-adaptively. We model such a query algorithm by a circuit where, to determine the -th bit of the input string , an initial joint (superposition) state is prepared on query registers, after which the oracle for the compressed string is applied to each of the query registers. Finally, the bit is recovered by performing an appropriate joint measurement on the final state (see Fig. 1b). Let be the minimum length of the compressed string for which the bits of the input string can be recovered using parallel queries.
Theorem 2. For all and , we have .
This upper bound has the right dependence on m (see Eq. (1)); the dependence on n is worse than in Theorem 1 but it is nevertheless a small polynomial in n. When n is a constant, the factor in Theorems 1 and 2 can be avoided, and a compression all the way to can be established.
Classical versus quantum: Furthermore, we note that while Eq. (1) is the best available for large t for classical schemes, the following counterparts [13, 11] of Theorems 1 and 2 for classical schemes do not match this lower bound.
(a) For odd ,
(b) For odd , , and for ,

3 adaptive queries
(a) A quantum circuit corresponding to an adaptive query scheme that takes an index as classical input and makes three probes to the oracle . , , and are unitaries that depend on the input; the final measurement yields .

4 non-adaptive queries
(b) A non-adaptive query scheme that makes four probes to the oracle , where all probes are fixed in advance and do not depend on any answers.
The quantum upper bounds obtained in this paper point to a quantum advantage. It is known that classical two-probe schemes can essentially do no better than a characteristic vector when , whereas our two-probe schemes provide significant compression even when for a constant . For larger , we have a classical lower bound
valid for all . Since the dependence on in our quantum upper bounds is of the form instead of , it shows that quantum schemes continue to enjoy some advantage for larger values of as well.
Adaptive versus non-adaptive: It is known that classical non-adaptive two-probe schemes are powerless: they offer no compression, not even one bit! In contrast, our two-probe quantum non-adaptive scheme allows compression to bits which provides significant savings for a large range of values of n.
Shallow quantum circuits: All the query algorithms that we present have the following property: For every probe, the state of the registers is prepared in superposition, a query is made, a unitary is applied to the registers and all the registers are measured in the computational basis. The lower bound applies to circuits that are allowed to maintain the registers in a superposition till the very end when the final measurement is made. It is remarkable that a scheme with shallow quantum circuits (complete measurement between any two queries) essentially matches the lower bound. It is known [14] such a shallow circuit offers no advantage for other problems, e.g., database search.
AI statement
We used OpenAI’s ChatGPT (Sol and Astra) and Anthropic’s Claude (Opus 5.5) for mathematical exploration, proof development, literature searches, and copy editing; the figures were generated by an AI agent from handwritten drawings supplied by the authors. Before consulting AI systems, we had obtained the two-probe adaptive scheme based on Bernstein–Vazirani and a non-adaptive scheme with the optimal dependence on m. The adaptive bound was developed through iterative discussions with ChatGPT from an idea supplied by the authors, while the ideas underlying the non-adaptive bound—private neighborhoods and their use with Deutsch-Jozsa—were supplied by the authors and ChatGPT assisted in developing the proof; the extension to t probes used a recursive template previously developed by the authors. The manuscript was written by the authors, with AI-assisted copy editing, and the authors retain full responsibility for its correctness, originality, attribution, and integrity.
2 Preliminaries
We write for . For a string , its Hamming weight is the number of 1s in it. We write for the set of all strings in with weight at most , that is, .
Definition 2.1 (Compression schemes with adaptive and non-adaptive retrieval). An -compression scheme S consists of a storage scheme and a query circuit . The storage scheme is a function
The query circuit is a quantum circuit that consists of the following:
-
A special classical register of bits capable of carrying an index ;
-
Arbitrary unitary operations on the quantum registers that are controlled by the index register I;
-
At most oracle gates of the form for some (note all oracle gates in the circuit are for the same string ), which acts as follows:
- A measurement at the end that yields an outcome in .
The query scheme is non-adaptive (see Fig. 1b) if the oracle gates are applied in parallel; alternatively, we may assume that the query circuit is allowed to use a product oracle gate of the form (for some ), which appears exactly once in the circuit. If the query scheme is allowed to use the outcome of an earlier application of to determine the query fed into a later , then we say that it is adaptive (see Fig. 1a). A compression scheme is valid if for all of Hamming weight at most and all , the circuit with the classical register initialized to and all its oracle gates as yields (with probability 1) as the outcome of the final measurement. Let be the smallest such that there exists a valid -compression scheme. Let be the smallest such that there exists a valid -compression scheme whose query scheme is non-adaptive.
Remark. We have modelled quantum query algorithms as circuits. In our proofs however, we will not present the circuits explicitly. We will describe them in informal language as a sequence of steps, some of which will be well-known quantum algorithms, e.g., the Bernstein-Vazirani algorithm or the Deutsch-Jozsa algorithm. It will be straightforward to see that one can represent these informally stated quantum algorithms as formal quantum circuits.
2.1 Expander graphs
In our schemes, we will use certain bipartite expander graphs. It will be convenient to represent our bipartite graphs as functions of the form
where represents the left vertices of and the right vertices of . In these bipartite graphs, the vertices of will have edges leaving them and will be labeled by distinct elements of . Often and will be sets of the form and will not be formally disjoint, but when referring to a vertex it will be clear from the context whether a vertex of or a vertex of is meant. We use to refer to the neighbors of a vertex , that is,
The existence of expander graphs with appropriate parameters is established in the following lemmas. Note that when these graphs are used in the query algorithm, they will be assumed to be hardwired into the underlying circuit (independent of the input), and will not be stored as part of the compressed string.
Lemma 3. For all and , there is a bipartite graph with such that for every set of size at most , we have .
Remark. In particular, for graphs promised by the above lemma, by Hall's theorem, for every set of size at most , there is a matching in that saturates . That is, for every such set , we can find labels such that is a sequence of distinct elements in .
Proof of Theorem 3. For , we may take and set for all . Clearly, this bipartite graph has a matching that saturates . So, we assume .
Pick independently for each pair in the domain. By the union bound, the probability that fails to provide the required expansion is bounded by
By setting , we can ensure that the right hand side is strictly less than 1. It follows that the random has the required property with positive probability.
Lemma 4. For all and , there is a bipartite graph with such that
(i) d is a power of 2;
(ii) for every , we have ;
(iii) for every set of size at most and every , we have
Proof of Theorem 4. If , it is straightforward to build such a graph , where all vertices in are assigned distinct neighbors. So we may assume that .
Construct a random as follows. For each , pick the elements without replacement from . It is enough to establish that for every and for every with elements, we have
We will use a union bound over the choices of and . First fix and . Fix the random choices for the neighborhoods of the elements . Let ; then, . When the random choices for the neighbors of are made, is a uniformly chosen random set from with elements; then, . By Chvátal's bound [8]
Taking a union bound over the choices for , we conclude that the probability that G fails to have the desired property is at most
Set to be a power of 2 at least , so that the right-hand side is less than 1. Thus, has the required properties with positive probability.
3 Two-probe schemes
As mentioned in the Introduction, the new ideas that lead to Theorems 1 and 2 are already contained in the case of two probes. In this section, we describe these two-probe schemes. Each of these schemes is built upon one well-known quantum element. The adaptive scheme uses the Bernstein-Vazirani algorithm to extract a string from its -bit Hadamard encoding by making just one quantum probe into the oracle . The non-adaptive scheme uses the Deutsch-Jozsa algorithm to tell apart strings that have exactly 1s from those that have no 1s at all, by making just one quantum probe into the oracle .

Figure 2: The basic template for the two-probe adaptive scheme
3.1 The adaptive two-probe scheme
Let be a string in that we wish to compress. Partition the sequence into equal substrings of bits each; we will choose the later in order to obtain a good compression. Since has weight at most , at most of the will be non-zero, say , where . The idea is to only store these non-zero substrings. Let be a string of bits obtained by concatenating in that order and, and adding zeroes at the end if . When presented an index , we need to determine where the substring containing is stored. This will be achieved by making an initial quantum probe. For the first probe, we store for each of the substrings the position in , where the that substring is stored, or 0 if the block was not a part of , because it was all zeroes. More precisely, for , let be the Hadamard encoding for the unique such that ; if no such exists (because is all zeroes) set . The query algorithm is straightforward. In order to determine , it first determines the index , such that contains ; this can be done using standard deterministic classical computation and requires no probe to the oracle. Then, the algorithm reads the number from using the Bernstein-Vazirani algorithm; if is 0 then the query returns 0; otherwise, the answer is obtained by reading the appropriate bit of . We summarize our observations as follows (see Fig. 2).
Lemma 5. Fix . There is a valid adaptive two-probe compression scheme that compresses a string into a string of the form , where bits and . The query algorithm can retrieve any bit of by making one quantum probe into followed by a classical probe into .
With this we may set and immediately conclude that . This, falls short of the near optimal bound claimed in Theorem 1 for . In the above scheme, the -th entry of bits in revealed the destination for the substring ; if the set of possible destinations of each could be made smaller, then we could manage with fewer than bits per entry in . To get the near optimal bound claimed in Theorem 1, we limit the possible destination using a bipartite expander graph with the property that for every set of vertices, there is a matching in that saturates . Such a bipartite graph with is promised in Theorem 3 (also see the remark immediately after the lemma). Fix such a graph. We find a matching in this bipartite graph that saturates the set of indices of the non-zero substrings identified above.
Let be the matching. For , we store in ; we store in the other positions in . We next describe how we use the matching to arrange the substrings in . We imagine to be an array of 2n entries, where each entry is string of bits. Note that for , the numbers are distinct elements of . We set ; that is, we route the non-empty substring to the position in corresponding to the vertex in that is matched to. To retrieve from , the query algorithm determines the substring that is part of (this needs no probes), determines using one quantum probe to , and finally reads one bit from the appropriate position of . We summarize the above observation as follows.
Lemma 6. Fix . There is a valid adaptive two-probe compression scheme that compresses a string into a string of the form , where and . The query algorithm can retrieve any bit of by making one quantum probe into followed by a classical probe into .
Note that by setting , we can conclude from this that ; but for the factor , this bound is asymptotically optimal.
3.2 The non-adaptive two-probe scheme
The non-adaptive scheme for bears some similarity to the adaptive schemes discussed above (see Fig. 3). As before, we partition into substrings of bits each. The string now has bits; we set if is non-zero and 0 otherwise, so one classical probe into reveals if is all zeroes. This time, will be set up for an application of the Deutsch-Jozsa algorithm. The contents of will be based on a bipartite graph , with the following property:
For every set with elements, for every , we have
We show below, using Theorem 4 how such a bipartite graph with appropriate parameters can be constructed; the bipartite graph will be fixed depending on and , but independent of the string that needs to be compressed. For now, let us assume that such bipartite graph can be found. Then, will be a string of length , whose bits are determined as follows. Let be the set of indices such that is part of one of the non-zero strings . Then, . By the above property of the bipartite graph, we may assign to each a set of neighbors such that is a sequence of pairwise disjoint sets, each with elements. For all and , we set ; the remaining bits of are set to 0. To determine from , the query algorithm non-adaptively makes one probe each to and .
Probe into : The algorithm determines (classically) the substring to which belongs; then it reads . Recall that indicates whether or not the substring to with belongs is all zeroes.


(a) The input string split into columns

(b) One copy of H for each column
Figure 3: The template for the non-adaptive scheme
Probe into : We regard as a 0-1 labelling of the vertices of . In the bipartite graph , each vertex has a set of neighbors. The query algorithm uses the Deutsch-Jozsa algorithm on the labeling restricted to to obtain a bit . Note that is designed so that for , all its neighbors are labelled 0 if , and exactly half of them are labelled 0 if .
Using one probe each into the two strings, the query algorithm computes and as described above; it then returns as its output. If , we have and , and the query algorithm returns the correct answer. For , then by definition ; since in this case, the query algorithm's answer is correct.
The expander graph: Our graph will be of the form . We will view as and as ; so, the left vertices of the are of the form and the right vertices are of the form . Let be the graph promised by Theorem 4. Then, for and , let . With the identification of with and and with , we obtain a bipartite graph with that has the required properties. We may view this construction as follows. We write the numbers in in a array in the natural order, increasing from left to right and top to bottom. We place a copy of between the indices in each column and a fresh set of 10nd vertices; to obtain the required graph , we take the union of all these graphs. See Fig. 3. We summarize the above observations.
Lemma 7. Fix . There is a valid non-adaptive two-probe compression scheme that compresses a string into a string of the form , where and . The query algorithm can retrieve any bit of by making one classical probe into followed by a quantum probe into .
We may set , and conclude that .
4 The general schemes via recursion
We observe that a -compression scheme whose query algorithm makes at least one classical probe into a memory that is always assigned a string of Hamming weight at most n, can be naturally lifted, via a recursive construction, to a t-probe scheme for every , while retaining the adaptive or non-adaptive nature of the original scheme. For , the scheme proceeds exactly as the two-probe scheme, except instead of making the classical probe to read the bit, it retrieves the bit using using a -probe scheme recursively.
Let illustrate this principle with the two-probe schemes presented in the previous section.
Proof of Theorem 1. Consider the adaptive scheme presented in Theorem 6. The scheme uses and , where the classical probe is made into . Furthermore, and . We may compress recursively, if we are allowed more probes. In particular, this yields the bound:
When solved together with the obvious upper bound (in particular, for the base case ), we obtain the bound stated in Theorem 1.
A convenient induction hypothesis is
for an absolute constant C. Let
For , choose
where A is a sufficiently large absolute constant. Then
assuming . Moreover, writing
we have
Applying the induction hypothesis to the recursive term gives
for some absolute constant , by choosing A sufficiently large. Thus the first term is absorbed by the slack in the recursive term, for a sufficiently large absolute constant C, and hence
10
☐
Proof of Theorem 2. For the non-adaptive scheme, we use Theorem 7 and obtain
When solved together with the obvious upper bound (in particular, for the base case ), we obtain the bound stated in Theorem 2. A convenient induction hypothesis is
for an absolute constant C. For , choose
Applying the induction hypothesis to the recursive term, and using , gives
for a sufficiently large absolute constant C, which completes the proof of Theorem 2.
References
[1] Noga Alon and Uriel Feige. On the power of two, three and four probes. In Claire Mathieu, editor, Proceedings of the Twentieth Annual ACM-SIAM Symposium on Discrete Algorithms, SODA 2009, New York, NY, USA, January 4-6, 2009, pages 346–354. SIAM, 2009.
[2] Mirza Galib Anwarul Husain Baig and Deepanjan Kesh. Two new schemes in the bit-probe model. In M. Sohel Rahman, Wing-Kin Sung, and Ryuhei Uehara, editors, WAL-COM: Algorithms and Computation - 12th International Conference, WALCOM 2018, Dhaka, Bangladesh, March 3-5, 2018, Proceedings, volume 10755 of Lecture Notes in Computer Science, pages 68–79. Springer, 2018.
[3] Mirza Galib Anwarul Husain Baig and Deepanjan Kesh. Improved bounds for two query adaptive bitprobe schemes storing five elements. Theoretical Computer Science, 838:208–230, 2020.
[4] Mirza Galib Anwarul Husain Baig and Deepanjan Kesh. Two improved schemes in the bitprobe model. Theoretical Computer Science, 806:543–552, 2020.
[5] Mirza Galib Anwarul Husain Baig, Deepanjan Kesh, and Chirag Sodani. An improved scheme in the two query adaptive bitprobe model. In Charles J. Colbourn, Roberto Grossi, and Nadia Pisanti, editors, Combinatorial Algorithms - 30th International Workshop, IWOCA 2019, Pisa, Italy, July 23-25, 2019, Proceedings, volume 11638 of Lecture Notes in Computer Science, pages 22–34. Springer, 2019.
[6] Mirza Galib Anwarul Husain Baig, Deepanjan Kesh, and Chirag Sodani. A two query adaptive bitprobe scheme storing five elements. In Gautam K. Das, Partha Sarathi Mandal, Krishnendu Mukhopadhyaya, and Shin-Ichi Nakano, editors, WALCOM: Algorithms and Computation
- 13th International Conference, WALCOM 2019, Guwahati, India, February 27 - March 2, 2019, Proceedings, volume 11355 of Lecture Notes in Computer Science, pages 317–328. Springer, 2019.
[7] H. Buhrman, P. B. Miltersen, J. Radhakrishnan, and S. Venkatesh. Are bitvectors optimal? SIAM Journal on Computing, 31(6):1723–1744, 2002.
[8] Vasek Chvátal. The tail of the hypergeometric distribution. Discret. Math., 25(3):285–287, 1979.
[9] Palash Dey, Jaikumar Radhakrishnan, and Santhoshini Velusamy. Improved explicit data structures in the bit-probe model using error-correcting codes. In 45th International Symposium on Mathematical Foundations of Computer Science (MFCS 2020), Leibniz International Proceedings in Informatics (LIPIcs), Dagstuhl, Germany, 2020. Schloss Dagstuhl–Leibniz-Zentrum für Informatik.
[10] Shyam S. Dhamapurkar, Shubham Vivek Pawar, and Jaikumar Radhakrishnan. Set Membership with Two Classical and Quantum Bit Probes. In Mikolaj Bojańczyk, Emanuela Merelli, and David P. Woodruff, editors, 49th International Colloquium on Automata, Languages, and Programming (ICALP 2022), volume 229 of Leibniz International Proceedings in Informatics (LIPIcs), pages 52:1–52:19, Dagstuhl, Germany, 2022. Schloss Dagstuhl – Leibniz-Zentrum für Informatik.
[11] Mohit Garg. The Bit-Probe Complexity of Set Membership. PhD thesis, Tata Institute of Fundamental Research, 2016.
[12] Mohit Garg and Jaikumar Radhakrishnan. Set membership with a few bit probes. In Proc. 26th Annual ACM-SIAM Symposium on Discrete Algorithms (SODA), pages 776–784, 2015.
[13] Mohit Garg and Jaikumar Radhakrishnan. Set membership with non-adaptive bit probes. In Proc. 34th Symposium on Theoretical Aspects of Computer Science (STACS 2017), pages 38:1–38:13, 2017.
[14] Yassine Hamoudi, Qipeng Liu, and Makrand Sinha. The nisq complexity of collision finding. page 3–32, Berlin, Heidelberg, 2024. Springer-Verlag.
[15] Patrick K. Nicholson, Venkatesh Raman, and S. Srinivasa Rao. A survey of data structures in the bitprobe model. In Andrej Brodnik, Alejandro López-Ortiz, Venkatesh Raman, and Alfredo Viola, editors, Space-Efficient Data Structures, Streams, and Algorithms: Papers in Honor of J. Ian Munro on the Occasion of His 66th Birthday, pages 303–318. Springer Berlin Heidelberg, Berlin, Heidelberg, 2013.
[16] Rasmus Pagh. On the cell probe complexity of membership and perfect hashing. In Proc. 33rd Annual ACM Symposium on Theory of Computing (STOC), 2001.
[17] Jaikumar Radhakrishnan, Venkatesh Raman, and S. Srinivasa Rao. Explicit deterministic constructions for membership in the bitprobe model. In Friedhelm Meyer auf der Heide, editor, Algorithms - ESA 2001, 9th Annual European Symposium, Aarhus, Denmark, August 28-31, 2001, Proceedings, volume 2161 of Lecture Notes in Computer Science, pages 290–299. Springer, 2001.
[18] Jaikumar Radhakrishnan, Pranab Sen, and Srinivasan Venkatesh. The quantum complexity of set membership. In 41st Annual Symposium on Foundations of Computer Science, FOCS 2000, 12-14 November 2000, Redondo Beach, California, USA, pages 554–562. IEEE Computer Society, 2000.