betaFeedback

WorksPhysics and Astronomy

A New Quantum Algorithm Framework for Integer Order Entropy Estimation

Abstract

Entropy estimation for unknown distributions is a basic problem in statistical property estimation. In this paper, we propose a quantum algorithm framework for estimating Rényi entropy with fixed integer order k≥2k\geq 2. Given purified quantum query-access to a distribution on nn symbols, our algorithm estimates its order-kk Rényi entropy to within additive error εε using O~(nukε1−uk+n(k−1)/(2k)ε)\widetilde{\mathcal{O}}\left(\frac{n^{u_k}}{ε^{1-u_k}} + \frac{n^{(k-1)/(2k)}}ε\right) queries, where uk=max⁡2≤j≤k(3k−j)2j−2−kk(2j−1)u_k=\max_{2\leq j\leq k} \frac{(3k-j)2^{j-2}-k}{k(2^j-1)}. The main ingredient is a recursive construction of collision states in which intermediate states are retained and reused. We bound both the preparation and reflection costs, and choose the number of retained states at each order so that all recursive steps fit within a common query budget. We combine this construction with a sequence of decreasing probability thresholds, estimating the contribution of the labels found along the way separately from the remaining power sum. A batch estimator gives the required bound in the high-precision regime, and an initial search removes the need for prior knowledge of the power sum.

Introduction

Estimating properties of unknown probability distributions is a fundamental task in statistics and theoretical computer science. Entropy estimation is a particularly important example: it asks how much information about the uncertainty of a distribution can be obtained without reconstructing all of its probabilities. For a distribution p=(pi)i=1np=(p_i)_{i=1}^n on [n][n] and an integer k≥2k\ge2, the Rényi entropy [1] and the associated power sum are

Hk(p):=11−klog⁡Pk(p),Pk(p):=∑i=1npik.(1)H_k(p):=\frac{1}{1-k}\log P_k(p),\qquad P_k(p):=\sum_{i=1}^{n}p_i^k. \tag*{(1)}

For integer orders, the power sum admits a useful probabilistic interpretation:

Pk(p)=Pr⁡{X1=⋯=Xk},X1,…,Xk∼iidp.P_k(p)=\Pr\{X_1=\cdots=X_k\},\qquad X_1,\ldots,X_k\mathrel{\overset{\mathrm{iid}}{\sim}}p.

Thus it is the probability that kk independent samples have the same label. Such an observation underlies classical collision estimators [2] and quantum algorithms based on distinctness testing [3]. It also suggests preparing coherent quantum states whose label probabilities are proportional to higher powers of pip_i via coherent access to a sampling procedure [3, 4].

This paper studies the following estimation problem.

Problem 1 (Integer order Rényi entropy estimation). Given purified quantum query-access to an unknown probability distribution pp on [n][n], a fixed integer k≥2k\ge2, an additive accuracy ϵ>0\epsilon>0, and a maximum failure probability δ∈(0,1/3)\delta\in(0,1/3), output an estimate H~k(p)\widetilde{H}_k(p) satisfying

Pr⁡{∣H~k(p)−Hk(p)∣≤ϵ}≥1−δ.\Pr\left\{\left|\widetilde{H}_k(p)-H_k(p)\right|\le\epsilon\right\}\ge1-\delta.

The resource measure is the number of queries to the preparation oracle.

Two issues arise when using collision states to estimate entropy. First, additive accuracy in Hk(p)H_k(p) requires relative accuracy in Pk(p)P_k(p), whose value may be as small as n1−kn^{1-k}. Second, a collision state of order s+1s+1 is prepared using states of order ss, so repeated use of the construction must account for the cost of these intermediate states. We address both issues by combining a recursive preparation procedure with quantum mean estimation and a sequence of decreasing probability thresholds.

Main results

We work in the purified quantum query-access model of Definition 1. For each fixed integer k≥2k \ge2, define

uk,j:=(3k−j)2j−2−kk(2j−1),uk:=max⁡2≤j≤kuk,j,bk:=k−12k.(2)u_{k,j} := \frac{(3k-j)2^{j-2}-k}{k(2^j-1)}, \qquad u_k := \max_{2 \le j \le k} u_{k,j}, \qquad b_k := \frac{k-1}{2k}. \tag*{(2)}

Our main result is the following theorem.

Theorem 1 (Main theorem). For any fixed integer k≥2k \ge2, there is a constant ck>0c_k > 0 and a quantum algorithm such that, for any n≥2n \ge2, ϵ∈(0,ck]\epsilon\in(0,c_k], δ∈(0,1/3)\delta\in(0,1/3), and probability distribution pp on [n][n], the algorithm estimates Hk(p)H_k(p) to within additive error ϵ\epsilon with success probability at least 1−δ1-\delta, using

O~k(nukϵ1−uk+nbkϵ)(3)\widetilde{O}_k\left(\frac{n^{u_k}}{\epsilon^{1-u_k}}+\frac{n^{b_k}}{\epsilon}\right) \tag*{(3)}

queries to UpU_p and Up†U_p^\dagger in Definition 1 (controlled access to UpU_p is not required).

We first construct an estimator with success probability at least 2/32/3; independent repetition followed by taking the median gives the stated dependence on δ\delta. The exponents of the query complexity Qk(n,ϵ)Q_k(n,\epsilon) for success probability at least 2/32/3 are summarized in Table I. The two terms in Eq. (3) are equal when ϵ=n−θk\epsilon=n^{-\theta_k}, where

Order kkuku_k1−uk1-u_kbkb_kθk\theta_k
21/31/32/32/31/41/41/41/4
34/94/95/95/91/31/31/41/4
41/21/21/21/23/83/81/41/4
519/3519/3516/3516/352/52/55/195/19
64/74/73/73/75/125/1213/4813/48
1022/3522/3513/3513/359/209/2025/8825/88
117/117/114/114/115/115/112/72/7
1229/4529/4516/4516/4511/2411/2467/23267/232
269/139/134/134/1325/5225/5211/3611/36

Table I. Exponents in quantum query upper bounds Qk(n,ϵ)=O~k(nuk/ϵ1−uk+nbk/ϵ)Q_k(n,\epsilon)=\widetilde{O}_k(n^{u_k}/\epsilon^{1-u_k}+n^{b_k}/\epsilon).

θk:=1−bkuk.(4)\theta_k := 1-\frac{b_k}{u_k}. \tag*{(4)}

Consequently, Theorem 1 gives

Qk(n,ϵ)≤{O~k(nuk/ϵ1−uk),n−θk≤ϵ≤ck,O~k(nbk/ϵ),0<ϵ≤min⁡{ck,n−θk}.(5)Q_k(n,\epsilon) \le \begin{cases} \widetilde{O}_k(n^{u_k}/\epsilon^{1-u_k}), & n^{-\theta_k} \le\epsilon\le c_k,\\ \widetilde{O}_k(n^{b_k}/\epsilon), & 0 < \epsilon\le\min\{c_k,n^{-\theta_k}\}. \end{cases} \tag*{(5)}

Dependence on the integer order

We describe how the query exponent depends on the integer order. By subtracting adjacent terms in Eq. (2), we obtain

uk,j+1≥uk,j⟺k≥2j+1−j−2.u_{k,j+1} \ge u_{k,j} \quad\Longleftrightarrow\quad k \ge2^{j+1}-j-2.

A maximizing level jj therefore satisfies

2j−j−1≤k≤2j+1−j−2,2≤j≤k.(6)2^j-j-1 \le k \le2^{j+1}-j-2,\qquad2 \le j \le k. \tag*{(6)}

Adjacent levels give the same value at a shared endpoint. The first ranges are displayed in Table II. Eq. (6) implies j=log⁡2k+O(1)j=\log_2 k+O(1). Using

uk,j=34−j2j−2+k/4k(2j−1)u_{k,j}=\frac{3}{4}-\frac{j2^{j-2}+k/4}{k(2^j-1)}

therefore gives

uk=34−log⁡2k4k+O(1/k).(7)u_k = \frac{3}{4} - \frac{\log_2 k}{4k} + O(1/k). \tag*{(7)}

This maximizing level identifies the term that determines the common query budget. Our algorithm still constructs collision prefixes successively up to the requested order kk.

Level jjInteger orders kkuku_k
22≤k≤42 \le k \le4(2k−2)/(3k)(2k - 2)/(3k)
34≤k≤114 \le k \le11(5k−6)/(7k)(5k - 6)/(7k)
411≤k≤2611 \le k \le26(11k−16)/(15k)(11k - 16)/(15k)
526≤k≤5726 \le k \le57(23k−40)/(31k)(23k - 40)/(31k)
657≤k≤12057 \le k \le120(47k−96)/(63k)(47k - 96)/(63k)

Table 2. Levels controlling the recursive budget. Shared endpoints have two maximizing levels.

Techniques

We describe the main ideas before giving the constructions and proofs. The framework has three components: a recursive procedure for preparing collision states, a threshold-based decomposition of the power sum, and a preliminary estimate of its scale.

1) Recursive preparation of collision states: For a known set A⊆[n]A \subseteq[n], a collision state of order ss has label probabilities proportional to pisp_i^s on AA. To extend it, we retain several copies, choose one uniformly, and compare its label with that of a fresh purified sample. Conditional on equality, the selected registers form a collision state of order s+1s+1. The routing operation moves the complete purification registers. Consequently, the unused copies are restored and factor from the output state.

To analyze preparation and reflection together, we use the transducer framework of Belovs, Jeffery, and Yolcu [5] and the amplification and estimation tools of Cornelissen, Apers, and Gribling [6]. We compose the operations of a stage before converting them to a query circuit, so the intermediate states are reused exactly within the transducer construction. Let Ms=∑i∈ApisM_s = \sum_{i \in A} p_i^s, let DsD_s bound the preparation and reflection costs at order ss, and set Es2=MsDs2E_s^2 = M_s D_s^2. Retaining approximately B/DsB/D_s copies gives the recurrence

Es+12≤Ok(ϕEs2+MsEsB+ϕs),(8)E_{s+1}^2 \le O_k\left(\phi E_s^2 + \frac{\sqrt{M_s}E_s}{B} + \phi^s\right), \tag*{(8)}

where pi≤ϕp_i \le\phi on AA. The two recursive terms account for extending a state and for using the retained copies. By expanding the recurrence and bounding each resulting term, we obtain a budget that is sufficient at every order up to kk. The largest of these requirements determines the exponent uku_k in Eq. (2).

2) Estimation over probability intervals: Suppose that RR is a known upper bound within a constant factor of Pk(p)P_k(p). Starting from ϕ0=R1/k\phi_0 = R^{1/k}, we decrease the threshold geometrically, with ϕj=ϕ0/2j\phi_j = \phi_0/2^j. At each stage, samples from the order-kk collision state reveal all labels whose probabilities exceed the next threshold, with high probability. We record the observed labels and remove them from the active set. Once the threshold reaches a constant multiple of (ηR)1/k(\eta R)^{1/k}, we estimate the remaining power sum to additive error Δ=Θk(ηR)\Delta= \Theta_k(\eta R), where η\eta is the desired relative accuracy.

At most O~k(1/η)\widetilde{O}_k(1/\eta) labels are recorded. We estimate their total contribution by conditioning on this known set and applying a batch estimator. The same estimator is applied directly to the full distribution in the high-precision regime. These two uses of batch estimation account for the second term in Eq. (3). The organization by probability thresholds is related to the multilevel approach of Chen et al. [7]; here the states used at each threshold are constructed from integer-order collisions.

3) Removing prior knowledge and the order-two case: We obtain RR by starting from the upper bound 11 and halving the candidate scale whenever an additive estimate certifies that the next candidate is still valid. Each test uses a collision-table estimator based on the search algorithm of Peng, Hou, and Dong [8]. The total cost of this preliminary search is absorbed in Eq. (3). For k=2k = 2, the first mean-estimation step of the collision-state construction suffices for both the preliminary search and the final estimate, giving a particularly simple implementation.

Collision statistics are a standard tool for estimating integer power sums. Acharya, Orlitsky, Suresh, and Tyagi [2] used this structure in classical Rényi entropy estimation. In the quantum setting, Gilyén and Li [4] developed a framework for distributional property testing under purified quantum query-access. Li and Wu [3] developed entropy estimators for a broad range of orders and reduced the integer-order problem to distinctness testing. Their work provides the starting point for exploiting collision structure in quantum entropy estimation. Our algorithm uses the collision interpretation at integer orders to construct the states needed for estimation recursively.

Quantum amplitude estimation [9] and variance-dependent mean estimation [10] supply the basic estimation procedures. The probability-oracle formulation and multidimensional estimation results of van Apeldoorn [11] give further context for coherent access to distributions. Chen, Wang, and Zhang [12] discuss purified access for a broad collection of distributional and quantum-state properties. We use this access model with arbitrary purification states and count calls to the preparation oracle and its inverse.

Our collision-table search uses learning-graph techniques [13] in the form developed by Peng, Hou, and Dong [8]. The recursive state construction uses the transducer composition framework [5, 6], which is closely related to the query-complexity characterization of state conversion [14]. We give the preparation, reflection, and normalization analysis needed to apply these tools to the entropy estimator.

Organization

The rest of the paper is organized as follows. Section II introduces the notation and access model. Section III gives the batch estimator, and Section IV obtains a coarse power-sum estimate without prior knowledge. In § 5, we construct the recursive collision-state primitive. Section VI analyzes its query complexity. Section VII combines these ingredients into the entropy estimator and proves Theorem 1. The collision-table estimator used in the binary search is proved in Appendix A and a simpler sufficient algorithm for order two that uses only the first recursive step is given in Appendix B.

Preliminaries

Notation

Throughout the paper, kk is a fixed integer. The notation O~k\widetilde{O}_k suppresses polylogarithmic factors in nn, 1/ϵ1/\epsilon, and 1/δ1/\delta, and allows its implicit constants to depend on kk. All query bounds are worst-case bounds. For an integer n≥2n \ge2, we write [n]={1,2,…,n}[n]=\{1,2,\ldots,n\}. Unless stated otherwise, logarithms are natural and vector norms are Euclidean. The Hilbert space of a quantum register XX is denoted by HX\mathcal{H}_X, and ∣0⟩\lvert0\rangle denotes its all-zero state. For a fixed integer k≥2k \ge2, Hk(p)H_k(p) and Pk(p)P_k(p) denote the entropy and power sum in Eq. (1). The scalar RR always denotes a known upper bound for the full power sum and PP abbreviates the unknown value Pk(p)P_k(p) when convenient. Estimates are denoted by a tilde. For a fixed set AA, we write MS=∑i∈ApisM_S=\sum_{i\in A}p_i^s for the restricted power sum. Probability thresholds are denoted by φ\varphi or φj\varphi_j and are imposed directly on the probabilities pip_i.

Purified quantum query-access

We use the purified-access model of [4], also formulated as a quantum probability oracle in [11]. The following definition specifies the operations charged in our query bounds.

Definition 1 (Purified quantum query-access for discrete distributions). An unknown discrete distribution p=(pi)i=1np=(p_i)_{i=1}^n has purified quantum query-access if we can query a unitary UpU_p and its inverse such that

Up∣0⟩B∣0⟩C=∣Ψp⟩=∑i=1npi∣ϕi⟩B∣i⟩C,(9)U_p\lvert0\rangle_B\lvert0\rangle_C=\lvert\Psi_p\rangle=\sum_{i=1}^{n}\sqrt{p_i}\lvert\phi_i\rangle_B\lvert i\rangle_C, \tag*{(9)}

where the states ∣ϕi⟩\lvert\phi_i\rangle are arbitrary normalized states. One application of UpU_p or Up†U_p^\dagger is one query. The action of UpU_p outside ∣0⟩B∣0⟩C\lvert0\rangle_B\lvert0\rangle_C is unrestricted.

The label register makes the states ∣ui⟩:=∣ϕi⟩B∣i⟩C\lvert u_i\rangle:=\lvert\phi_i\rangle_B\lvert i\rangle_C orthonormal. All permutations in our algorithms move complete copies of registers BCBC, so the unknown purification states are retained together with their labels.

Controlled versions of the preparation oracle are often included in the access model [12]. The algorithms below require only UpU_p and Up†U_p^\dagger. Indeed, a controlled reflection about Ψp\Psi_p is implemented by applying Up†U_p^\dagger, a controlled phase on the known state ∣0⟩B∣0⟩C\lvert0\rangle_B\lvert0\rangle_C, and then UpU_p. The two oracle calls cancel when the control is inactive. We use the same construction for controlled table lookups.

Power sums and entropy estimation

Let P=Pk(p)P=P_k(p). The following estimates will be used repeatedly:

n1−k≤P≤1,pmax⁡≤P1/k,(10)n^{1-k}\le P\le1,\qquad p_{\max}\le P^{1/k}, \tag*{(10)}
Ps(p)≤Ps/k(s≥k),(11)P_s(p)\le P^{s/k}\qquad(s\ge k), \tag*{(11)}
Ps(p)≤n1−s/kPs/k(0<s≤k),(12)P_s(p)\le n^{1-s/k}P^{s/k}\qquad(0<s\le k), \tag*{(12)}
Ps(p)≤P(s−1)/(k−1)(1≤s≤k).(13)P_s(p)\le P^{(s-1)/(k-1)}\qquad(1\le s\le k). \tag*{(13)}

The first three inequalities follow from standard comparisons between finite-dimensional norms. To prove Eq. (13), take X∼pX\sim p and apply the moment inequality to the nonnegative random variable pXp_X, using Ps(p)=EpXs−1P_s(p)=\mathbb{E}p_X^{s-1} and Pk(p)=EpXk−1P_k(p)=\mathbb{E}p_X^{k-1}.

Suppose that an estimate P~\widetilde{P} satisfies ∣P~−P∣≤ηP|\widetilde{P}-P|\le\eta P for η≤1/2\eta\le1/2. Then

∣log⁡P~1−k−Hk(p)∣≤2ηk−1.(14)\left|\frac{\log\widetilde{P}}{1-k}-H_k(p)\right|\le\frac{2\eta}{k-1}. \tag*{(14)}

Consequently, relative accuracy η=Θk(ϵ)\eta=\Theta_k(\epsilon) in the power sum suffices for additive accuracy ϵ\epsilon in the entropy, as in [2, 3]. If only an upper bound R≤CkPR\le C_kP is available, it is enough to request additive accuracy Δ=ckϵR\Delta=c_k\epsilon R for a sufficiently small constant ckc_k. Before taking the logarithm, the estimate is projected onto [n1−k,1][n^{1-k},1]. This projection cannot increase its distance from PP.

Estimating power sums with batches of samples

We first estimate Pk(p)P_k(p) when a numerical upper bound is available. The estimator is based on the collision statistic of a batch of independent samples, a standard unbiased estimator for integer power sums [2]. Its quantum implementation combines a variance estimate with a reflection about the batch state. The latter operation is cheaper than preparing the whole batch again, so we keep the two costs separate. Throughout this section, we write P=Pk(p)P=P_k(p).

Lemma 1 (Product-state reflection). For an integer r≥1r\ge1 and 0<ζ<1/20<\zeta<1/2, the reflection

2(∣Ψp⟩⟨Ψp∣)⊗r−I2\left(|\Psi_p\rangle\langle\Psi_p|\right)^{\otimes r}-I

can be implemented with Euclidean error at most ζ\zeta, uniformly on sample-register inputs with initialized auxiliary registers, using O(rlog⁡(1/ζ))O(\sqrt{r}\log(1/\zeta)) queries. A controlled version has the same query bound. The ideal operation returns the auxiliary registers to zero.

Proof. Let Pj=∣Ψp⟩⟨Ψp∣P_j=|\Psi_p\rangle\langle\Psi_p| on register jj and Rj=2Pj−IR_j=2P_j-I. Put

∣u⟩=r−1/2∑j=1r∣j⟩,S=∑j=1r∣j⟩⟨j∣⊗Rj,W=(2∣u⟩⟨u∣−I)S.|u\rangle=r^{-1/2}\sum_{j=1}^{r}|j\rangle,\qquad S=\sum_{j=1}^{r}|j\rangle\langle j|\otimes R_j,\qquad W=(2|u\rangle\langle u|-I)S.

By routing the selected register through the oracle, we implement SS with two queries. Since the projectors PjP_j commute, they admit a common eigenspace decomposition. On a common eigenspace with exactly hh rejecting registers, the eigenphases of WW that overlap ∣u⟩|u\rangle are ±2arcsin⁡h/r\pm2\arcsin\sqrt{h/r}. For h=0h=0 the phase is zero; otherwise its distance from zero modulo 2π2\pi is at least 2/r2/\sqrt{r}.

Coherent phase detection at resolution Θ(r−1/2)\Theta(r^{-1/2}), with error O(ζ2)O(\zeta^2) and subsequent uncomputation, distinguishes these cases using O(rlog⁡(1/ζ))O(\sqrt{r}\log(1/\zeta)) controlled walk steps [9]. Applying phase +1+1 in the first case and phase −1-1 in the second implements the desired reflection, because the common positive subspace is spanned by ∣Ψp⟩⊗r|\Psi_p\rangle^{\otimes r}. Controlled local reflections use the known middle phase between ordinary inverse and forward preparation calls, as described in Section II.

Lemma 2 (Separate preparation and reflection costs). Suppose a known observable measured in ∣Ψ⟩|\Psi\rangle produces a real random variable ZZ with Var⁡Z≤σ2\operatorname{Var}Z\le\sigma^2. Suppose preparation costs CprepC_{\mathrm{prep}} queries and reflection about Ψ\Psi costs O~(Cref)\widetilde{O}(C_{\mathrm{ref}}), with logarithmic dependence on inverse implementation error. If the observable is reversibly computable without queries, its mean can be estimated to additive error Δ\Delta using

O~(Cprep+Crefmax⁡{1,σ/Δ})(15)\widetilde{O}\left(C_{\mathrm{prep}}+C_{\mathrm{ref}}\max\{1,\sigma/\Delta\}\right) \tag*{(15)}

queries at constant success probability. Failure probability δ\delta introduces an additional factor O(log⁡(1/δ))O(\log(1/\delta)).

Proof. The variance-dependent estimator of Montanaro [10 Theorem 2.5] uses a polylogarithmic number of initial-state copies and O~(σ/Δ)\widetilde{O}(\sigma/\Delta) reflections. Replacing σ\sigma by max⁡{σ,Δ}\max\{\sigma,\Delta\} covers the remaining case. Its observable computations, shifts, truncations, and rotations are known operations. If the complete procedure makes at most MM reflections, implement each with Euclidean error at most c/Mc/M for a sufficiently small constant cc. Telescoping the circuit errors changes the final state by at most cc. The logarithmic precision overhead and median amplification give the stated bound.

For independent X1,…,Xr∼pX_1,\ldots,X_r \sim p, r≥2kr \ge2k, define the collision statistic

Zr=(rk)−1∑A⊆[r]∣A∣=k1{Xi is the same for every i∈A}.(16)Z_r=\binom{r}{k}^{-1}\sum_{\substack{A\subseteq[r]\\ |A|=k}}\mathbf{1}\{X_i\text{ is the same for every }i\in A\}. \tag*{(16)}

This rational observable can be computed reversibly from the sample labels without further queries.

Lemma 3 (Collision variance). For fixed kk and r≥2kr \ge2k,

EZr=Pk,Var⁡Zr≤Ck∑ℓ=1kr−ℓP2k−ℓ(p)≤Ck∑ℓ=1kr−ℓP2−ℓ/k.(17)\mathbb{E}Z_r=P_k,\qquad\operatorname{Var}Z_r\le C_k\sum_{\ell=1}^{k}r^{-\ell}P_{2k-\ell}(p)\le C_k\sum_{\ell=1}^{k}r^{-\ell}P_2^{-\ell/k}. \tag*{(17)}

Proof. Each indicator has expectation PkP_k. Indicators indexed by disjoint subsets are independent. If two subsets of size kk overlap in ℓ≥1\ell\ge1 positions, their product has expectation P2k−ℓ(p)P_{2k-\ell}(p). For a fixed first subset, there are (kℓ)(r−kk−ℓ)\binom{k}{\ell}\binom{r-k}{k-\ell} possible second subsets with this overlap. After division by (rk)\binom{r}{k}, the coefficient is at most Ckr−ℓC_k r^{-\ell}. Summing over ℓ\ell gives the first variance estimate, and Eq. (11) gives the second.

Theorem 2 (Batch estimator with a known upper bound). For a fixed integer k≥2k \ge2, suppose Pk(p)≤R≤1P_k(p) \le R \le1, where RR is known. For any η∈(0,1/16]\eta\in(0,1/16] and δ∈(0,1/3)\delta\in(0,1/3), there exists a quantum algorithm that estimates Pk(p)P_k(p) to within additive error ηR\eta R, with success probability at least 1−δ1-\delta, using

O~k(R−1/(k+1)η−2/(k+1)+R−1/(2k)η−1)(18)\widetilde{O}_k\left(R^{-1/(k+1)}\eta^{-2/(k+1)}+R^{-1/(2k)}\eta^{-1}\right) \tag*{(18)}

queries, with log⁡(1/δ)\log(1/\delta) included among the suppressed factors.

Proof. Choose

r=max⁡{2k,⌈R−1/(k+1)η−2/(k+1)⌉},σR2=Ck∑ℓ=1kr−ℓR−2ℓ/k.r=\max\left\{2k,\left\lceil R^{-1/(k+1)}\eta^{-2/(k+1)}\right\rceil\right\},\qquad\sigma_R^2=C_k\sum_{\ell=1}^{k}r^{-\ell}R^{-2\ell/k}.

Preparing the batch requires rr queries, whereas Lemma 1 implements its reflection using O~(r)\widetilde{O}(\sqrt{r}) queries. To include the work registers that store the statistic, we add their zero-state projector to the initial reflection and conjugate by the reversible circuit computing ZrZ_r. Lemma 2 therefore gives

O~k(r+rσRηR)≤O~k[r+1η(R−1/(2k)+r−(k−1)/2R−1/2)].(19)\widetilde{O}_k\left(r+\frac{\sqrt{r}\sigma_R}{\eta R}\right)\le\widetilde{O}_k\left[r+\frac{1}{\eta}\left(R^{-1/(2k)}+r^{-(k-1)/2}R^{-1/2}\right)\right]. \tag*{(19)}

To obtain the inequality, observe that the squared terms in the reflection cost form the geometric progression r1−ℓR−ℓ/kr^{1-\ell}R^{-\ell/k}. Its sum is at most kk times the sum of its two endpoints. Our choice of rr balances the preparation cost with the last term in Eq. (19). The query budget and the accuracy of each reflection are fixed before running the estimator.

Obtaining a power-sum estimate without prior knowledge

To estimate the entropy to the required accuracy, we need a constant-factor upper bound on Pk(p)P_k(p). We first show how to query an implicit table of independent samples. We then use a collision-table estimator inside a binary search for the power sum. The proof of the collision-table estimator is deferred to Appendix A.

Lemma 4 (Implicit independent-sample table). An algorithm accessing a length-LL table only by

OX∣j,z⟩=∣j,z⊕Xj⟩O_X|j,z\rangle= |j,z \oplus X_j\rangle

can be simulated so that its output law is exactly the law averaged over independent X1,…,XL∼pX_1,\ldots,X_L \sim p. Each table query, including an inverse or controlled query, uses one call each to UpU_p and Up†U_p^\dagger. The simulation uses LL private preparation registers initialized to zero.

Proof. Let CjC_j copy the visible label in private register jj into the response register by XOR. Implement the lookup as

O~=∑j∣j⟩⟨j∣⊗Up,j†CjUp,j.(20)\widetilde{O}=\sum_j |j\rangle\langle j|\otimes U_{p,j}^{\dagger}C_jU_{p,j}. \tag*{(20)}

Routing the addressed register through the oracle port costs one query in each direction. For analysis, set V=Up⊗LV=U_p^{\otimes L} and Otab=∑j∣j⟩⟨j∣⊗CjO_{\mathrm{tab}}=\sum_j|j\rangle\langle j|\otimes C_j. Then O~=V†OtabV\widetilde{O}=V^\dagger O_{\mathrm{tab}}V. All other algorithmic gates act outside the private table and commute with VV, so these conjugations telescope. Tracing out the private table removes the final V†V^\dagger.

The resulting computation is equivalent to querying OtabO_{\mathrm{tab}} on ∣Ψp⟩⊗L|\Psi_p\rangle^{\otimes L}. Dephasing its label registers changes no output probabilities, because the label projectors commute with the entire computation. The dephased labels have joint law p⊗Lp^{\otimes L}. For a controlled query, control only CjC_j; the ordinary preparation calls cancel when the control is inactive. The unitary VV is introduced only to analyze the output distribution; the simulation does not apply it and therefore incurs no LL-query initialization cost.

Proposition 1 (Sparse-table estimate). For any fixed integer k≥2k\ge2, suppose Pk(p)≤g≤1P_k(p)\le g\le1, where gg is known. For any η∈(0,1/4]\eta\in(0,1/4] and δ∈(0,1/3)\delta\in(0,1/3), there is a quantum algorithm that outputs an estimate P~k(p)\widetilde{P}_k(p) satisfying

∣P~k(p)−Pk(p)∣≤ηg|\widetilde{P}_k(p)-P_k(p)|\le\eta g

with probability at least 1−δ1-\delta, using O~k(nuk/η)\widetilde{O}_k(n^{u_k}/\eta) queries. The query count and output range are bounded on every execution, even if the supplied value gg fails to satisfy the stated assumption.

The proof in Appendix A uses a table of length ⌈kg−1/k⌉\lceil kg^{-1/k}\rceil, whose expected number of kk-collisions is bounded by a constant depending on kk. A capped collision count has negligible bias and can be estimated coherently through Lemma 4.

Lemma 5 (Initial scale). A scale RR satisfying

Pk(p)≤R≤163Pk(p),R≤1,(21)P_k(p)\le R\le\frac{16}{3}P_k(p),\qquad R\le1, \tag*{(21)}

can be found with probability at least 1−δ1-\delta, for any δ∈(0,1/3)\delta\in(0,1/3), using O~k(nuk)\widetilde{O}_k(n^{u_k}) queries. The procedure has a deterministic worst-case query bound.

Algorithm 1: Binary search for the power sum

Input: Purified access oracle UpU_p; dimension bound nn; fixed integer k≥2k\ge2; maximum failure probability δ∈(0,1/3)\delta\in(0,1/3).

Parameters: J0:=⌈(k−1)log⁡2n⌉+2J_0:=\lceil(k-1)\log_2 n\rceil+2.

Output: A scale RR satisfying Eq. (21).

  1. Set g←1g\gets1.

  2. For j=0,1,…,J0−1j=0,1,\ldots,J_0-1, estimate Pk(p)P_k(p) to additive error g/16g/16 using Proposition 1, with failure probability at most δ/(J0+1)\delta/(J_0+1). Denote the output by P~j\widetilde{P}_j.

  3. If P~j≥g/4\widetilde{P}_j\ge g/4, return R=gR=g; otherwise set g←g/2g\gets g/2 and continue.

  4. If the iteration limit is reached, declare failure.

Proof. The pseudocode is given in Algorithm 1. Suppose first that every estimate is within its stated error. The initial upper bound Pk(p)≤1P_k(p)\le1 is valid. Whenever the algorithm continues, we have Pk(p)<5g/16<g/2P_k(p)<5g/16<g/2, so the next call also has a valid upper bound. When it stops, the returned value satisfies 3R/16≤Pk(p)≤R3R/16\le P_k(p)\le R, as required.

When all estimates are accurate, the procedure stops before the candidate upper bound falls below Pk(p)P_k(p). Since Pk(p)≥n1−kP_k(p)\ge n^{1-k}, the prescribed number of iterations is sufficient. By a union bound, all required estimates are accurate with probability at least 1−δ1-\delta. Each test uses O~k(nuk)\widetilde{O}_k(n^{u_k}) queries, and there are Ok(log⁡n)O_k(\log n) tests. The fixed limit also ensures g−1=Ok(nk−1)g^{-1}=O_k(n^{k-1}) on unsuccessful histories, so the same query bound holds for every execution.

The same scale-search procedure can be applied to the batch estimator in Theorem 2. This gives a direct entropy estimator with query complexity

Qk(n,ϵ)≤O~k(n(k−1)/(k+1)ϵ−2/(k+1)+nbk/ϵ).(22)Q_k(n,\epsilon) \le\widetilde{O}_k\left(n^{(k-1)/(k+1)}\epsilon^{-2/(k+1)} + n^{b_k}/\epsilon\right). \tag*{(22)}

In the full algorithm, we use the batch estimator after a scale has already been obtained.

Recursive construction of collision states

We next construct the operation that extends a collision state by one order. For convenience, write ∣ui⟩=∣ϕi⟩B∣i⟩C\lvert u_i\rangle= \lvert\phi_i\rangle_B\lvert i\rangle_C and ∣Ψp⟩=∑ipi∣ui⟩\lvert\Psi_p\rangle= \sum_i \sqrt{p_i}\lvert u_i\rangle. An order-ss collision state consists of ss complete purified-sample registers with a common label. When such a state is used to prepare one of higher order, we call it a collision prefix. We use the term cache for a collection of retained copies that will be reused during the construction. A raw sample means a copy of ∣Ψp⟩\lvert\Psi_p\rangle before conditioning on any active set. During one stage, the active set is fixed and all operations move complete collision prefixes, including their purification registers.

Transduction costs and composition

We use the transducer formalism of [5] in the form developed in [6]. In particular, we invoke the reflection characterization, rebalancing, amplitude amplification, bounded mean estimation, and composition results in [6 Theorem 2.4, Lemma 2.5, Corollary 3.4, Theorem 3.7, and Theorems 2.9–2.15]. The underlying state-conversion viewpoint is described in [14]. A canonical transducer performs an exact public-state conversion. Its query cost W(T,v)W(T,v) is a quadratic form in the public input vector vv; hence W(T,v)1/2W(T,v)^{1/2} obeys the triangle inequality. Costs add under sequential composition and direct sums. We use the bidirectional model, permitting UpU_p and Up†U_p^\dagger.

All operations within a complete stage are composed before conversion to a query circuit. A transduction cost QQ gives an O(Q)O(Q)-query circuit at constant final accuracy. If stages are converted separately, they use fresh caches and inverse-polylogarithmic accuracy; this overhead is absorbed in O~k\widetilde{O}_k. In particular, each separately converted stage prepares its own cache, so its exact-input assumption does not depend on the approximation error of a previous conversion.

For a reflection, we refer to the costs on its positive and negative eigenspaces as its positive and negative costs, respectively. Rebalancing changes costs A,BA,B to aA,B/aaA,B/a for any input-independent a>0a>0. A useful consequence is the following commuting-projector rule: if mm commuting local projectors have reflection cost at most dd, reflection about their common positive subspace has positive cost aa and negative cost O(md2/a)O(md^2/a).

For completeness, we give the witness calculation that yields this rule. Let QjQ_j be the local negative projectors and K=∑jQjK=\sum_j Q_j. On a vector vv orthogonal to their common kernel, use components QjK+vQ_jK^+v, where K+K^+ is the Moore–Penrose inverse. Then

∑jQj(QjK+v)=v,∑j∥QjK+v∥2=⟨v∣K+∣v⟩≤∥v∥2.\sum_j Q_j(Q_jK^+v)=v,\qquad\sum_j\lVert Q_jK^+v\rVert^2=\langle v\lvert K^+\rvert v\rangle\le\lVert v\rVert^2.

The nonzero eigenvalues of KK are positive integers. The positive witness has one copy of the input in each index sector, so its squared norm is mm. These witnesses satisfy the cross-sign reflection constraints. Rebalancing and composition with the local reflections give the rule. The same argument applies when the registers are entangled with untouched auxiliary systems, or when the reflection includes known tests that work registers are zero.

We also record the amplification formula used below. Suppose

∣Ψ⟩=∣Ψ0⟩∣0⟩+∣Ψ1⟩∣1⟩,λ=∥Ψ1∥2,∣Ψ‾⟩=λ1−λ∣Ψ0⟩∣0⟩−1−λλ∣Ψ1⟩∣1⟩.\lvert\Psi\rangle=\lvert\Psi_0\rangle\lvert0\rangle+\lvert\Psi_1\rangle\lvert1\rangle,\qquad\lambda=\lVert\Psi_1\rVert^2,\qquad\lvert\overline{\Psi}\rangle=\sqrt{\frac{\lambda}{1-\lambda}}\lvert\Psi_0\rangle\lvert0\rangle-\sqrt{\frac{1-\lambda}{\lambda}}\lvert\Psi_1\rangle\lvert1\rangle.

For a reflection transducer TT about Ψ\Psi, exact preparation of the normalized good state costs

O(W(T,Ψ)+(1−λ)W(T,Ψ‾)λ).(23)O\left(\frac{W(T,\Psi)+(1-\lambda)W(T,\overline{\Psi})}{\sqrt{\lambda}}\right). \tag*{(23)}

Reflection about that state has positive cost O(W(T,Ψ)/λ)O(W(T,\Psi)/\lambda) and negative cost O(W(T,v∣1⟩))O(W(T,v\lvert1\rangle)) on vectors orthogonal to it [6 Corollary 3.4].

An asymmetric source reflection

Let QQ project onto a cache of LL identical order-ss prefix states, and let Pf=∣Ψp⟩⟨Ψp∣P_f = |\Psi_p\rangle\langle\Psi_p| act on a fresh register. Suppose a local prefix reflection has cost DsD_s and restores its initialized retained buffers. The commuting-projector rule gives a cache reflection with costs bb, O(LDs2/b)O(LD_s^2/b). A fresh-state reflection can be rebalanced to costs cc, O(1/c)O(1/c).

Reflection about QPfQP_f has positive cost O(b+c)O(b+c). On a negative input zz its cost is at most

O(LDs2b∥Pfz∥2+1c∥(I−Pf)z∥2).(24)O\left(\frac{LD_s^2}{b}\lVert P_fz\rVert^2+\frac{1}{c}\lVert(I-P_f)z\rVert^2\right). \tag*{(24)}

To see this, decompose z=Pfz+(I−Pf)zz=P_fz+(I-P_f)z. The first component is negative for QQ, because QPfz=0QP_fz=0, and the second is negative for PfP_f. We place the corresponding negative witnesses in separate direct-sum sectors. Their cross-sign constraints sum to the required inner product, and their squared norms give Eq. (24). This calculation composes the witnesses directly and does not require a separate test of PfP_f. The decomposition is made with the projectors of the negative input, so the local constraints apply across distinct oracle inputs as required. Known index and workspace projectors reject orthogonal components at zero query cost. Previously initialized buffers remain unchanged throughout the operation and are restored exactly.

Extending a collision state

Let A⊆B\mathcal{A}\subseteq\mathcal{B} be known sets and suppose pi≤φ≤1p_i\leq\varphi\leq1 for i∈Ai\in\mathcal{A}. For an integer s≥1s\geq1, put

F=∑i∈Bpis>0,G=∑i∈Apis+1,F=\sum_{i\in\mathcal{B}}p_i^s>0,\qquad G=\sum_{i\in\mathcal{A}}p_i^{s+1},
∣χs,B⟩=F−1/2∑i∈Bpis/2∣ui⟩⊗s,∣χs+1,A⟩=G−1/2∑i∈Api(s+1)/2∣ui⟩⊗(s+1).|\chi_{s,B}\rangle=F^{-1/2}\sum_{i\in\mathcal{B}}p_i^{s/2}|u_i\rangle^{\otimes s},\qquad |\chi_{s+1,A}\rangle=G^{-1/2}\sum_{i\in\mathcal{A}}p_i^{(s+1)/2}|u_i\rangle^{\otimes(s+1)}.

The latter state is used only when G>0G>0. Write Mj,A=∑i∈ApijM_{j,A}=\sum_{i\in\mathcal{A}}p_i^j.

Lemma 6 (Exact prefix extension). Suppose preparation and reflection for χs,B\chi_{s,B} have transduction cost at most DsD_s and restore their initialized buffers. For L≥1L\geq1, a cache of L−1L-1 retained copies, one additional prefix, and a fresh raw sample give preparation of χs+1,A\chi_{s+1,A} at cost

Ds+1=O(Ds2Fφ+F/L+φsG).(25)D_{s+1}=O\left(\sqrt{\frac{D_s^2F\varphi+F/L+\varphi^s}{G}}\right). \tag*{(25)}

This includes replenishment of the additional prefix. The same bound gives reflection about the new state on span⁡{∣ui⟩⊗(s+1):i∈A, pi>0}\operatorname{span}\{|u_i\rangle^{\otimes(s+1)}:i\in\mathcal{A},\ p_i>0\}. Unused prefixes and all preceding buffers factor exactly from the output and are restored. The guarantees hold with arbitrary spectator entanglement.

The source cache also estimates GG to additive error 0<Δ≤cG0<\Delta\leq cG at additional cost

O~(DsFφG+FG/L+φs/2GΔ).(26)\widetilde{O}\left(\frac{D_s\sqrt{F\varphi G}+\sqrt{FG/L}+\varphi^{s/2}\sqrt{G}}{\Delta}\right). \tag*{(26)}

If instead a known upper bound 0≤G≤g≤Fφ0\leq G\leq g\leq F\varphi is known, g>0g>0, and 0<Δ≤cg0<\Delta\leq cg, the bound is

O~(DsFφg+Fg/L+φs/2gΔ).(27)\widetilde{O}\left(\frac{D_s\sqrt{F\varphi g}+\sqrt{Fg/L}+\varphi^{s/2}\sqrt{g}}{\Delta}\right). \tag*{(27)}

This includes G=0G=0. Constant-factor estimates suffice to choose the parameters, while the final numerical rescaling requires a correspondingly accurate estimate of FF. Mean estimation restores the source cache and the fresh sample exactly at the transducer level.

Proof. Choose a uniform index in [L][L], compare the selected prefix label with a fresh raw sample, and flag a match in A\mathcal{A}. Move the selected complete prefix to an output port. Let VV denote these query-free operations. The good component factors as

h ∣χs+1,A⟩⊗∣χs,B⟩⊗(L−1)⊗∣uL⟩,h=G/F.(28)\sqrt{h}\,|\chi_{s+1,A}\rangle\otimes|\chi_{s,B}\rangle^{\otimes(L-1)}\otimes|u_L\rangle,\qquad h=G/F. \tag*{(28)}

where ∣uL⟩|u_L\rangle is a known uniform index state. We uncompute this known index state after the operation. We also include an independent coin with success probability ϑ=1/4\vartheta= 1/4 in the flag. The actual success probability is λ=ϑh≤1/4\lambda= \vartheta h \le1/4, with the same normalized good state.

First consider a unit vector v=∑i∈Avi∣ui⟩⊗(s+1)v = \sum_{i\in A} v_i |u_i\rangle^{\otimes(s+1)} orthogonal to the new prefix. Invert the witness map on vv with the retained prefixes and uniform index, and project the initial known workspace onto its prescribed state. Call the resulting vector BvB_v for the undiluted flag; the actual flag gives ϑBv\sqrt{\vartheta}B_v. With Vj=∑i∈Apij∣vi∣2V_j = \sum_{i\in A} p_i^j |v_i|^2, direct inner products give

∥Bv∥2=1L+(1−1L)VsF,∥PfBv∥2=V1L,QPfBv=0.(29)\lVert B_v\rVert^2 = \frac{1}{L} + \left(1-\frac{1}{L}\right)\frac{V_s}{F}, \qquad\lVert P_fB_v\rVert^2 = \frac{V_1}{L}, \qquad QP_fB_v = 0. \tag*{(29)}

Equal insertion positions contribute 1 to the first identity; distinct positions contribute Vs/FV_s/F. After projection of the fresh register onto Ψp\Psi_p, the inserted prefix vector is ∑ipivi∣ui⟩⊗s\sum_i \sqrt{p_i}v_i|u_i\rangle^{\otimes s}. Its overlap with the cache state is zero by the orthogonality of vv to χs+1,A\chi_{s+1,A}. All cross-position terms therefore vanish in the second identity. Allowing the coefficients viv_i to take values in an auxiliary Hilbert space proves the same identities in the presence of spectator entanglement.

Combining Eqs. (24) and (29) with the reflection formula for the normalized good state gives positive and negative costs bounded by

O(b+cϑh),O(ϑDs2φb+ϑ1/L+φs/Fc),O\left(\frac{b+c}{\vartheta h}\right), \qquad O\left(\vartheta\frac{D_s^2\varphi}{b}+\vartheta\frac{1/L+\varphi^s/F}{c}\right),

respectively. We set b=cb=c and choose their common value to balance these two bounds. The squared balanced cost is a constant multiple of (Ds2φ+1/L+φs/F)/h(D_s^2\varphi+1/L+\varphi^s/F)/h, proving the reflection part of (25).

For preparation and estimation, let Z1,…,ZLZ_1,\ldots,Z_L be independent cache labels with law qi=pis/Fq_i=p_i^s/F on B\mathcal{B}. Let NiN_i count their occurrences of ii, and for an independent raw label Y∼pY\sim p put

X=NY1Y∈AL,S=∑a=1LpZa1Za∈A.X=\frac{N_Y1_{Y\in A}}{L}, \qquad S=\sum_{a=1}^{L}p_{Z_a}1_{Z_a\in A}.

Binomial moments give

EX=h,Var⁡X=hL+(1−1L)M2s+1,AF2−h2,(30)\mathbb{E}X=h, \qquad\operatorname{Var}X=\frac{h}{L}+\left(1-\frac{1}{L}\right)\frac{M_{2s+1,A}}{F^2}-h^2, \tag*{(30)}
ES=Lh,Var⁡S=L(Ms+2,AF−h2).(31)\mathbb{E}S=Lh, \qquad\operatorname{Var}S=L\left(\frac{M_{s+2,A}}{F}-h^2\right). \tag*{(31)}

Let Ψ‾\overline{\Psi} be the normalized Grover complement of the flagged source. After inverse witness mapping and projection of the known workspace, its coefficient in each cache and fresh-label sector is ϑ(h−X)/λ(1−λ)\vartheta(h-X)/\sqrt{\lambda(1-\lambda)}. For the resulting vector BΨ‾B_{\overline{\Psi}},

∥BΨ‾∥2=ϑ2Var⁡Xλ(1−λ)≤O(1L+M2s+1,AFG),(32)\lVert B_{\overline{\Psi}}\rVert^2=\frac{\vartheta^2\operatorname{Var}X}{\lambda(1-\lambda)}\le O\left(\frac{1}{L}+\frac{M_{2s+1,A}}{FG}\right), \tag*{(32)}
∥PfBΨ‾∥2=ϑ2Var⁡SL2λ(1−λ)≤O(Ms+2,ALG),QPfBΨ‾=0.(33)\lVert P_fB_{\overline{\Psi}}\rVert^2=\frac{\vartheta^2\operatorname{Var}S}{L^2\lambda(1-\lambda)}\le O\left(\frac{M_{s+2,A}}{LG}\right), \qquad QP_fB_{\overline{\Psi}}=0. \tag*{(33)}

The source reflection, conjugated by VV, consequently has costs

W(T,Ψ)=O(b+c),W(T,\Psi)=O(b+c),
W(T,Ψ‾)=O(Ds2Ms+2,AbG+1/L+M2s+1,A/(FG)c).W(T,\overline{\Psi})=O\left(\frac{D_s^2M_{s+2,A}}{bG}+\frac{1/L+M_{2s+1,A}/(FG)}{c}\right).

Use Ms+2,A≤φGM_{s+2,A}\le\varphi G and M2s+1,A≤φsGM_{2s+1,A}\le\varphi^sG, and choose

b=c=Ds2φ+1/L+φs/F.b=c=\sqrt{D_s^2\varphi+1/L+\varphi^s/F}.

The sum of the two costs is O(Ds2φ+1/L+φs/F)O(\sqrt{D_s^2\varphi+1/L+\varphi^s/F}). Eq. (23) gives Eq. (25) for preparation. The same bound includes the cost of replacing the consumed prefix, since G≤FφG\le F\varphi. It also includes the fresh sample, since G≤φs∑i∈Api≤φsG\le\varphi^s\sum_{i\in A}p_i\le\varphi^s. The factorization in Eq. (28) is exact.

For the mean, apply the bounded-mean transducer of [6 Theorem 3.7] to the Boolean flag observable. Request flag error Δλ=ϑΔ/F\Delta_\lambda= \vartheta\Delta/F and choose its iteration parameter t=Θ(λ/Δλ)t = \Theta(\sqrt{\lambda}/\Delta_\lambda). Choose its bias and variance parameter at most a sufficiently small multiple of Δ2\Delta^2. The output variance is O(λ/t2)+O(Δ2)O(\lambda/t^2) + O(\Delta^2), while the cost is, up to logarithms, tt times the sum of the source and complement costs. A constant number of repetitions and Chebyshev’s inequality give Eq. (26). The source is restored exactly; uncomputing VV restores its cache and fresh sample. Only the source reflection and the known flag enter this calculation. Hence the bound is independent of the purification vectors and their phases.

To prove the statement with a known upper bound gg, choose a known ρ=Θ(g/F)\rho= \Theta(g/F) with 0<ρ≤1/80 < \rho\le1/8 and a sufficiently small fixed ϑ>0\vartheta> 0. A three-branch known coin always accepts with weight ρ\rho, accepts an active match with weight ϑ\vartheta, and otherwise rejects. Its mean is

μ=ρ+ϑG/F=Θ(g/F),0<μ≤1/2.\mu= \rho+ \vartheta G/F = \Theta(g/F), \qquad0 < \mu\le1/2.

The centered coefficient after inverse witness mapping is ϑ(h−X)/μ(1−μ)\vartheta(h-X)/\sqrt{\mu(1-\mu)}. The squared norms are ϑ2Var⁡X/[μ(1−μ)]\vartheta^2 \operatorname{Var} X/[\mu(1-\mu)] and ϑ2Var⁡S/[L2μ(1−μ)]\vartheta^2 \operatorname{Var} S/[L^2\mu(1-\mu)]. The moment contributions in Eq. (32)–(33) now have an additional factor at most G/gG/g. They vanish when G=0G=0. We use the same reflection-cost parameters and take t=Θ(g/F/(Δ/F))t = \Theta(\sqrt{g/F}/(\Delta/F)). Subtracting the known baseline and multiplying by F/ϑF/\vartheta gives Eq. (27). This procedure remains well defined when G=0G=0, because it does not require preparation of the corresponding normalized collision state.

Order-two states and retained auxiliary registers

Lemma 6 includes s=1s = 1. Take the unconditioned source on the full alphabet, so B=[n]\mathcal{B} = [n], M1=1M_1 = 1, D1=O(1)D_1 = O(1), and χ1,B=Ψp\chi_{1,\mathcal{B}} = \Psi_p. With a raw cache of size rr, the active pair state satisfies

D22=O(1/r+φM2),M2=∑i∈Api2.(34)D_2^2 = O\left(\frac{1/r+\varphi}{M_2}\right), \qquad M_2 = \sum_{i\in A} p_i^2. \tag*{(34)}

There is no need to condition this source on the active set. The mean estimator with a known upper bound estimates M2M_2 before the normalized pair state is constructed, and it remains well defined when M2=0M_2 = 0.

Local reflections preserve their initialized buffers. On that public subspace, the local projectors of a cache commute even when their implementations share earlier buffers. We may therefore compose their reflection witnesses with the exact transducers from the preceding levels. The construction uses only their action on this invariant subspace.

A stage with LsL_s initialized order-ss prefixes and MM order-kk outputs needs Ok(∑sLs+kM+1)O_k(\sum_s L_s + kM + 1) raw samples, in addition to its stated raw buffer. We prepare this sample pool in advance. Subsequent controlled operations use the prepared samples, known gates, and controlled reflections, without controlled calls to UpU_p. Every prefix cost is at least a constant, so the pool cost is included in setup and per-output costs. Early termination leaves the unused pool untouched. A complete stage is composed before circuit conversion, with fresh pools at any separately converted stage.

Query complexity of the recursive construction

In this section, we analyze the number of retained states required by the recursive construction. Fix an integer k≥2k \ge2 and suppose that a known scale satisfies Pk(p)≤R≤CkPk(p)P_k(p) \le R \le C_kP_k(p) and R≤1R \le1. Let η\eta denote the relative power-sum accuracy. Constants depending only on kk are absorbed into the choices of the parameters.

Choice of accuracy regime

If η≤R1/(2k)\eta\le R^{1/(2k)}, Theorem 2 gives

O~k(R−1/(k+1)η−2/(k+1)+R−1/(2k)/η)=O~k(R−1/(2k)/η).(35)\widetilde{O}_k\left(R^{-1/(k+1)}\eta^{-2/(k+1)} + R^{-1/(2k)}/\eta\right) = \widetilde{O}_k\left(R^{-1/(2k)}/\eta\right). \tag*{(35)}

We therefore analyze the branch

η>R1/(2k),φ0=R1/k,φ∗=(ηR)1/k.(36)\eta> R^{1/(2k)}, \qquad\varphi_0 = R^{1/k}, \qquad\varphi_* = (\eta R)^{1/k}. \tag*{(36)}

The stage threshold satisfies φ∗≤φ≤φ0\varphi_* \le\varphi\le\varphi_0. In particular,

φ≥R1/(k−1),(37)\varphi\ge R^{1/(k-1)}, \tag*{(37)}

since η>R1/(2k)≥R1/(k−1)\eta> R^{1/(2k)} \ge R^{1/(k-1)}. Choose

B=R−uk/(k−1)η−(1−uk),r=∣B∣.(38)B = R^{-u_k/(k-1)}\eta^{-(1-u_k)}, \qquad r = |B|. \tag*{(38)}

When implementing the algorithm, we multiply these budgets by sufficiently large constants depending only on kk.

Initial states and the recursive query bound

The exponents satisfy

uk,j≤k−1k+1(2≤j≤k).(39)u_{k,j} \le\frac{k-1}{k+1} \qquad(2 \le j \le k). \tag*{(39)}

Indeed, with M=2j−2M=2^{j-2}, the numerator of the difference after multiplication by the positive common denominator is

M[k2−7k+j(k+1)]+2k.M\left[k^2-7k+j(k+1)\right]+2k.

For j=2j=2 it is (k−1)(k−2)(k-1)(k-2). For j≥3j \ge3, the bracket is at least (k−1)(k−3)≥0(k-1)(k-3) \ge0. It follows from Eq. (36) that

Bφ0≤R{(k−1)−(k+1)uk}/{2k(k−1)}≤1.(40)B\varphi_0 \le R^{\{(k-1)-(k+1)u_k\}/\{2k(k-1)\}} \le1. \tag*{(40)}

At a fixed active set, write Ms=∑i∈ApisM_s=\sum_{i\in A}p_i^s for s≥2s \ge2, and keep M1=1M_1=1 for the unconditioned source. By (13),

Ms≤R(s−1)/(k−1)(2≤s≤k).(41)M_s \le R^{(s-1)/(k-1)} \qquad(2 \le s \le k). \tag*{(41)}

The pair base and Eq. (40) give

E22:=M2D22=Ok(2φ+B−1)=Ok(B−1).(42)E_2^2 := M_2D_2^2 = O_k(2\varphi+B^{-1})=O_k(B^{-1}). \tag*{(42)}

Once a constant-factor estimate M~s=Θk(Ms)\widetilde{M}_s=\Theta_k(M_s) has been certified, choose a bound Ds≥1D_s\ge1 on the local preparation and reflection costs and retain

Ls=max⁡{1,⌈B/Ds⌉},2≤s<k.(43)L_s=\max\{1,\lceil B/D_s\rceil\}, \qquad2 \le s<k. \tag*{(43)}

The next query-cost estimate is computed from the exact-prefix numerator and a certified scale for Ms+1M_{s+1}:

Ds+1=Ckmax⁡{1,Ds2M~sφ+M~s/Ls+φsM~s+1}.(44)D_{s+1}=C_k\max\left\{1,\sqrt{\frac{D_s^2\widetilde{M}_s\varphi+\widetilde{M}_s/L_s+\varphi^s}{\widetilde{M}_{s+1}}}\right\}. \tag*{(44)}

As shown in Section VII, the numerator can be computed before obtaining a constant-factor estimate of Ms+1M_{s+1}. We use this local recurrence to determine the number of retained copies at each order.

Set Es2=MsDs2E_s^2=M_sD_s^2. Since Ls≥B/DsL_s\ge B/D_s, the recurrence implies

E22=Ok(B−1),Es+12≤Ck(φEs2+MsEsB+φs).(45)E_2^2=O_k(B^{-1}), \qquad E_{s+1}^2\le C_k\left(\varphi E_s^2+\frac{\sqrt{M_s}E_s}{B}+\varphi^s\right). \tag*{(45)}

The contribution of the maximum with 1 in Eq. (44) is absorbed by the inequality Ms+1≤φsM_{s+1}\le\varphi^s. Rounding LsL_s upwards can only decrease the middle term. Thus Eq. (45) holds independently of the setup-cost bound that we prove below.

Analysis of the recurrence

Normalize by ys=Es2/φs−1y_s=E_s^2/\varphi^{s-1}. Eqs. (41)–(45) give

y2=Ok((Bφ)−1),ys+1≤Ck(ys+asys+1),as=R(s−1)/(2(k−1))Bφ(s+1)/2.(46)y_2=O_k((B\varphi)^{-1}), \qquad y_{s+1}\le C_k(y_s+a_s\sqrt{y_s}+1), \qquad a_s=\frac{R^{(s-1)/(2(k-1))}}{B\varphi^{(s+1)/2}}. \tag*{(46)}

The coefficients decrease with ss, because

as+1as=R1/(k−1)φ≤1.\frac{a_{s+1}}{a_s}=\frac{\sqrt{R^{1/(k-1)}}}{\varphi}\le1.

Moreover, Bφ≤1B\varphi\le1. We may therefore absorb the additive constant into a fixed multiple of the initial bound (Bφ)−1(B\varphi)^{-1}.

To expand the recurrence, bound each sum by a fixed multiple of its largest summand. Every resulting term is obtained by composing identity maps with maps of the form z↦aszz\mapsto a_s\sqrt{z}. If it uses mm square-root steps at indices i1<⋯<imi_1<\cdots<i_m, then ij≥j+1i_j\ge j+1. Because asa_s is nonincreasing, moving them to indices 2,…,m+12,\ldots,m+1 can only enlarge that term. Thus

ys≤Ck′max⁡0≤m≤s−2Vm,Vm=R(m−1+2−m)/(k−1)B−(2−2−m)φ−(m+1).(47)y_s\le C'_k\max_{0\le m\le s-2}V_m,\qquad V_m=R^{(m-1+2^{-m})/(k-1)}B^{-(2-2^{-m})}\varphi^{-(m+1)}. \tag*{(47)}

For m=0m=0 this is exactly V0=(Bφ)−1V_0=(B\varphi)^{-1}.

We show that each term is at most

Y=B2φk+1R.(48)Y = \frac{B^2\varphi^{k+1}}{R}. \tag*{(48)}

Put j=m+2j=m+2 and M=2mM=2^m. The inequality Vm≤YV_m \le Y is equivalent to

B4M−1≥R{M(k+j−4)+1}/(k−1)φ−M(k+j).(49)B^{4M-1} \ge R^{\{M(k+j-4)+1\}/(k-1)}\varphi^{-M(k+j)}. \tag*{(49)}

The right-hand side is largest at φ=φ∗\varphi=\varphi_*. Substitution and a (4M−1)(4M-1)st root yield

B≥Bj:=R−uk,j/(k−1)η−(1−uk,j).(50)B \ge B_j := R^{-u_{k,j}/(k-1)}\eta^{-(1-u_{k,j})}. \tag*{(50)}

The identity 1−uk,j=2j−2(k+j)/[k(2j−1)]1-u_{k,j}=2^{j-2}(k+j)/[k(2^j-1)] verifies the accuracy exponent directly. Moreover,

Bj=η−1(ηR−1/(k−1))uk,j,B_j=\eta^{-1}\left(\eta R^{-1/(k-1)}\right)^{u_{k,j}},

and the factor in parentheses is at least one in the regime of Eq. (36). Maximizing over jj therefore gives precisely the budget in Eq. (38). Combining Eqs. (47)–(48), we obtain the following bound simultaneously for all orders:

Es2≤Ok(B2φk+sR),2≤s≤k.(51)E_s^2 \le O_k\left(\frac{B^2\varphi^{k+s}}{R}\right), \qquad2 \le s \le k. \tag*{(51)}

Lemma 7 (Uniform setup budgets). In the branch (36), the raw cache costs Ok(B)O_k(B). For every retained prefix whose moment satisfies Ms≳kφsM_s \gtrsim_k \varphi^s, the recursive query-cost estimate satisfies Ds=Ok(B)D_s=O_k(B). Its rounded cache has setup cost LsDs=Ok(B)L_sD_s=O_k(B). All retained caches together have cost Ok(B)O_k(B) for fixed kk, and Eq. (51) holds for every prefix.

Proof. The simultaneous bound in Eq. (51) has already been established. For any retained prefix, it gives

Ds2=Es2/Ms≤Ok(B2φk/R)=Ok(B2),D_s^2 = E_s^2/M_s \le O_k(B^2\varphi^k/R)=O_k(B^2),

because φ≤φ0\varphi\le\varphi_0. Hence LsDs≤B+Ds=Ok(B)L_sD_s\le B+D_s=O_k(B). The raw cache has ⌈B⌉\lceil B\rceil samples. There are at most k−2k-2 additional caches. We construct a prefix only after certifying the stated condition on its moment. Section VII describes this test and explains how the algorithm proceeds when the moment is too small.

At k=2k=2 there are no square-root steps and no intermediate collision caches. The only path is V0V_0, and

B=R−1/3η−2/3,φ∗=(ηR)1/2,B3φ∗4/R=1.B=R^{-1/3}\eta^{-2/3}, \qquad\varphi_*=(\eta R)^{1/2}, \qquad B^3\varphi_*^4/R=1.

Hence the pair-state construction satisfies Eq. (51) as well. Its source normalization is known exactly, since M1=1M_1=1.

Rényi entropy estimator for integer orders

In this section, we combine the preceding subroutines to estimate Hk(p)H_k(p). We first locate the power sum within a constant factor. We then estimate the contributions of the recorded and active labels separately and analyze the error and query complexity of the complete algorithm.

Algorithm and parameter choice

Let ϵ\epsilon be the required entropy accuracy. We choose η=ck′ϵ\eta=c'_k\epsilon for a sufficiently small constant ck′>0c'_k>0, decreasing the allowed constant range of ϵ\epsilon if necessary so that η≤1/64\eta\le1/64. First obtain RR using Algorithm 1. If η≤R1/(2k)\eta\le R^{1/(2k)}, apply the batch estimator of Theorem 2. Its query complexity is given by Eq. (35). Otherwise, set

Δ=ηR,φ∗=Θk(Δ1/k),φ0=R1/k,B=CkR−uk/(k−1)η−(1−uk),r=⌈B⌉.(52)\Delta=\eta R,\qquad\varphi_*=\Theta_k(\Delta^{1/k}),\qquad\varphi_0=R^{1/k},\qquad B=C_kR^{-u_k/(k-1)}\eta^{-(1-u_k)},\qquad r=\lceil B\rceil. \tag*{(52)}

We choose the constants in φ∗\varphi_* and BB to satisfy Lemma 7 and the error requirements below. Let φj=φ0/2j\varphi_j=\varphi_0/2^j and choose the final index so that its threshold is within a fixed factor of φ∗\varphi_*. The pseudocode is given in Algorithm 2.

Algorithm 2: Quantum algorithm for integer order Rényi entropy estimation

Input: Purified access oracle UpU_p for p=(pi)i=1np=(p_i)_{i=1}^n; fixed integer k≥2k \ge2; additive accuracy ϵ∈(0,ck]\epsilon\in(0,c_k]; maximum failure probability δ∈(0,1/3)\delta\in(0,1/3).

Parameters: η:=ck′ϵ\eta:= c_k'\epsilon; the parameters in Eq. (52) after RR is found.

Output: An estimate H~k(p)\widetilde{H}_k(p) satisfying Problem 1.

  1. Use Algorithm 1 to find RR, with failure probability at most 1/201/20.

  2. If η≤R1/(2k)\eta\le R^{1/(2k)}, estimate the full moment with the batch estimator and go to step 6. Otherwise initialize the parameters in Eq. (52), set A=[n]\mathcal{A}=[n], and set the recorded set to empty.

  3. At each dyadic threshold φ\varphi, estimate the active moments M2,…,MkM_2,\ldots,M_k within constant factors, in increasing order. Construct a prefix cache only after certifying that its moment is large enough. If a moment is sufficiently small, halve φ\varphi without collecting labels.

  4. At a retained nonfinal stage, keep the active mask fixed and draw O~k(Mk/φk)\widetilde{O}_k(M_k/\varphi^k) labels from the order-kk state. Add the observed labels to the recorded set, remove them from activity, and halve φ\varphi.

  5. At the final threshold, either certify a negligible active moment or refine the required normalizations and estimate that moment. Estimate the recorded contribution by conditional batch estimation.

  6. Denote the sum of the estimated contributions by P~\widetilde{P}. Project it onto [n1−k,1][n^{1-k},1] and output log⁡P~/(1−k)\log\widetilde{P}/(1-k) for this run.

  7. Repeat the complete run O(log⁡(1/δ))O(\log(1/\delta)) times independently and return the median as H~k(p)\widetilde{H}_k(p).

Within a run, use fixed error assignments so that steps 1–6 succeed jointly with probability at least 2/32/3. Every separately converted test or stage uses fresh retained states and a predetermined query limit.

Preparation of the retained states

At a fixed stage, maintain pi≤φp_i \le\varphi for i∈Ai \in\mathcal{A}. Define Ms=∑i∈ApisM_s=\sum_{i\in\mathcal{A}}p_i^s for 2≤s≤k2\le s\le k and G=MkG=M_k, while M1=1M_1=1 denotes the normalization of the unconditioned source. We use

Ms≤R(s−1)/(k−1),Ms+1≤φMs (s≥2),G≤φk−sMs (2≤s≤k).(53)M_s \le R^{(s-1)/(k-1)},\qquad M_{s+1}\le\varphi M_s\ (s\ge2),\qquad G\le\varphi^{k-s}M_s\ (2\le s\le k). \tag*{(53)}

The pair moment also satisfies M2≤φM1M_2\le\varphi M_1.

The unnormalized query-cost bound ese_s can be computed before estimating MsM_s. Start with e2=Ck(2φ+1/r)e_2=C_k(2\varphi+1/r). Once a coarse scale M~s=Θk(Ms)\widetilde{M}_s=\Theta_k(M_s) is certified, set

Ds=Ckmax⁡{1,esM~s},Ls=max⁡{1,⌈B/Ds⌉},D_s=C_k\max\left\{1,\sqrt{\frac{e_s}{\widetilde{M}_s}}\right\},\qquad L_s=\max\{1,\lceil B/D_s\rceil\},
es+1=Ck(Ds2M~sφ+M~sLs+φs).(54)e_{s+1}=C_k\left(D_s^2\widetilde{M}_s\varphi+\frac{\widetilde{M}_s}{L_s}+\varphi^s\right). \tag*{(54)}

The fixed constants may be chosen separately at successive orders. With this choice, es+1e_{s+1} is known before the next moment is estimated. Taking the maximum with 1 does not change the asymptotic bound, because es≳kφs−1≥Mse_s\gtrsim_k\varphi^{s-1}\ge M_s. An extra source prefix, in addition to the retained cache, is included when applying Lemma 6; this changes the bounds by only a constant.

By induction, these quantities bound the exact preparation and reflection costs. They also satisfy

e2=Ok(B−1),e_2=O_k(B^{-1}),
es+1≤Ok(φes+R(s−1)/(2(k−1))esB+φs),(55)e_{s+1}\le O_k\left(\varphi e_s+\frac{R^{(s-1)/(2(k-1))}\sqrt{e_s}}{B}+\varphi^s\right), \tag*{(55)}
es≤Ok(B2φk+s/R).e_s\le O_k(B^2\varphi^{k+s}/R).

The last inequality follows from the recurrence analysis in Section VI. It is used only in the analysis; the algorithm determines concrete sizes from the computable quantities in Eq. (54). All retained buffers are restored exactly. A certified inequality Ms≳kφsM_s\gtrsim_k\varphi^s implies Ds=Ok(B)D_s=O_k(B) and LsDs=Ok(B)L_sD_s=O_k(B) by Lemma 7.

Estimating the restricted power sums

We obtain constant-factor estimates of M2,M3,…,MkM_2,M_3,\ldots,M_k in increasing order. Each test for MsM_s uses only caches whose normalizations have already been certified. The first test needs the unconditioned source and its buffer, so it is defined even when the active set has zero mass. For MsM_s, begin with a valid upper scale derived from RR and the coarse interval for φMs−1\varphi M_{s-1}; for s=2s=2 use M1=1M_1=1. We decrease the candidate upper bound geometrically until it reaches csφsc_s\varphi^s, where cs>0c_s>0 is a sufficiently small fixed constant. At a candidate scale gg, apply (27) to additive precision Θk(g)\Theta_k(g). Its query cost, apart from the bounded initialization, is

O~k(ϵs/g)≤O~k(Bφk/R)≤O~k(B),g≳kφs.(56)\widetilde{O}_k\left(\sqrt{\epsilon_s/g}\right) \leq\widetilde{O}_k\left(B\sqrt{\varphi^k/R}\right) \leq\widetilde{O}_k(B), \qquad g\gtrsim_k \varphi^s. \tag*{(56)}

We implement the tests with confidence intervals and stopping thresholds separated by fixed factors. Whenever a test is accurate, it either certifies a smaller valid upper bound or returns a constant-factor interval containing MsM_s. Constant-factor normalization estimates suffice at this point: we multiply the estimated match ratio by the certified endpoints for Ms−1M_{s-1}. Their ratio is bounded in terms of kk. If the supplied scale is within a fixed factor of Ms−1φM_{s-1}\varphi, reduce the fixed coin coefficient in the baseline construction accordingly. This preserves its cost bound.

If the test certifies Ms<(φ/2)sM_s<(\varphi/2)^s, no active label has probability at least φ/2\varphi/2. Skip extraction and halve φ\varphi. The tests can be continued to a sufficiently small floor so that a successful exit always either yields this certificate or returns Ms≳kφsM_s\gtrsim_k\varphi^s. At the final threshold, a small certificate gives

G≤φk−sMs=Ok(Δ),G\leq\varphi^{k-s}M_s=O_k(\Delta),

with its constant chosen within the residual error allocation. We may then set the residual estimate to zero. Otherwise, the certified moment is large enough to construct the next prefix cache. Thus every normalized state used by the algorithm has a positive certified normalization, while the positive acceptance baseline keeps the preceding tests well defined even at zero.

Finding labels and estimating the remaining contribution

At a retained nonfinal stage, let G=Mk≳kφkG=M_k\gtrsim_k\varphi^k. Use the certified scale to select

M=O~k(G/φk)M=\widetilde{O}_k(G/\varphi^k)

independent output labels from the exact order-kk state, with the mask fixed for the whole stage. Each active label with pi≥φ/2p_i\geq\varphi/2 is sampled with probability at least φk/(2kG)\varphi^k/(2^kG). A union bound shows that the logarithmic factor in the number of samples suffices to observe all such labels with the required confidence. Remove every observed label at the end of the stage. On this event, every label remaining in the active set has probability at most φ/2\varphi/2.

By (55), the extraction cost is

MDk≤O~k(Gϵkφk)≤O~k(BG/R)=O~k(B).(57)MD_k\leq\widetilde{O}_k\left(\frac{\sqrt{G\epsilon_k}}{\varphi^k}\right)\leq\widetilde{O}_k\left(B\sqrt{G/R}\right)=\widetilde{O}_k(B). \tag*{(57)}

The total number of recorded labels is at most the number of outputs. Summing the geometric threshold bounds gives

∣S∣≤O~k(R/φ∗k)=O~k(1/η).(58)|S|\leq\widetilde{O}_k(R/\varphi_*^k)=\widetilde{O}_k(1/\eta). \tag*{(58)}

At the final stage the active probabilities are Ok(φ∗)O_k(\varphi_*).

If the residual has not already been certified negligible, find a constant-factor estimate g=Θk(G)g=\Theta_k(G) above a sufficiently small multiple of Δ\Delta. The prefix mean primitive estimates it to additive error Θk(Δ)\Theta_k(\Delta) at cost

O~k(B+ϵkgΔ)≤O~k(B+BφkΔg/R)=O~k(B).(59)\widetilde{O}_k\left(B+\sqrt{\frac{\epsilon_k g}{\Delta}}\right)\leq\widetilde{O}_k\left(B+B\frac{\varphi^k}{\Delta}\sqrt{g/R}\right)=\widetilde{O}_k(B). \tag*{(59)}

The last equality uses the final threshold relation φ∗k=Θk(Δ)\varphi_*^k=\Theta_k(\Delta). The residual is discarded only after its total moment has been certified small. A bound on the largest remaining probability alone would not justify this step.

Accurate normalization factors

The normalized collision states are defined in terms of the true moments, even though the algorithm initially knows them only within constant factors. After undoing known coin factors, their match probabilities obey

Ms=Ms−1λs,2≤s≤k,M1=1.M_s=M_{s-1}\lambda_s,\qquad2\leq s\leq k,\qquad M_1=1.

Constant-factor estimates suffice for constructing the states, locating subsequent moments, and collecting labels. For final numerical rescaling, let g=Θk(G)g=\Theta_k(G) be a retained residual scale and put ν=Θk(min⁡{1,Δ/g})\nu=\Theta_k(\min\{1,\Delta/g\}). Refine M2,…,Mk−1M_2,\ldots,M_{k-1} sequentially to relative error Ok(ν)O_k(\nu), assigning a sufficiently small fixed fraction to each factor. The accumulated multiplicative error over the fixed number of orders is Ok(ν)O_k(\nu). At k=2k=2 this list is empty. For 2≤s<k2 \le s < k, the refinement costs

O~k(B+gDsΔ)≤O~k(B+gesΔMs).\widetilde{O}_k\left(B+\frac{gD_s}{\Delta}\right)\le\widetilde{O}_k\left(B+\frac{g\sqrt{e_s}}{\Delta\sqrt{M_s}}\right).

Using G≤φk−sMsG \le\varphi^{k-s}M_s, g=Θk(G)g=\Theta_k(G), and Eq. (55),

gesΔMs≤Ok(BφkΔgR)=Ok(B).(60)\frac{g\sqrt{e_s}}{\Delta\sqrt{M_s}}\le O_k\left(B\frac{\varphi^k}{\Delta}\sqrt{\frac{g}{R}}\right)=O_k(B). \tag*{(60)}

The normalization refinement therefore adds only O~k(B)\widetilde{O}_k(B) queries. We perform it only after certifying that the residual is large enough to require estimation. Consequently, no relative-accuracy requirement is imposed on a zero residual.

Estimating the contribution of the recorded labels

Lemma 8 (Estimation on a known set). Let S⊆[n]S \subseteq[n] be a known set of mm labels, Pk(p)≤RP_k(p) \le R, and Δ=ηR\Delta=\eta R. Its contribution GS=∑i∈SpikG_S=\sum_{i\in S}p_i^k can be estimated to additive error Ok(Δ)O_k(\Delta) using

O~k[R−1/(2k)(m(k−1)2/(2k(k+1))η−2/(k+1)+η−1)](61)\widetilde{O}_k\left[R^{-1/(2k)}\left(m^{(k-1)^2/(2k(k+1))}\eta^{-2/(k+1)}+\eta^{-1}\right)\right] \tag*{(61)}

purified queries. If m=O~k(1/η)m=\widetilde{O}_k(1/\eta), this is O~k(R−1/(2k)/η)\widetilde{O}_k(R^{-1/(2k)}/\eta).

Proof. If SS is empty, we return zero. Otherwise, put w=∑i∈Spiw=\sum_{i\in S}p_i and F=min⁡{R,wk}F=\min\{R,w^k\}. Then GS≤FG_S\le F, and Hölder’s inequality gives wk≤mk−1GS≤mk−1Fw^k\le m^{k-1}G_S\le m^{k-1}F.

Suppose first that a constant-factor scale for positive ww is known. Fixed-point amplitude amplification [15] prepares the original purified state conditioned on SS at cost O~(w−1/2)\widetilde{O}(w^{-1/2}). This supplies purified access to the distribution pi/wp_i/w on SS, whose power sum of order kk is at most F/wkF/w^k. Apply Theorem 2 with additive precision Θk(Δ/wk)\Theta_k(\Delta/w^k). If the requested error is already a sufficiently large fraction of the upper bound on the conditional moment, we return zero instead. Including conditional preparation, the query cost is

O~k[w−(k−1)/(2(k+1))F1/(k+1)Δ−2/(k+1)+F1−1/(2k)/Δ].(62)\widetilde{O}_k\left[w^{-(k-1)/(2(k+1))}F^{1/(k+1)}\Delta^{-2/(k+1)}+F^{1-1/(2k)}/\Delta\right]. \tag*{(62)}

We enlarge the moment upper bounds by fixed factors when necessary to account for the uncertainty in the mass estimate. Substituting wk≤mk−1Fw^k\le m^{k-1}F and F≤RF\le R gives Eq. (61). For m=O~k(1/η)m=\widetilde{O}_k(1/\eta), the first inverse-accuracy exponent is

(k−1)22k(k+1)+2k+1=k+12k≤1.\frac{(k-1)^2}{2k(k+1)}+\frac{2}{k+1}=\frac{k+1}{2k}\le1.

To find the scale of ww, we use amplitude-estimation tests [9] with geometrically decreasing candidate values and fixed query budgets, stopping at a sufficiently small multiple of Δ1/k\Delta^{1/k}. If ww is certified below that scale, then GS≤wk=Ok(Δ)G_S\le w^k=O_k(\Delta) and returning zero is valid. Otherwise retain a constant-factor interval and refine ww to relative error Θk(min⁡{1,Δ/F})\Theta_k(\min\{1,\Delta/F\}). The refinement costs

O~k(FΔw)≤O~k(R−1/(2k)η).(63)\widetilde{O}_k\left(\frac{F}{\Delta\sqrt{w}}\right)\le\widetilde{O}_k\left(\frac{R^{-1/(2k)}}{\eta}\right). \tag*{(63)}

Indeed, if wk≤Rw^k\le R then F/w=wk−1/2≤R1−1/(2k)F/\sqrt{w}=w^{k-1/2}\le R^{1-1/(2k)}; if wk≥Rw^k\ge R, the same conclusion follows from F=RF=R. The initial tests cost O~k(Δ−1/(2k))\widetilde{O}_k(\Delta^{-1/(2k)}), which is absorbed. The refined mass controls the final multiplication by wkw^k to error Ok(Δ)O_k(\Delta), since the contribution is at most FF. When w=0w=0, the initial tests terminate without invoking conditional preparation.

Finally, fix an upper bound QQ on the number of conditional preparation and inverse calls in the complete capped batch circuit. Implement each preparation with state error at most

ξ=ckmin⁡{1,Δ/wk}/(Q+1)2,\xi=c_k\min\{1,\Delta/w^k\}/(Q+1)^2,

where we choose the tolerance conservatively from the certified interval for ww. A two-dimensional output rotation gives an ideal unitary extension of the exact conditional state whose operator-norm distance from the implemented preparation is O(ξ)O(\xi). Its inverse has the same error, so the full circuit changes by at most O(Qξ)O(Q\xi). Fixed-point amplification has only logarithmic dependence on 1/ξ1/\xi. The known positive mass floor and R≥n1−kR\ge n^{1-k} keep this logarithm polynomial in log⁡(n/η)\log(n/\eta). Allocate fixed fractions of the total error to the mass, conditional moment, and preparation errors, and amplify confidence to obtain the claim. ∎

Error analysis and total query complexity

We assign a fixed query budget to every scale test, cache construction, and output stage, using the certified classical intervals available at that point. Each complete stage receives a fresh raw-sample pool covering its cache and output budgets. Its preparation is charged through the setup and per-output costs. Controlled reflections about the raw sample use only ordinary UpU_p, Up†U_p^\dagger and a known controlled zero-state phase.

Within each stage, we compose initialization with all label-extraction operations before converting the transducer to a circuit. The retained source states are therefore exact throughout the transducer construction. There are O~k(log⁡2(n/η))\widetilde{O}_k(\log^2(n/\eta)) scale tests and stages. Rebuild caches for every separately converted test or stage, and use inverse-polylogarithmic conversion accuracy. Confidence amplification and a union bound add only logarithmic factors. In particular, extraction calls within a stage are not converted individually at accuracy inverse-polynomial in the number of outputs.

The endpoint intervals fix the maximum number of scale tests. Cap every test, cache construction, and extraction stage by its prescribed O~k(B)\widetilde{O}_k(B) bound, and cap the number of recorded labels by Eq. (58). An exceeded cap or an inconsistent confidence interval is declared a failure. With sufficiently large fixed constants in the budgets, these events do not occur when all estimates are accurate. The caps also bound the number of queries on every other execution.

Proof of Theorem 1. Obtaining the initial scale requires O~k(nuk)\widetilde{O}_k(n^{u_k}) queries. In the high-precision branch, (35) costs O~k(R−1/(2k)/η)\widetilde{O}_k(R^{-1/(2k)}/\eta). Otherwise each localization, setup, extraction, normalization, and residual step costs O~k(B)\widetilde{O}_k(B) by Eqs. (56)–(60) and Lemma 7. Lemma 8 and Eq. (58) estimate the recorded contribution at cost O~k(R−1/(2k)/η)\widetilde{O}_k(R^{-1/(2k)}/\eta).

Add the estimates for the recorded and active labels. Their total moment error is Ok(ηR)=Ok(ηPk(p))O_k(\eta R)=O_k(\eta P_k(p)). Since η=ck′ϵ\eta=c'_k\epsilon, choosing ck′c'_k sufficiently small and applying Eq. (14) gives entropy error at most ϵ\epsilon. The projection onto [n1−k,1][n^{1-k},1] does not increase the moment error. We allocate the individual failure probabilities so that one complete run succeeds with probability at least 2/32/3.

Finally, R≥n1−kR\ge n^{1-k} implies

B≤Ok(nukη−(1−uk)),R−1/(2k)/η≤nbk/η.B\le O_k(n^{u_k}\eta^{-(1-u_k)}),\qquad R^{-1/(2k)}/\eta\le n^{b_k}/\eta.

Substituting η=Θk(ϵ)\eta=\Theta_k(\epsilon) gives Eq. (3) at constant success probability. The initial search is absorbed by the first term. Repeating the complete algorithm O(log⁡(1/δ))O(\log(1/\delta)) times and taking the median gives success probability at least 1−δ1-\delta. The overheads from circuit conversion and confidence amplification are polylogarithmic and are included in the stated bound.

Sparse collision tables for scale estimation

In this appendix, we prove Proposition 1, which is used in the binary search of Section IV. Combining the proposition with that search and Eq. (14) also gives a direct entropy estimator using O~k(nuk/ϵ)\widetilde{O}_k(n^{u_k}/\epsilon) queries.

Collision search with bounded populations

For a table x∈[n]Lx\in[n]^L, write Ny(x)N_y(x) for the multiplicity of label yy and define

Bi(x)=∣{y:Ny(x)≥i}∣,Ci(x)=∑y(Ny(x)i).(64)B_i(x)=|\{y:N_y(x)\ge i\}|,\qquad C_i(x)=\sum_y\binom{N_y(x)}{i}. \tag*{(64)}

The quantities BiB_i control the search cost, while CkC_k is the statistic whose expectation we estimate.

Lemma 9 (A capped-population search algorithm). Fix k≥2k\ge2. Suppose a length-LL table has maximum multiplicity at most K≥kK\ge k, and known numbers satisfy

1≤Dk−1≤⋯≤D2≤L,Bi(x)≤Di(2≤i<k).1\le D_{k-1}\le\cdots\le D_2\le L,\qquad B_i(x)\le D_i\quad(2\le i<k).

The sequences are empty when k=2k=2. Define

Q(L,D)=max⁡2≤j≤k(L2j−1∏i=2j−1Di2i−2)1/(2j−1).(65)Q(L,D)=\max_{2\le j\le k}\left(L^{2^{j-1}}\prod_{i=2}^{j-1}D_i^{2^{i-2}}\right)^{1/(2^{j-1})}. \tag*{(65)}

There is an algorithm that decides whether a kk-collision exists and, when it exists, finds a collision label, with failure probability at most ζ\zeta, using

O~k(K(k−1)/2Q(L,D))(66)\widetilde{O}_k\left(K^{(k-1)/2}Q(L,D)\right) \tag*{(66)}

queries. Its query count is fixed and its output is bounded even outside the promise. The suppressed factors are logarithmic in LL, nn, 1/ζ1/\zeta.

Proof. We use the colored dual-adversary construction in [8 Lemma 8.5 and Proposition 8.6], following its learning-graph approach. The positive inputs have a colorful kk-collision and multiplicity at most KK; negative inputs have no kk-collision anywhere. Both domains obey the population promises. Thus each negative input has at most k−1k-1 occurrences of any label.

Partition the positions randomly into kk balanced roles of sizes vi=Θk(L)v_i=\Theta_k(L). The number of equal-label prefixes across the first jj roles is at most KjDjK^jD_j. For raw set sizes aia_i, the diagonal objective of the construction is, up to fixed constants,

a1+∑j=2k−1ajCjcol∏i<jai∏i≤jvi+∑s=1k∏i≤svi∏i<sai,Cjcol≤KjDj.(67)a_1+\sum_{j=2}^{k-1}a_j\sqrt{\frac{C_j^{\mathrm{col}}\prod_{i<j}a_i}{\prod_{i\leq j}v_i}}+\sum_{s=1}^{k}\sqrt{\frac{\prod_{i\leq s}v_i}{\prod_{i<s}a_i}},\qquad C_j^{\mathrm{col}}\leq K^jD_j. \tag*{(67)}

We make explicit its dependence on KK. Correction branches in the feasibility constraints count occurrences of the selected positive certificate label in a negative input. There are at most k−1k-1, so their branch parameter is kk and the number of raw copies at level ii can be taken as ℓi=ki−1(2k−1)\ell_i=k^{i-1}(2^k-1). It depends only on kk.

If the selected label has did_i occurrences in role ii, then ∑idi≤K\sum_i d_i\leq K and the positive normalization is

γx=∏i<k(vi)di(vi−ℓiai)di,\gamma_x=\prod_{i<k}\frac{(v_i)_{d_i}}{(v_i-\ell_i a_i)_{d_i}},

where (z)d(z)_d denotes the falling factorial. Under vi≥4Kv_i\geq4K and ℓiai≤vi/(8K)\ell_i a_i\leq v_i/(8K),

log⁡γx≤2∑i<kdiℓiaivi≤14.\log\gamma_x\leq2\sum_{i<k}\frac{d_i\ell_i a_i}{v_i}\leq\frac{1}{4}.

Thus the correction multiplicities and positive normalization remain bounded by constants depending only on kk. The cited feasibility construction retains the objective (67) with such constants. This establishes the required dependence on the multiplicity cutoff KK.

To optimize, put Q=Q(L,D)Q=Q(L,D), z1=Q/Lz_1=Q/L, a1′=Qa'_1=Q, and, for 2≤j<k2\leq j<k, set

zj=min⁡{zj−1,Qzj−1LDj},aj′=Lzjzj−1.(68)z_j=\min\left\{z_{j-1},\frac{Q\sqrt{z_{j-1}}}{\sqrt{LD_j}}\right\},\qquad a'_j=\frac{Lz_j}{z_{j-1}}. \tag*{(68)}

Since Dj≤LD_j\leq L and L2/3≤Q≤LL^{2/3}\leq Q\leq L, these satisfy Q≤aj′≤LQ\leq a'_j\leq L and

aj′Dj∏i<jai′Lj≤Q.a'_j\sqrt{\frac{D_j\prod_{i<j}a'_i}{L^j}}\leq Q.

Expanding the minima shows that zk−1z_{k-1} is the minimum, over subsequences 2≤i1<⋯<im≤k−12\leq i_1<\cdots<i_m\leq k-1 including the empty subsequence, of

Q2−2−mL∏t=1mDit2−(m−t+1).(69)\frac{Q^{2-2^{-m}}}{L\prod_{t=1}^{m}D_{i_t}^{2^{-(m-t+1)}}}. \tag*{(69)}

For fixed mm, its denominator is largest at it=t+1i_t=t+1, since DiD_i is nonincreasing. The j=m+2j=m+2 term in Eq. (65) then implies that each expression is at least L/Q2L/Q^2. Since ∏i<sai′=Ls−1/zs−1\prod_{i<s}a'_i=L^{s-1}/z_{s-1}, all certificate terms obey

Ls∏i<sai′≤Q.\sqrt{\frac{L^s}{\prod_{i<s}a'_i}}\leq Q.

For s=1s=1, this follows directly from Q≥L2/3Q\geq L^{2/3}.

Choose a sufficiently large fixed ckc_k and take ai=max⁡{1,⌊ai′/(ckK)⌋}a_i=\max\{1,\lfloor a'_i/(c_kK)\rfloor\}. If L≥ck′KL\geq c'_kK, the volume conditions hold, and ai′/(2ckK)≤ai≤ai′a'_i/(2c_kK)\leq a_i\leq a'_i. Otherwise reading the table costs Ok(K)O_k(K) and suffices. The setup terms in Eq. (67), including KjK^j, and the enlarged certificate terms are all bounded by Ok(K(k−1)/2/Q)O_k(K^{(k-1)/2}/Q). The algorithmic characterization by the dual adversary bound [14] then gives the colored decision algorithm.

A fixed kk-tuple is colorful with probability bounded away from zero in terms of kk. We repeat the procedure with independent colorings and accept if any repetition finds a collision. This decides the existence of a collision with bounded error. A globally negative table is a valid negative input for every coloring; on positive tables a favorable coloring supplies a valid positive input. Repetition reduces the error to the required confidence.

For search, binary-search the label alphabet. At each decision step replace labels outside the selected label prefix by distinct position-tagged symbols. This uses O(1)O(1) original lookups, preserves all population and multiplicity caps, and keeps a collision precisely when the selected prefix contains a collision label. After at most ⌈log⁡2n⌉\lceil\log_2 n\rceil correct decisions, the remaining prefix identifies a collision label. We pad all operations to fixed query budgets, including executions on inputs outside the promise.

Moments and tails of a random table

Let X1,…,XLX_1,\ldots,X_L be independent samples, with L=⌈kg−1/k⌉L=\lceil kg^{-1/k}\rceil and Pk(p)≤g≤1P_k(p)\le g\le1. We use BiB_i and CiC_i for the corresponding random population and collision counts.

Lemma 10 (Collision moments). There is a constant AkA_k such that, for 2≤i≤k2\le i\le k and every integer h≥1h\ge1,

ECih≤(Akh)ihmax⁡{1,LiPi(p)}h.(70)\mathbb{E}C_i^h \le(A_kh)^{ih}\max\{1,L^iP_i(p)\}^h. \tag*{(70)}

Moreover,

LiPi(p)≤(k+1)in1−i/k,Pr⁡{max⁡yNy>K}≤(k+1)K+1(K+1)!(K≥k−1).(71)L^iP_i(p)\le(k+1)^i n^{1-i/k},\qquad \Pr\{\max_y N_y>K\}\le\frac{(k+1)^{K+1}}{(K+1)!}\qquad(K\ge k-1). \tag*{(71)}

Proof. We have Lpmax⁡≤k+1Lp_{\max}\le k+1, and Eq. (12) proves the first inequality in Eq. (71). Expand CihC_i^h as a sum of hh collision constraints on ii distinct positions each. A connected component of overlapping constraints on v≥iv\ge i positions forces all its labels to agree and contributes at most

LvPv(p)≤LiPi(p)(Lpmax⁡)v−i≤LiPi(p)(k+1)v−iL^vP_v(p)\le L^iP_i(p)(Lp_{\max})^{v-i}\le L^iP_i(p)(k+1)^{v-i}

after summing its embeddings. There are at most hh components, at most ihih positions, and at most (ih)ih(ih)^{ih} identification patterns. These bounds give Eq. (70) after enlarging AkA_k.

If an occupancy exceeds KK, then CK+1≥1C_{K+1}\ge1. Thus

Pr⁡{max⁡yNy>K}≤(LK+1)PK+1(p)≤LkPk(p)(Lpmax⁡)K+1−k(K+1)!≤(k+1)K+1(K+1)!.\Pr\{\max_y N_y>K\}\le\binom{L}{K+1}P_{K+1}(p)\le\frac{L^kP_k(p)(Lp_{\max})^{K+1-k}}{(K+1)!}\le\frac{(k+1)^{K+1}}{(K+1)!}.

Corollary 1 (A promise with negligible truncation error). For 0<η≤1/40<\eta\le1/4, choose h=⌈cklog⁡((n+2)/η)⌉h=\lceil c_k\log((n+2)/\eta)\rceil with sufficiently large ckc_k. There are caps

K=Ok(h),J=Ok(hk),Di=min⁡{L,⌈An1−i/k⌉},A=Ok(hk),(72)K=O_k(h),\qquad J=O_k(h^k),\qquad D_i=\min\{L,\lceil An^{1-i/k}\rceil\},\qquad A=O_k(h^k), \tag*{(72)}

with D2≥⋯≥Dk−1≥1D_2\ge\cdots\ge D_{k-1}\ge1, such that

Pr⁡{max⁡yNy>K or some Bi>Di}≤η100J,E(Ck−J)+≤η100.(73)\Pr\{\max_y N_y>K\text{ or some }B_i>D_i\}\le\frac{\eta}{100J},\qquad \mathbb{E}(C_k-J)_+\le\frac{\eta}{100}. \tag*{(73)}

The same conclusion holds with any larger fixed constants, depending only on kk, in the denominators.

Proof. Apply Markov’s inequality to Eq. (70) with moment order hh. A sufficiently large multiple of hkn1−i/kh^k n^{1-i/k} gives tail probability at most e−he^{-h}. Taking the minimum with LL is valid because Bi≤LB_i\le L. The factorial estimate controls the maximum occupancy. Finally,

E(Ck−J)+≤ECkhJh−1.\mathbb{E}(C_k-J)_+\le\frac{\mathbb{E}C_k^h}{J^{h-1}}.

Take JJ to be a sufficiently large multiple of (Akh)k(A_kh)^k. The right-hand side is at most Je−hJe^{-h} up to a fixed constant. Increasing ckc_k absorbs the caps and the finite number of tail events.

The bounded collision-count estimator

Proof of Proposition 1. Set L=⌈kg−1/k⌉L = \lceil kg^{-1/k}\rceil and β=(Lk)\beta= \binom{L}{k}. Then

βg=Θk(1),ECk=βPk(p)≤βg=Ok(1).(74)\beta g = \Theta_k(1), \qquad\mathbb{E}C_k = \beta P_k(p) \le\beta g = O_k(1). \tag*{(74)}

Choose the caps in Corollary 1 with a sufficiently small fixed multiple of η\eta. The following procedure computes a capped count on promised tables:

  1. Initialize c=0c = 0 and an empty set of excluded labels.

  2. Use Lemma 9, masking excluded labels by distinct position tags. If no collision remains, output cc.

  3. For the returned label, use quantum search [16] to enumerate its positions and verify each reported position, stopping after K+1K + 1 discoveries or when a fixed query budget is reached. Under the promise there are at most KK positions; high-confidence search tests whether any remain.

  4. If dd positions are found, add (dk)\binom{d}{k} to cc, cap the result at JJ, and exclude the label. Stop at the cap or after at most JJ iterations; otherwise return to step 2.

Every returned index is checked against the table. If a subroutine fails, a cap is exceeded, or the query budget is exhausted, return an arbitrary value in [0,J][0,J]. Reduce all decision and enumeration errors so their total probability is at most η/(100J)\eta/(100J). Occurrence enumeration costs O~(KL)\widetilde{O}(K\sqrt{L}) per iteration, which is absorbed, up to powers of KK, by Q(L,D)≥L2/3Q(L,D) \ge L^{2/3}.

Let Y∈[0,J]Y \in[0,J] be the output. Combining its bounded range, the bad-table probability, and the clipping error gives

∣EY−βPk(p)∣≤ck′η,EY=Ok(1),(75)\left|\mathbb{E}Y-\beta P_k(p)\right| \le c'_k\eta,\qquad\mathbb{E}Y=O_k(1), \tag*{(75)}

where ck′c'_k can be made arbitrarily small by decreasing the fixed error tolerances.

We implement this procedure coherently by retaining its random bits, measurement records, and private table registers. Lemma 4 gives the exact independent-table mean. Rotate a flag with conditional success probability Y/JY/J. Its mean is Ok(1/J)O_k(1/J), so amplitude estimation [9] attains additive error Θk(η/J)\Theta_k(\eta/J) using Ok(J/η)O_k(\sqrt{J}/\eta) executions and inverse executions of the coherent procedure. Multiply the estimate by J/βJ/\beta. Eqs. (74)–(75) give error at most ηg\eta g. The initial reflection includes the zero-initialized implicit table and is a known query-free operation.

For the execution cost, g≥Pk(p)≥n1−kg \ge P_k(p) \ge n^{1-k} gives L≤(k+1)n1−1/kL \le(k+1)n^{1-1/k}, and Di≤O~k(n1−i/k)D_i \le\widetilde{O}_k(n^{1-i/k}). The exponent of nn in the jjth term of (65) is

2j−1(1−1/k)+∑i=2j−12i−2(1−i/k)2j−1=(3k−j)2j−2−kk(2j−1)=uk,j.(76)\frac{2^{j-1}(1-1/k)+\sum_{i=2}^{j-1}2^{i-2}(1-i/k)}{2^j-1} = \frac{(3k-j)2^{j-2}-k}{k(2^j-1)} = u_{k,j}. \tag*{(76)}

All polynomial factors in KK, JJ, AA and all confidence factors are polylogarithmic in n/ηn/\eta. Thus each execution costs O~k(nuk)\widetilde{O}_k(n^{u_k}), proving the stated O~k(nuk/η)\widetilde{O}_k(n^{u_k}/\eta) bound. Median amplification gives any desired confidence. The explicit caps bound both the output and the query cost on every execution.

A simpler order-two estimator

Algorithm 2 applies to k=2k=2, with no intermediate collision-state levels. In this section, we give a simpler implementation for this order. It uses only the first mean-estimation step of Lemma 6, both to locate the power sum and to obtain the final estimate.

Proposition 2 (Direct order-two estimator). Let P=P2(p)P=P_2(p) and suppose P≤R≤CPP \le R \le CP, R≤1R \le1, for fixed CC. For sufficiently small ϵ>0\epsilon>0, the order-one to order-two prefix mean primitive estimates H~2(p)\widetilde{H}_2(p) to additive error ϵ\epsilon using

O~(R−1/3ϵ−2/3+R−1/4/ϵ)(77)\widetilde{O}\left(R^{-1/3}\epsilon^{-2/3}+R^{-1/4}/\epsilon\right) \tag*{(77)}

ordinary purified queries at constant success probability. The same primitive finds the initial scale at worst-case cost O~(n1/3)\widetilde{O}(n^{1/3}). The complete procedure is given in Algorithm 3. Hence

Q2(n,ϵ)≤O~(n1/3ϵ−2/3+n1/4/ϵ).(78)Q_2(n,\epsilon)\le\widetilde{O}\left(n^{1/3}\epsilon^{-2/3}+n^{1/4}/\epsilon\right). \tag*{(78)}

Algorithm 3: Quantum algorithm for order-two Rényi entropy estimation

Input: Purified access oracle UpU_p; dimension bound nn; additive accuracy ϵ\epsilon; maximum failure probability δ∈(0,1/3)\delta\in(0,1/3).

Output: An estimate H~2(p)\widetilde{H}_2(p) with additive error at most ϵ\epsilon and failure probability at most δ\delta.

  1. Start with g=1g=1. At each candidate, set φ=g\varphi=\sqrt{g} and L=⌈g−1/3⌉L=\lceil g^{-1/3}\rceil. Use the s=1s=1 mean primitive of Lemma 6 to estimate P2(p)P_2(p) to additive error g/16g/16.

  2. If the estimate is at least g/4g/4, retain R=gR=g. Otherwise replace gg by max⁡{g/2,1/n}\max\{g/2,1/n\} and repeat, subject to a fixed limit of O(log⁡n)O(\log n) tests.

  3. Set φ=R\varphi=\sqrt{R} and L=⌈R−1/3ϵ−2/3⌉L=\lceil R^{-1/3}\epsilon^{-2/3}\rceil. Prepare LL raw samples and use the same primitive to estimate P2(p)P_2(p) to additive error cϵRc\epsilon R, for a sufficiently small constant cc.

  4. Project the result onto [1/n,1][1/n,1] and take its negative logarithm.

  5. Repeat the complete procedure O(log⁡(1/δ))O(\log(1/\delta)) times and return the median.

The confidence assignments in steps 1–4 make each complete run succeed with probability at least 2/32/3.

Proof. Use the whole alphabet as both sets in Lemma 6, with

s=1,M1=1,D1=O(1),G=P,g=R,φ=R.s=1,\qquad M_1=1,\qquad D_1=O(1),\qquad G=P,\qquad g=R,\qquad\varphi=\sqrt{R}.

The promises hold because pmax⁡2≤P≤Rp_{\max}^2\le P\le R and R≤R=M1φR\le\sqrt{R}=M_1\varphi. Prepare a cache of LL raw samples and the constant number of additional source samples. Comparing the selected sample with a fresh sample gives a match probability of PP, and the source normalization is exactly one. With additive moment error Δ=c′ϵR\Delta=c'\epsilon R, Eq. (27), including setup, gives

Q(L)≤O~(L+φR+R/LϵR)=O~(L+R−1/4ϵ+1ϵLR).(79)\begin{aligned} Q(L)\le\widetilde{O}\left(L+\frac{\sqrt{\varphi R}+\sqrt{R/L}}{\epsilon R}\right) \\ &=\widetilde{O}\left(L+\frac{R^{-1/4}}{\epsilon}+\frac{1}{\epsilon\sqrt{LR}}\right). \tag*{(79)} \end{aligned}

Choose L=⌈R−1/3ϵ−2/3⌉L=\lceil R^{-1/3}\epsilon^{-2/3}\rceil. The first and last terms are then O(R−1/3ϵ−2/3)O(R^{-1/3}\epsilon^{-2/3}), proving Eq. (77). Compose the cache initialization and mean transducer before circuit conversion. Projection onto [1/n,1][1/n,1] and the negative logarithm give the entropy estimate.

To obtain the initial scale, start at g=1g=1. At each valid candidate upper bound, set φ=g\varphi=\sqrt{g}, L=⌈g−1/3⌉L=\lceil g^{-1/3}\rceil, and estimate PP to error g/16g/16 by the same primitive. Its cost is O~(g−1/3+g−1/4)=O~(g−1/3)\widetilde{O}(g^{-1/3}+g^{-1/4})=\widetilde{O}(g^{-1/3}). Stop if the estimate is at least g/4g/4; otherwise replace gg by max⁡{g/2,1/n}\max\{g/2,1/n\}. When the estimate is accurate, continuation preserves the upper-bound assumption and stopping gives P≥3g/16P\ge3g/16. Since P≥1/nP\ge1/n, an accurate test must stop at g=1/ng=1/n.

Fix the number of tests and their caps using P≥1/nP\ge1/n, and amplify their confidence according to that number. The geometric cost sum is at most O~(n1/3)\widetilde{O}(n^{1/3}). If the intervals become inconsistent or the query budget is exhausted, we declare failure. The returned scale obeys P≤R≤(16/3)PP\le R\le(16/3)P. Substituting R≥1/nR\ge1/n in Eq. (77) proves Eq. (78).

Thus the same prefix framework applies at every fixed integer order. Order two uses raw samples as its only cache and has no intermediate moment normalizations. It does not require label collection or the batch estimator.

References

  1. [1]A. Rényi, “On measures of entropy and information,” in Proc. 4th Berkeley Symp. Mathematical Statistics and Probability, vol. 1, pp. 547–561, 1961.
  2. [2]J. Acharya, A. Orlitsky, A. T. Suresh, and H. Tyagi, “Estimating Rényi entropy of discrete distributions,” IEEE Trans. Inf. Theory, vol. 63, no. 1, pp. 38–56, 2017. arXiv:1408.1000.arxiv.org/abs/1408.1000
  3. [3]T. Li and X. Wu, “Quantum query complexity of entropy estimation,” IEEE Trans. Inf. Theory, vol. 65, no. 5, pp. 2899–2921, 2019. doi:10.1109/TIT.2018.2883306.DOI
  4. [4]A. Gilyén and T. Li, “Distributional property testing in a quantum world,” in Proc. 11th Innovations in Theoretical Computer Science Conf. (ITCS), LIPIcs, vol. 151, pp. 25:1–25:19, 2020. doi:10.4230/LIPIcs.ITCS.2020.25.DOI
  5. [5]A. Belovs, S. Jeffery, and D. Yolcu, “Taming quantum time complexity,” Quantum, vol. 8, Art. no. 1444, 2024. doi:10.22331/q-2024-08-23-1444.DOI
  6. [6]A. Cornelissen, S. Apers, and S. Gribling, “Improved quantum volume estimation with transducers and amortized quantum walks,” 2026. arXiv:2609.40217v2.arxiv.org/abs/2609.40217
  7. [7]K. Chen, M. Gao, T. Li, Q. Wang, and X. Wang, “Quantum multi-level estimation of functionals of discrete distributions,” in Proc. 53rd Int. Colloq. Automata, Languages, and Programming (ICALP), LIPIcs, vol. 374, pp. 58:1–58:23, 2026. doi:10.4230/LIPIcs.ICALP.2026.58. Full version: arXiv:2605.03685v1.DOI
  8. [8]T. Peng, S. Hou, and X. Dong, “Tight quantum query bounds for collision finding over arbitrary bounded types,” 2026. arXiv:2611.17804v1.arxiv.org/abs/2611.17804
  9. [9]G. Brassard, P. Høyer, M. Mosca, and A. Tapp, “Quantum amplitude amplification and estimation,” in Quantum Computation and Quantum Information, Contemporary Mathematics, vol. 305, pp. 53–74, American Mathematical Society, 2002. arXiv:quant-ph/0005055.DOI
  10. [10]A. Montanaro, “Quantum speedup of Monte Carlo methods,” Proc. R. Soc. A, vol. 471, no. 2181, Art. no. 20150301, 2015. arXiv:1504.06987.DOI
  11. [11]J. van Apeldoorn, “Quantum probability oracles & multidimensional amplitude estimation,” in Proc. 16th Conf. Theory of Quantum Computation, Communication and Cryptography (TQC), LIPIcs, vol. 197, pp. 9:1–9:11, 2021. doi:10.4230/LIPIcs.TQC.2021.9.DOI
  12. [12]K. Chen, Q. Wang, and Z. Zhang, “A list of complexity bounds for property testing by quantum sample-to-query lifting,” 2025. arXiv:2512.01971v1.arxiv.org/abs/2512.01971
  13. [13]A. Belovs, “Learning-graph-based quantum algorithm for k-distinctness,” in Proc. 53rd Annu. IEEE Symp. Foundations of Computer Science (FOCS), pp. 207–216, 2012.arxiv.org/abs/1205.1534
  14. [14]T. Lee, R. Mittal, B. W. Reichardt, R. Špalek, and M. Szegedy, “Quantum query complexity of state conversion,” in Proc. 52nd Annu. IEEE Symp. Foundations of Computer Science (FOCS), pp. 344–353, 2011. arXiv:1011.3020.DOI
  15. [15]T. J. Yoder, G. H. Low, and I. L. Chuang, “Fixed-point quantum search with an optimal number of queries,” Phys. Rev. Lett., vol. 113, Art. no. 210501, 2014. arXiv:1409.3305.DOI
  16. [16]M. Boyer, G. Brassard, P. Høyer, and A. Tapp, “Tight bounds on quantum searching,” Fortschr. Phys., vol. 46, no. 4–5, pp. 493–505, 1998. arXiv:quant-ph/9605034.arxiv.org/abs/quant-ph/9605034

Paper details

vlnc:W_5d8nfm4k
Version
v1 · latest
Published
Fresh — added to the Hub within the last 30 days
Added
License
CC BY 4.0
Usage

views · 2

downloads · 0

A view counts once per browser per day, a download each time the PDF is requested.

  • Physics and Astronomy

Not recorded for this paper

View statement
Looking for related papers…
Contents