betaFeedback

WorksPhysics and Astronomy

Harnessing dimensional leakage for continuous-variable randomness certification

Abstract

Semi-device-independent quantum protocols often rely on strict Hilbert-space dimension assumptions that are difficult to satisfy in realistic implementations, particularly with infinite-dimensional optical fields. The almost-qudit framework addresses this issue by quantifying the leakage of quantum states beyond a target subspace. Although such leakage can severely compromise randomness certification for fixed preparation and measurement inputs, we show that averaging over the full input ensemble can mitigate this vulnerability and extend the range of tolerable leakage. This enhanced robustness enables nonzero randomness certification using low-squeezing single-mode Gaussian states and homodyne detection, thus offering an experimentally accessible continuous-variable implementation.

Introduction

Prepare-and-measure (PM) scenarios [1, 2] provide a versatile framework for quantum information processing when the preparation and measurement devices are not fully characterized. By assuming that the communicated quantum system satisfies physical constraints [3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15], most notably a bounded Hilbert-space dimension [16, 17, 18, 19], semi-device-independent protocols can certify quantum properties without requiring a detailed model of the underlying devices. These include quantum randomness generation [20, 21, 22, 23, 24, 25, 26], and the certification and characterization of properties of quantum states and measurements [27, 28, 29, 30, 31]. Such protocols are attractive for practical quantum technologies, where a full device-independent analysis may be experimentally demanding [32, 33]. Their reliability, however, frequently rests on the assumption that the physical systems used in the experiment satisfy the prescribed dimension constraint [34].

In realistic implementations, this assumption is rarely exact. Optical fields, for instance, occupy infinite-dimensional Hilbert spaces [35, 36], and even when information is encoded in a nominal qubit or qudit, such as in the polarization or orbital angular momentum of photons, multiphoton contributions, higher-order Fock-state occupations, and other unwanted degrees of freedom can extend beyond the intended subspace. To address this issue, the concept of almost qudits has been introduced [34], in which a quantum state is predominantly supported on a target dd-dimensional subspace but may contain a small higher-dimensional component. Specifically, a state ρx\rho_x associated with preparation xx is an almost qudit if

Tr⁡(ρxΠd)≥1−εx,(1)\operatorname{Tr}(\rho_x\Pi_d) \ge1-\varepsilon_x, \tag*{(1)}

where Πd\Pi_d projects onto the target dd-dimensional subspace and εx\varepsilon_x quantifies the dimensional leakage. This operational description accommodates physical systems while retaining the central premise of dimension-based semi-device-independent protocols.

The introduction of almost qudits also revealed a severe limitation of these protocols, since even a small dimension leakage can substantially compromise certification procedures [34, 37], including quantum randomness generation and measurement certification. In randomness generation, the problem is particularly pronounced when one seeks to certify the output associated with a specific preparation and measurement setting. An adversary with classical side information can exploit the additional degrees of freedom to reproduce the observed statistics while making the selected output more predictable than an ideal-qudit analysis would suggest. Consequently, the certified randomness can deteriorate rapidly as the dimension leakage increases, even when the system remains predominantly confined to the intended subspace. This sensitivity raises an important question: to what extent does the fragility of existing protocols reflect a fundamental limitation imposed by dimensional leakage, and to what extent does it depend on how the protocol’s performance is evaluated?

In this work, we show that averaging the guessing probability over preparation and measurement inputs can substantially mitigate the effects of dimensional leakage. Unlike fixed-input certification, we exploit the full input ensemble, yielding more robust randomness guarantees and extending the range of leakage parameters compatible with nonzero certified randomness. We further demonstrate that this robustness enables practical continuous-variable (CV) implementations using Gaussian states with reasonably low squeezing and homodyne measurements, which have also been used in other quantum randomness generation schemes [38, 39]. Rather than requiring strictly finite-dimensional states, our framework accommodates their higher-dimensional components, turning the tolerance of dimensional leakage from a potential limitation into a practical advantage for experimentally accessible semi-device-independent randomness generation.

The remainder of the paper is organized as follows. Sec. II introduces the almost-qudit PM scenario. Sec. III presents the randomness certification method and compares the average and fixed-input estimators. Sec. IV explores CV implementations using Gaussian and non-Gaussian states with homodyne and displaced photodetection. Sec. V concludes the paper. The Appendices A, B, and C provide results for additional witnesses and technical derivations.

Almost-dd-dimensional prepare-and-measure scenario

The prepare-and-measure scenario consists of a preparation device that receives an input x∈{0,…,∣X∣−1}x \in\{0,\ldots,|X|-1\} and sends a physical system to a measurement device. The latter receives an input y∈{0,…,∣Y∣−1}y \in\{0,\ldots,|Y|-1\} and returns an outcome b∈{0,…,∣B∣−1}b \in\{0,\ldots,|B|-1\}. The resulting statistics define a behavior {p(b∣x,y)}b,x,y\{p(b|x,y)\}_{b,x,y}. In a classical description, the communicated system carries a message m∈Mm \in\mathcal{M}, implying that

p(b∣x,y)=∑λ,mq(λ)p(m∣x,λ)p(b∣m,y,λ),(2)p(b|x,y)=\sum_{\lambda,m}q(\lambda)p(m|x,\lambda)p(b|m,y,\lambda), \tag*{(2)}

where λ\lambda represents shared classical randomness, independent of the inputs. In a quantum description, the message is replaced by a state ρxλ\rho_x^\lambda and the measurement by a POVM {Mb∣yλ}b\{M_{b|y}^\lambda\}_b, so that

p(b∣x,y)=∑λq(λ)Tr⁡(ρxλMb∣yλ).(3)p(b|x,y)=\sum_\lambda q(\lambda)\operatorname{Tr}(\rho_x^\lambda M_{b|y}^\lambda). \tag*{(3)}

A separation between classical and quantum correlations requires a restriction on the communicated system. The standard dimension assumption imposes ∣M∣≤d|\mathcal{M}| \le d classically and dim⁡(H)≤d\dim(\mathcal{H}) \le d quantum mechanically [16, 20, 21]. Alternative assumptions include bounds on the energy or mean photon number [3, 4, 5], constraints on photon-number statistics [6], on overlaps between preparations [7, 8], on fidelities with reference states [9], or on the information carried by the communicated system [10, 12, 13, 40].

The almost-qudit framework relaxes the dimension assumption by bounding the population outside a dd-dimensional subspace, while leaving the ambient Hilbert space unrestricted [34], as expressed by Eq. (1) and illustrated schematically in Figure 1(a). Here we assume the same leakage for all preparations, εx=ε\varepsilon_x=\varepsilon, for simplicity. The dd-dimensional subspace is defined by a rank-dd projector Πd=∑j=0d−1∣j⟩⟨j∣\Pi_d=\sum_{j=0}^{d-1}|j\rangle\langle j|, for some orthonormal basis {∣j⟩}j=0d−1\{|j\rangle\}_{j=0}^{d-1}, common to all preparations. For ε=0\varepsilon=0, the dimension-bounded scenario is recovered, while for ε>0\varepsilon>0 the preparations may have some population outside the intended dd-dimensional subspace.

Figure 1. Almost-dd-dimensional prepare-and-measure scenario. (a) Quantum realization. The preparation device receives an input xx and emits a state in a Hilbert space H\mathcal{H}. The measurement device receives the system and an input yy, and produces an outcome bb. For each preparation, the population outside the designated dd-dimensional subspace, averaged over shared classical randomness, is at most ε\varepsilon. The dependence of the states, measurements, and subspace on the shared variable is omitted in the diagram. (b) Classical realization. The input XX is encoded into a message MM, which, together with the measurement input YY, determines the output BB. The shared variable Λ\Lambda may correlate the devices. For each preparation, the probability that the message lies outside the designated alphabet of at most dd symbols, averaged over Λ\Lambda, is at most ε\varepsilon.

In the presence of shared randomness, Eq. (1) can be extended in two natural ways. One possibility is to require the leakage bound for every realization λ\lambda,

Tr⁡(ρxλΠdλ)≥1−ε∀x,λ,(4)\operatorname{Tr}(\rho_x^\lambda\Pi_d^\lambda)\ge1-\varepsilon\qquad\forall x,\lambda, \tag*{(4)}

where Πdλ\Pi_d^\lambda is a rank-dd projector common to all preparations associated with a given λ\lambda. We use, however, a less restrictive alternative, imposing the same condition only on average over the shared randomness,

∑λq(λ)Tr⁡(ρxλΠdλ)≥1−ε∀x,(5)\sum_\lambda q(\lambda)\operatorname{Tr}(\rho_x^\lambda\Pi_d^\lambda)\ge1-\varepsilon\qquad\forall x, \tag*{(5)}

which allows realizations with larger leakage to be compensated by others with smaller leakage. As in the mean-observable-constrained framework of Ref. [3], the average condition is closer to what can be directly characterized from the observed ensemble, without requiring access to each hidden variable λ\lambda, which motivates its use throughout this work. An important remark is that Eq. (5) allows for particular strategies to exceed the leakage bound for a specific λ\lambda, as long as the average remains bounded by what is observed in the experiment.

The classical counterpart, illustrated in Figure 1(b), is

∑λq(λ)∑m∈Mdλp(m∣x,λ)≥1−ε∀x,(6)\sum_\lambda q(\lambda)\sum_{m\in\mathcal{M}_d^\lambda}p(m|x,\lambda)\ge1-\varepsilon\qquad\forall x, \tag*{(6)}

where Mdλ\mathcal{M}_d^\lambda is the designated alphabet for a given λ\lambda, common to all preparation inputs xx, with ∣Mdλ∣≤d|\mathcal{M}_d^\lambda|\le d for every λ\lambda. As in the quantum case, particular realizations may have a larger leakage, as long as the average over λ\lambda remains bounded.

Linear dimension witnesses provide experimentally accessible tests of communication constraints. For four preparations, x∈{0,1,2,3}x\in\{0,1,2,3\}, and two binary measurements, y∈{0,1}y\in\{0,1\}, we consider the witness [41]

S4=E00+E01+E10−E11−E20+E21−E30−E31,(7)S_4 = E_{00} + E_{01} + E_{10} - E_{11} - E_{20} + E_{21} - E_{30} - E_{31}, \tag*{(7)}

where Exy=p(0∣x,y)−p(1∣x,y)E_{xy}=p(0|x,y)-p(1|x,y). For a strict bit constraint, its classical bound is S4C=4S_4^{\mathrm{C}}=4, while the maximal qubit value is S4Q=42S_4^{\mathrm{Q}}=4\sqrt{2}. Other witnesses and scenarios are considered in Appendix § 1.3.1, together with their results.

Under the average leakage assumption of Eqs. (5) and (6), these bounds change, since the communicated system is no longer fully restricted to dimension dd, and become

S4C(ε)=min⁡{4+8ε,8},(8)S_4^{\mathrm{C}}(\varepsilon)=\min\{4+8\varepsilon,8\}, \tag*{(8)}

and

S4Q(ε)={42+8ε−8ε2,0≤ε≤12,8,ε≥12,(9)S_4^{\mathrm{Q}}(\varepsilon)= \begin{cases} 4\sqrt{2+8\varepsilon-8\varepsilon^2}, & 0\le\varepsilon\le\frac{1}{2},\\ 8, & \varepsilon\ge\frac{1}{2}, \end{cases} \tag*{(9)}

where we derive the classical bound in Appendix § 1.3.2, and the quantum bound follows from the optimal almost-qubit random access code in Ref. [34], whose success probability relates to our witness by pRAC=1/2+S4/16p_{\mathrm{RAC}}=1/2+S_4/16. Both bounds recover the usual bit and qubit values at ε=0\varepsilon=0 and reach the algebraic maximum S4=8S_4=8 at ε=1/2\varepsilon=1/2.

Average randomness is more robust to dimension leakage

In the original work introducing the almost-qudit framework [34], as well as in several other semi-device-independent works tailored to randomness certification [3, 6, 9, 13, 21, 26, 42], it is commonly assumed that a fixed-input pair (x0,y0)(x_0,y_0) is used for randomness generation, while the remaining inputs are mainly used to estimate the value of the witness. In this setting, for a decomposition of the observed behavior into strategies λ\lambda known to the adversary, we define the guessing probability for the fixed-input pair as

Pg(x0,y0)=∑λq(λ)max⁡bp(b∣x0,y0,λ),(10)P_g(x_0,y_0)=\sum_{\lambda}q(\lambda)\max_b p(b|x_0,y_0,\lambda), \tag*{(10)}

with the corresponding certified randomness quantified by the min-entropy Hmin⁡=−log⁡2Pg(x0,y0)H_{\min}=-\log_2 P_g(x_0,y_0). One of the main reasons to consider such a type of estimator is that the witness and the choice of (x0,y0)(x_0,y_0) can be tailored such that the randomness is concentrated on this particular input pair, therefore allowing more randomness to be extracted from it than from other inputs, or from an average over all of them.

We consider, however, another estimator that remains less explored, although some instances of it have already appeared in the literature [22, 25, 43]. We call it the average uniform guessing probability, defined as

P‾g=1∣X∣∣Y∣∑x,y∑λq(λ)max⁡bp(b∣x,y,λ),(11)\overline{P}_g=\frac{1}{|X||Y|}\sum_{x,y}\sum_{\lambda}q(\lambda)\max_b p(b|x,y,\lambda), \tag*{(11)}

which captures the guessing probability when all input pairs are used for randomness generation and are sampled uniformly, with the corresponding min-entropy given by Hmin⁡avg=−log⁡2P‾gH_{\min}^{\mathrm{avg}}=-\log_2\overline{P}_g. Notice that, for uniformly sampled inputs, this quantity is simply the average of the fixed-input guessing probabilities over all pairs (x,y)(x,y).

The maximizations over bb in Eqs. (10) and (11) are not linear, since the most likely outcome may depend on the adversary’s classical information λ\lambda and, for the average estimator, also on the input pair (x,y)(x,y). To remove this maximization, we group together all realizations λ\lambda that lead to the same deterministic guess. For the fixed-input estimator, a branch is labelled by a single guess g∈{0,1}g\in\{0,1\} for (x0,y0)(x_0,y_0), while for the average estimator it is labelled by a complete table g={gxy}x,y\boldsymbol{g}=\{g_{xy}\}_{x,y}. Denoting the total probability of each branch by qgq_g and defining the subnormalized correlator Exyg=qg∑b=01(−1)bp(b∣x,y,g)E_{xy}^{g}=q_g\sum_{b=0}^{1}(-1)^b p(b|x,y,g), the guessing probabilities can be written linearly as

Pg(x0,y0)=∑g=01qg+(−1)gEx0y0g2,(12)P_g(x_0,y_0)=\sum_{g=0}^{1}\frac{q_g+(-1)^gE_{x_0y_0}^{g}}{2}, \tag*{(12)}
P‾g=∑g[qg2+12∣X∣∣Y∣∑x,y(−1)gxyExyg],(13)\overline{P}_g=\sum_g\left[\frac{q_g}{2}+\frac{1}{2|X||Y|}\sum_{x,y}(-1)^{g_{xy}}E_{xy}^{g}\right], \tag*{(13)}

which can now be used as proper linear objective functions in optimization problems.

The goal now is to seek for the largest guessing probability for a given witness value s=∑x,yCxyExys=\sum_{x,y}C_{xy}E_{xy} and leakage ε\varepsilon. To upper bound these values, we use the SDP hierarchy introduced for almost qudits in Ref. [34]. In their construction, the preparations can be taken to be pure and are therefore represented by rank-one projectors RxR_x, while the measurement effects can be represented by projectors Mb∣yM_{b|y} through a Naimark dilation. The dd-dimensional subspace is represented by a rank-dd projector VV. The almost-dd condition for a normalized preparation is then Tr⁡(RxV)≥1−ε\operatorname{Tr}(R_xV)\ge1-\varepsilon.

Notice now that, because Eqs. (12) and (13) optimize over guessing branches weighted by qgq_g, it is convenient to work directly with subnormalized quantities, absorbing this weight into a weighted trace τg(A)=qgTr⁡(A)\tau_g(A)=q_g\operatorname{Tr}(A). This gives, in particular, τg(Rx)=qg\tau_g(R_x)=q_g and τg(V)=dqg\tau_g(V)=d q_g. For the leakage assumption, we can either assume Eq. (4) or Eq. (5). We use the latter, which in this notation reads

∑gτg(RxV)≥1−ε(14)\sum_g\tau_g(R_xV)\ge1-\varepsilon \tag*{(14)}

for all xx, as it imposes a weaker assumption on the adversary.

What we do next is to replace the unknown operator products appearing inside τg\tau_g by moment matrices. For each branch we construct a moment matrix Γg\Gamma^g whose entries are Γu,vg=τg(uv†)\Gamma^g_{u,v}=\tau_g(uv^\dagger), with uu and vv products of the operators {1,V,{Rx}x,{Mb∣y}b,y}\{\mathbb{1},V,\{R_x\}_x,\{M_{b|y}\}_{b,y}\} up to the chosen relaxation level. In this way, every quantity involving τg\tau_g that appears in the optimization is simply an entry, or a linear combination of entries, of Γg\Gamma^g; for instance, τg(Rx)=Γ1,Rxg\tau_g(R_x)=\Gamma^g_{1,R_x}, τg(RxMb∣y)=ΓRx,Mb∣yg\tau_g(R_xM_{b|y})=\Gamma^g_{R_x,M_{b|y}}, and τg(RxV)=ΓRx,Vg\tau_g(R_xV)=\Gamma^g_{R_x,V}. By construction, Γg⪰0\Gamma^g\succeq0. The algebraic relations satisfied by the operators, such as Rx2=RxR_x^2=R_x, Mb∣y2=Mb∣yM_{b|y}^2=M_{b|y}, V2=VV^2 = V, and ∑bMb∣y=1\sum_b M_{b|y} = \mathbb{1}, together with cyclicity of the trace, translate into linear equalities between different entries of Γg\Gamma^g. For the binary-outcome witnesses considered below, we write My≡M0∣yM_y \equiv M_{0|y}. Denoting by GG the guessing-probability objective of either Eq. (10) or Eq. (11), the resulting SDP is

maximize⁡{qg,Γg}G(15)\begin{aligned} \underset{\{q_g,\Gamma^g\}}{\operatorname{maximize}}\quad&G \tag*{(15)} \end{aligned}
subject toΓg⪰0,qg≥0,∑gqg=1,∑g∑x,yCxyExyg=s,Exyg=2τg(RxMy)−qg,τg(Rx)=qg,τg(V)=dqg,∑gτg(RxV)≥1−ε,0≤τg(RxMy)≤qg,0≤τg(RxV)≤qg,∀x,y,g.\begin{aligned} \text{subject to}\quad&\Gamma^g \succeq0,\qquad q_g \ge0,\qquad\sum_g q_g = 1,\\ &\sum_g\sum_{x,y} C_{xy}E^g_{xy}=s,\\ &E^g_{xy}=2\tau_g(R_xM_y)-q_g,\\ &\tau_g(R_x)=q_g,\qquad\tau_g(V)=dq_g,\\ &\sum_g\tau_g(R_xV)\ge1-\varepsilon,\\ &0\le\tau_g(R_xM_y)\le q_g,\\ &0\le\tau_g(R_xV)\le q_g,\qquad\forall x,y,g. \end{aligned}

where all terms τg(⋅)\tau_g(\cdot) are understood as linear entries of Γg\Gamma^g, while the weights qgq_g are fixed by τg(Rx)=qg\tau_g(R_x)=q_g. For Eq. (10), gg denotes a single binary guess, while for Eq. (11) it denotes a complete table of guesses gg. Since the moment construction relaxes the original quantum problem, its optimum G⋆G^\star upper bounds the guessing probability and therefore gives the certified lower bound Hmin⁡⋆=−log⁡2G⋆H_{\min}^\star=-\log_2 G^\star.

We next compare the two guessing probabilities for the witnesses considered here. Since the same qualitative behavior is observed in all cases, we focus in the main text on S4S_4 and leave the results for other scenarios witnesses to the Appendix § 1.3.1. All results are obtained at the second level of the moment hierarchy. For a strict dimension bound, ε=0\varepsilon=0, the two estimators behave similarly close to the maximal quantum violation, as shown in Figure 2(a). As soon as dimension leakage is introduced, while the fixed-input estimator only becomes positive for sufficiently large values of S4S_4, the average estimator certifies randomness already for much smaller violations and decreases much more smoothly as ε\varepsilon is increased. For ε=0.05\varepsilon=0.05, the fixed-input estimator does not certify randomness over the range shown, while the average estimator still gives a nonzero min-entropy for several values of S4S_4.

Figure 2. Average versus fixed-input randomness under dimension leakage. (a) Certified min-entropy for the S4S_4 witness as a function of its observed value and for different leakage parameters ε\varepsilon. Solid curves correspond to the average uniform guessing probability and dashed curves to the fixed-input guessing probability with (x0=0,y0=0)(x_0=0,y_0=0). (b) Certified min-entropy evaluated at the maximal almost-qubit value S4Q(ε)S_4^{\mathsf{Q}}(\varepsilon) as a function of ε\varepsilon. The solid purple curve shows the average case, while the dashed purple curve shows the fixed-input one.

We must emphasize, however, that there is a trade-off between the two estimators. A fixed-input pair can be chosen such that the witness certifies particularly large randomness for that pair, and can therefore outperform the average estimator under a strict dimension assumption (see the Appendix § 1.3.1 result for the S3S_3 and S331S_{331} witnesses). On the other hand, the average estimator is less affected by leakage because increasing the predictability of only the selected pair is no longer enough. Since all input pairs contribute to the guessing probability, the adversary needs to improve the predictability over a larger part of the input set, which gives an intuition for the slower degradation seen in Figure 2(b), where we evaluate the min-entropy of both cases for the maximal almost-qubit value S4Q(ε)S_4^{\mathsf{Q}}(\varepsilon) for each leakage.

Another important point to notice in Figure 2(b) is that, for the average case, randomness can in principle still be certified

throughout the region where the quantum and classical bounds in Eqs. (8) and (9) remain separated, up to the point where both reach the algebraic maximum S4=8S_4=8 at ε=1/2\varepsilon=1/2. For the fixed-input case, the certification disappears much earlier.

Dimension leakage as a resource for continuous-variable implementations

To our knowledge, a single-mode fully Gaussian setup (Gaussian preparations and measurements) has not been shown to detect nonclassicality—and therefore certify randomness—in the hard-truncated dd-dimensional PM scenario. Allowing leakage makes violations of the classical bound in Eq. (8) possible, but at the same time weakens the randomness bounds. Here we show that the increased robustness of the average estimator allows this tradeoff to be balanced, leading to positive randomness from a fully Gaussian setup.

We also investigate other CV implementations, including Gaussian preparations with displaced photodetection and non-Gaussian preparations with homodyne detection. The former allows us to assess whether non-Gaussian measurements can enhance randomness certification, while the latter explores the role of non-Gaussian preparations, considering both unrestricted states and experimentally implementable superpositions of squeezed cat states.

Gaussian preparations with homodyne detection

We first consider a fully Gaussian implementation, with single-mode Gaussian preparations followed by homodyne detection. Following the phase-space description of [35], we use quadratures satisfying [q^,p^]=2i[\hat{q},\hat{p}] = 2i, such that the vacuum covariance matrix is the identity. A single-mode Gaussian preparation ρx\rho_x is completely characterized by its displacement vector dx=(qx,px)T\boldsymbol{d}_x = (q_x,p_x)^T and its covariance matrix VxV_x. We parametrize it as

Vx=(2nˉx+1)R(ϕx)(e−2rx00e2rx)RT(ϕx),(16)V_x = (2\bar{n}_x+1)R(\phi_x) \begin{pmatrix} e^{-2r_x} & 0 \\ 0 & e^{2r_x} \end{pmatrix} R^T(\phi_x), \tag*{(16)}

where nˉx≥0\bar{n}_x \ge0 is the thermal occupation, rx≥0r_x \ge0 is the squeezing parameter, ϕx\phi_x specifies the squeezing direction, and R(ϕ)R(\phi) denotes the usual rotation matrix by an angle ϕ\phi. Pure Gaussian states are recovered for nˉx=0\bar{n}_x = 0.

For measurement input yy, homodyne detection measures the quadrature q^θy=q^cos⁡θy+p^sin⁡θy\hat{q}_{\theta_y} = \hat{q}\cos\theta_y + \hat{p}\sin\theta_y, where θy\theta_y is the local-oscillator phase. For a Gaussian preparation ρx\rho_x, the continuous homodyne outcome z∈Rz \in\mathbb{R} follows a normal distribution [36] with probability density

fxy(z)=12πσxy2exp⁡[−(z−μxy)22σxy2],(17)f_{xy}(z) = \frac{1}{\sqrt{2\pi\sigma_{xy}^{2}}}\exp\left[-\frac{(z-\mu_{xy})^{2}}{2\sigma_{xy}^{2}}\right], \tag*{(17)}

with mean μxy=uyTdx\mu_{xy} = \boldsymbol{u}_y^T\boldsymbol{d}_x and variance σxy2=uyTVxuy\sigma_{xy}^{2} = \boldsymbol{u}_y^T V_x\boldsymbol{u}_y, where uy=(cos⁡θy,sin⁡θy)T\boldsymbol{u}_y = (\cos\theta_y,\sin\theta_y)^T specifies the measured quadrature. The probability of obtaining an outcome in a measurable interval R⊆RR \subseteq\mathbb{R} is therefore Pr⁡(z∈R∣x,y)=∫Rfxy(z) dz\Pr(z \in R|x,y) = \int_R f_{xy}(z)\,dz, with ∫−∞∞fxy(z) dz=1\int_{-\infty}^{\infty}f_{xy}(z)\,dz = 1. To obtain a binary behavior, we assign the interval Ry=[ay,by]R_y = [a_y,b_y] to outcome b=0b=0 and its complement R∖Ry\mathbb{R}\setminus R_y to b=1b=1. The resulting probabilities can then be evaluated analytically as

p(0∣x,y)=Φ(by−μxyσxy)−Φ(ay−μxyσxy),(18)p(0|x,y) = \Phi\left(\frac{b_y-\mu_{xy}}{\sigma_{xy}}\right)-\Phi\left(\frac{a_y-\mu_{xy}}{\sigma_{xy}}\right), \tag*{(18)}
p(1∣x,y)=1−p(0∣x,y),(19)p(1|x,y) = 1-p(0|x,y), \tag*{(19)}

where Φ(t)=12π∫−∞te−u2/2 du\Phi(t)=\frac{1}{\sqrt{2\pi}}\int_{-\infty}^{t}e^{-u^2/2}\,du denotes the cumulative distribution function of a standard normal distribution. The correlators entering S4S_4 (and also the other inequalities considered in Appendix A) are Exy=2p(0∣x,y)−1E_{xy}=2p(0|x,y)-1.

For the almost-qubit condition, the leakage of preparation xx is the population outside the first two Fock levels, εx=1−⟨0∣ρx∣0⟩−⟨1∣ρx∣1⟩\varepsilon_x=1-\langle0|\rho_x|0\rangle-\langle1|\rho_x|1\rangle. For a single-mode Gaussian state, the Fock-state populations can be obtained analytically [44]. Since Ref. [44] uses a different quadrature normalization and covariance-matrix convention from the one adopted here, we provide in Appendix C a short derivation directly in our notation. Defining Ax=Vx+1A_x=V_x+\mathbb{1} and Jx=Ax−1J_x=A_x^{-1}, the vacuum and single-photon populations are

p0,x=⟨0∣ρx∣0⟩=2exp⁡[−dxTJxdx/2]det⁡Ax,(20)p_{0,x}=\langle0|\rho_x|0\rangle=\frac{2\exp\left[-\boldsymbol{d}_x^T J_x\boldsymbol{d}_x/2\right]}{\sqrt{\det A_x}}, \tag*{(20)}
p1,x=⟨1∣ρx∣1⟩=p0,x(1−Tr⁡Jx+dxTJx2dx),(21)p_{1,x}=\langle1|\rho_x|1\rangle=p_{0,x}\left(1-\operatorname{Tr}J_x+\boldsymbol{d}_x^T J_x^2\boldsymbol{d}_x\right), \tag*{(21)}

such that εx=1−p0,x−p1,x\varepsilon_x=1-p_{0,x}-p_{1,x}.

We use these expressions to numerically search for large values of S4S_4 at a fixed leakage. Let ξ=(qx,px,rx,ϕx,nˉx,θy,ay,by)x,y\boldsymbol{\xi}=(q_x,p_x,r_x,\phi_x,\bar{n}_x,\theta_y,a_y,b_y)_{x,y}. For each chosen value of ε\varepsilon, we consider the nonlinear optimization problem

maximize⁡ξS4(ξ)\underset{\boldsymbol{\xi}}{\operatorname{maximize}\quad} S_4(\boldsymbol{\xi})
subject toεx(ξ)=ε,x=0,1,2,3,(22)\text{subject to}\quad\varepsilon_x(\boldsymbol{\xi})=\varepsilon,\qquad x=0,1,2,3, \tag*{(22)}

which we solve numerically using global differential-evolution searches. The resulting points are not guaranteed to give the global Gaussian maximum and we therefore interpret them only as optimized feasible points. This is sufficient for our purpose, since any such point already shows that the corresponding pair (s,ε)(s,\varepsilon), with s=S4(ξ)s = S_4(\xi), can be physically achieved using Gaussian preparations and homodyne measurements.

For each optimized pair (s,ε)(s,\varepsilon), we then solve the SDP in Eq. (15) and obtain a lower bound on Hmin⁡avgH_{\min}^{\mathrm{avg}}. The result of this procedure is shown in Figure 3(a). As the allowed leakage increases, the optimized Gaussian value of S4S_4 also increases, eventually exceeding the corresponding classical almost-qubit bound. However, the certified randomness does not follow the same monotonic behavior. Instead, it is maximized at an intermediate leakage, showing the tradeoff between achieving a larger violation and simultaneously weakening the dimension assumption available to the adversary. The best point found along this curve, marked by the star, occurs at ε=0.075\varepsilon= 0.075, for which S4=5.38S_4 = 5.38 and Hmin⁡avg≥0.0313H_{\min}^{\mathrm{avg}} \ge0.0313. Notice that, although larger values of S4S_4 can be reached by increasing ε\varepsilon, they lead to less certified randomness.

Figure 3. Gaussian preparations with homodyne detection. (a) Optimized S4S_4 as a function of the common leakage ε\varepsilon, with color indicating the lower bound on Hmin⁡avgH_{\min}^{\mathrm{avg}} and the dashed line the classical almost-qubit bound. The dotted vertical lines delimit the region where Hmin⁡avg≥0.01H_{\min}^{\mathrm{avg}} \ge0.01, and the star marks the optimal value, at ε=0.075\varepsilon= 0.075, S4≃5.379S_4 \simeq5.379, and Hmin⁡avg≥0.0313H_{\min}^{\mathrm{avg}} \ge0.0313 bits. (b) Phase-space representation of the preparations: dots show the displacements, solid curves the 1σ1\sigma contours, the dashed circle the vacuum 1σ1\sigma contour, and the dotted axes the two homodyne quadratures. (c) Preparation and measurement parameters for the same realization, with nˉx=0\bar{n}_x = 0 for all preparations.

The Gaussian implementation is shown in Figure 3(b), with the parameters listed in Figure 3(c). The four preparations are arranged in the four quadrants of phase space, reproducing the sign pattern that underlies the 2→12 \to1 QRAC square [45, 46]. The two homodyne settings measure the qq and pp quadratures, with the sign of each outcome determining the binary outcome bb. It is therefore not exactly the usual QRAC square, but rather its continuous-variable analogue, now implemented with displaced weakly squeezed Gaussian states. The squeezing is also small, r≃0.11r \simeq0.11 (0.97 dB), making the strategy experimentally feasible. We therefore close this section by showing that a fully Gaussian implementation can certify randomness when a controlled amount of dimension leakage is allowed.

Gaussian preparations with displaced photodetection

We next keep the same class of single-mode Gaussian preparations, but replace homodyne detection by a displaced on–off photodetection measurement. Such schemes consist of applying a phase-space displacement followed by photon detection [47, 48, 49]. Although the displacement is a Gaussian operation, photon counting is a non-Gaussian measurement.

For an ideal on–off detector, the no-click and click events are described by Πnc=∣0⟩⟨0∣\Pi_{\mathrm{nc}} = |0\rangle\langle0| and Πc=1−∣0⟩⟨0∣\Pi_{\mathrm{c}} = \mathbb{1} - |0\rangle\langle0|, respectively. If the measurement input yy specifies a displacement D(βy)D(\beta_y) before detection, the effective no-click operator acting on the incoming state is

M1∣y=D†(βy)ΠncD(βy)=∣−βy⟩⟨−βy∣,(23)M_{1|y} = D^\dagger(\beta_y)\Pi_{\mathrm{nc}}D(\beta_y) = |-\beta_y\rangle\langle-\beta_y|, \tag*{(23)}

where the sign of the displacement can be absorbed into its definition, such that we write simply M1∣y=∣βy⟩⟨βy∣M_{1|y} = |\beta_y\rangle\langle\beta_y| and M0∣y=1−∣βy⟩⟨βy∣M_{0|y} = \mathbb{1} - |\beta_y\rangle\langle\beta_y|. Notice that we use the convention b=1b = 1 for no-click and b=0b = 0 for click.

The corresponding no-click probability is therefore the overlap of the preparation with a coherent state (see Eq. (36) in Appendix § 1.3.3),

p(1∣x,y)=⟨βy∣ρx∣βy⟩=2det⁡Axexp⁡[−12(dβy−dx)TJx(dβy−dx)],(24)\begin{aligned} p(1|x,y) = \langle\beta_y|\rho_x|\beta_y\rangle\\ &= \frac{2}{\sqrt{\det A_x}}\exp\left[-\frac{1}{2}(d_{\beta_y}-d_x)^{T}J_x(d_{\beta_y}-d_x)\right], \tag*{(24)} \end{aligned}

where Ax=Vx+1A_x = V_x + \mathbb{1}, Jx=Ax−1J_x = A_x^{-1}, dβy=(2Re⁡βy,2Im⁡βy)Td_{\beta_y} = (2\operatorname{Re}\beta_y, 2\operatorname{Im}\beta_y)^T. The correlators can then be obtained as Exy=1−2p(1∣x,y)E_{xy} = 1 - 2p(1|x,y).

We again solve Eq. (22), now with ξ={qx,px,rx,ϕx,nˉx,βy}x,y\xi= \{q_x,p_x,r_x,\phi_x,\bar{n}_x,\beta_y\}_{x,y}, such that the optimization runs over both the Gaussian preparation parameters and the complex displacement amplitudes βy\beta_y. For each optimized pair (s,ε)(s,\varepsilon), we then solve the SDP in Eq. (15). The results are shown in Figure 4, following the same structure as in the previous subsection. Notice that the certified randomness in Figure 4(a) is improved when displaced photodetection is used instead of homodyne detection for the same class of Gaussian preparations. The phase-space representation of the preparations is shown in Figure 4(b), while the corresponding preparation and measurement parameters are listed in Figure 4(c).

Figure 4. Gaussian preparations with displaced photodetection. (a) Certified randomness under dimension leakage. The dashed curve gives the classical bound, the dotted vertical lines delimit the region with Hmin⁡≥0.01H_{\min} \ge0.01, and the star marks the optimal randomness point, at ε=0.035\varepsilon= 0.035, S4≃5.245S_4 \simeq5.245, and Hmin⁡avg≥0.082H_{\min}^{\mathrm{avg}} \ge0.082 bits. (b) Phase-space representation of the optimized Gaussian preparations. (c) Preparation and measurement parameters at ε=0.035\varepsilon= 0.035, with nˉx=0\bar{n}_x = 0 for all preparations.

Non-gaussian preparations with homodyne detection

Unrestricted states with a Fock cutoff

To study the role of the preparations, we retain the binary homodyne measurements of Sec. IV A and consider arbitrary pure states. For numerical tractability, we introduce a cutoff at the first eight Fock levels, writing ∣ψx⟩=∑n=07cx,n∣n⟩|\psi_x\rangle= \sum_{n=0}^{7} c_{x,n}|n\rangle, with ∑n=07∣cx,n∣2=1\sum_{n=0}^{7}|c_{x,n}|^2 = 1. For a target qubit encoded in ∣0⟩|0\rangle and ∣1⟩|1\rangle, we impose a common leakage for all preparations, εx=1−∣cx,0∣2−∣cx,1∣2=ε\varepsilon_x = 1 - |c_{x,0}|^2 - |c_{x,1}|^2 = \varepsilon.

Since we introduced a Fock cutoff, we can follow the homodyne construction of Ref. [22], now extended to the first eight Fock levels. For each measurement input yy, the measured quadrature q^θy\hat{q}_{\theta_y} is binned into an interval [ay,by][a_y,b_y] and its complement, with the corresponding measurement operators represented as finite-dimensional matrices in the truncated Fock basis. For fixed measurement settings and outcome assignments, the witness can be written as

S4=∑xcx†Wxcx,Wx=∑yCxy(2My−1),(25)S_4 = \sum_x \mathbf{c}_x^\dagger W_x \mathbf{c}_x,\qquad W_x = \sum_y C_{xy}(2M_y - 1), \tag*{(25)}

where cx=(cx,0,…,cx,7)T\mathbf{c}_x = (c_{x,0},\ldots,c_{x,7})^T, CxyC_{xy} are the coefficients of Eq. (7), and MyM_y is the measurement operator associated with outcome b=0b = 0. Since each term depends only on one preparation, the Fock amplitudes can be optimized independently for each xx, subject to the normalization and leakage constraints. We then optimize the homodyne phases and interval boundaries using differential evolution followed by local refinement, considering both outcome assignments. For each ε\varepsilon, the resulting value of S4S_4 is used in the SDP of Eq. (15) to certify randomness under the average leakage assumption of Eq. (5).

Figure 5(a) shows that the largest lower bound on the average min-entropy found in the scan occurs at ε=0.025\varepsilon= 0.025, where S4≃5.398S_4 \simeq5.398 and the bound is approximately 0.125 bits per round. At the same point, the fixed-input bound for (x0,y0)=(0,0)(x_0,y_0) = (0,0) is numerically zero. For comparison, the best Gaussian realization found with homodyne detection gives 0.0313 bits at ε=0.075\varepsilon= 0.075 (Figure 3(a)). The non-Gaussian realization thus gives about four times the certified average min-entropy at one third of the leakage.

Figure 5. Unrestricted non-Gaussian states with homodyne detection. (a) Certified randomness under dimension leakage. The dashed curve gives the classical bound, the dotted vertical lines delimit the region with Hmin⁡avg≥0.01H_{\min}^{\mathrm{avg}} \ge0.01, and the star marks the largest-randomness point, at ε=0.025\varepsilon= 0.025, S4≃5.398S_4 \simeq5.398 and Hmin⁡avg≥0.125H_{\min}^{\mathrm{avg}} \ge0.125 bits. (b) Fock-state populations ∣cx,n∣2|c_{x,n}|^2 at the starred point, common to all four preparations. (c) Preparation phases ϕx\phi_x, mean photon numbers ⟨n^⟩x\langle\hat{n} \rangle_x, and homodyne phases θy\theta_y for the same realization. Up to global phases, the four preparations satisfy ∣ψx⟩=eiϕxn^∣ψ0⟩|\psi_x\rangle= e^{i\phi_x\hat{n}}|\psi_0\rangle to numerical precision, with ∣ψ0⟩≃−0.6877∣0⟩+(0.3939+0.5889i)∣1⟩+(0.0452−0.1094i)∣2⟩−(0.0821−0.0164i)∣3⟩+(0.0252+0.0252i)∣4⟩−(0.0055−0.0280i)∣5⟩+(0.0215−0.0090i)∣6⟩−(0.0308+0.0204i)∣7⟩|\psi_0\rangle\simeq-0.6877|0\rangle+ (0.3939 + 0.5889i)|1\rangle+ (0.0452 - 0.1094i)|2\rangle- (0.0821 - 0.0164i)|3\rangle+ (0.0252 + 0.0252i)|4\rangle- (0.0055 - 0.0280i)|5\rangle+ (0.0215 - 0.0090i)|6\rangle- (0.0308 + 0.0204i)|7\rangle.

Another noteworthy point in Figure 5(a) is that, for ε=0\varepsilon= 0, we recover the homodyne result of Ref. [22], where arbitrary preparations within the first two Fock levels were considered. Interestingly—and as suggested by Ref. [22]—even without dimensional leakage, we already certify a positive average min-entropy of approximately 0.067 bits (which can be enhanced to 0.125 bits when a small leakage is allowed).

At the starred point, the four independently optimized states are, up to global phases and numerical precision, related by ∣ψx⟩=eiϕxn^∣ψ0⟩|\psi_x\rangle= e^{i\phi_x\hat{n}}|\psi_0\rangle, with ϕx=0,−π/2,π/2,π\phi_x = 0,-\pi/2,\pi/2,\pi for x=0,1,2,3x = 0,1,2,3, respectively (where ∣ψ0⟩|\psi_0\rangle is given in the caption of Figure 5). These rotations preserve the Fock populations, so the distribution in Figure 5(b) applies to all four states. The vacuum and single-photon populations are approximately 0.473 and 0.502, leaving 0.025 in the higher Fock levels. The corresponding homodyne phases in Figure 5(c) differ by π/2\pi/2 to numerical precision, and the optimized intervals effectively bin each quadrature by its sign. As in the Gaussian case, the preparations exhibit a Q RAC-like square symmetry, now generated by phase rotations of a single non-Gaussian state.

Superpositions of squeezed cat states

Although the unrestricted eight-level optimization above establishes the performance achievable within a truncated Fock space, preparing arbitrary superpositions of Fock states remains experimentally challenging. Motivated by the rotational symmetry and parity structure observed in the previous section, we now restrict the preparations to a physically structured family based on superpositions of even and odd squeezed optical cat states [50, 51, 52].

Similar to the case of unrestricted states with a Fock cutoff, we generate the four preparations from a single seed state ∣ψ0⟩|\psi_0\rangle through the phase-space rotations ∣ψx⟩=eiϕxn^∣ψ0⟩|\psi_x\rangle=e^{i\phi_x\hat{n}}|\psi_0\rangle, with ϕx=0,−π/2,π/2,π\phi_x=0,-\pi/2,\pi/2,\pi for x=0,1,2,3x=0,1,2,3, respectively. Because the sign-binned homodyne operators only couple Fock states of opposite parity, a state with definite photon-number parity yields vanishing correlators. But this time we construct ∣ψ0⟩|\psi_0\rangle as a coherent superposition of orthogonal even (++) and odd (−-) squeezed cat states,

∣ψ0⟩=w+∣ψ+⟩+eiχ1−w+∣ψ−⟩,(26)|\psi_0\rangle=\sqrt{w_+}|\psi_+\rangle+e^{i\chi}\sqrt{1-w_+}|\psi_-\rangle, \tag*{(26)}

with 0≤w+≤10\leq w_+\leq1, relative phase χ∈[−π,π]\chi\in[-\pi,\pi], and

∣ψ±⟩=N±S^(r±)(∣α±⟩±∣−α±⟩),(27)|\psi_\pm\rangle=\mathcal{N}_\pm\hat{S}(r_\pm)(|\alpha_\pm\rangle\pm|-\alpha_\pm\rangle), \tag*{(27)}

where S^(r±)=exp⁡[r±2(a^2−a^†2)]\hat{S}(r_\pm)=\exp\left[\frac{r_\pm}{2}(\hat{a}^2-\hat{a}^{\dagger2})\right] is the single-mode squeezing operator with real squeezing parameter r±r_\pm, ∣±α±⟩|\pm\alpha_\pm\rangle are coherent states with amplitude α±≥0\alpha_\pm\geq0, and N±\mathcal{N}_\pm are normalization constants. This formulation is mainly inspired in Ref. [52].

Since ∣ψ+⟩|\psi_+\rangle and ∣ψ−⟩|\psi_-\rangle have support exclusively on even and odd Fock numbers, respectively, the vacuum and single-photon populations of each preparation are given by ⟨0∣ρx∣0⟩=w+∣⟨0∣ψ+⟩∣2\langle0|\rho_x|0\rangle=w_+|\langle0|\psi_+\rangle|^2 and ⟨1∣ρx∣1⟩=(1−w+)∣⟨1∣ψ−⟩∣2\langle1|\rho_x|1\rangle=(1-w_+)|\langle1|\psi_-\rangle|^2. Consequently, denoting the component leakages by ϵ+=1−∣⟨0∣ψ+⟩∣2\epsilon_+=1-|\langle0|\psi_+\rangle|^2 and ϵ−=1−∣⟨1∣ψ−⟩∣2\epsilon_-=1-|\langle1|\psi_-\rangle|^2, the total leakage of ∣ψ0⟩|\psi_0\rangle is the convex combination

ϵx=w+ϵ++(1−w+)ϵ−=ϵ.(28)\epsilon_x=w_+\epsilon_++(1-w_+)\epsilon_-=\epsilon. \tag*{(28)}

For any choice of parameters (α±,r±)(\alpha_\pm,r_\pm) such that ϵ\epsilon lies between ϵ+\epsilon_+ and ϵ−\epsilon_-, the weight w+=(ϵ−ϵ−)/(ϵ+−ϵ−)w_+=(\epsilon-\epsilon_-)/(\epsilon_+-\epsilon_-) is uniquely fixed by Eq. (28), ensuring that the exact leakage constraint is satisfied analytically. At ϵ=0\epsilon=0, taking α±,r±→0\alpha_\pm,r_\pm\to0 reduces ∣ψ+⟩|\psi_+\rangle and ∣ψ−⟩|\psi_-\rangle to ∣0⟩|0\rangle and ∣1⟩|1\rangle, naturally recovering the strict-qubit preparations. For ϵ>0\epsilon>0, we numerically optimize S4S_4 over the state parameters (α±,r±,χ)(\alpha_\pm,r_\pm,\chi) and the homodyne angles θy\theta_y (with sign-binned outcomes) in a truncated Fock space, and insert each optimized pair (S4,ϵ)(S_4,\epsilon) into the SDP of Eq. (15) to lower bound Hmin⁡avgH_{\min}^{\mathrm{avg}}.

The results are presented in Figure 6. As shown in the figure, the optimized witness values for the squeezed cat states closely track those of the unrestricted Fock-state search (dash-dotted curve) across the entire leakage range. The largest certified randomness occurs at ϵ=0.041\epsilon=0.041, where S4≃5.59S_4\simeq5.59 and Hmin⁡avg≥0.119H_{\min}^{\mathrm{avg}}\geq0.119 bits per round. Remarkably, this structured family recovers about 95% of the maximum min-entropy certified by unrestricted eight-level Fock states (0.125 bits at ϵ=0.025\epsilon=0.025 in Figure 5(a)), while outperforming the Gaussian homodyne implementation (0.0313 bits at ϵ=0.075\epsilon=0.075 in Figure 3(a)) by nearly a factor of four.

Figure 6. Superpositions of squeezed cat states with homodyne detection. Optimized S4S_4 as a function of the common leakage ϵ\epsilon, with color indicating the lower bound on Hmin⁡avgH_{\min}^{\mathrm{avg}} and the gray dashed line the classical almost-qubit bound S4c(ϵ)S_4^{\mathrm{c}}(\epsilon). The black dash-dotted curve shows the witness values obtained for unrestricted states with a cutoff at the first eight Fock levels, and the purple dotted vertical lines delimit the region with Hmin⁡avg≥0.01H_{\min}^{\mathrm{avg}}\geq0.01. The star marks the optimal randomness point, at ϵ=0.041\epsilon=0.041, S4≃5.59S_4\simeq5.59, and Hmin⁡avg≥0.119H_{\min}^{\mathrm{avg}}\geq0.119 bits.

At the starred point, all four preparations share the same photon-number distribution and a mean photon number of ⟨n^⟩x≃0.604\langle\hat{n}\rangle_x\simeq0.604. The vacuum and single-photon populations are approximately 0.453 and 0.506, in that order, while the leaked population (ϵ=0.041\epsilon=0.041) remains almost entirely confined to the two- and three-photon levels (n=2,3n=2,3), with negligible contributions for n≥4n\geq4, a behavior similar to Figure 5(b). On the measurement side, the optimal homodyne phases are given by the orthogonal settings θ0=π/4\theta_0=\pi/4 and θ1=3π/4\theta_1=3\pi/4, with outcome b=0b=0 assigned to the intervals [0,∞)[0,\infty) and (−∞,0](-\infty,0], respectively, and b=1b=1 to their complements.

Discussion

We have investigated non-classicality and randomness certification against dimensional leakage in the almost-qubit prepare-and-measure scenario. Our results show that the choice of randomness estimator plays a crucial role. While leakage can severely compromise certification based on a fixed preparation-measurement pair, averaging the guessing probability over the full input ensemble can mitigate that. The intuition is that an adversary can exploit additional dimensions to increase the predictability of a selected input pair, whereas the average estimator accounts for predictability across all preparation and measurement inputs.

We have further shown that this robustness can enable continuous-variable implementations using experimentally accessible resources. In particular, single-mode Gaussian states measured by homodyne detection can certify nonzero average randomness even with relatively low squeezing. Replacing homodyne detection with displaced on-off photodetection increases the certified randomness in the Gaussian setting considered, but introduces a non-Gaussian measurement.

Non-Gaussian preparations with homodyne detection yield even larger certified randomness. While unrestricted states within the first eight Fock levels provide the best results, experimentally motivated squeezed cat states achieve nearly the same certification, retaining about 95% of the optimal min-entropy found in the eight-level search.

More broadly, our results suggest that dimensional leakage need not be viewed solely as an imperfection to be minimized. Rather, within a suitable certification framework, the higher-dimensional structure of physical systems can be exploited to enable randomness certification in continuous-variable implementations.

Several directions for future work remain open. An important next step is to assess the approach under finite statistics and realistic experimental imperfections, including optical losses, detector inefficiencies, and finite measurement resolution, while developing methods to bound leakage from observed data. Generalizing the average guessing probability to nonuniform input distributions could help optimize certified randomness and clarify its trade-off with fixed-input certification. Further extensions to alternative dimension witnesses, larger input and output alphabets, and multimode optical fields may broaden the range of practical implementations.

Acknowledgments

We acknowledge funding the Brazilian National Council for Scientific and Technological Development (CNPq; Grants No. 403181/2024-0 and 301687/2025-0), the National Institute of Science and Technology for Applied Quantum Computing through CNPq Process No. 408884/2024-0, and the Financiadora de Estudos e Projetos (Grant No. 1699/24 IIF-FINEP). This work was also partially funded through the project “Design e arquiteturas de protocolos CV-QKD” supported by the EMBRAPII CIMATEC Competence Center in Quantum Technologies-Quantum Industrial Innovation (QuIIN), with financial resources from the PPI IoT/Manufatura 4.0 of the MCTI Grant No. 053/2023, signed with EMBRAPII. M.A. acknowledges financial support from the Center for Quantum-Enabled Computing (C4QEC) project, carried out within the International Research Agendas programme of the Foundation for Polish Science, co-financed by the European Union under the European Funds for Smart Economy 2021–2027 (FENG).

References

Average versus fixed-input randomness for the S3S_3 and S331S_{331} witnesses

The comparison between average and fixed-input randomness is extended here to two additional facet inequalities of the classical bit prepare-and-measure polytope. Both scenarios have three preparations, x∈{0,1,2}x \in\{0,1,2\}, binary outcomes b∈{0,1}b \in\{0,1\}, and target dimension d=2d=2, with either two or three measurement inputs. As in the main text, the correlators are defined as Exy=p(0∣x,y)−p(1∣x,y)E_{xy}=p(0|x,y)-p(1|x,y).

For two measurement inputs, y∈{0,1}y \in\{0,1\}, the minimal dimension witness is

S3=E00+E01+E10−E11−E20.(29)S_3=E_{00}+E_{01}+E_{10}-E_{11}-E_{20}. \tag*{(29)}

Its classical bit bound and maximal qubit value are S3C(0)=3S_3^C(0)=3 and S3Q(0)=1+22S_3^Q(0)=1+2\sqrt{2}, respectively. For three measurement inputs, y∈{0,1,2}y \in\{0,1,2\}, the witness considered is

S331=E00+E01−E11+E12−E20−E22,(30)S_{331}=E_{00}+E_{01}-E_{11}+E_{12}-E_{20}-E_{22}, \tag*{(30)}

with S331C(0)=4S_{331}^C(0)=4 and S331Q(0)=33S_{331}^Q(0)=3\sqrt{3}. These bounds refer to the strict dimension constraint, ε=0\varepsilon=0.

For both witnesses, the average leakage condition of Eq. (5) is imposed with d=2d=2, separately for each preparation x∈{0,1,2}x \in\{0,1,2\}. The guessing probabilities are bounded using the SDP construction in Eq. (15), with the witness coefficients replaced by those of Eqs. (29) and (30).

For fixed-input generation, the selected pairs are (x0,y0)=(2,1)(x_0,y_0)=(2,1) for S3S_3 and (x0,y0)=(0,2)(x_0,y_0)=(0,2) for S331S_{331}. For average generation, all six or nine input pairs, respectively, are sampled uniformly, including those whose correlators do not appear in the witness. The quantities compared are Hmin⁡=−log⁡2Pg(x0,y0)H_{\min}=-\log_2 P_g(x_0,y_0) and Hmin⁡avg=−log⁡2P‾gH_{\min}^{\mathrm{avg}}=-\log_2 \overline{P}_g, with both guessing probabilities optimized under the same witness and leakage constraints.

Figure 7 shows the resulting certified lower bounds as functions of the observed witness value for S3S_3 in panel (a) and S331S_{331} in panel (b). Under a strict dimension constraint, the selected fixed inputs yield more certified randomness close to the maximal qubit violation, whereas the average estimator certifies randomness over a broader range of witness values. Even at ε=0\varepsilon=0, there is therefore a trade-off between the amount of randomness certified near the quantum maximum and the range of violations for which certification is possible.

Figure 7. Average versus fixed-input randomness under dimension leakage. Certified min-entropy for the (a) S3S_3 and (b) S331S_{331} witnesses as a function of their observed values and for different leakage parameters ε\varepsilon. Solid curves correspond to the average uniform guessing probability and dashed curves to the fixed-input guessing probability, with (x0,y0)=(2,1)(x_0,y_0)=(2,1) for S3S_3 and (x0,y0)=(0,2)(x_0,y_0)=(0,2) for S331S_{331}.

As the allowed dimensional leakage increases, the fixed-input bounds deteriorate rapidly, and larger witness values are required to obtain a positive certified min-entropy. The average bounds remain positive over a wider range and can exceed the fixed-input bounds even close to the ideal qubit maximum. For example, at ε=0.05\varepsilon=0.05 and S3≃3.8283S_3 \simeq3.8283, the average estimator certifies approximately 0.0340.034 bits, whereas the fixed-input bound is numerically zero. For S331S_{331} at the same leakage and S331≃5.1961S_{331} \simeq5.1961, the corresponding bounds are approximately 0.0870.087 bits for the average estimator and 0.0030.003 bits for the fixed-input estimator. These comparisons are made at witness values close to the strict-qubit maxima, rather than at the maximal almost-qubit values for the specified leakage.

The different requirements for perfect guessing help explain the greater robustness of the average estimator. For fixed-input generation, only the selected output must be deterministic in each strategy known to the adversary; the remaining input pairs may retain unpredictable outcomes while contributing to the observed violation. By contrast, the uniform average guessing probability equals one only if every input pair is perfectly predictable in every strategy of nonzero weight. Increasing the predictability of a single pair is therefore insufficient to make the average guessing probability reach one. Although dimensional leakage can assist the adversary in both cases, the average objective requires predictability across the full input ensemble.

This interpretation does not imply a universal ordering between the two estimators. The average guessing probability is optimized over a common adversarial decomposition across all inputs, rather than obtained by averaging independently optimized fixed-input bounds. The results for S3S_3 and S331S_{331} show that averaging can improve robustness to dimensional leakage and extend the range of violations compatible with certified randomness, as observed for S4S_4 in the main text. A suitably chosen fixed input can nevertheless remain preferable near the ideal quantum maximum when leakage is sufficiently small.

A tight classical bound for S4S_4

For completeness, we derive the classical bound of S4S_4 under the average leakage assumption. For each λ\lambda, we define the leakage of preparation xx as

ℓxλ=1−∑m∈M2λp(m∣x,λ)=∑m∉M2λp(m∣x,λ),(31)\ell_x^\lambda=1-\sum_{m\in\mathcal{M}_2^\lambda}p(m|x,\lambda)=\sum_{m\notin\mathcal{M}_2^\lambda}p(m|x,\lambda), \tag*{(31)}

so that Eq. (6) is equivalent to ∑λq(λ)ℓxλ≤ε\sum_\lambda q(\lambda)\ell_x^\lambda\le\varepsilon for every xx.

For a fixed λ\lambda, we split the contribution to S4S_4 according to whether the communicated message lies inside or outside the alphabet M2λ\mathcal{M}_2^\lambda. The part of the behavior that stays inside M2λ\mathcal{M}_2^\lambda cannot exceed the usual bit bound S4=4S_4=4. On the other hand, whenever a preparation leaks outside this alphabet, its contribution to S4S_4 can improve by at most 2, since each preparation appears in two correlators, whose total algebraic value is at most 2. Therefore, for each λ\lambda,

S4λ≤4+2∑xℓxλ,(32)S_4^\lambda\le4+2\sum_x\ell_x^\lambda, \tag*{(32)}

and averaging over the shared randomness gives

S4≤4+2∑x∑λq(λ)ℓxλ≤4+8ε,(33)S_4\le4+2\sum_x\sum_\lambda q(\lambda)\ell_x^\lambda\le4+8\varepsilon, \tag*{(33)}

where in the last step we used the same leakage bound ε\varepsilon for the four preparations. Combining this with the algebraic maximum S4≤8S_4\le8, we obtain

S4C(ε)≤min⁡{4+8ε,8}.(34)S_4^{\mathrm{C}}(\varepsilon)\le\min\{4+8\varepsilon,8\}. \tag*{(34)}

To complete the proof, we show that the bound is tight (i.e. can be achieved). For ε=0\varepsilon=0, the usual bit strategy gives S4=4S_4=4. At ε=1/2\varepsilon=1/2, shared randomness can be used so that, for each value of λ\lambda, two preparations belong to the two-symbol alphabet and the other two leak, while averaging over λ\lambda makes every preparation leak with probability 1/21/2. In this case the algebraic value S4=8S_4=8 can be reached. By convexly mixing this strategy with the usual bit strategy, one obtains all intermediate values S4=4+8εS_4=4+8\varepsilon for 0≤ε≤1/20\le\varepsilon\le1/2. Therefore, S4C(ε)=min⁡{4+8ε,8}S_4^{\mathrm{C}}(\varepsilon)=\min\{4+8\varepsilon,8\}.

Fock-space leakage of a Gaussian state

For two single-mode Gaussian states ρ0\rho_0 and ρ1\rho_1, with displacement vectors d0,d1d_0,d_1 and covariance matrices V0,V1V_0,V_1, the fidelity is given in Sec. III.A.3, Eq. (80) of Ref. [35] by

F(ρ0,ρ1)=2Δ+δ−δ×exp⁡[−12(d0−d1)T(V0+V1)−1(d0−d1)].(35)F(\rho_0,\rho_1)=\frac{2}{\sqrt{\Delta+\delta}-\sqrt{\delta}}\times\exp\left[-\frac{1}{2}(d_0-d_1)^T(V_0+V_1)^{-1}(d_0-d_1)\right]. \tag*{(35)}

where Δ=det⁡(V0+V1)\Delta=\det(V_0+V_1) and δ=(det⁡V0−1)(det⁡V1−1)\delta=(\det V_0-1)(\det V_1-1).

We now take ρ0=ρ\rho_0=\rho and ρ1=∣α⟩⟨α∣\rho_1=|\alpha\rangle\langle\alpha|, with V=V0V=V_0 and d=d0d=d_0. In the convention [q^,p^]=2i[\hat{q},\hat{p}]=2i, a coherent state has covariance matrix V1=1V_1=\mathbb{1} and displacement d1=dα=(2Re⁡α,2Im⁡α)Td_1=d_\alpha=(2\operatorname{Re}\alpha,2\operatorname{Im}\alpha)^T (see Sec. II.B.2 of Ref. [35]). Since det⁡V1=1\det V_1=1, we have δ=0\delta=0, while Δ=det⁡(V+1)\Delta=\det(V+\mathbb{1}). Moreover, since the coherent state is pure, F(ρ,∣α⟩⟨α∣)=⟨α∣ρ∣α⟩F(\rho,|\alpha\rangle\langle\alpha|)=\langle\alpha|\rho|\alpha\rangle. Defining A=V+1A=V+\mathbb{1} and J=A−1J=A^{-1} therefore gives

⟨α∣ρ∣α⟩=2det⁡Aexp⁡[−12(dα−d)TJ(dα−d)].(36)\langle\alpha|\rho|\alpha\rangle=\frac{2}{\sqrt{\det A}}\exp\left[-\frac{1}{2}(d_\alpha-d)^TJ(d_\alpha-d)\right]. \tag*{(36)}

Using ∣α⟩=e−∣α∣2/2∑n=0∞αn∣n⟩n!|\alpha\rangle=e^{-|\alpha|^2/2}\sum_{n=0}^{\infty}\frac{\alpha^n|n\rangle}{\sqrt{n!}}, we have

e∣α∣2⟨α∣ρ∣α⟩=∑m,n=0∞(α∗)mαnm!n!⟨m∣ρ∣n⟩,(37)e^{|\alpha|^2}\langle\alpha|\rho|\alpha\rangle=\sum_{m,n=0}^{\infty}\frac{(\alpha^*)^m\alpha^n}{\sqrt{m!n!}}\langle m|\rho|n\rangle, \tag*{(37)}

from which the first two Fock populations follow as

p0=⟨0∣ρ∣0⟩=⟨α∣ρ∣α⟩∣α=0,(38)p_0=\langle0|\rho|0\rangle=\left.\langle\alpha|\rho|\alpha\rangle\right|_{\alpha=0}, \tag*{(38)}
p1=⟨1∣ρ∣1⟩=∂α∂α∗[e∣α∣2⟨α∣ρ∣α⟩]∣α=0,(39)p_1=\langle1|\rho|1\rangle=\left.\partial_\alpha\partial_{\alpha^*}\left[e^{|\alpha|^2}\langle\alpha|\rho|\alpha\rangle\right]\right|_{\alpha=0}, \tag*{(39)}

since ∂α∂α∗\partial_\alpha\partial_{\alpha^*} extracts the coefficient of αα∗\alpha\alpha^*, while setting α=0\alpha=0 removes all terms containing higher powers. The first expression gives

p0=2exp⁡[−dTJd/2]det⁡A.(40)p_0=\frac{2\exp[-d^TJd/2]}{\sqrt{\det A}}. \tag*{(40)}

For the second, write α=u+iv\alpha=u+iv and s=(u,v)T\mathbf{s}=(u,v)^{T} such that dα=2sd_{\alpha}=2\mathbf{s}, ∣α∣2=sTs|\alpha|^{2}=\mathbf{s}^{T}\mathbf{s}, and ∂α∂α∗=(∂u2+∂v2)/4\partial_{\alpha}\partial_{\alpha^{*}}=(\partial_{u}^{2}+\partial_{v}^{2})/4. Using Eq. (36), we can write

e∣α∣2⟨α∣ρ∣α⟩=2det⁡Aeg(s)(41)e^{|\alpha|^{2}}\langle\alpha|\rho|\alpha\rangle=\frac{2}{\sqrt{\det A}}e^{g(\mathbf{s})} \tag*{(41)}

with

g(s)=sT(1−2J)s+2sTJd−12dTJd.(42)g(\mathbf{s})=\mathbf{s}^{T}(1-2J)\mathbf{s}+2\mathbf{s}^{T}J\mathbf{d}-\frac{1}{2}\mathbf{d}^{T}J\mathbf{d}. \tag*{(42)}

At s=0\mathbf{s}=0 (α=0\alpha=0),

∇g=(∂ug∂vg)=2Jd,(∂u2+∂v2)g=4(1−Tr⁡J).(43)\nabla g=\begin{pmatrix}\partial_{u}g\\\partial_{v}g\end{pmatrix}=2J\mathbf{d},\qquad(\partial_{u}^{2}+\partial_{v}^{2})g=4(1-\operatorname{Tr}J). \tag*{(43)}

Using (∂u2+∂v2)eg=eg[(∂u2+∂v2)g+∣∇g∣2](\partial_{u}^{2}+\partial_{v}^{2})e^{g}=e^{g}[(\partial_{u}^{2}+\partial_{v}^{2})g+|\nabla g|^{2}], we then obtain

p1=p0(1−Tr⁡J+dTJ2d).(44)p_{1}=p_{0}(1-\operatorname{Tr}J+\mathbf{d}^{T}J^{2}\mathbf{d}). \tag*{(44)}

References

  1. [1]J. B. Brask, N. Brunner, J. Pauwels, D. Rusca, and A. Tavakoli, Quantum correlations in prepare-and-measure scenarios with their semi-device-independent applications (2026), arXiv:2603.23604 [quant-ph].arxiv.org/abs/2603.23604
  2. [2]A. de Oliveira Junior, S. Zamora, J. B. Brask, R. Chaves, and A. Tavakoli, Quantum prepare-and-measure scenarios: concepts and methods (2026), arXiv:2601.07225 [quant-ph].
  3. [3]T. Van Himbeeck, E. Woodhead, N. J. Cerf, R. García-Patrón, and S. Pironio, Quantum 1, 33 (2017).
  4. [4]D. Rusca, T. van Himbeeck, A. Martin, J. B. Brask, W. Shi, S. Pironio, N. Brunner, and H. Zbinden, Phys. Rev. A 100, 062338 (2019).
  5. [5]M. Avesani, H. Tebyanian, P. Villoresi, and G. Vallone, Phys. Rev. Applied 15, 034034 (2021).
  6. [6]C. Roch i Carceller, J. Pauwels, S. Pironio, and A. Tavakoli, Phys. Rev. Lett. 135, 14802 (2025).
  7. [7]J. B. Brask, A. Martin, W. Esposito, R. Houlmann, J. Bowles, H. Zbinden, and N. Brunner, Phys. Rev. Applied 7, 054018 (2017).
  8. [8]W. Shi, Y. Cai, J. B. Brask, H. Zbinden, and N. Brunner, Phys. Rev. A 100, 042108 (2019).
  9. [9]A. Tavakoli, Phys. Rev. Lett. 126, 210503 (2021).
  10. [10]R. Chaves, J. B. Brask, and N. Brunner, Phys. Rev. Lett. 115, 110501 (2015).
  11. [11]T. S. Sarubi, S. Zamora, M. Alves, V. F. Alves, G. M. Viswanathan, and R. Chaves, Braz. J. Phys. 56, 136 (2026).
  12. [12]A. Tavakoli, E. Zambrini Cruzeiro, J. B. Brask, N. Gisin, and N. Brunner, Quantum 4, 332 (2020).
  13. [13]A. Tavakoli, E. Zambrini Cruzeiro, E. Woodhead, and S. Pironio, Quantum 6, 620 (2022).
  14. [14]G. Cobucci, A. Bernal, M. J. Renner, and A. Tavakoli, Nat. Commun. 17, 1104 (2026).
  15. [15]J. Pauwels, S. Pironio, and A. Tavakoli, Quantum 9, 1637 (2025).
  16. [16]R. Gallego, N. Brunner, C. Hadley, and A. Acín, Phys. Rev. Lett. 105, 230501 (2010).
  17. [17]T. S. Sarubi, M. Alves, S. Zamora, V. F. Alves, A. de Oliveira Junior, and R. Chaves, Phys. Rev. A 114, 042404 (2026).
  18. [18]M. Navascués and T. Vértesi, Phys. Rev. Lett. 115, 020501 (2015).
  19. [19]A. Bernal, G. Cobucci, M. J. Renner, and A. Tavakoli, Phys. Rev. Lett. 133, 240203 (2024).
  20. [20]M. Pawłowski and N. Brunner, Phys. Rev. A 84, 010302 (2011).
  21. [21]H.-W. Li, M. Pawłowski, Z.-Q. Yin, G.-C. Guo, and Z.-F. Han, Phys. Rev. A 85, 052308 (2012).
  22. [22]M. Alves, V. L. Sena, S. Zamora, T. S. Sarubi, A. de Oliveira Junior, A. B. Tacla, and R. Chaves, Phys. Rev. A 113, 042418 (2026).
  23. [23]T. S. Sarubi, M. Alves, V. F. Alves, S. Zamora, D. H. G. Duarte, A. de Oliveira Junior, and R. Chaves, Randomness certification and trade-offs in the prepare-and-broadcast scenario (2026), arXiv:2608.08329 [quant-ph].arxiv.org/abs/2608.08329
  24. [24]E. Passaro, D. Cavalcanti, P. Skrzypczyk, and A. Acín, New J. Phys. 17, 113010 (2015).
  25. [25]P. Mironowicz, A. Tavakoli, A. Hameedi, B. Marques, M. Pawłowski, and M. Bourennane, New J. Phys. 18, 065004 (2016).
  26. [26]C. Roch i Carceller, L. N. Faria, Z.-H. Liu, N. Sguerso, U. L. Andersen, J. S. Neergaard-Nielsen, and J. B. Brask, Phys. Rev. A 112, 022430 (2025).
  27. [27]A. Tavakoli, J. Kanievski, T. Vértesi, D. Rosset, and N. Brunner, Phys. Rev. A 98, 062307 (2018).
  28. [28]A. Tavakoli, M. Smania, T. Vértesi, N. Brunner, and M. Bourennane, Sci. Adv. 6, eaaw6664 (2020).
  29. [29]N. Miklin, J. J. Barkhof, and M. Pawłowski, Phys. Rev. Research 2, 033014 (2020).
  30. [30]S. Zamora, R. A. Macêdo, T. S. Sarubi, M. Alves, D. Poderini, and R. Chaves, Phys. Rev. A 112, 042410 (2025).
  31. [31]M. Navascués, K. F. Pál, T. Vértesi, and M. Araújo, Phys. Rev. Lett. 131, 250802 (2023).
  32. [32]V. Scrani, Acta Phys. Slovaca 62, 347 (2012).
  33. [33]A. Acín and L. Masanes, Nature 540, 213 (2016).
  34. [34]J. Pauwels, S. Pironio, E. Woodhead, and A. Tavakoli, Phys. Rev. Lett. 129, 250504 (2022).
  35. [35]C. Weedbrook, S. Pirandola, R. García-Patrón, N. J. Cerf, T. C. Ralph, J. H. Shapiro, and S. Lloyd, Rev. Mod. Phys. 84, 621 (2012).
  36. [36]J. Brask, Gaussian states and operations—a quick reference (2022), arXiv:2102.05748 [quant-ph].arxiv.org/abs/2102.05748
  37. [37]J. Pauwels, S. Pironio, E. Woodhead, and A. Tavakoli, Phys. Rev. Lett. 132, 189901 (2024).
  38. [38]T. Gehring, C. Lupo, A. Kordts, D. S. Nikolic, N. Jain, T. Ry- dberg, T. B. Pedersen, S. Pirandola, and U. L. Andersen, Nat. Commun. 12, 605 (2021).
  39. [39]M. Ishihara, C. Roch i Carceller, K. N. Wilkinson, C. A. Breum, T. Gehring, and J. B. Brask, Phys. Rev. A 114, 052413 (2026).
  40. [40]A. Mishra, M. Masini, M. Balanźóda, A. Tavakoli, and S. Pironio, Prepare-and-measure quantum key distribution from a bound on information leakage (2026), arXiv:2610.37296 [quant-ph].arxiv.org/abs/2610.37296
  41. [41]P. Doderini, S. Brito, R. Nery, F. Sciarrino, and R. Chaves, Phys. Rev. Research 2, 043106 (2020).
  42. [42]P. Mironowicz, H.-W. Li, and M. Pawłowski, Phys. Rev. A 90, 022322 (2014).
  43. [43]H.-W. Li, Z.-Q. Yin, M. Pawłowski, G.-C. Guo, and Z.-F. Han, Phys. Rev. A 91, 032305 (2015).
  44. [44]V. V. Dodonov, O. V. Man’ko, and V. I. Man’ko, Phys. Rev. A 49, 2993 (1994).
  45. [45]A. Ambainis, A. Nayak, A. Ta-Shma, and U. Vazirani, J. ACM 49, 496 (2002).
  46. [46]A. Ambainis, D. Leung, L. Mancinska, and M. Ozols, Quantum random access codes with shared randomness (2009), arXiv:0810.2937 [quant-ph].arxiv.org/abs/0810.2937
  47. [47]K. Banászěk and W. Wódkiewicz, Phys. Rev. Lett. 76, 4344 (1996).
  48. [48]J. Brask and R. Chaves, Phys. Rev. A 86, 010103 (2012).
  49. [49]R. Chaves, G. B. Lemos, and J. Pienaar, Phys. Rev. Lett. 120, 190401 (2018).
  50. [50]A. Ourjoumtsev, H. Jeong, R. Tualle-Brouri, and P. Grangier, Nature 448, 784 (2007).
  51. [51]D. V. Sychev, A. E. Ulanov, A. A. Pushkina, M. W. Richards, I. A. Fedorov, and A. I. Lvovsky, Nat. Photonics 11, 379 (2017).
  52. [52]D. S. Schlegel, F. Minganti, and V. Savona, Phys. Rev. A 106, 022431 (2022).

Paper details

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

views · 0

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