Introduction
Universal fault-tolerant quantum computation offers a promising route to information-processing capabilities beyond the reach of classical computers [1 ] . Identifying the quantum resources underlying this potential advantage remains a fundamental challenge. Although entanglement is essential for many quantum information-processing tasks, it alone does not guarantee a computational advantage. Indeed, the Gottesman-Knill theorem establishes that circuits comprising stabilizer-state preparations, Clifford operations, and computational-basis measurements can be efficiently simulated classically, even when they generate highly entangled states [2 ] . Achieving universal and efficient quantum computation, in contrast, requires extending this classically simulable framework with suitable non-Clifford operations [3 , 4 ] . The quantum resource associated with this departure, known as nonstabilizerness or quantum magic , therefore plays a central role in enabling quantum computational advantage [3 , 4 , 5 , 6 ] .
Beyond computation, nonstabilizerness has emerged as an important resource in quantum many-body physics and communication complexity, offering insights into quantum dynamics, resource generation, and the limits of classical information processing [7 , 8 , 9 ] . For odd-prime-dimensional qudits, the discrete Wigner function provides a natural phase-space description, connecting negativity to contextuality and limitations of efficient classical simulation within the quasiprobability framework [10 , 11 , 12 , 13 ] . These connections have motivated the development of several quantitative measures of nonstabilizerness, including the mana and relative entropy of magic [5 ] , robustness of magic [6 ] , thauma [14 ] , and stabilizer Rényi entropy (SRE) [15 , 16 ] .
Although these measures capture complementary aspects of quantum magic, their experimental accessibility and computational evaluation remain significant challenges.
The difficulty stems from two fundamental bottlenecks. Experimentally, many existing approaches require extensive knowledge of the quantum state, with full tomography incurring a measurement overhead that scales exponentially with the number of qudits [17 , 18 ] . Computationally, the stabilizer polytope, defined as the convex hull of pure stabilizer states, has a rapidly growing number of vertices, making its exact characterization increasingly demanding. Consequently, determining whether a state belongs to this polytope or quantifying its distance from the stabilizer set can become computationally intractable even when complete tomographic information is available. These limitations often restrict practical methods to systems of limited size or dimension, or to states possessing specific symmetries or structures.
To circumvent these difficulties, several measurement-based approaches have been proposed to probe quantum magic without complete state reconstruction. Randomized-measurement protocols based on the second stabilizer Rényi entropy enable magic quantification but suffer from sensitivity to experimental imperfections and require exponentially many measurements with increasing system size [19 ] . More robust entropy-based criteria have since been developed, although their efficient certification guarantees hold only under restricted entropy conditions and not for arbitrary mixed states [20 ] . Complementary methods exploit two-copy Bell-sampling statistics [21 ] , while multifractal-flatness approaches can require exponentially many samples to estimate stabilizer entropy to fixed accuracy [22 ] . More recently, the reduced-stabilizer-polytope framework has enabled magic detection from a restricted set of Pauli measurements, together with lower bounds on the robustness of magic [23 ] . Despite these advances, experimentally accessible and scalable methods for detecting and quantifying magic in higher-dimensional quantum systems remain elusive. This raises a fundamental
Results
Throughout the paper, n n n denotes the number of qudits, d d d their odd prime local dimension, and D = d n D=d^n D = d n the total dimension. On a single qudit, the shift and phase operators satisfy X ∣ j ⟩ = ∣ j + 1 ⟩ X|j\rangle=|j+1\rangle X ∣ j ⟩ = ∣ j + 1 ⟩ and Z ∣ j ⟩ = ω j ∣ j ⟩ Z|j\rangle=\omega^j|j\rangle Z ∣ j ⟩ = ω j ∣ j ⟩ , where ω = e 2 π i / d \omega=e^{2\pi i/d} ω = e 2 π i / d and arithmetic is modulo d d d . The displacement operator at ( p , q ) ∈ Z d 2 (p,q)\in\mathbb{Z}_d^2 ( p , q ) ∈ Z d 2 is
T ( p , q ) = ω − 2 − 1 p q Z p X q , (1) T_{(p,q)}=\omega^{-2^{-1}pq}Z^pX^q, \tag*{(1)} T ( p , q ) = ω − 2 − 1 pq Z p X q , (1)
where 2 − 1 2^{-1} 2 − 1 is the inverse of 2 modulo d d d . For u = ( p , q ) ∈ Z d 2 n \mathbf{u}=(\mathbf{p},\mathbf{q})\in\mathbb{Z}_d^{2n} u = ( p , q ) ∈ Z d 2 n , the corresponding n n n -qudit displacement is T u = ⨂ ℓ = 1 n T ( p ℓ , q ℓ ) T_{\mathbf{u}}=\bigotimes_{\ell=1}^{n}T_{(p_\ell,q_\ell)} T u = ⨂ ℓ = 1 n T ( p ℓ , q ℓ ) .
The operators ω a T u \omega^aT_{\mathbf{u}} ω a T u , with a ∈ Z d a\in\mathbb{Z}_d a ∈ Z d , form the Pauli group H d \mathcal{H}_d H d . The Clifford group is its normalizer,
C d = { U ∈ U ( D ) : U H d U † = H d } . (2) \mathcal{C}_d=\{U\in\mathrm{U}(D):U\mathcal{H}_dU^\dagger=\mathcal{H}_d\}. \tag*{(2)} C d = { U ∈ U ( D ) : U H d U † = H d } . (2)
A pure stabilizer state is the unique common + 1 +1 + 1 eigenstate of an abelian Pauli subgroup of order D D D that contains no non-identity scalar. The convex hull of pure stabilizer states is the stabilizer polytope. States outside this polytope are magic states.
The phase-point operators are defined by [10 ]
A 0 = 1 D ∑ v T v , A u = T u A 0 T u † . (3) A_{\mathbf{0}}=\frac{1}{D}\sum_{\mathbf{v}}T_{\mathbf{v}},\qquad A_{\mathbf{u}}=T_{\mathbf{u}}A_{\mathbf{0}}T_{\mathbf{u}}^\dagger. \tag*{(3)} A 0 = D 1 v ∑ T v , A u = T u A 0 T u † . (3)
Here A 0 ∣ x ⟩ = ∣ − x ⟩ A_{\mathbf{0}}|\mathbf{x}\rangle=|-\mathbf{x}\rangle A 0 ∣ x ⟩ = ∣ − x ⟩ . The operators satisfy Tr ( A u ) = 1 \operatorname{Tr}(A_{\mathbf{u}})=1 Tr ( A u ) = 1 and Tr ( A u A v ) = D δ u , v \operatorname{Tr}(A_{\mathbf{u}}A_{\mathbf{v}})=D\delta_{\mathbf{u},\mathbf{v}} Tr ( A u A v ) = D δ u , v . The discrete Wigner function (DWF) is
W ρ ( u ) = 1 D Tr ( A u ρ ) , ∑ u W ρ ( u ) = 1 , (4) W_\rho(\mathbf{u})=\frac{1}{D}\operatorname{Tr}(A_{\mathbf{u}}\rho),\qquad\sum_{\mathbf{u}}W_\rho(\mathbf{u})=1, \tag*{(4)} W ρ ( u ) = D 1 Tr ( A u ρ ) , u ∑ W ρ ( u ) = 1 , (4)
and its moments are defined in Eq. (5) . By the discrete Hudson theorem, Wigner negativity is equivalent to magic for pure states. For mixed states, Wigner negativity is sufficient to certify magic [10 , 11 ] . The Supplementary Materials give further details of the formalism along with examples.
Detecting magic from low-order Wigner moments
We first introduce a moment-based framework for detecting nonstabilizerness, then show how to experimentally measure the required moments and use them to quantify Wigner negativity.
Definition 1. For a quantum state ρ ∈ D ( C d ) \rho\in\mathbb{D}(\mathbb{C}^d) ρ ∈ D ( C d ) , with discrete Wigner function W ρ ( u ) W_\rho(\mathbf{u}) W ρ ( u ) (with u ∈ Z d × Z d \mathbf{u}\in\mathbb{Z}_d\times\mathbb{Z}_d u ∈ Z d × Z d labels the points of the discrete phase-space), we define its k k k -th Wigner moment as
w k : = ∑ u = ( 0 , 0 ) ( d − 1 , d − 1 ) [ W ρ ( u ) ] k , (5) w_k:=\sum_{\mathbf{u}=(0,0)}^{(d-1,d-1)}[W_\rho(\mathbf{u})]^k, \tag*{(5)} w k := u = ( 0 , 0 ) ∑ ( d − 1 , d − 1 ) [ W ρ ( u ) ] k , (5) where, k ∈ N k\in\mathbb{N} k ∈ N , and k ≥ 1 k\ge1 k ≥ 1 .
A necessary and sufficient criterion for detecting pure magic states
By the discrete Hudson theorem, a pure state is magic if and only if its Wigner function is negative at some phase-space point [10 ] . Checking this directly requires evaluating the Wigner function at every point, which is hard in general. We show that for pure states a single number built from the moments suffices, with no need for individual phase-space values. We first review three properties of the Wigner moments that hold for any number of qudits.
Lemma 1. For every state ρ \rho ρ of n n n qudits of odd prime dimension d d d , the Wigner function and its moments satisfy
∣ W ρ ( u ) ∣ ≤ 1 D for all u , (6) \lvert W_{\rho}(u)\rvert\le\frac{1}{D} \qquad\text{for all }u, \tag*{(6)} ∣ W ρ ( u )∣ ≤ D 1 for all u , (6) w 2 = 1 D Tr [ ρ 2 ] , (7) w_2 = \frac{1}{D}\operatorname{Tr}[\rho^2], \tag*{(7)} w 2 = D 1 Tr [ ρ 2 ] , (7) ∣ w k ∣ ≤ w 2 D k − 2 for all k ≥ 2. (8) \lvert w_k\rvert\le\frac{w_2}{D^{k-2}} \qquad\text{for all } k \ge2. \tag*{(8)} ∣ w k ∣ ≤ D k − 2 w 2 for all k ≥ 2. (8)
The detailed proof is given in Methods IV A 1. Eq. (7) tells us that the second moment is simply the purity, up to the factor D D D . We therefore introduce rescaled moments whose magnitudes are bounded independently of the number of qudits,
P = D w 2 = Tr [ ρ 2 ] , b = D 2 w 3 , c = D 3 w 4 . (9) P = D w_2 = \operatorname{Tr}[\rho^2], \qquad b = D^2w_3, \qquad c = D^3w_4. \tag*{(9)} P = D w 2 = Tr [ ρ 2 ] , b = D 2 w 3 , c = D 3 w 4 . (9)
In these variables, Lemma 1 takes a compact form,
∣ b ∣ ≤ P , 0 ≤ c ≤ P . (10) \lvert b\rvert\le P, \qquad0 \le c \le P. \tag*{(10)} ∣ b ∣ ≤ P , 0 ≤ c ≤ P . (10)
For a pure state the purity is one, so P = 1 P=1 P = 1 and this inequality reduces to a condition on b b b alone. The bound ∣ b ∣ ≤ P \lvert b\rvert\le P ∣ b ∣ ≤ P shows that b b b can never exceed one. The central question is therefore whether the upper value b = 1 b=1 b = 1 is reserved for stabilizer states. The following theorem answers it.
Theorem 1. Let ∣ ψ ⟩ \lvert\psi\rangle ∣ ψ ⟩ be a pure state of n n n qudits of odd prime dimension d d d . Then
D 2 w 3 ≤ 1 , (11) D^2w_3 \le1, \tag*{(11)} D 2 w 3 ≤ 1 , (11) and equality holds if and only if ∣ ψ ⟩ \lvert\psi\rangle ∣ ψ ⟩ is a stabilizer state. Consequently,
D 2 w 3 > 1 ⟺ ∣ ψ ⟩ is a magic state . (12) D^2w_3 > 1 \Longleftrightarrow\lvert\psi\rangle\text{ is a magic state}. \tag*{(12)} D 2 w 3 > 1 ⟺ ∣ ψ ⟩ is a magic state . (12)
For a detailed proof see Methods IV A 2. Theorem 1 is one of the main detection result of this work. For pure states the moment criterion is not merely sufficient but exact, so no pure magic state can escape it, and it depends only on the third moment, regardless of the number of qudits.
The single number D 2 w 3 D^2w_3 D 2 w 3 has two further properties that make it a natural figure of merit. It does not change under Clifford unitaries, because these only permute the points of phase space [10 ] and every moment is a sum over all points. It is also multiplicative under tensor products, because the Wigner function of a product state is the product of the Wigner functions.
To make the certificates concrete, we use the strange state
∣ ψ 1 ⟩ = ∣ 1 ⟩ − ∣ 2 ⟩ 2 , (13) \lvert\psi_1\rangle= \frac{\lvert1\rangle-\lvert2\rangle}{\sqrt{2}}, \tag*{(13)} ∣ ψ 1 ⟩ = 2 ∣ 1 ⟩ − ∣ 2 ⟩ , (13)
and the ququint state
∣ ψ 4 ⟩ = ∣ 0 ⟩ − ∣ 1 ⟩ + ∣ 2 ⟩ + ∣ 3 ⟩ + ∣ 4 ⟩ 5 . (14) \lvert\psi_4\rangle= \frac{\lvert0\rangle-\lvert1\rangle+\lvert2\rangle+\lvert3\rangle+\lvert4\rangle}{\sqrt{5}}. \tag*{(14)} ∣ ψ 4 ⟩ = 5 ∣ 0 ⟩ − ∣ 1 ⟩ + ∣ 2 ⟩ + ∣ 3 ⟩ + ∣ 4 ⟩ . (14)
Their rescaled third moments are b = 0 b=0 b = 0 and b = 77 / 125 = 0.616 b=77/125=0.616 b = 77/125 = 0.616 , respectively, compared with b = 1 b=1 b = 1 for every pure stabilizer state. The detailed discrete Wigner distributions and the original pure-state examples are provided in the Supplementary Information.
Extension to mixed states
The proof of Theorem 1 relies essentially on purity, and Hudson’s theorem does not extend to mixed states. The moment inequality below, however, requires only Wigner non-negativity, so it applies to both pure and mixed states.
Theorem 2. If ρ ∈ D ( C D ) \rho\in\mathcal{D}(\mathbb{C}^{D}) ρ ∈ D ( C D ) is a quantum state whose discrete Wigner function is nonnegative at every point of the discrete phase space, i.e., W ρ ( u ) ≥ 0 ∀ u ∈ Z d 2 n W_{\rho}(u) \ge0\ \forall u \in\mathbb{Z}_d^{2n} W ρ ( u ) ≥ 0 ∀ u ∈ Z d 2 n , then
w 2 2 ≤ w 3 (15) w_2^2 \le w_3 \tag*{(15)} w 2 2 ≤ w 3 (15) where, w 2 w_2 w 2 and w 3 w_3 w 3 are defined in Definition 1.
A detailed proof is given in Methods IV A 3. The condition holds for every non-negative, normalized DW, independent of the Hilbert-space dimension and the purity of the state, so any violation certifies Wigner negativity. For pure states, it recovers one direction of Theorem 1, which also proves the converse. To establish Theorem 2 as a witness of magic for mixed states, we must show that every mixed stabilizer state has a non-negative Wigner function. We begin with the following lemma.
Lemma 2. Let ρ = ∑ k p k ∣ S k ⟩ ⟨ S k ∣ \rho=\sum_k p_k\lvert S_k\rangle\langle S_k\rvert ρ = ∑ k p k ∣ S k ⟩ ⟨ S k ∣ be a mixed stabilizer state in an odd prime or prime-power dimension, where { p k } \{p_k\} { p k } forms a probability distribution and ∣ S k ⟩ \lvert S_k\rangle ∣ S k ⟩ are pure stabilizer states. Then,
W ρ ( u ) ≥ 0 , ∀ u ∈ Z d × Z d . (16) W_{\rho}(u) \ge0, \qquad\forall u \in\mathbb{Z}_d \times\mathbb{Z}_d. \tag*{(16)} W ρ ( u ) ≥ 0 , ∀ u ∈ Z d × Z d . (16)
The proof is given in Methods IV A 4. The above lemma implies that a violation of Theorem 2 certifies a magic state. A nonnegative Wigner function, however, does not imply stabilizer-polytope membership for mixed states. The rescaled witness is G = P 2 − b = P 2 ( D 2 w 2 2 − w 3 ) G=P^2-b=P^2(D^2w_2^2-w_3) G = P 2 − b = P 2 ( D 2 w 2 2 − w 3 ) , which is nonpositive for every nonnegative Wigner function, so G > 0 G>0 G > 0 certifies magic.
For illustration consider the two depolarized families
ρ 1 ( p ) = p ∣ ψ 1 ⟩ ⟨ ψ 1 ∣ + ( 1 − p ) I 3 / 3 , \rho_1(p)=p\lvert\psi_1\rangle\langle\psi_1\rvert+(1-p)\mathbb{I}_3/3, ρ 1 ( p ) = p ∣ ψ 1 ⟩ ⟨ ψ 1 ∣ + ( 1 − p ) I 3 /3 ,
ρ 2 ( p ) = p ∣ ψ 4 ⟩ ⟨ ψ 4 ∣ + ( 1 − p ) I 5 / 5. (17) \rho_2(p)=p\lvert\psi_4\rangle\langle\psi_4\rvert+(1-p)\mathbb{I}_5/5. \tag*{(17)} ρ 2 ( p ) = p ∣ ψ 4 ⟩ ⟨ ψ 4 ∣ + ( 1 − p ) I 5 /5. (17)
with 0 ≤ p ≤ 1 0\le p\le1 0 ≤ p ≤ 1 . Their full Wigner distributions and moment calculations are provided in the Supplementary Information. For the noisy strange state,
w 2 2 − w 3 = p 2 ( p + 2 ) ( 4 p − 1 ) 81 , (18) w_2^2-w_3=\frac{p^2(p+2)(4p-1)}{81}, \tag*{(18)} w 2 2 − w 3 = 81 p 2 ( p + 2 ) ( 4 p − 1 ) , (18)
so the third-moment witness detects exactly the Wigner-negative region p > 1 / 4 p>1/4 p > 1/4 . The fourth-moment witness has the same threshold. For the noisy ququint,
w 2 2 − w 3 = 4 p 2 ( 20 p 2 − 3 p − 5 ) 3125 , (19) w_2^2-w_3=\frac{4p^2(20p^2-3p-5)}{3125}, \tag*{(19)} w 2 2 − w 3 = 3125 4 p 2 ( 20 p 2 − 3 p − 5 ) , (19)
so the third-moment threshold is ( 3 + 409 ) / 40 ≃ 0.5806 (3+\sqrt{409})/40 \simeq0.5806 ( 3 + 409 ) /40 ≃ 0.5806 , whereas Wigner negativity starts at 1 / 5 ≃ 0.4472 1/\sqrt{5}\simeq0.4472 1/ 5 ≃ 0.4472 . Figure 1 displays this distinction.
Figure 1. Analytical graphs of ( w 2 2 − w 3 ) (w_2^2-w_3) ( w 2 2 − w 3 ) as a function of the mixing parameter p p p for (a) the qutrit state ρ 1 \rho_1 ρ 1 (d = 3 d=3 d = 3 ) and (b) the ququint state ρ 2 \rho_2 ρ 2 (d = 5 d=5 d = 5 ). The blue curves represent the corresponding analytical expressions. Light blue and light pink shading indicate positive and negative values, respectively, with positive values certifying magic according to the criterion. The black dashed lines represent zero. The insets magnify the regions near p = 0 p=0 p = 0 . In (a), the magenta dotted line marks p = 1 / 4 p=1/4 p = 1/4 , where both the criterion and the Wigner function change sign. In (b), the purple dash-dotted line marks p = 1 / 5 p=1/\sqrt{5} p = 1/ 5 , above which the Wigner function becomes negative, while the magenta dotted line marks p = ( 3 + 409 ) / 40 p=(3+\sqrt{409})/40 p = ( 3 + 409 ) /40 , above which the criterion is violated.
A complete hierarchy for mixed states
For mixed states the criterion of Theorem 2 is sufficient but not necessary. The d = 5 d = 5 d = 5 example of Sec. II A 2 makes this explicit, since the DWF of ρ 2 \rho_2 ρ 2 is negative for p > 1 / 5 ≈ 0.447 p > 1/\sqrt{5} \approx0.447 p > 1/ 5 ≈ 0.447 while w 2 2 > w 3 w_2^2 > w_3 w 2 2 > w 3 holds only for p > 0.581 p > 0.581 p > 0.581 . One may ask whether a better inequality in w 2 w_2 w 2 and w 3 w_3 w 3 alone exists. It does not. Any normalized distribution that is uniform on its support saturates w 2 2 = w 3 w_2^2 = w_3 w 2 2 = w 3 , so the Cauchy-Schwarz bound is already optimal at this order. The gap can only be closed with higher moments, and the following theorem shows how.
Theorem 3. For a state ρ \rho ρ and an integer m ≥ 1 m \ge1 m ≥ 1 define the ( m + 1 ) × ( m + 1 ) (m + 1) \times(m + 1) ( m + 1 ) × ( m + 1 ) matrix
[ H m ( ρ ) ] i j = w i + j + 1 , i , j = 0 , 1 , … , m , (20) [H_m(\rho)]_{ij} = w_{i+j+1}, \qquad i,j = 0,1,\ldots,m, \tag*{(20)} [ H m ( ρ ) ] ij = w i + j + 1 , i , j = 0 , 1 , … , m , (20) with w 1 = 1 w_1 = 1 w 1 = 1 . If W ρ ( u ) ≥ 0 W_\rho(\mathbf{u}) \ge0 W ρ ( u ) ≥ 0 for all u \mathbf{u} u , then H m ( ρ ) ⪰ 0 H_m(\rho) \succeq0 H m ( ρ ) ⪰ 0 for every m m m . Conversely, if W ρ W_\rho W ρ takes r r r distinct values and is negative somewhere, then H r − 1 ( ρ ) H_{r-1}(\rho) H r − 1 ( ρ ) has a negative eigenvalue. Since r ≤ D 2 r \le D^2 r ≤ D 2 , the conditions H m ⪰ 0 H_m \succeq0 H m ⪰ 0 with m ≤ D 2 − 1 m \le D^2 - 1 m ≤ D 2 − 1 are necessary and sufficient for a nonnegative DWF.
We provide the proof in Methods IV A 5. The first level is the matrix
H 1 = ( 1 w 2 w 2 w 3 ) , (21) H_1 = \begin{pmatrix} 1 & w_2 \\ w_2 & w_3 \end{pmatrix}, \tag*{(21)} H 1 = ( 1 w 2 w 2 w 3 ) , (21)
whose determinant is w 3 − w 2 2 w_3 - w_2^2 w 3 − w 2 2 , so that H 1 ⪰ 0 H_1 \succeq0 H 1 ⪰ 0 is exactly Theorem 2. Level m m m requires the moments up to w 2 m + 1 w_{2m+1} w 2 m + 1 , each of which can be measured with the multicopy protocol of Sec. II C. Table I lists the noise threshold above which each level detects the state ρ 2 \rho_2 ρ 2 . The DWF of ρ 2 \rho_2 ρ 2 takes five distinct values, so by Theorem 3 the fourth level reproduces the exact negativity threshold 1 / 5 1/\sqrt{5} 1/ 5 .
The hierarchy progressively closes the ququint gap (Table I). Its Wigner distribution has at most five distinct values, so the fourth level reaches the exact negativity threshold. The fourth-moment witness alone detects negativity only for p ≳ 0.6224 p \gtrsim0.6224 p ≳ 0.6224 , illustrating that an even-moment witness and the Hankel hierarchy have different detection properties.
Operational quantification of magic
We will now demonstrate that the same low-order Wigner moments used to certify nonstabilizerness also provide quantitative lower bounds on Wigner negativity and, consequently, the amount of magic present in a quantum state.
Negativity and mana
In the discrete Wigner formalism, the natural measures of magic quantify the amount of negative weight carried by the Wigner function. The sum negativity and the ℓ 1 \ell_1 ℓ 1 -norm of the DWF are respectively defined as
N ( ρ ) = ∑ u : W ρ ( u ) < 0 ∣ W ρ ( u ) ∣ , and (22) \mathcal{N}(\rho) = \sum_{\mathbf{u}: W_\rho(\mathbf{u}) < 0} \lvert W_\rho(\mathbf{u})\rvert,
\qquad\text{and} \tag*{(22)} N ( ρ ) = u : W ρ ( u ) < 0 ∑ ∣ W ρ ( u )∣ , and (22)
∥ W ρ ∥ 1 = ∑ u ∣ W ρ ( u ) ∣ = 1 + 2 N ( ρ ) . (23) \lVert W_\rho\rVert_1 = \sum_{\mathbf{u}} \lvert W_\rho(\mathbf{u})\rvert= 1 + 2\mathcal{N}(\rho). \tag*{(23)} ∥ W ρ ∥ 1 = u ∑ ∣ W ρ ( u )∣ = 1 + 2 N ( ρ ) . (23)
The second equality follows from normalization, since the positive part of W ρ W_\rho W ρ must exceed the negative part by exactly one. The logarithm of the ℓ 1 \ell_1 ℓ 1 -norm is the mana, or Wigner log negativity [5 ] ,
M ( ρ ) = log ∥ W ρ ∥ 1 . (24) \mathcal{M}(\rho) = \log\lVert W_\rho\rVert_1. \tag*{(24)} M ( ρ ) = log ∥ W ρ ∥ 1 . (24)
Mana is additive under tensor products (M ( ρ ⊗ σ ) = M ( ρ ) + M ( σ ) \mathcal{M}(\rho\otimes\sigma) = \mathcal{M}(\rho) + \mathcal{M}(\sigma) M ( ρ ⊗ σ ) = M ( ρ ) + M ( σ ) ) and nonincreasing under stabilizer operations. It vanishes precisely for states with nonnegative DWFs and provides operational bounds on magic-state distillation and the classical simulation overhead of quasiprobability-based methods [5 ] which we discuss in Sec. II E.
Evaluating M \mathcal{M} M generally requires reconstructing the complete DWF, which becomes increasingly demanding with system size. Here, we circumvent this requirement by deriving two complementary lower bounds on mana from low-order Wigner moments, involving ( w 2 , w 3 ) (w_2,w_3) ( w 2 , w 3 ) and ( w 2 , w 4 ) (w_2,w_4) ( w 2 , w 4 ) , respectively. A strictly positive bound certifies nonstabilizerness while simultaneously quantifying the minimum amount of magic present in the state.
Certified bound from the second and third moments
We first establish a quantitative connection between the violation of w 2 2 ≤ w 3 w_2^2 \le w_3 w 2 2 ≤ w 3 (Theorem 2) and the sum negativity. Recall the rescaled moments P = D w 2 P = D w_2 P = D w 2 and b = D 2 w 3 b = D^2 w_3 b = D 2 w 3 introduced in Eq. (9)
Theorem 4. For every state ρ \rho ρ of n n n qudits of odd prime dimension d d d ,
N ( ρ ) ≥ D 2 ( w 2 2 − w 3 ) 1 + 2 D w 2 + D 2 w 3 = P 2 − b 1 + 2 P + b . (25) \mathcal{N}(\rho) \ge\frac{D^2(w_2^2-w_3)}{1+2Dw_2+D^2w_3} = \frac{P^2-b}{1+2P+b}. \tag*{(25)} N ( ρ ) ≥ 1 + 2 D w 2 + D 2 w 3 D 2 ( w 2 2 − w 3 ) = 1 + 2 P + b P 2 − b . (25)
For a pure state this reads
N ( ψ ) ≥ 1 − D 2 w 3 3 + D 2 w 3 . (26) \mathcal{N}(\psi) \ge\frac{1-D^2w_3}{3+D^2w_3}. \tag*{(26)} N ( ψ ) ≥ 3 + D 2 w 3 1 − D 2 w 3 . (26)
The proof is provided in Methods IV A 6. Three observations follow from this theorem. First, the numerator of Eq. (25) is proportional to the violation w 2 2 − w 3 w_2^2-w_3 w 2 2 − w 3 . Thus, the lower bound is strictly positive precisely when the criterion of Theorem 2 is violated. Conversely, for N = 0 N=0 N = 0 , the bound recovers the inequality w 2 2 ≤ w 3 w_2^2\leq w_3 w 2 2 ≤ w 3 . Second, the bound is tight when all inequalities used in the proof are saturated, which occurs when all negative DWF entries equal − 1 / D -1/D − 1/ D and all positive entries are equal. The qutrit strange state provides an example: with D 2 w 3 = 0 D^2w_3=0 D 2 w 3 = 0 , Eq. (26) yields N ≥ 1 / 3 N\geq1/3 N ≥ 1/3 , exactly matching its sum negativity. Finally, the bound directly provides a certified lower bound on mana,
M ( ρ ) ≥ M 3 ( ρ ) : = log [ 1 + 2 ( P 2 − b ) 1 + 2 P + b ] . (27) \mathcal{M}(\rho)\geq\mathcal{M}_3(\rho):=\log\left[1+\frac{2(P^2-b)}{1+2P+b}\right]. \tag*{(27)} M ( ρ ) ≥ M 3 ( ρ ) := log [ 1 + 1 + 2 P + b 2 ( P 2 − b ) ] . (27)
Certified bound from the second and fourth moments
Theorem 4 has a limitation: as shown in Eq. (65) , its lower bound on the sum negativity never exceeds the purity P ≤ 1 P\leq1 P ≤ 1 , whereas the negativity of tensor-product magic states can grow exponentially with the number of copies. To overcome this limitation, we derive a complementary bound involving the second and fourth Wigner moments.
Theorem 5. For every state ρ \rho ρ of n n n qudits of odd prime dimension d d d ,
∥ W ρ ∥ 1 ≥ w 3 2 / 3 w 4 1 / 2 = D 3 c , (28) \lVert W_\rho\rVert_1\geq\frac{w_3^{2/3}}{w_4^{1/2}}=\sqrt{\frac{D^3}{c}}, \tag*{(28)} ∥ W ρ ∥ 1 ≥ w 4 1/2 w 3 2/3 = c D 3 , (28) with c = D 3 w 4 c=D^3w_4 c = D 3 w 4 , and equality holds if and only if ∣ W ρ ∣ \lvert W_\rho\rvert ∣ W ρ ∣ is constant on its support. Equivalently,
M ( ρ ) ≥ M 4 ( ρ ) : = 1 2 log w 3 3 w 4 2 . (29) \mathcal{M}(\rho)\geq\mathcal{M}_4(\rho):=\frac{1}{2}\log\frac{w_3^3}{w_4^2}. \tag*{(29)} M ( ρ ) ≥ M 4 ( ρ ) := 2 1 log w 4 2 w 3 3 . (29) The quantity M 4 \mathcal{M}_4 M 4 is additive under tensor products and invariant under Clifford unitaries. For pure states M 4 ( ψ ) ≥ 0 \mathcal{M}_4(\psi)\geq0 M 4 ( ψ ) ≥ 0 , with equality if and only if ψ \psi ψ is a stabilizer state.
For a detailed proof see Methods IV A 7. Importantly, Eq. (28) holds irrespective of the signs of the DWF entries. For a nonnegative DWF, ∣ W ∣ 1 = 1 \lvert W\rvert_1=1 ∣ W ∣ 1 = 1 , implying w 2 3 ≤ w 4 w_2^3\leq w_4 w 2 3 ≤ w 4 . Thus, Theorem 5 also yields an alternative sufficient criterion for Wigner negativity:
w 2 3 > w 4 ⟹ the Wigner function of ρ is negative . (30) w_2^3>w_4\quad\Longrightarrow\quad\text{the Wigner function of }\rho\text{ is negative}. \tag*{(30)} w 2 3 > w 4 ⟹ the Wigner function of ρ is negative . (30)
For the qutrit strange state w 3 2 / w 4 = 2 w_3^2/w_4=2 w 3 2 / w 4 = 2 , so ∥ W ∥ 1 ≥ 2 ≈ 1.41 \lVert W\rVert_1\geq\sqrt{2}\approx1.41 ∥ W ∥ 1 ≥ 2 ≈ 1.41 , against the exact value 5 / 3 5/3 5/3 . Similarly, for the ququint state ∣ ψ 4 ⟩ \lvert\psi_4\rangle ∣ ψ 4 ⟩ one finds ∥ W ∥ 1 ≥ 1.43 \lVert W\rVert_1\geq1.43 ∥ W ∥ 1 ≥ 1.43 , against the exact value $1.79.
The same argument works with any higher even moment. Hölder’s inequality between ∥ W ∥ 1 \lVert W\rVert_1 ∥ W ∥ 1 , ∥ W ∥ 2 \lVert W\rVert_2 ∥ W ∥ 2 and ∥ W ∥ 2 n \lVert W\rVert_{2n} ∥ W ∥ 2 n gives
∥ W ∥ 1 ≥ ( w 2 2 n − 1 w 2 n ) 1 / ( 2 n − 2 ) , n ≥ 2. (31) \lVert W\rVert_1\geq\left(\frac{w_2^{2n-1}}{w_{2n}}\right)^{1/(2n-2)},\qquad n\geq2. \tag*{(31)} ∥ W ∥ 1 ≥ ( w 2 n w 2 2 n − 1 ) 1/ ( 2 n − 2 ) , n ≥ 2. (31)
For all examples of this paper and for about 5900 random negative states in d = 3 d=3 d = 3 and d = 5 d=5 d = 5 , this family weakens as n n n grows, and it tends to the trivial value w 2 / max u ∣ W ρ ( u ) ∣ w_2/\max_u\lvert W_\rho(u)\rvert w 2 / max u ∣ W ρ ( u )∣ as n → ∞ n\to\infty n → ∞ . The fourth moment is thus the most useful member of the family, and we do not pursue higher orders here.
Relation between the two bounds
The two bounds rely on different Wigner moments and capture distinct features of the underlying distribution. Below, we compare their detection capabilities, tightness, and scaling behavior to clarify their respective advantages. Detection.— Theorem 4 provides a strictly positive lower bound on the sum negativity when w 2 2 > w 3 w_2^2>w_3 w 2 2 > w 3 , whereas Theorem 5 certifies negativity when w 2 3 > w 4 w_2^3>w_4 w 2 3 > w 4 . These criteria are generally inequivalent, and neither implies the other. For all examples considered in this work, the third-moment criterion is at least as robust against noise as the fourth-moment criterion. In particular, for the noisy state ρ 2 \rho_2 ρ 2 introduced in Sec. II A, the third-moment criterion detects Wigner negativity for p > 0.581 p > 0.581 p > 0.581 , while the fourth-moment criterion requires p > 0.622 p > 0.622 p > 0.622 .
Tightness. —The two bounds are saturated under different conditions. The third-moment bound is tight when all negative Wigner entries equal − 1 / D -1/D − 1/ D and all positive entries are equal, as exemplified by the qutrit strange state. In contrast, the fourth-moment bound is saturated when ∣ W ∣ |W| ∣ W ∣ takes a single value on its support. Since the strange state has ∣ W ∣ ∈ { 1 / 3 , 1 / 6 } |W| \in\{1/3, 1/6\} ∣ W ∣ ∈ { 1/3 , 1/6 } , the fourth-moment bound is not tight.
Scaling with system size. —The third-moment bound never exceeds N = 1 \mathcal{N} = 1 N = 1 as follows from Eq. (65) , while the fourth-moment bound is multiplicative under tensor products. Consequently, when applied directly to m m m copies of a resource state, only the fourth-moment bound captures the exponential growth of the Wigner ℓ 1 \ell_1 ℓ 1 norm. The limitation of the first is not fundamental, however. Resource states are usually supplied as product states, and then Theorem 4 can be applied to each copy separately and the results multiplied. Figure 2 compares the three options for the strange state and for ∣ ψ 4 ⟩ |\psi_4\rangle ∣ ψ 4 ⟩ .
Figure 2. Certified mana of m m m copies of (a) the strange state and (b) ∣ ψ 4 ⟩ |\psi_4\rangle ∣ ψ 4 ⟩ . The third-moment bound of Theorem 4 is applied either to each copy separately (teal squares) or to the global state of all copies (magenta triangles down). The fourth-moment bound of Theorem 5 gives the same result in both cases (blue triangles up). Black circles show the exact mana. In panel (a) the per-copy third-moment bound coincides with the exact mana.
Combination. —Both bounds hold at the same time, so the best certificate is
N ( ρ ) ≥ max { P 2 − b 1 + 2 P + b , 1 2 ( P 3 c − 1 ) } . (32) \mathcal{N}(\rho) \ge\max\left\{\frac{P^2-b}{1+2P+b},\ \frac{1}{2}\left(\sqrt{\frac{P^3}{c}}-1\right)\right\}. \tag*{(32)} N ( ρ ) ≥ max { 1 + 2 P + b P 2 − b , 2 1 ( c P 3 − 1 ) } . (32)
The combined mana certificate is M ( ρ ) ≥ log [ 1 + 2 B ( ρ ) ] \mathcal{M}(\rho) \ge\log[1 + 2B(\rho)] M ( ρ ) ≥ log [ 1 + 2 B ( ρ )] , where B B B is the right-hand side of Eq. (32) .
Numerical comparison
Figure 3 compares the two bounds for the two noisy-state families introduced in Sec. II A 2. For the noisy strange state the third-moment bound is exact at p = 1 p = 1 p = 1 and the fourth-moment bound is stronger for intermediate noise. For the noisy state ρ 2 \rho_2 ρ 2 the fourth-moment bound is stronger throughout. Neither bound can see the orange region of Figure 3 (b), marked undetected magic, where the state is magic but its discrete Wigner function is nonnegative. This limitation is inherent to Wigner-negativity-based certification, as discussed in Sec. II A 3.
Figure 3. Exact sum negativity and the certified lower bounds of Theorem 4 and Theorem 5 for (a) the noisy strange state ρ 1 \rho_1 ρ 1 and (b) the noisy state ρ 2 \rho_2 ρ 2 in d = 5 d=5 d = 5 . The black line is the exact sum negativity, the magenta dashed line the bound from ( w 2 , w 3 ) (w_2,w_3) ( w 2 , w 3 ) and the blue dash-dotted line the bound from ( w 2 , w 4 ) (w_2,w_4) ( w 2 , w 4 ) . In the green region the state is a mixture of stabilizer states. In the orange region of panel (b), labelled undetected magic, the state is magic but its Wigner function is nonnegative.
To further assess their performance, Figure 4 compares the certified and exact sum negativities for 10 000 randomly generated states in dimensions d = 3 d = 3 d = 3 and d = 5 d = 5 d = 5 , comprising equal numbers of pure and mixed states of random ranks. As expected from the theorems, all points lie on or below the diagonal. The ( w 2 , w 3 ) (w_2,w_3) ( w 2 , w 3 ) bound exceeds the ( w 2 , w 4 ) (w_2,w_4) ( w 2 , w 4 ) bound for only 14.6% and 16.6% of the negative states for d = 3 d = 3 d = 3 and d = 5 d = 5 d = 5 , respectively. The mean ratios of the individual bounds to the exact sum negativity are 0.299 and 0.409 for d = 3 d = 3 d = 3 , and 0.246 and 0.389 for d = 5 d = 5 d = 5 , respectively. Taking the maximum of the two bounds improves these ratios to 0.419 and 0.398, respectively.
Figure 4. Certified lower bounds against the exact sum negativity for 10000 random states in (a) d = 3 d = 3 d = 3 and (b) d = 5 d = 5 d = 5 . Half of the states are pure and half are mixed states of random rank. No point lies above the diagonal.
Finally, Figure 2 illustrates the certified mana of m m m copies. The global third-moment bound saturates after one copy. The per-copy third-moment bound and the fourth-moment bound both grow linearly with m m m , as the exact mana does. For the strange state the per-copy bound is exact for every m m m .
Direct estimation of discrete Wigner moments from few copies
All the results established so far rely on a few low-order moments of the DW. Their practical applicability therefore depends on how efficiently these moments can be measured. A natural route uses single-copy randomized measurements, and we study it numerically in Sec. II D. Here we show that a few copies of the state, measured jointly, give each moment directly, in the spirit of the multicopy estimation of nonlinear functionals [[40 ] ] and of Bell-sampling tests for stabilizer states [[41 ] ]. In particular, we demonstrate that each rescaled discrete Wigner moment whose order is not a multiple of d d d can be expressed as the expectation value of a fixed Hermitian observable with outcomes ± 1 \pm1 ± 1 , enabling direct estimation without reconstructing the full DWF.
Multicopy observable
Consider k k k copies of an n n n -qudit system, with computational basis states denoted by ∣ x 1 , … , x k ⟩ |x_1,\ldots,x_k\rangle ∣ x 1 , … , x k ⟩ with x j ∈ Z d n x_j \in\mathbb{Z}_d^n x j ∈ Z d n . We define s = x 1 + ⋯ + x k \mathbf{s} = \mathbf{x}_1 + \cdots+ \mathbf{x}_k s = x 1 + ⋯ + x k with addition performed modulo d d d .
Proposition 1. Let k ≥ 2 k \ge2 k ≥ 2 be an integer that is not a multiple of d d d , and let k − 1 k^{-1} k − 1 be its inverse in Z d \mathbb{Z}_d Z d . Define the operator R k R_k R k on k k k copies by
R k ∣ x 1 , … , x k ⟩ = ∣ 2 k − 1 s − x 1 , … , 2 k − 1 s − x k ⟩ . (33) R_k |x_1,\ldots,x_k\rangle= |2k^{-1}\mathbf{s} - x_1,\ldots,2k^{-1}\mathbf{s} - x_k\rangle. \tag*{(33)} R k ∣ x 1 , … , x k ⟩ = ∣2 k − 1 s − x 1 , … , 2 k − 1 s − x k ⟩ . (33)
Then R k R_k R k is a permutation of the computational basis, it is Hermitian and unitary with R k 2 = I R_k^2 = \mathbb{I} R k 2 = I , and for every state ρ \rho ρ
D k − 1 w k = Tr [ ρ ⊗ k R k ] . (34) D^{k-1} w_k = \operatorname{Tr}[\rho^{\otimes k}R_k]. \tag*{(34)} D k − 1 w k = Tr [ ρ ⊗ k R k ] . (34)
For a detailed proof see Methods IV B 1. For k = 2 k = 2 k = 2 , Eq. (33) is the swap operator and Eq. (34) is the familiar swap test for the purity, in agreement with Eq. (7) . The operator R k R_k R k acts independently on each of the n n n qudit positions, so it is a tensor product of n n n identical operators, each acting on k k k qudits. The measurement circuit is given in Methods, Sec. IV B 2.
For fixed k , d k,d k , d , the Clifford transformation in Methods converts R k R_k R k to a product of local parity operators. Each round prepares k k k copies, applies this transformation across corresponding qudits, measures local parity, and multiplies the outcomes. The product is r = ± 1 r = \pm1 r = ± 1 with mean D k − 1 w k D^{k-1}w_k D k − 1 w k . The Clifford preprocessing has depth independent of n n n under parallel inter-copy connectivity. Local parity readout is an additional measurement primitive, whose basis and resource assumptions are specified in Methods; it is not automatically a Clifford-only computational-basis readout.
Sample complexity
Each round of the multicopy protocol returns a binary outcome r = ± 1 r=\pm1 r = ± 1 whose expectation value is the rescaled Wigner moment of interest, provided that the moment order k k k is not divisible by the local dimension d d d . We now determine the number of measurement rounds required to estimate this expectation value to a prescribed accuracy and confidence. Since the measurement outcomes are bounded independently of the Hilbert-space dimension, the resulting sample complexity is independent of the number of qudits. The analysis follows from Hoeffding’s inequality [42 ] , stated as Lemma 3 in Methods IV C.
Applied to the outcomes of Sec. IV B 2, whose mean is D k − 1 w k D^{k-1}w_k D k − 1 w k by Eq. (72) , the concentration inequality, combined with Theorems 2, 4 and 5 , yields the following result.
Corollary 1. (i) Measuring a single moment. Let k ≥ 2 k \ge2 k ≥ 2 be an integer not divisible by d d d . The average of r r r over M M M independent measurement rounds estimates D k − 1 w k D^{k-1}w_k D k − 1 w k to within additive error η \eta η with confidence at least 1 − δ 1-\delta 1 − δ when
M ≥ 2 η 2 ln 2 δ . (35) M \ge\frac{2}{\eta^2}\ln\frac{2}{\delta}. \tag*{(35)} M ≥ η 2 2 ln δ 2 . (35) This requires k M kM k M copies of ρ \rho ρ and is independent of the number of qudits n n n and the local dimension d d d .
(ii) Detection. For d ≥ 5 d \ge5 d ≥ 5 , estimate P P P from two-copy rounds and b b b from three-copy rounds, ⌈ ( 18 / ϵ 2 ) ln ( 4 / δ ) ⌉ \lceil(18/\epsilon^2) \ln(4/\delta) \rceil ⌈( 18/ ϵ 2 ) ln ( 4/ δ )⌉ rounds each, clip the estimate P ^ \widehat{P} P to [ 0 , 1 ] [0,1] [ 0 , 1 ] , and set G ^ = P ^ 2 − b ^ \widehat{G}=\widehat{P}^{2}-\widehat{b} G = P 2 − b . This uses
N = 5 ⌈ 18 ϵ 2 ln 4 δ ⌉ (36) N = 5\left\lceil\frac{18}{\epsilon^2}\ln\frac{4}{\delta}\right\rceil \tag*{(36)} N = 5 ⌈ ϵ 2 18 ln δ 4 ⌉ (36)
copies of ρ \rho ρ , independently of the number of qudits, and
Pr ( ∣ G ^ − G ∣ > ϵ ) ≤ δ . (37) \Pr\left(\lvert\widehat{G}-G\rvert>\epsilon\right)\le\delta. \tag*{(37)} Pr ( ∣ G − G ∣ > ϵ ) ≤ δ . (37)
Declaring the state magic whenever G ^ > ϵ \widehat{G}>\epsilon G > ϵ is therefore incorrect with probability at most δ \delta δ , and a state with G > 2 ϵ G>2\epsilon G > 2 ϵ is detected with probability at least 1 − δ 1-\delta 1 − δ .
(iii) Quantifier from ( w 2 , w 3 ) (w_2,w_3) ( w 2 , w 3 ) . For d ≥ 5 d \ge5 d ≥ 5 , estimate P P P and b b b from M = ⌈ ( 2 / η 2 ) ln ( 4 / δ ) ⌉ M=\lceil(2/\eta^2)\ln(4/\delta)\rceil M = ⌈( 2/ η 2 ) ln ( 4/ δ )⌉ rounds each, which uses 5 M 5M 5 M copies of ρ \rho ρ , and set b + = b ^ + η b_+=\widehat{b}+\eta b + = b + η and P = max { 0 , P ^ − η , − b + } P=\max\{0,\widehat{P}-\eta,-b_+\} P = max { 0 , P − η , − b + } . Then, with probability at least 1 − δ 1-\delta 1 − δ ,
N ( ρ ) ≥ P 2 − b + 1 + 2 P + b + . (38) \mathcal{N}(\rho)\ge\frac{P^2-b_+}{1+2P+b_+}. \tag*{(38)} N ( ρ ) ≥ 1 + 2 P + b + P 2 − b + . (38)
(iv) Quantifier from ( w 2 , w 4 ) (w_2,w_4) ( w 2 , w 4 ) . For every odd prime d d d , estimate P P P and c c c from M = ⌈ ( 2 / η 2 ) ln ( 4 / δ ) ⌉ M=\lceil(2/\eta^2)\ln(4/\delta)\rceil M = ⌈( 2/ η 2 ) ln ( 4/ δ )⌉ rounds each, which uses 6 M 6M 6 M copies of ρ \rho ρ , and set c + = c ^ + η c_+=\widehat{c}+\eta c + = c + η . If c + > 0 c_+>0 c + > 0 , then, with probability at least 1 − δ 1-\delta 1 − δ ,
N ( ρ ) ≥ 1 2 [ max { 0 , P ^ − η } 3 c + − 1 ] , (39) \mathcal{N}(\rho)\ge\frac{1}{2}\left[\sqrt{\frac{\max\{0,\widehat{P}-\eta\}^3}{c_+}-1}\right], \tag*{(39)} N ( ρ ) ≥ 2 1 c + max { 0 , P − η } 3 − 1 , (39)
or equivalently ∥ W ρ ∥ 1 ≥ max { 0 , P ^ − η } 3 / c + \lVert W_\rho\rVert_1\ge\sqrt{\max\{0,\widehat{P}-\eta\}^3/c_+} ∥ W ρ ∥ 1 ≥ max { 0 , P − η } 3 / c + .
The proof is provided in Methods IV C 1. The rescaled moments P P P , b b b and c c c defined in Eq. (9) are exactly the quantities measured by this protocol for k = 2 , 3 , 4 k=2,3,4 k = 2 , 3 , 4 . These moments directly determine the magic-detection and quantification criteria established in Sec. II B. To see how the corollary translates into an operational certificate, consider the criterion P 2 − b > 0 P^2-b>0 P 2 − b > 0 . The estimates of P P P and b b b are each accurate to ϵ / 3 \epsilon/3 ϵ /3 with failure probability δ / 2 \delta/2 δ /2 . Clipping P ^ \widehat{P} P to the interval [ 0 , 1 ] [0,1] [ 0 , 1 ] in which P P P must lie can only reduce its error, and then ∣ P ^ + P ∣ ≤ 2 \lvert\widehat{P}+P\rvert\le2 ∣ P + P ∣ ≤ 2 , so the error of P ^ \widehat{P} P enters the witness at most twice and that of b ^ \widehat{b} b once. By the union bound the witness is therefore accurate to ϵ \epsilon ϵ with probability at least 1 − δ 1-\delta 1 − δ , which gives Eqs. (36) and (37) .
For a pure magic state, the violation is 1 − D 2 w 3 1-D^2w_3 1 − D 2 w 3 . Whenever this violation remains bounded away from zero, magic can be certified with a number of copies independent of the system size.
The detailed error-propagation analysis, including general individual accuracies, failure probabilities, and the union bound, is provided in Methods IV C 1.
The certified bounds of Theorems 4 and 5 are handled in parts (iii) and (iv), by inserting the lower or upper endpoints of the corresponding confidence intervals where they make the bounds smaller, namely the upper endpoints for b b b and c c c and the lower endpoint for P P P . Since P + b ≥ 0 P+b\ge0 P + b ≥ 0 by Eq. (10) , in part (iii) the lower endpoint for P P P is replaced by − b + -b_+ − b + whenever it lies below it, which keeps the ( w 2 , w 3 ) (w_2,w_3) ( w 2 , w 3 ) quantifier valid. The same holds for any one-sided confidence intervals P ≥ P − P\ge P_- P ≥ P − , b ≤ b + b\le b_+ b ≤ b + and c ≤ c + c\le c_+ c ≤ c + that are valid together with probability at least 1 − δ 1-\delta 1 − δ , such as those obtained from the classical-shadow estimates of Sec. II D, with P ^ − η \widehat{P}-\eta P − η , b ^ + η \widehat{b}+\eta b + η and c ^ + η \widehat{c}+\eta c + η replaced by P − P_- P − , b + b_+ b + and c + c_+ c + . Since part (iv) uses only P P P and c c c , which have binary mult comes r = ± 1 r=\pm1 r = ± 1 are drawn with the exact mean of Eq. (72) . The estimation error exhibits nearly identical scaling with the number of measurement rounds for systems ranging from one to twenty qudits, consistent with the dimension-independent sample-complexity bound predicted by Corollary 1.
Figure 5. Mean absolute error of the estimate of D 2 w 3 D^2w_3 D 2 w 3 from M M M rounds of the three-copy protocol of Sec. IV B 2 for ∣ ψ 4 ⟩ ⊗ n |\psi_4\rangle^{\otimes n} ∣ ψ 4 ⟩ ⊗ n with d = 5 d=5 d = 5 , averaged over 4000 repetitions, for n = 1 n=1 n = 1 (magenta circles), n = 2 n=2 n = 2 (blue squares), n = 5 n=5 n = 5 (purple triangles) and n = 20 n=20 n = 20 (green diamonds). The black dashed line is the large-M M M value for an unbiased ± 1 \pm1 ± 1 variable of zero mean, which is the worst case.
Remark 1. When k k k is a multiple of d d d , the condition in Eq. (68) admits D D D solutions for s = 0 \mathbf{s}=0 s = 0 and none otherwise. In this case, the rescaled moment can be expressed as D k − 1 w k = D Tr [ ρ ⊗ k O k ] D^{k-1}w_k=D\operatorname{Tr}[\rho^{\otimes k}O_k] D k − 1 w k = D Tr [ ρ ⊗ k O k ] with an observable O k O_k O k of eigenvalues ± 1 \pm1 ± 1 and 0 0 0 . The variance of the resulting estimate is at most D 2 Tr [ ρ ⊗ k O k 2 ] D^2\operatorname{Tr}[\rho^{\otimes k}O_k^2] D 2 Tr [ ρ ⊗ k O k 2 ] per round.
The operator ∑ u A u ⊗ k \sum_{\mathbf{u}}A_{\mathbf{u}}^{\otimes k} ∑ u A u ⊗ k commutes with U ⊗ k U^{\otimes k} U ⊗ k for every Clifford unitary U U U , so this quantity is the same for all stabilizer states, and for them it grows linearly with D D D . For other states, however, it can be considerably smaller, as illustrated by the tensor-product strange states considered in Sec. II D.
This distinction is particularly relevant for estimating the third Wigner moment in qutrit systems, where d = k = 3 d=k=3 d = k = 3 . For d = 3 d=3 d = 3 , we therefore recommend the pair ( w 2 , w 4 ) (w_2,w_4) ( w 2 , w 4 ) , for which Proposition 1 holds and Theorem 5 provides both the detection criterion and the bound. For the noisy strange state, the criterion w 3 2 > w 4 w_3^2>w_4 w 3 2 > w 4 detects negativity for all p > 1 / 4 p>1/4 p > 1/4 , exactly as w 2 2 > w 3 w_2^2>w_3 w 2 2 > w 3 does.
Numerical simulation: estimating the moments in practice
The multicopy protocol of Sec. II C provides direct access to discrete Wigner moments through joint measurements on a few copies of the state. Many current platforms, however, can only measure one copy at a time. For them the standard tool for nonlinear functions of a state is the randomized measurement [44 , 45 , 46 ] , and its most flexible form is the classical shadow [43 ] . In this section, we develop unbiased classical-shadow estimators of discrete Wigner moments, investigate their performance for the noisy strange state, and compare their measurement costs with those of conventional quantum state tomography. The classical-shadow construction is given in Methods IV D.
A single qutrit
We first estimate the moments of the noisy strange state ρ 1 = p ∣ ψ 1 ⟩ ⟨ ψ 1 ∣ + ( 1 − p ) I 3 / 3 \rho_1=p|\psi_1\rangle\langle\psi_1|+(1-p)\mathbb{I}_3/3 ρ 1 = p ∣ ψ 1 ⟩ ⟨ ψ 1 ∣ + ( 1 − p ) I 3 /3 of Sec. II A. Figure 6 (a) shows the estimated violation w 2 2 − w 3 w_2^2-w_3 w 2 2 − w 3 over 200 repetitions for N = 10 3 N=10^3 N = 1 0 3 and N = 10 4 N=10^4 N = 1 0 4 snapshots. The estimates follow the exact curve w 2 2 − w 3 = p 2 ( p + 2 ) ( 4 p − 1 ) / 81 w_2^2-w_3=p^2(p+2)(4p-1)/81 w 2 2 − w 3 = p 2 ( p + 2 ) ( 4 p − 1 ) /81 at every p p p , with no visible bias. For N = 10 4 N=10^4 N = 1 0 4 , the estimated violation exceeds three standard deviations for all p ≥ 0.35 p\geq0.35 p ≥ 0.35 , demonstrating reliable magic detection even in the presence of substantial noise.
Figure 6. Classical-shadow estimation for the noisy strange state ρ 1 \rho_1 ρ 1 . (a) Estimated violation w 2 − w 3 w_2-w_3 w 2 − w 3 for N = 10 3 N=10^3 N = 1 0 3 (green squares) and N = 10 4 N=10^4 N = 1 0 4 (blue circles) snapshots, mean and standard deviation over 200 repetitions, with the exact curve (black line). (b) Standard deviation of the estimated violation as a function of the number of snapshots for p = 0.6 p=0.6 p = 0.6 (green circles), p = 0.8 p=0.8 p = 0.8 (blue squares) and p = 1 p=1 p = 1 (magenta triangles). The black dashed line is proportional to N − 1 / 2 N^{-1/2} N − 1/2 . (c) Certified lower bounds on the sum negativity from Theorems 4 and 5 , estimated from N = 10 4 N=10^4 N = 1 0 4 snapshots, the ( w 2 , w 3 ) (w_2,w_3) ( w 2 , w 3 ) bound as magenta squares and the ( w 2 , w 4 ) (w_2,w_4) ( w 2 , w 4 ) bound as blue triangles. The magenta dashed and blue dash-dotted lines are the exact bounds, and the black line is the exact sum negativity.
Figure 6 (b) shows the estimator’s standard deviation on the number of snapshots N N N for three representative magic states. The standard deviation decreases as N − 1 / 2 N^{-1/2} N − 1/2 , consistent with the expected scaling of a nondegenerate U-statistic. Interestingly, for the maximally mixed state (p = 0 p=0 p = 0 ), which is not shown in the figure, a faster scaling of N − 1 N^{-1} N − 1 is observed. This behavior arises because the leading statistical fluctuations of a U-statistic are determined by the snapshot-to-snapshot variation of the overlap ∑ u W ^ i ( u ) W ρ ( u ) \sum_{\mathbf{u}}\widehat{W}_i(\mathbf{u})W_{\rho}(\mathbf{u}) ∑ u W i ( u ) W ρ ( u ) . A flat Wigner function makes this overlap the same for every snapshot, so only the next-order term survives.
Figure 6 (c) presents the lower bounds on the sum negativity obtained from the estimated moments using Theorems 4 and 5 , with N = 10 4 N=10^4 N = 1 0 4 snapshots. On average the estimated certificates reproduce the exact bounds. Single estimates fluctuate around them, so a rigorous certificate uses the lower end of a confidence interval, as described in Sec. II C 2. This behaviour should be contrasted with a naïve plug-in estimate of the negativity itself, ∑ u ∣ W ‾ ( u ) ∣ \sum_{\mathbf{u}}|\overline{W}(\mathbf{u})| ∑ u ∣ W ( u ) ∣ with W ‾ \overline{W} W the averaged snapshot. The absolute value turns statistical noise around zero into apparent negativity, so this estimate is biased upward. With 10 3 10^3 1 0 3 snapshots it reports ∥ W ∥ 1 ≈ 1.002 \|W\|_1\approx1.002 ∥ W ∥ 1 ≈ 1.002 at p = 0.2 p=0.2 p = 0.2 , where the Wigner function is manifestly nonnegative. The moment-based certificates avoid this problem because they are built from unbiased estimates of smooth quantities.
Comparison with state tomography
The obvious alternative to estimating the moments is to reconstruct the state and compute the moments from the reconstruction. To compare these approaches, we consider a register of n n n noisy strange states, ρ = ρ 1 ⊗ n \rho=\rho_1^{\otimes n} ρ = ρ 1 ⊗ n with p = 0.9 p=0.9 p = 0.9 , for n = 1 , 2 , 3 , 4 n=1,2,3,4 n = 1 , 2 , 3 , 4 , corresponding to Hilbert-space dimensions D = 3 , 9 , 27 , 81 D=3,9,27,81 D = 3 , 9 , 27 , 81 . Such a register is what a magic state factory delivers, and its rescaled violation V = D 2 ( w 2 2 − w 3 ) = P 2 − b V=D^2(w_2^2-w_3)=P^2-b V = D 2 ( w 2 2 − w 3 ) = P 2 − b is of order unity for every n n n . We estimate V V V in four ways and count the total number of copies N N N used by each.
Standard state tomography. Each qutrit is measured in one of its four mutually unbiased bases [47 ] , all 4 n 4^n 4 n settings are used equally often, and the state is reconstructed by linear inversion. The reconstruction is projected onto the set of density matrices [48 ] , and V V V is computed from its DWF.
The multicopy protocol of Sec. II C, with two-copy rounds for P P P and three-copy rounds for b b b . For qutrits the three-copy observable has the eigenvalues ± 1 \pm1 ± 1 and 0 (Remark 1). Its variance, and hence the error, is computed exactly for this state, with the copies split optimally between the two kinds of rounds.
Figure 7(a) shows the root-mean-square error of each estimate for three qutrits. The three moment-based estimates converge essentially as N − 1 / 2 N^{-1/2} N − 1/2 . Tomography converges more slowly, because its error is dominated by a systematic bias rather than by fluctuations. The reconstruction has D 2 D^2 D 2 noisy parameters, and the projection onto physical states pulls the reconstructed discrete Wigner function towards zero, so the violation is underestimated until the noise per parameter becomes small. The bias shrinks only as the number of copies per parameter grows.
Figure 7(b) shows the number of copies needed to reach an error of 0.05, a precision that resolves V V V for every n n n considered. For a single qutrit tomography is the cheapest method, which is not surprising, since a qutrit has only eight real parameters. From two qutrits onward the picture changes. The cost of tomography grows from about 10 3 10^3 1 0 3 copies at D = 3 D=3 D = 3 to about 2 × 10 5 2 \times10^5 2 × 1 0 5 at D = 81 D=81 D = 81 , roughly as D 1.6 D^{1.6} D 1.6 . The cost of global shadows stays between 3.5 × 10 3 3.5 \times10^3 3.5 × 1 0 3 and 6 × 10 3 6 \times10^3 6 × 1 0 3 over the whole range. Local shadows grow slowly, and at D = 81 D=81 D = 81 they need about nine times fewer copies than tomography. The multicopy protocol needs between 0.9 × 10 3 0.9 \times10^3 0.9 × 1 0 3 and 1.8 × 10 3 1.8 \times10^3 1.8 × 1 0 3 copies, and its cost even decreases with n n n for this state, because the variance of the three-copy observable shrinks for a register of strange states.
These numbers must be read with the right caveats. Global random unitaries generally require deeper circuits as the number of qudits increases, whereas local random unitaries are considerably easier to implement. Moreover, the variance of the global-shadow estimator contains a contribution of order D 2 / N 2 D^2/N^2 D 2 / N 2 , which is negligible for the dimensions considered here but can become significant for larger systems, requiring N ≳ D N \gtrsim D N ≳ D to suppress this contribution. For qutrits the three-copy observable is not a ± 1 \pm1 ± 1 variable, and for some states, stabilizer states among them, its variance grows linearly with D D D (Remark 1). In contrast, for odd prime dimensions d ≥ 5 d \ge5 d ≥ 5 , all Wigner moments up to fourth order admit dimension-independent multicopy measurements, for which Corollary 1 guarantees dimension-independent sample complexity at fixed additive precision, whereas a direct estimate of every phase-space value of the Wigner function needs a number of copies that grows as D 2 D^2 D 2 (see Supplementary Information, Comparison with direct Wigner tomography). Furthermore, the estimators involve classical post-processing over D 2 D^2 D 2 phase-space points, introducing additional computational costs. Despite these limitations, our numerical results demonstrate that estimating low-order Wigner moments can require substantially fewer copies than full state tomography for magic certification, with the advantage increasing with system size over the range investigated.
Application: certified cost of classical simulation
Stabilizer circuits with nonnegative DWF representations admit efficient classical simulation [2 , 11 , 12 ] , whereas magic states provide the additional resources required for universal quantum computation [3 ] . DWF negativity thus connects these resources to the cost of classical simulation: quasiprobability methods incur a sampling overhead that grows with the negativity [39 ] . Our resource bounds constrain this overhead. In particular, for Clifford evolution and computational-basis measurement with m m m copies of a resource state ρ m \rho_m ρ m and stabilizer states on the remaining inputs, the signed estimator defined in Methods, Sec. IV E, admits the sufficient Hoeffding sampling prescription
Figure 7. Cost of estimating the rescaled violation V = D 2 ( w 2 2 − w 3 ) V = D^2(w_2^2-w_3) V = D 2 ( w 2 2 − w 3 ) for a register of n n n noisy strange states with p = 0.9 p = 0.9 p = 0.9 . Blue circles show global shadows, purple squares local shadows, magenta diamonds state tomography, and the green dashed line (triangles) the multicopy protocol of Sec. II C. (a) Root-mean-square error as a function of the total number of copies for three qutrits (D = 27 D = 27 D = 27 ), over the range of N N N simulated for all methods. The grey dotted line marks the target error 0.05. (b) Number of copies needed to reach the error 0.05, as a function of the dimension D = 3 n D = 3^n D = 3 n , interpolated from the simulated data. The lighter square for local shadows at D = 81 D = 81 D = 81 is extrapolated from the last two simulated points. The multicopy values follow from the exact variances of the outcomes.
s H ( ϵ , δ ) = 2 ϵ 2 ∥ W ρ m ∥ 1 2 m ln 2 δ , (40) s_{\mathrm{H}}(\epsilon,\delta)=\frac{2}{\epsilon^2}\lVert W_{\rho_m}\rVert_1^{2m}\ln\frac{2}{\delta}, \tag*{(40)} s H ( ϵ , δ ) = ϵ 2 2 ∥ W ρ m ∥ 1 2 m ln δ 2 , (40)
where ϵ \epsilon ϵ is the target additive accuracy and 1 − δ 1-\delta 1 − δ is the confidence level.
Certified sample count
Evaluating Eq. (116) generally requires knowledge of the complete Wigner function of ρ m \rho_m ρ m . The moment-based bounds derived in Sec. II B provide a way to certify the corresponding sampling overhead without reconstructing the distribution.
Corollary 2. Let L ( ρ m ) L(\rho_m) L ( ρ m ) be the larger of the two certified values of ∥ W ρ m ∥ 1 \lVert W_{\rho_m}\rVert_1 ∥ W ρ m ∥ 1 , i.e.,
L ≡ max { 1 + 2 ( P 2 − b ) 1 + 2 P + b , P 3 c } , (41) L \equiv\max\left\{1+\frac{2(P^2-b)}{1+2P+b},\sqrt{\frac{P^3}{c}}\right\}, \tag*{(41)} L ≡ max { 1 + 1 + 2 P + b 2 ( P 2 − b ) , c P 3 } , (41) computed from the moments of a single copy of ρ m \rho_m ρ m . Then the number of samples in Eq. (116) obeys
s H ( ϵ , δ ) ≥ 2 ϵ 2 L 2 m ln 2 δ . (42) s_{\mathrm{H}}(\epsilon,\delta)\geq\frac{2}{\epsilon^2}L^{2m}\ln\frac{2}{\delta}. \tag*{(42)} s H ( ϵ , δ ) ≥ ϵ 2 2 L 2 m ln δ 2 . (42)
The statement follows from Theorems 4 and 5 and applies to both pure and mixed states. Noisy magic states are exactly what a real device supplies, and for them Theorem 1 no longer applies, but Corollary 2 still does. Second, the low-order moments of a single resource state determine a certified exponential growth rate for arbitrarily many copies. Thus, estimating only three moments from a few copies of the resource is sufficient to certify the scaling of the sample-count prescription. Importantly, this result concerns the sampling overhead associated with the specific quasiprobability estimator and its concentration bound, rather than a fundamental lower bound on the complexity of arbitrary classical simulation algorithms.
We illustrate Corollary 2 using the two magic states introduced in Sec. II A: the qutrit strange state and the state ∣ ψ 4 ⟩ \lvert\psi_4\rangle ∣ ψ 4 ⟩ in d = 5 d=5 d = 5 . For the strange state the bound of Theorem 4 is exact, so the certified value equals the true one, L = ∥ W 1 ∥ 1 = 5 / 3 L=\lVert W_1\rVert_1=5/3 L = ∥ W 1 ∥ 1 = 5/3 . For ∣ ψ 4 ⟩ \lvert\psi_4\rangle ∣ ψ 4 ⟩ the larger certificate comes from Theorem 5, L = 125 / 61 ≈ 1.43 L=\sqrt{125/61}\approx1.43 L = 125/61 ≈ 1.43 , against the exact value ∥ W ∥ 1 ≈ 1.79 \lVert W\rVert_1\approx1.79 ∥ W ∥ 1 ≈ 1.79 . Figure 8 shows the resulting sample counts as a function of the number m m m of injected copies, for ϵ = δ = 0.01 \epsilon=\delta=0.01 ϵ = δ = 0.01 . Both the exact and the certified counts grow exponentially, and the moments of a single copy certify the full rate for the strange state and 61% of it for ∣ ψ 4 ⟩ \lvert\psi_4\rangle ∣ ψ 4 ⟩ . For forty injected copies of ∣ ψ 4 ⟩ \lvert\psi_4\rangle ∣ ψ 4 ⟩ this is a certified count of more than 10 17 10^{17} 1 0 17 samples, obtained from two-copy and four-copy measurements on a single qutrit.
Figure 8. Number of samples s ( ϵ , δ ) s(\epsilon,\delta) s ( ϵ , δ ) needed by the quasiprobability estimator of Eq. (114) for m m m injected magic states, with ϵ = δ = 0.01 \epsilon=\delta=0.01 ϵ = δ = 0.01 . Solid lines use the exact ∥ W ∥ 1 \lVert W\rVert_1 ∥ W ∥ 1 and dashed lines with open symbols the certified value of Corollary 2, for the strange state (magenta, circles) and ∣ ψ 4 ⟩ \lvert\psi_4\rangle ∣ ψ 4 ⟩ (blue, squares). For the strange state the two lines coincide.
Discussion
Low-order moments of the DWF provide direct access to the operational detection and quantification of quantum magic without requiring full state reconstruction of individual phase-space values or optimization over the stabilizer polytope. For pure states of any number of odd-prime-dimensional qudits, a third moment inequality gives a necessary and sufficient criterion for nonstabilizerness. For mixed states, the elementary witness is sufficient but not necessary for Wigner negativity, and the Hankel hierarchy becomes complete for this particular property at a finite order. Beyond detection, we obtained complementary lower bounds on the sum negativity and mana from low-order moments, which further certify the sampling overhead of quasiprobability-based classical simulation with magic-state inputs.
Importantly, our framework provides an experimentally accessible route to magic certification through multicopy measurements implemented using Clifford circuits. For moments whose order is not a multiple of d d d , which includes all moments used here when d ≥ 5 d \ge5 d ≥ 5 and w 2 w_2 w 2 and w 4 w_4 w 4 when d = 3 d=3 d = 3 , the number of measurement rounds required to achieve a fixed additive precision is independent of the system size, in contrast with the exponentially growing cost of full state reconstruction. We further demonstrated the applicability of our approach to representative qutrit and ququint states, including noisy magic states, and investigated an alternative implementation using single-copy randomized measurements. Our results establish low-order Wigner moments as operational probes of nonstabilizer resources, connecting experimentally accessible measurements to magic quantification and the cost of classical simulation. More broadly, this approach provides a promising direction for resource certification in higher-dimensional quantum systems and scalable fault-tolerant quantum information processing.
Several open avenues for future research emerge from this work. The first concerns the information that the present bound leaves aside. Combining higher-order moments may yield tighter bounds and extend the framework to other magic measures, such as robustness of magic, and to the magic of channels. Secondly, extending the approach to qubits, where no Wigner representation is covariant under the full Clifford group, may require alternative phase-space representations or stabilizer Rényi entropies. Finally, on the experimental side, trapped-ion and superconducting qudit processors [49 , 50 ] , which support the operations required for multicopy measurements and classical-shadow protocols, provide promising platforms for experimental demonstrations of our magic-certification framework.
Methods
Proofs of the detection and quantification results
Proof of Lemma 1
We prove the properties one by one.
(i) Bound on the discrete Wigner function. The point operator at the origin is the parity operator, which reflects every computational basis state,
A 0 ∣ x ⟩ = ∣ − x ⟩ . (43) A_0\lvert x\rangle=\lvert-x\rangle. \tag*{(43)} A 0 ∣ x ⟩ = ∣ − x ⟩ . (43)
Applying the reflection twice gives the identity, so A 0 A_0 A 0 has eigenvalues ± 1 \pm1 ± 1 . Every other point operator is unitarily equivalent to A 0 A_0 A 0 by Eq. (3) and has the same eigenvalues. Hence
− I ≤ A u ≤ I ⟹ − 1 ≤ Tr [ A u ρ ] ≤ 1. (44) -\mathbb{I}\le A_{\mathbf{u}}\le\mathbb{I}\quad\Longrightarrow\quad-1\le\operatorname{Tr}[A_{\mathbf{u}}\rho]\le1. \tag*{(44)} − I ≤ A u ≤ I ⟹ − 1 ≤ Tr [ A u ρ ] ≤ 1. (44)
Dividing by D D D gives Eq. (6) .
(ii) The second moment. The point operators are orthogonal [10 ] ,
Tr [ A u A v ] = D δ u , v . (45) \operatorname{Tr}[A_{\mathbf{u}}A_{\mathbf{v}}]=D\delta_{\mathbf{u},\mathbf{v}}. \tag*{(45)} Tr [ A u A v ] = D δ u , v . (45)
There are D 2 D^2 D 2 of them, so they form a basis of the operator space. Expanding ρ \rho ρ in this basis and using Eq. (45) to read off the coefficients, we find that the coefficients are exactly the values of the DWF,
ρ = ∑ u W ρ ( u ) A u . (46) \rho=\sum_{\mathbf{u}}W_\rho(\mathbf{u})A_{\mathbf{u}}. \tag*{(46)} ρ = u ∑ W ρ ( u ) A u . (46)
Inserting Eq. (46) twice into the purity and using Eq. (45) once more,
Tr [ ρ 2 ] = ∑ u , v W ρ ( u ) W ρ ( v ) Tr [ A u A v ] = D ∑ u W ρ ( u ) 2 = D w 2 , (47) \begin{aligned}
\operatorname{Tr}[\rho^2]&=\sum_{\mathbf{u},\mathbf{v}}W_\rho(\mathbf{u})W_\rho(\mathbf{v})\operatorname{Tr}[A_{\mathbf{u}}A_{\mathbf{v}}]\\
&=D\sum_{\mathbf{u}}W_\rho(\mathbf{u})^2=Dw_2, \tag*{(47)}
\end{aligned} Tr [ ρ 2 ] = u , v ∑ W ρ ( u ) W ρ ( v ) Tr [ A u A v ] = D u ∑ W ρ ( u ) 2 = D w 2 , (47)
which is Eq. (7) .
(iii) Higher moments. We keep two factors of W ρ ( u ) W_\rho(\mathbf{u}) W ρ ( u ) and bound the remaining k − 2 k-2 k − 2 factors with Eq. (6) ,
∣ w k ∣ ≤ ∑ u ∣ W ρ ( u ) ∣ k − 2 W ρ ( u ) 2 ≤ 1 D k − 2 ∑ u W ρ ( u ) 2 = w 2 D k − 2 , (48) \begin{aligned}
|w_k|&\le\sum_{\mathbf{u}}|W_\rho(\mathbf{u})|^{k-2}W_\rho(\mathbf{u})^2\\
&\le\frac{1}{D^{k-2}}\sum_{\mathbf{u}}W_\rho(\mathbf{u})^2=\frac{w_2}{D^{k-2}}, \tag*{(48)}
\end{aligned} ∣ w k ∣ ≤ u ∑ ∣ W ρ ( u ) ∣ k − 2 W ρ ( u ) 2 ≤ D k − 2 1 u ∑ W ρ ( u ) 2 = D k − 2 w 2 , (48)
which is Eq. (8) .
Proof of Theorem 1
Throughout the proof, we denote W ψ W_\psi W ψ by W W W . Now, for a pure state Eq. (7) gives
w 2 = 1 D . (49) w_2 = \frac{1}{D}. \tag*{(49)} w 2 = D 1 . (49)
Each value of the DWF is at most 1 / D 1/D 1/ D by Eq. (6) , and each square W ( u ) 2 W(\mathbf{u})^2 W ( u ) 2 is nonnegative. Therefore
w 3 = ∑ u W ( u ) W ( u ) 2 ≤ 1 D ∑ u W ( u ) 2 = 1 D w 2 = 1 D 2 , (50) \begin{aligned}
w_3 &= \sum_{\mathbf{u}} W(\mathbf{u})W(\mathbf{u})^2 \\
&\leq\frac{1}{D}\sum_{\mathbf{u}}W(\mathbf{u})^2 = \frac{1}{D}w_2 = \frac{1}{D^2}, \tag*{(50)}
\end{aligned} w 3 = u ∑ W ( u ) W ( u ) 2 ≤ D 1 u ∑ W ( u ) 2 = D 1 w 2 = D 2 1 , (50)
which is Eq. (11) .
Next, the gap in Eq. (50) can be written as a sum over phase space,
1 D 2 − w 3 = ∑ u W ( u ) 2 [ 1 D − W ( u ) ] . (51) \frac{1}{D^2}-w_3=\sum_{\mathbf{u}}W(\mathbf{u})^2\left[\frac{1}{D}-W(\mathbf{u})\right]. \tag*{(51)} D 2 1 − w 3 = u ∑ W ( u ) 2 [ D 1 − W ( u ) ] . (51)
Every term on the right is nonnegative. The sum vanishes only if every term vanishes, that is, only if at each point
W ( u ) = 0 or W ( u ) = 1 D . (52) W(\mathbf{u})=0 \qquad\text{or} \qquad W(\mathbf{u})=\frac{1}{D}. \tag*{(52)} W ( u ) = 0 or W ( u ) = D 1 . (52)
Such a DWF has no negative values. By the discrete Hudson theorem [10 ] , a pure state with a nonnegative DWF is a stabilizer state.
The DWF of a pure stabilizer state equals 1 / D 1/D 1/ D on exactly D D D points of phase space and vanishes elsewhere [10 ] . Hence
w 3 = D ⋅ 1 D 3 = 1 D 2 . (53) w_3=D\cdot\frac{1}{D^3}=\frac{1}{D^2}. \tag*{(53)} w 3 = D ⋅ D 3 1 = D 2 1 . (53)
Combining Eq. (49)
w 2 2 − w 3 = 1 − D 2 w 3 D 2 . (54) w_2^2-w_3=\frac{1-D^2w_3}{D^2}. \tag*{(54)} w 2 2 − w 3 = D 2 1 − D 2 w 3 . (54)
which is negative exactly when D 2 w 3 > 1 D^2w_3>1 D 2 w 3 > 1 , that is, exactly when ∣ ψ ⟩ |\psi\rangle ∣ ψ ⟩ is not a stabilizer state.
Proof of Theorem 2
Let us assume that the DWF, W ρ ( u ) ≡ W W_\rho(\mathbf{u})\equiv W W ρ ( u ) ≡ W is non-negative. Since W ≥ 0 W\geq0 W ≥ 0 , we may take square roots, and W 2 = W 1 2 ⋅ W 3 2 W^2=W^{\frac{1}{2}}\cdot W^{\frac{3}{2}} W 2 = W 2 1 ⋅ W 2 3 . We apply the Cauchy-Schwarz inequality,
w 2 2 = ( ∑ u W 1 2 ⋅ W 3 2 ) 2 ≤ ( ∑ u W ) ( ∑ u W 3 ) = w 3 . (55) \begin{aligned}
w_2^2&=\left(\sum_{\mathbf{u}}W^{\frac{1}{2}}\cdot W^{\frac{3}{2}}\right)^2\\
&\leq\left(\sum_{\mathbf{u}}W\right)\left(\sum_{\mathbf{u}}W^3\right)=w_3. \tag*{(55)}
\end{aligned} w 2 2 = ( u ∑ W 2 1 ⋅ W 2 3 ) 2 ≤ ( u ∑ W ) ( u ∑ W 3 ) = w 3 . (55)
This completes the proof.
Proof of lemma 2
Let STAB denote the set of stabilizer states in an odd prime or prime-power dimension. Now, consider a mixed stabilizer state ρ = ∑ j p j ∣ S j ⟩ ⟨ S j ∣ ∈ S T A B \rho=\sum_jp_j|S_j\rangle\langle S_j|\in\mathrm{STAB} ρ = ∑ j p j ∣ S j ⟩ ⟨ S j ∣ ∈ STAB , with p j ≥ 0 p_j\geq0 p j ≥ 0 , and ∑ j p j = 1 \sum_jp_j=1 ∑ j p j = 1 . By linearity of the DWF representation,
W ρ ( u ) = 1 d Tr [ A u ρ ] = 1 d Tr [ A u ∑ j p j ∣ S j ⟩ ⟨ S j ∣ ] = ∑ j p j 1 d Tr [ A u ∣ S j ⟩ ⟨ S j ∣ ] = ∑ j p j W ∣ S j ⟩ ⟨ S j ∣ ( u ) . (56) \begin{aligned}
W_\rho(\mathbf{u})&=\frac{1}{d}\operatorname{Tr}[A_{\mathbf{u}}\rho]\\
&=\frac{1}{d}\operatorname{Tr}\left[A_{\mathbf{u}}\sum_jp_j|S_j\rangle\langle S_j|\right]\\
&=\sum_jp_j\frac{1}{d}\operatorname{Tr}[A_{\mathbf{u}}|S_j\rangle\langle S_j|]\\
&=\sum_jp_jW_{|S_j\rangle\langle S_j|}(\mathbf{u}). \tag*{(56)}
\end{aligned} W ρ ( u ) = d 1 Tr [ A u ρ ] = d 1 Tr [ A u j ∑ p j ∣ S j ⟩ ⟨ S j ∣ ] = j ∑ p j d 1 Tr [ A u ∣ S j ⟩ ⟨ S j ∣ ] = j ∑ p j W ∣ S j ⟩ ⟨ S j ∣ ( u ) . (56)
Since every ∣ S j ⟩ ∈ S T A B |S_j\rangle\in\mathrm{STAB} ∣ S j ⟩ ∈ STAB has a non-negative DWF, W ∣ S j ⟩ ⟨ S j ∣ ( u ) ≥ 0 W_{|S_j\rangle\langle S_j|}(\mathbf{u})\geq0 W ∣ S j ⟩ ⟨ S j ∣ ( u ) ≥ 0 , ∀ j , u \forall j,\mathbf{u} ∀ j , u , and p j ≥ 0 p_j\geq0 p j ≥ 0 , we immediately obtain
W ρ ( u ) = ∑ j p j W ρ j ( u ) ≥ 0 , ∀ u ∈ Z d × Z d . W_\rho(\mathbf{u})=\sum_jp_jW_{\rho_j}(\mathbf{u})\geq0,\qquad\forall\mathbf{u}\in\mathbb{Z}_d\times\mathbb{Z}_d. W ρ ( u ) = j ∑ p j W ρ j ( u ) ≥ 0 , ∀ u ∈ Z d × Z d .
Hence, any mixed stabilizer states also possesses a non-negative DWF. However, its converse is not always true [10 ] . Combined with Theorem 2, this shows that every mixed stabilizer state satisfies w 2 2 ≤ w 3 w_2^2\leq w_3 w 2 2 ≤ w 3 , so a violation of this inequality certifies magic also for mixed states.
Proof of Theorem 3
For any real vector c = ( c 0 , … , c m ) \mathbf{c}=(c_0,\ldots,c_m) c = ( c 0 , … , c m ) let f ( x ) = ∑ i c i x i f(x)=\sum_i c_ix^i f ( x ) = ∑ i c i x i . Then
c T H m c = ∑ i , j c i c j ∑ u W ( u ) i + j + 1 = ∑ u W ( u ) f ( W ( u ) ) 2 . (57) \begin{aligned}
\mathbf{c}^{T}H_m\mathbf{c}
&=\sum_{i,j}c_ic_j\sum_{\mathbf{u}}W(\mathbf{u})^{i+j+1}\\
&=\sum_{\mathbf{u}}W(\mathbf{u})f(W(\mathbf{u}))^2. \tag*{(57)}
\end{aligned} c T H m c = i , j ∑ c i c j u ∑ W ( u ) i + j + 1 = u ∑ W ( u ) f ( W ( u ) ) 2 . (57)
If W ≥ 0 W\geq0 W ≥ 0 every term is nonnegative, which proves the first claim. For the converse let t 1 , … , t r t_1,\ldots,t_r t 1 , … , t r be the distinct values of W W W , with t 1 < 0 t_1<0 t 1 < 0 , and choose f ( x ) = ∏ l = 2 r ( x − t l ) f(x)=\prod_{l=2}^{r}(x-t_l) f ( x ) = ∏ l = 2 r ( x − t l ) , a polynomial of degree $r-1. Then f f f vanishes at every value of W W W except t 1 t_1 t 1 , and Eq. (57) becomes μ 1 t 1 f ( t 1 ) 2 < 0 \mu_1t_1f(t_1)^2<0 μ 1 t 1 f ( t 1 ) 2 < 0 , where μ 1 ≥ 1 \mu_1\geq1 μ 1 ≥ 1 is the number of points at which W = t 1 W=t_1 W = t 1 .
Proof of Theorem 4
Theorem 2 follows from applying the Cauchy-Schwarz inequality to a probability distribution. Although a Wigner function with negative values is not a probability distribution, we apply the Cauchy-Schwarz inequality to the positive part only and bound the contributions from the negative part.
With this aim, we first split the DWF as W = W + − W − W=W_+-W_- W = W + − W − , where W + W_+ W + and W − W_- W − are nonnegative and are never both nonzero at the same point. The normalization condition gives,
∑ u W − = N , ∑ u W + = 1 + N . (58) \sum_{\mathbf{u}}W_-=\mathcal{N},\qquad\sum_{\mathbf{u}}W_+=1+\mathcal{N}. \tag*{(58)} u ∑ W − = N , u ∑ W + = 1 + N . (58)
Since the supports are disjoint, the moments split as
w 2 = ∑ u W + 2 + ∑ u W − 2 , w 3 = ∑ u W + 3 − ∑ u W − 3 . (59) w_2 = \sum_{\mathbf{u}} W_+^2 + \sum_{\mathbf{u}} W_-^2,\qquad w_3 = \sum_{\mathbf{u}} W_+^3 - \sum_{\mathbf{u}} W_-^3. \tag*{(59)} w 2 = u ∑ W + 2 + u ∑ W − 2 , w 3 = u ∑ W + 3 − u ∑ W − 3 . (59)
Since every value of W − W_- W − lies between 0 0 0 and 1 / D 1/D 1/ D as of Lemma 1, hence
∑ u W − 2 ≤ N D , ∑ u W − 3 ≤ N D 2 . (60) \sum_{\mathbf{u}} W_-^2 \le\frac{\mathcal{N}}{D},\qquad\sum_{\mathbf{u}} W_-^3 \le\frac{\mathcal{N}}{D^2}. \tag*{(60)} u ∑ W − 2 ≤ D N , u ∑ W − 3 ≤ D 2 N . (60)
Inserting this in Eq. (59) and multiplying by D D D and D 2 D^2 D 2 , respectively,
D ∑ u W + 2 ≥ P − N , D 2 ∑ u W + 3 ≤ b + N . (61) D\sum_{\mathbf{u}} W_+^2 \ge P-\mathcal{N},\qquad D^2\sum_{\mathbf{u}} W_+^3 \le b+\mathcal{N}. \tag*{(61)} D u ∑ W + 2 ≥ P − N , D 2 u ∑ W + 3 ≤ b + N . (61)
Further, applying the Cauchy-Schwarz inequality to the nonnegative distribution W + W_+ W + yields (total weight 1 + N 1+\mathcal{N} 1 + N ),
( ∑ u W + 2 ) 2 ≤ ( ∑ u W + ) ( ∑ u W + 3 ) = ( 1 + N ) ∑ u W + 3 . (62) \left(\sum_{\mathbf{u}} W_+^2\right)^2 \le\left(\sum_{\mathbf{u}} W_+\right)\left(\sum_{\mathbf{u}} W_+^3\right)=(1+\mathcal{N})\sum_{\mathbf{u}} W_+^3. \tag*{(62)} ( u ∑ W + 2 ) 2 ≤ ( u ∑ W + ) ( u ∑ W + 3 ) = ( 1 + N ) u ∑ W + 3 . (62)
Now, suppose first that N ≤ P \mathcal{N}\le P N ≤ P , so that the first bound in Eq. (61) is nonnegative and may be squared. Multiplying Eq. (62) by D 2 D^2 D 2 and using Eq. (61) on both sides,
( P − N ) 2 ≤ ( 1 + N ) ( b + N ) . (63) (P-\mathcal{N})^2\le(1+\mathcal{N})(b+\mathcal{N}). \tag*{(63)} ( P − N ) 2 ≤ ( 1 + N ) ( b + N ) . (63)
After simplification, we obtain,
P 2 − b ≤ N ( 1 + 2 P + b ) . (64) P^2-b\le\mathcal{N}(1+2P+b). \tag*{(64)} P 2 − b ≤ N ( 1 + 2 P + b ) . (64)
Lemma 1 gives b ≥ − P b\ge-P b ≥ − P , so the bracket is positive and Eq. (25) follows.
Now, if N > P \mathcal{N}>P N > P , the bound holds trivially, because its right-hand side never exceeds P P P ,
P − P 2 − b 1 + 2 P + b = ( 1 + P ) ( P + b ) 1 + 2 P + b ≥ 0. (65) P-\frac{P^2-b}{1+2P+b}=\frac{(1+P)(P+b)}{1+2P+b}\ge0. \tag*{(65)} P − 1 + 2 P + b P 2 − b = 1 + 2 P + b ( 1 + P ) ( P + b ) ≥ 0. (65)
Setting P = 1 P=1 P = 1 gives Eq. (26) .
Proof of Theorem 5
Splitting each term of w 2 w_2 w 2 as W 2 = ∣ W ∣ 2 / 3 ∣ W ∣ 4 / 3 W^2=|W|^{2/3}|W|^{4/3} W 2 = ∣ W ∣ 2/3 ∣ W ∣ 4/3 and applying Hölder’s inequality with conjugate exponents 3 / 2 3/2 3/2 and 3 3 3 , we obtain
w 2 = ∑ u ∣ W ∣ 2 / 3 ∣ W ∣ 4 / 3 ≤ ( ∑ u ∣ W ∣ ) 2 / 3 ( ∑ u W 4 ) 1 / 3 = ∥ W ∥ 1 2 / 3 w 4 1 / 3 . (66) \begin{aligned}
w_2&=\sum_{\mathbf{u}}|W|^{2/3}|W|^{4/3}\\
&\le\left(\sum_{\mathbf{u}}|W|\right)^{2/3}\left(\sum_{\mathbf{u}}W^4\right)^{1/3}
=\lVert W\rVert_1^{2/3}w_4^{1/3}. \tag*{(66)}
\end{aligned} w 2 = u ∑ ∣ W ∣ 2/3 ∣ W ∣ 4/3 ≤ ( u ∑ ∣ W ∣ ) 2/3 ( u ∑ W 4 ) 1/3 = ∥ W ∥ 1 2/3 w 4 1/3 . (66)
Raising both sides to the third power gives w 2 3 ≤ ∥ W ∥ 1 2 w 4 w_2^3\le\lVert W\rVert_1^2w_4 w 2 3 ≤ ∥ W ∥ 1 2 w 4 , which is Eq. (28) . Hölder’s inequality is an equality exactly when the two raised factors are proportional, that is, when ∣ W ∣ |W| ∣ W ∣ is proportional to W 4 W^4 W 4 on the support, which means ∣ W ∣ |W| ∣ W ∣ is constant there.
For product states, the Wigner moments factorize as w k ( ρ ⊗ σ ) = w k ( ρ ) w k ( σ ) w_k(\rho\otimes\sigma)=w_k(\rho)w_k(\sigma) w k ( ρ ⊗ σ ) = w k ( ρ ) w k ( σ ) , establishing the additivity of M 4 \mathcal{M}_4 M 4 . Its invariance under Clifford unitaries follows from the permutation covariance of the DWF [10 ] .
For a pure state w 2 = 1 / D w_2=1/D w 2 = 1/ D , and Lemma 1 gives w 4 ≤ 1 / D 3 w_4\le1/D^3 w 4 ≤ 1/ D 3 . Hence w 2 3 / w 4 ≥ 1 w_2^3/w_4\ge1 w 2 3 / w 4 ≥ 1 and M 4 ≥ 0 \mathcal{M}_4\ge0 M 4 ≥ 0 . Equality requires ∣ W ∣ = 1 / D |W|=1/D ∣ W ∣ = 1/ D on the support. The support then has D D D points, because w 2 = 1 / D w_2=1/D w 2 = 1/ D , and the condition ∑ W = 1 \sum W=1 ∑ W = 1 forces all of these values to be positive. The state is then a stabilizer state by the discrete Hudson theorem [10 ] .
Multicopy measurement methods
Proof of Proposition 1
From the definitions of T u T_{\mathbf{u}} T u , A 0 A_0 A 0 and Eq. (3) , the phase-space point operator at u = ( p , q ) \mathbf{u}=(\mathbf{p},\mathbf{q}) u = ( p , q ) acts as
A ( p , q ) ∣ x ⟩ = ω 2 p ⋅ ( q − x ) ∣ 2 q − x ⟩ . (67) A_{(\mathbf{p},\mathbf{q})}|x\rangle=\omega^{2\mathbf{p}\cdot(\mathbf{q}-x)}|2\mathbf{q}-x\rangle. \tag*{(67)} A ( p , q ) ∣ x ⟩ = ω 2 p ⋅ ( q − x ) ∣2 q − x ⟩ . (67)
Applying this to each of the k k k copies and summing over the phase space,
∑ p , q A ( p , q ) ⊗ k ∣ x 1 , … , x k ⟩ = ∑ q [ ∑ p ω 2 p ⋅ ( k q − s ) ] ∣ 2 q − x 1 , … , 2 q − x k ⟩ = D ∑ q δ k q , s ∣ 2 q − x 1 , … , 2 q − x k ⟩ . (68) \begin{aligned}
\sum_{\mathbf{p},\mathbf{q}}A_{(\mathbf{p},\mathbf{q})}^{\otimes k}|x_1,\ldots,x_k\rangle
&=\sum_{\mathbf{q}}\left[\sum_{\mathbf{p}}\omega^{2\mathbf{p}\cdot(k\mathbf{q}-s)}\right]|2\mathbf{q}-x_1,\ldots,2\mathbf{q}-x_k\rangle\\
&=D\sum_{\mathbf{q}}\delta_{k\mathbf{q},s}|2\mathbf{q}-x_1,\ldots,2\mathbf{q}-x_k\rangle. \tag*{(68)}
\end{aligned} p , q ∑ A ( p , q ) ⊗ k ∣ x 1 , … , x k ⟩ = q ∑ [ p ∑ ω 2 p ⋅ ( k q − s ) ] ∣2 q − x 1 , … , 2 q − x k ⟩ = D q ∑ δ k q , s ∣2 q − x 1 , … , 2 q − x k ⟩ . (68)
When k k k is invertible modulo d d d the only solution is q = k − 1 s \mathbf{q}=k^{-1}s q = k − 1 s , so that
∑ u A u ⊗ k = D R k . (69) \sum_{\mathbf{u}}A_{\mathbf{u}}^{\otimes k}=DR_k. \tag*{(69)} u ∑ A u ⊗ k = D R k . (69)
Then w k = D − k ∑ u Tr [ A u ρ ] k = D − k Tr [ ρ ⊗ k ∑ u A u ⊗ k ] w_k=D^{-k}\sum_{\mathbf{u}}\operatorname{Tr}[A_{\mathbf{u}}\rho]^k=D^{-k}\operatorname{Tr}[\rho^{\otimes k}\sum_{\mathbf{u}}A_{\mathbf{u}}^{\otimes k}] w k = D − k ∑ u Tr [ A u ρ ] k = D − k Tr [ ρ ⊗ k ∑ u A u ⊗ k ] gives Eq. (34) . The map in Eq. (33) preserves s s s , since the new sum is 2 s − s 2s-s 2 s − s . Applying it twice therefore returns x j x_j x j , so R k 2 = I R_k^2=I R k 2 = I , and a real permutation matrix that squares to the identity is symmetric.
Measurement circuit
The operator R k R_k R k is a linear map on the labels, so it is a Clifford operation and can be brought to a simple form. Let V k V_k V k be the Clifford unitary
V k ∣ x 1 , x 2 , … , x k ⟩ = ∣ s , x 2 − x 1 , … , x k − x 1 ⟩ . (70) V_k|x_1,x_2,\ldots,x_k\rangle=|s,x_2-x_1,\ldots,x_k-x_1\rangle. \tag*{(70)} V k ∣ x 1 , x 2 , … , x k ⟩ = ∣ s , x 2 − x 1 , … , x k − x 1 ⟩ . (70)
which is invertible because k k k is invertible modulo d d d , and which is built from two-qudit SUM gates and single-qudit multiplication gates acting on corresponding qudits of different copies. Equation (33) leaves s s s unchanged and flips the sign of every difference x j − x 1 x_j-x_1 x j − x 1 , so that
V k R k V k † = I ⊗ Π ⊗ ( k − 1 ) , (71) V_kR_kV_k^\dagger=I\otimes\Pi^{\otimes(k-1)}, \tag*{(71)} V k R k V k † = I ⊗ Π ⊗ ( k − 1 ) , (71)
where Π = A 0 \Pi= A_0 Π = A 0 is the parity operator of one n n n -qudit register. The protocol for one round is therefore as follows. Prepare k k k copies of ρ \rho ρ , apply V k V_k V k , measure the single-qudit parity on each qudit of the last k − 1 k-1 k − 1 registers, and multiply the outcomes. The product is a random variable r = ± 1 r = \pm1 r = ± 1 with mean
E [ r ] = D k − 1 w k . (72) \mathbb{E}[r] = D^{k-1}w_k. \tag*{(72)} E [ r ] = D k − 1 w k . (72)
The circuit has depth independent of n n n and uses only transversal gates between copies. Alternatively, since R k R_k R k is both unitary and Hermitian, its expectation value can be obtained from a Hadamard test with one control qubit.
Sample complexity of the moment-based criterion
Here, we state the concentration inequality used in Sec. II C 2 and provide the detailed sample-complexity analysis for the moment-based detection and quantification criteria introduced in Secs. II A and II B. We use the standard Hoeffding’s inequality [42 ] in the form required for our analysis.
Lemma 3 (Hoeffding). Let r 1 , … , r M r_1,\ldots,r_M r 1 , … , r M be independent random variables with values in [ − 1 , 1 ] [-1,1] [ − 1 , 1 ] and common mean μ \mu μ , and let r ˉ = 1 M ∑ i r i \bar{r} = \frac{1}{M}\sum_i r_i r ˉ = M 1 ∑ i r i . Then, for every ϵ > 0 \epsilon> 0 ϵ > 0 ,
Pr [ ∣ r ˉ − μ ∣ ≥ ϵ ] ≤ 2 e − M ϵ 2 / 2 . (73) \Pr\left[|\bar{r}-\mu|\geq\epsilon\right]\leq2e^{-M\epsilon^2/2}. \tag*{(73)} Pr [ ∣ r ˉ − μ ∣ ≥ ϵ ] ≤ 2 e − M ϵ 2 /2 . (73)
Now we prove each part of Corollary 1, one by one.
Proof of Corollary 1
Part (i). For the multicopy measurements defined in Sec. IV B 2, each round acts on fresh copies of ρ \rho ρ , so their outcomes are independent. Each outcome is ± 1 \pm1 ± 1 , and by Eq. (72) each has mean μ = D k − 1 w k \mu= D^{k-1}w_k μ = D k − 1 w k . Applying Lemma 3, the probability that the estimate differs from D k − 1 w k D^{k-1}w_k D k − 1 w k by η \eta η or more is bounded by
Pr [ ∣ 1 M ∑ i = 1 M r i − D k − 1 w k ∣ ≥ η ] ≤ 2 e − M η 2 / 2 . (74) \Pr\left[\left|\frac{1}{M}\sum_{i=1}^{M}r_i-D^{k-1}w_k\right|\geq\eta\right]\leq2e^{-M\eta^2/2}. \tag*{(74)} Pr [ M 1 i = 1 ∑ M r i − D k − 1 w k ≥ η ] ≤ 2 e − M η 2 /2 . (74)
This probability is at most δ \delta δ when
e − M η 2 / 2 ≤ δ 2 , that is, M η 2 2 ≥ ln 2 δ . (75) e^{-M\eta^2/2}\leq\frac{\delta}{2},\quad\text{that is,}\quad\frac{M\eta^2}{2}\geq\ln\frac{2}{\delta}. \tag*{(75)} e − M η 2 /2 ≤ 2 δ , that is, 2 M η 2 ≥ ln δ 2 . (75)
This establishes Eq. (35) . Since each round consumes k k k copies of ρ \rho ρ , the total copy complexity is k M kM k M . The bound is independent of n n n and d d d , as these parameters affect only the expectation value while the measurement outcomes remain bounded.
Part (ii). We now derive the copy complexity required to estimate the moment-based detection criterion
G ≡ P 2 − b > 0 , (76) G\equiv P^2-b>0, \tag*{(76)} G ≡ P 2 − b > 0 , (76)
which is equivalent to w 2 2 − w 3 > 0 w_2^2-w_3>0 w 2 2 − w 3 > 0 , since G = D 2 ( w 2 2 − w 3 ) G=D^2(w_2^2-w_3) G = D 2 ( w 2 2 − w 3 ) . Here, P = D w 2 = Tr ( ρ 2 ) P=Dw_2=\operatorname{Tr}(\rho^2) P = D w 2 = Tr ( ρ 2 ) and b = D 2 w 3 b=D^2w_3 b = D 2 w 3 are the rescaled moments defined in Eq. (9) . Our objective is to estimate G G G to additive accuracy ϵ \epsilon ϵ with confidence at least 1 − δ 1-\delta 1 − δ .
We consider the multicopy measurement protocol developed in Sec. II C 1 for odd prime local dimensions d ≥ 5 d\geq5 d ≥ 5 , where both the second- and third-moment estimators have outcomes in { − 1 , + 1 } \{-1,+1\} { − 1 , + 1 } .
Let M P M_P M P and M b M_b M b denote the numbers of independent measurement rounds used to estimate P P P and b b b , respectively. Each round requires two copies for P P P and three copies for b b b . Thus, the total number of copies is
N = 2 M P + 3 M b . (77) N=2M_P+3M_b. \tag*{(77)} N = 2 M P + 3 M b . (77)
Let X i X_i X i and Y j Y_j Y j denote the measurement outcomes corresponding to the second and third moments, with
E [ X i ] = P , E [ Y j ] = b , X i , Y j ∈ { − 1 , + 1 } . (78) \mathbb{E}[X_i]=P,\qquad\mathbb{E}[Y_j]=b,\qquad X_i,Y_j\in\{-1,+1\}. \tag*{(78)} E [ X i ] = P , E [ Y j ] = b , X i , Y j ∈ { − 1 , + 1 } . (78)
The corresponding sample-mean estimators are
P ~ = 1 M P ∑ i = 1 M P X i , b ^ = 1 M b ∑ j = 1 M b Y j . (79) \widetilde{P}=\frac{1}{M_P}\sum_{i=1}^{M_P}X_i,\qquad\widehat{b}=\frac{1}{M_b}\sum_{j=1}^{M_b}Y_j. \tag*{(79)} P = M P 1 i = 1 ∑ M P X i , b = M b 1 j = 1 ∑ M b Y j . (79)
Applying Hoeffding’s inequality (Lemma 3), we obtain
Pr [ ∣ P ~ − P ∣ ≥ ϵ P ] ≤ 2 e − M P ϵ P 2 / 2 , (80) \Pr\left[|\widetilde{P}-P|\geq\epsilon_P\right]\leq2e^{-M_P\epsilon_P^2/2}, \tag*{(80)} Pr [ ∣ P − P ∣ ≥ ϵ P ] ≤ 2 e − M P ϵ P 2 /2 , (80)
Pr [ ∣ b ^ − b ∣ ≥ ϵ b ] ≤ 2 e − M b ϵ b 2 / 2 . (81) \Pr\left[|\widehat{b}-b|\geq\epsilon_b\right]\leq2e^{-M_b\epsilon_b^2/2}. \tag*{(81)} Pr [ ∣ b − b ∣ ≥ ϵ b ] ≤ 2 e − M b ϵ b 2 /2 . (81)
To ensure that these failure probabilities are at most δ P \delta_P δ P and δ b \delta_b δ b , respectively, it is sufficient to require
M P ≥ 2 ϵ P 2 ln ( 2 δ P ) , (82) M_P\geq\frac{2}{\epsilon_P^2}\ln\left(\frac{2}{\delta_P}\right), \tag*{(82)} M P ≥ ϵ P 2 2 ln ( δ P 2 ) , (82)
M b ≥ 2 ϵ b 2 ln ( 2 δ b ) . (83) M_b\geq\frac{2}{\epsilon_b^2}\ln\left(\frac{2}{\delta_b}\right). \tag*{(83)} M b ≥ ϵ b 2 2 ln ( δ b 2 ) . (83)
We next determine how the individual estimation errors propagate to the witness G G G . Since the purity satisfies 0 ≤ P ≤ 1 0\leq P\leq1 0 ≤ P ≤ 1 , we define the clipped estimator
P ^ = min { 1 , max { 0 , P ~ } } . (84) \widehat{P}=\min\{1,\max\{0,\widetilde{P}\}\}. \tag*{(84)} P = min { 1 , max { 0 , P }} . (84)
Clipping cannot increase the estimation error, and hence
∣ P ^ − P ∣ ≤ ∣ P ~ − P ∣ . (85) |\widehat{P}-P|\leq|\widetilde{P}-P|. \tag*{(85)} ∣ P − P ∣ ≤ ∣ P − P ∣. (85)
Defining the estimated witness as
G ^ = P ^ 2 − b ^ , (86) \widehat{G}=\widehat{P}^{\,2}-\widehat{b}, \tag*{(86)} G = P 2 − b , (86)
we obtain
∣ G ^ − G ∣ = ∣ ( P ^ 2 − P 2 ) − ( b ^ − b ) ∣ ≤ ∣ P ^ − P ∣ ∣ P ^ + P ∣ + ∣ b ^ − b ∣ ≤ 2 ∣ P ^ − P ∣ + ∣ b ^ − b ∣ , (87) \begin{aligned}
|\widehat{G}-G|&=|(\widehat{P}^{\,2}-P^2)-(\widehat{b}-b)|\\
&\leq|\widehat{P}-P||\widehat{P}+P|+|\widehat{b}-b|\\
&\leq2|\widehat{P}-P|+|\widehat{b}-b|, \tag*{(87)}
\end{aligned} ∣ G − G ∣ = ∣ ( P 2 − P 2 ) − ( b − b ) ∣ ≤ ∣ P − P ∣∣ P + P ∣ + ∣ b − b ∣ ≤ 2∣ P − P ∣ + ∣ b − b ∣ , (87)
where the last inequality follows from 0 ≤ P , P ^ ≤ 1 0\leq P,\widehat{P}\leq1 0 ≤ P , P ≤ 1 . Consequently, whenever ∣ P ^ − P ∣ ≤ ϵ P |\widehat{P}-P|\leq\epsilon_P ∣ P − P ∣ ≤ ϵ P and ∣ b ^ − b ∣ ≤ ϵ b |\widehat{b}-b|\leq\epsilon_b ∣ b − b ∣ ≤ ϵ b , we have
∣ G ^ − G ∣ ≤ 2 ϵ P + ϵ b . (88) |\widehat{G}-G|\leq2\epsilon_P+\epsilon_b. \tag*{(88)} ∣ G − G ∣ ≤ 2 ϵ P + ϵ b . (88)
Using the union bound, the probability that the witness error exceeds this threshold satisfies
Pr [ ∣ G ^ − G ∣ > 2 ϵ P + ϵ b ] ≤ Pr [ ∣ P ^ − P ∣ > ϵ P ] + Pr [ ∣ b ^ − b ∣ > ϵ b ] ≤ δ P + δ b . (89) \Pr\left[|\widehat{G}-G|>2\epsilon_P+\epsilon_b\right]
\leq\Pr\left[|\widehat{P}-P|>\epsilon_P\right]+\Pr\left[|\widehat{b}-b|>\epsilon_b\right]
\leq\delta_P+\delta_b. \tag*{(89)} Pr [ ∣ G − G ∣ > 2 ϵ P + ϵ b ] ≤ Pr [ ∣ P − P ∣ > ϵ P ] + Pr [ ∣ b − b ∣ > ϵ b ] ≤ δ P + δ b . (89)
Therefore, an overall additive accuracy ϵ \epsilon ϵ with failure probability at most δ \delta δ is guaranteed provided that
2 ϵ P + ϵ b ≤ ϵ , δ P + δ b ≤ δ . (90) 2\epsilon_P+\epsilon_b\leq\epsilon,\qquad\delta_P+\delta_b\leq\delta. \tag*{(90)} 2 ϵ P + ϵ b ≤ ϵ , δ P + δ b ≤ δ . (90)
Combining Eqs. (77) , (82) , and (83) , a sufficient total copy budget is obtained by choosing
N = 2 ⌈ 2 ϵ P 2 ln ( 2 δ P ) ⌉ + 3 ⌈ 2 ϵ b 2 ln ( 2 δ b ) ⌉ . (91) N=2\left\lceil\frac{2}{\epsilon_P^2}\ln\left(\frac{2}{\delta_P}\right)\right\rceil+3\left\lceil\frac{2}{\epsilon_b^2}\ln\left(\frac{2}{\delta_b}\right)\right\rceil. \tag*{(91)} N = 2 ⌈ ϵ P 2 2 ln ( δ P 2 ) ⌉ + 3 ⌈ ϵ b 2 2 ln ( δ b 2 ) ⌉ . (91)
For simplicity, choosing
ϵ P = ϵ b = ϵ 3 , δ P = δ b = δ 2 (92) \epsilon_P=\epsilon_b=\frac{\epsilon}{3},\qquad\delta_P=\delta_b=\frac{\delta}{2} \tag*{(92)} ϵ P = ϵ b = 3 ϵ , δ P = δ b = 2 δ (92)
satisfies the constraints in Eq. (90) . The corresponding sufficient copy budget is
N = 5 ⌈ 18 ϵ 2 ln ( 4 δ ) ⌉ , (93) N=5\left\lceil\frac{18}{\epsilon^2}\ln\left(\frac{4}{\delta}\right)\right\rceil, \tag*{(93)} N = 5 ⌈ ϵ 2 18 ln ( δ 4 ) ⌉ , (93)
which guarantees
Pr [ ∣ G ^ − G ∣ > ϵ ] ≤ δ . (94) \Pr\left[|\widehat{G}-G|>\epsilon\right]\leq\delta. \tag*{(94)} Pr [ ∣ G − G ∣ > ϵ ] ≤ δ . (94)
Equations (93) and (94) are Eqs. (36) and (37) of part (ii) of Corollary 1.
Thus, the total copy complexity scales as
N = O ( 1 ϵ 2 log 1 δ ) , (95) N=O\left(\frac{1}{\epsilon^2}\log\frac{1}{\delta}\right), \tag*{(95)} N = O ( ϵ 2 1 log δ 1 ) , (95)
independently of the number of qudits for the bounded-outcome implementation.
Finally, the confidence interval G ≥ G ^ − ϵ G\geq\widehat{G}-\epsilon G ≥ G − ϵ provides an operational certification condition. In particular, whenever G ^ > ϵ \widehat{G}>\epsilon G > ϵ , Wigner negativity is certified with confidence at least 1 − δ 1-\delta 1 − δ . For a state with a true witness gap G > 2 ϵ G>2\epsilon G > 2 ϵ , the protocol detects the violation with probability at least 1 − δ 1-\delta 1 − δ . Both statements follow from Eq. (94) . If the state is not magic, its DWF is nonnegative, and Theorem 2 gives w 2 ≤ w 3 w_2\leq w_3 w 2 ≤ w 3 , that is, G ≤ 0 G\leq0 G ≤ 0 . Declaring it magic requires G ^ > ϵ \widehat{G}>\epsilon G > ϵ , and hence
G ^ − G > ϵ − G ≥ ϵ , (96) \widehat{G}-G>\epsilon-G\geq\epsilon, \tag*{(96)} G − G > ϵ − G ≥ ϵ , (96)
which happens with probability at most δ \delta δ . Conversely, any estimate below or at the certification threshold, G ^ ≤ ϵ \widehat{G}\leq\epsilon G ≤ ϵ , satisfies
G − G ^ ≥ G − ϵ > ϵ . (97) G-\widehat{G}\geq G-\epsilon>\epsilon. \tag*{(97)} G − G ≥ G − ϵ > ϵ . (97)
Thus, the protocol certifies magic with probability at least 1 − δ 1-\delta 1 − δ whenever G > 2 ϵ G>2\epsilon G > 2 ϵ . This completes the proof of part (ii) of Corollary 1.
Part (iii) and (iv). To prove part (iii), we apply part (i) to P P P and to b b b separately, allowing each a failure probability δ / 2 \delta/2 δ /2 . Each estimate then requires
M ≥ 2 η 2 ln 2 δ / 2 = 2 η 2 ln 4 δ (98) M\geq\frac{2}{\eta^2}\ln\frac{2}{\delta/2}=\frac{2}{\eta^2}\ln\frac{4}{\delta} \tag*{(98)} M ≥ η 2 2 ln δ /2 2 = η 2 2 ln δ 4 (98)
rounds of each kind, which uses 2 M + 3 M = 5 M 2M+3M=5M 2 M + 3 M = 5 M copies. By the union bound, ∣ P ^ − P ∣ ≤ η |\widehat{P}-P|\leq\eta ∣ P − P ∣ ≤ η and ∣ b ^ − b ∣ ≤ η |\widehat{b}-b|\leq\eta ∣ b − b ∣ ≤ η hold together with probability at least 1 − δ 1-\delta 1 − δ . In part (iv) the same holds for P P P and c c c , with 2 M + 4 M = 6 M 2M+4M=6M 2 M + 4 M = 6 M copies. We write P − = P ^ − η P_-=\widehat{P}-\eta P − = P − η , b + = b ^ + η b_+=\widehat{b}+\eta b + = b + η and c + = c ^ + η c_+=\widehat{c}+\eta c + = c + η , so that on this event P ≥ P − P\geq P_- P ≥ P − , b ≤ b + b\leq b_+ b ≤ b + and c ≤ c + c\leq c_+ c ≤ c + . The argument below uses only these three inequalities, and therefore applies to any confidence intervals of this form. Since P ≥ 0 P\geq0 P ≥ 0 and P ≥ − b ≥ − b + P\geq-b\geq-b_+ P ≥ − b ≥ − b + by Eq. (10) , the true purity also satisfies
P ≥ P ‾ = max { 0 , P − , − b + } . (99) P\geq\underline{P}=\max\{0,P_-,-b_+\}. \tag*{(99)} P ≥ P = max { 0 , P − , − b + } . (99)
Now the bound of Theorem 4 is the function
f ( P , b ) = P 2 − b 1 + 2 P + b = ( 1 + P ) 2 1 + 2 P + b − 1 , (100) f(P,b)=\frac{P^2-b}{1+2P+b}=\frac{(1+P)^2}{1+2P+b}-1, \tag*{(100)} f ( P , b ) = 1 + 2 P + b P 2 − b = 1 + 2 P + b ( 1 + P ) 2 − 1 , (100)
where the second form follows by adding and subtracting 1 + 2 P + b 1+2P+b 1 + 2 P + b in the numerator. We consider it in the region where P ≥ 0 P\geq0 P ≥ 0 and P + b ≥ 0 P+b\geq0 P + b ≥ 0 . There the denominator is at least 1 + P > 0 1+P>0 1 + P > 0 , and the two partial derivatives are
∂ f ∂ b = − ( 1 + P ) 2 ( 1 + 2 P + b ) 2 < 0 , (101) \frac{\partial f}{\partial b}=-\frac{(1+P)^2}{(1+2P+b)^2}<0, \tag*{(101)} ∂ b ∂ f = − ( 1 + 2 P + b ) 2 ( 1 + P ) 2 < 0 , (101)
∂ f ∂ P = 2 ( 1 + P ) ( P + b ) ( 1 + 2 P + b ) 2 ≥ 0 , (102) \frac{\partial f}{\partial P}=\frac{2(1+P)(P+b)}{(1+2P+b)^2}\geq0, \tag*{(102)} ∂ P ∂ f = ( 1 + 2 P + b ) 2 2 ( 1 + P ) ( P + b ) ≥ 0 , (102)
so f f f decreases when b b b grows and does not increase when P P P decreases. The true point ( P , b ) (P,b) ( P , b ) lies in this region by Eq. (10) . We first raise b b b to b + b_+ b + at fixed P P P . Along this step P + b + ≥ P + b ≥ 0 P+b_+\geq P+b\geq0 P + b + ≥ P + b ≥ 0 , so we stay in the region and f ( P , b + ) ≤ f ( P , b ) f(P,b_+)\leq f(P,b) f ( P , b + ) ≤ f ( P , b ) . We then lower P P P to P ‾ \underline{P} P at fixed b + b_+ b + . Along this step P ‾ + b + ≥ 0 \underline{P}+b_+\geq0 P + b + ≥ 0 , so we again stay in the region and f ( P ‾ , b + ) ≤ f ( P , b + ) f(\underline{P},b_+)\leq f(P,b_+) f ( P , b + ) ≤ f ( P , b + ) . Together with Theorem 4 ,
f ( P ‾ , b + ) ≤ f ( P , b ) ≤ N ( ρ ) , (103) f(\underline{P},b_+)\leq f(P,b)\leq\mathcal{N}(\rho), \tag*{(103)} f ( P , b + ) ≤ f ( P , b ) ≤ N ( ρ ) , (103)
which is Eq. (38) . The entry − b + -b_+ − b + in P ‾ \underline{P} P is what keeps the second step inside the region. Without it the lower endpoint for P P P could lie below the line P + b + = 0 P+b_+=0 P + b + = 0 , where f f f increases as P P P decreases, and the inserted value could exceed the true bound.
The bound of Theorem 5 , P 3 / c \sqrt{P^3/c} P 3 / c , is nondecreasing in P ≥ 0 P\geq0 P ≥ 0 and decreasing in c > 0 c>0 c > 0 . The true c = D 3 ∑ ω W ρ ( ω ) 4 c=D^3\sum_{\omega}W_{\rho}(\omega)^4 c = D 3 ∑ ω W ρ ( ω ) 4 is strictly positive, since the Wigner function sums to one. With P ≥ max { 0 , P − } ≥ 0 P\geq\max\{0,P_-\}\geq0 P ≥ max { 0 , P − } ≥ 0 and 0 < c ≤ c + 0<c\leq c_+ 0 < c ≤ c + ,
max { 0 , P − } 3 c + ≤ P 3 c ≤ ∥ W ρ ∥ 1 (104) \sqrt{\frac{\max\{0,P_-\}^3}{c_+}}\leq\sqrt{\frac{P^3}{c}}\leq\lVert W_{\rho}\rVert_1 \tag*{(104)} c + max { 0 , P − } 3 ≤ c P 3 ≤ ∥ W ρ ∥ 1 (104)
by Theorem 5 . Using ∥ W ρ ∥ 1 = 1 + 2 N ( ρ ) \lVert W_{\rho}\rVert_1=1+2\mathcal{N}(\rho) ∥ W ρ ∥ 1 = 1 + 2 N ( ρ ) from Eq. (23) , this is Eq. (39) . This bound uses only P P P and c c c , so no information on b b b is needed. This completes the proof of Corollary 1.
Classical shadows of the Wigner function
In each round of the protocol a random unitary U U U is applied to a fresh copy of ρ \rho ρ and all qudits are measured in the computational basis. If the outcome is k \mathbf{k} k , the vector ∣ ϕ ⟩ = U † ∣ k ⟩ |\phi\rangle= U^\dagger|\mathbf{k}\rangle ∣ ϕ ⟩ = U † ∣ k ⟩ is stored. When U U U is drawn from a unitary 2-design, such as the Haar measure or the Clifford group, the operator
ρ ^ = ( D + 1 ) ∣ ϕ ⟩ ⟨ ϕ ∣ − I (105) \hat{\rho} = (D+1)|\phi\rangle\langle\phi|-\mathbb{I} \tag*{(105)} ρ ^ = ( D + 1 ) ∣ ϕ ⟩ ⟨ ϕ ∣ − I (105)
is an unbiased estimator of the state with E [ ρ ^ ] = ρ \mathbb{E}[\hat{\rho}]=\rho E [ ρ ^ ] = ρ [43 ] . We call it a snapshot. Its DWF follows from Eq. (4) and from Tr [ A u ] = 1 \operatorname{Tr}[A_{\mathbf{u}}]=1 Tr [ A u ] = 1 ,
W ^ ( u ) = ( D + 1 ) ⟨ ϕ ∣ A u ∣ ϕ ⟩ − 1 D , (106) \hat{W}(\mathbf{u})=\frac{(D+1)\langle\phi|A_{\mathbf{u}}|\phi\rangle-1}{D}, \tag*{(106)} W ^ ( u ) = D ( D + 1 ) ⟨ ϕ ∣ A u ∣ ϕ ⟩ − 1 , (106)
which is again unbiased, i.e., E [ W ^ ( u ) ] = W ρ ( u ) \mathbb{E}[\hat{W}(\mathbf{u})]=W_{\rho}(\mathbf{u}) E [ W ^ ( u )] = W ρ ( u ) .
A single snapshot does not provide an unbiased estimate of W ρ ( u ) 2 W_{\rho}(\mathbf{u})^{2} W ρ ( u ) 2 , since E [ W ^ ( u ) 2 ] \mathbb{E}[\hat{W}(\mathbf{u})^{2}] E [ W ^ ( u ) 2 ] also contains the variance of W ^ ( u ) \hat{W}(\mathbf{u}) W ^ ( u ) . This limitation can be overcome by combining independent snapshots. For N N N snapshots W ^ 1 , … , W ^ N \hat{W}_{1},\ldots,\hat{W}_{N} W ^ 1 , … , W ^ N and distinct indices, E [ W ^ i ( u ) W ^ j ( u ) ] = W ρ ( u ) 2 \mathbb{E}[\hat{W}_{i}(\mathbf{u})\hat{W}_{j}(\mathbf{u})]=W_{\rho}(\mathbf{u})^{2} E [ W ^ i ( u ) W ^ j ( u )] = W ρ ( u ) 2 , and the same holds for products of three and four distinct snapshots. Averaging over all ordered tuples of distinct indices therefore gives unbiased estimators, the so-called U-statistics. They need only the power sums
S m ( u ) = ∑ i = 1 N W ^ i ( u ) m , m = 1 , … , 4 , (107) S_m(\mathbf{u})=\sum_{i=1}^{N}\hat{W}_{i}(\mathbf{u})^{m},\qquad m=1,\ldots,4, \tag*{(107)} S m ( u ) = i = 1 ∑ N W ^ i ( u ) m , m = 1 , … , 4 , (107)
because sums over distinct indices can be written through power sums. With ( N ) k = N ( N − 1 ) ⋯ ( N − k + 1 ) (N)_k=N(N-1)\cdots(N-k+1) ( N ) k = N ( N − 1 ) ⋯ ( N − k + 1 ) the estimators read
w ^ 2 = 1 ( N ) 2 ∑ u [ S 1 2 − S 2 ] , (108) \hat{w}_{2}=\frac{1}{(N)_2}\sum_{\mathbf{u}}\left[S_1^2-S_2\right], \tag*{(108)} w ^ 2 = ( N ) 2 1 u ∑ [ S 1 2 − S 2 ] , (108)
w ^ 3 = 1 ( N ) 3 ∑ u [ S 1 3 − 3 S 1 S 2 + 2 S 3 ] , (109) \hat{w}_{3}=\frac{1}{(N)_3}\sum_{\mathbf{u}}\left[S_1^3-3S_1S_2+2S_3\right], \tag*{(109)} w ^ 3 = ( N ) 3 1 u ∑ [ S 1 3 − 3 S 1 S 2 + 2 S 3 ] , (109)
w ^ 4 = 1 ( N ) 4 ∑ u [ S 1 4 − 6 S 1 2 S 2 + 8 S 1 S 3 + 3 S 2 2 − 6 S 4 ] . (110) \hat{w}_{4}=\frac{1}{(N)_4}\sum_{\mathbf{u}}\left[S_1^4-6S_1^2S_2+8S_1S_3+3S_2^2-6S_4\right]. \tag*{(110)} w ^ 4 = ( N ) 4 1 u ∑ [ S 1 4 − 6 S 1 2 S 2 + 8 S 1 S 3 + 3 S 2 2 − 6 S 4 ] . (110)
Each bracket is the sum over distinct tuples, ∑ i ≠ j W ^ i W ^ j \sum_{i\ne j}\hat{W}_i\hat{W}_j ∑ i = j W ^ i W ^ j for k = 2 k=2 k = 2 and so on. The violation is estimated as w ^ 2 − w ^ 3 \hat{w}_2-\hat{w}_3 w ^ 2 − w ^ 3 . Its bias equals the variance of w ^ 2 \hat{w}_2 w ^ 2 and becomes negligible once N N N is large enough for a useful estimate. The certified bounds of Theorems 4 and 5 are evaluated with the same estimates.
We would now like to discuss two experimentally relevant implementations of classical shadows. In the global-shadow protocol, the random unitary U U U acts jointly on all qudits, whereas in the local-shadow protocol, independent random unitaries are applied to individual qudits, offering a simpler experimental implementation. Each local snapshot is a tensor product of single-qudit snapshots, and its DWF factorizes into the corresponding single-qudit Wigner functions. In our numerical simulations, the random unitaries are sampled from the Haar measure, and the states ∣ ϕ ⟩ |\phi\rangle ∣ ϕ ⟩ are generated according to the probability density D ⟨ ϕ ∣ ρ ∣ ϕ ⟩ D\langle\phi|\rho|\phi\rangle D ⟨ ϕ ∣ ρ ∣ ϕ ⟩ with respect to this measure. The expectation values ⟨ ϕ ∣ A u ∣ ϕ ⟩ \langle\phi|A_{\mathbf{u}}|\phi\rangle ⟨ ϕ ∣ A u ∣ ϕ ⟩ at all D 2 D^2 D 2 phase-space points are then evaluated using a single fast Fourier transform per snapshot, exploiting the action of the phase-point operators given in Eq. (67) .
Quasiprobability estimator and its sampling prescription
Consider a system of n n n qudits initially prepared in a product state ρ = ρ 1 ⊗ ⋯ ⊗ ρ n \rho=\rho_1\otimes\cdots\otimes\rho_n ρ = ρ 1 ⊗ ⋯ ⊗ ρ n , acted on by a Clifford unitary U U U , and measured in the computational basis. We want the probability of an outcome o \mathbf{o} o ,
p ( o ) = Tr [ ∣ o ⟩ ⟨ o ∣ U ρ U † ] . (111) p(\mathbf{o})=\operatorname{Tr}\left[|\mathbf{o}\rangle\langle\mathbf{o}|U\rho U^\dagger\right]. \tag*{(111)} p ( o ) = Tr [ ∣ o ⟩ ⟨ o ∣ U ρ U † ] . (111)
Inserting the expansion of Eq. (46) for ρ \rho ρ turns this into a sum over phase space,
p ( o ) = ∑ u W ρ ( u ) ξ o ( u ) , ξ o ( u ) = ⟨ o ∣ U A u U † ∣ o ⟩ . (112) p(\mathbf{o})=\sum_{\mathbf{u}}W_{\rho}(\mathbf{u})\xi_{\mathbf{o}}(\mathbf{u}),\qquad\xi_{\mathbf{o}}(\mathbf{u})=\langle\mathbf{o}|UA_{\mathbf{u}}U^\dagger|\mathbf{o}\rangle. \tag*{(112)} p ( o ) = u ∑ W ρ ( u ) ξ o ( u ) , ξ o ( u ) = ⟨ o ∣ U A u U † ∣ o ⟩ . (112)
A Clifford unitary maps each phase-space point operator to another one, U A u U † = A Γ ( u ) UA_{\mathbf{u}}U^\dagger=A_{\Gamma(\mathbf{u})} U A u U † = A Γ ( u ) , where Γ \Gamma Γ is an affine map of phase space that is easy to compute [10 ] . A point operator sends ∣ o ⟩ |\mathbf{o}\rangle ∣ o ⟩ to ∣ 2 q − o ⟩ |2\mathbf{q}-\mathbf{o}\rangle ∣2 q − o ⟩ up to a phase, so its diagonal element is one if the position label of the point is o \mathbf{o} o and zero otherwise. The function ξ o \xi_{\mathbf{o}} ξ o is therefore an indicator,
ξ o ( u ) = { 1 , Γ ( u ) has position o , 0 , otherwise . (113) \xi_{\mathbf{o}}(\mathbf{u})=
\begin{cases}
1, & \Gamma(\mathbf{u})\text{ has position }\mathbf{o},\\
0, & \text{otherwise}.
\end{cases} \tag*{(113)} ξ o ( u ) = { 1 , 0 , Γ ( u ) has position o , otherwise . (113)
If W ρ W_{\rho} W ρ were a probability distribution, Eq. (112) would describe a classical stochastic process. One would draw a phase-space point, move it with Γ \Gamma Γ , and read off its position. When W ρ W_{\rho} W ρ has negative values, one samples from ∣ W ρ ∣ |W_{\rho}| ∣ W ρ ∣ instead and corrects with the sign. Draw u \mathbf{u} u with probability ∣ W ρ ( u ) ∣ / ∥ W ρ ∥ 1 |W_{\rho}(\mathbf{u})|/\lVert W_{\rho}\rVert_1 ∣ W ρ ( u ) ∣/ ∥ W ρ ∥ 1 and record
X = ∥ W ρ ∥ 1 sign [ W ρ ( u ) ] ξ o ( u ) . (114) X=\lVert W_{\rho}\rVert_1\operatorname{sign}[W_{\rho}(\mathbf{u})]\xi_{\mathbf{o}}(\mathbf{u}). \tag*{(114)} X = ∥ W ρ ∥ 1 sign [ W ρ ( u )] ξ o ( u ) . (114)
By construction, the average of X X X is exactly p ( o ) p(\mathbf{o}) p ( o ) , and every value of X X X lies between − ∥ W ρ ∥ 1 -\lVert W_{\rho}\rVert_1 − ∥ W ρ ∥ 1 and + ∥ W ρ ∥ 1 +\lVert W_{\rho}\rVert_1 + ∥ W ρ ∥ 1 . For a product input, ∣ W ρ ∣ / ∥ W ρ ∥ 1 |W_{\rho}|/\lVert W_{\rho}\rVert_1 ∣ W ρ ∣/ ∥ W ρ ∥ 1 is a product distribution, so each sample is drawn qudit by qudit in polynomial time. The sampling budget grows with the Wigner ℓ 1 \ell_1 ℓ 1 norm; implementation and preprocessing costs must also be considered. Averaging s s s independent values of X X X , Hoeffding’s inequality (Lemma 3 of Sec. II C2, applied to X / ∥ W ρ ∥ 1 X/\lVert W_{\rho}\rVert_1 X / ∥ W ρ ∥ 1 ) gives the estimate within error ϵ \epsilon ϵ with probability at least 1 − δ 1-\delta 1 − δ under the sufficient Hoeffding prescription
s H ( ϵ , δ ) = 2 ϵ 2 ∥ W ρ ∥ 1 2 ln 2 δ . (115) s_{\mathrm{H}}(\epsilon,\delta)=\frac{2}{\epsilon^2}\lVert W_{\rho}\rVert_1^2\ln\frac{2}{\delta}. \tag*{(115)} s H ( ϵ , δ ) = ϵ 2 2 ∥ W ρ ∥ 1 2 ln δ 2 . (115)
The Wigner ℓ 1 \ell_1 ℓ 1 norm is multiplicative under tensor products. Thus, when m m m input qudits are prepared in identical magic states ρ m \rho_m ρ m and the remaining inputs are stabilizer states,
s H ( ϵ , δ ) = 2 ϵ 2 ∥ W ρ m ∥ 1 2 m ln 2 δ = 2 ϵ 2 e 2 m M ( ρ m ) ln 2 δ . (116) s_{\mathrm{H}}(\epsilon,\delta)=\frac{2}{\epsilon^2}\lVert W_{\rho_m}\rVert_1^{2m}\ln\frac{2}{\delta}=\frac{2}{\epsilon^2}e^{2m\mathcal{M}(\rho_m)}\ln\frac{2}{\delta}. \tag*{(116)} s H ( ϵ , δ ) = ϵ 2 2 ∥ W ρ m ∥ 1 2 m ln δ 2 = ϵ 2 2 e 2 m M ( ρ m ) ln δ 2 . (116)
The sufficient sample-count prescription grows exponentially in the number of injected magic states, at a rate set by their mana. This is the estimator of Ref. [39 ] , written for Clifford circuits and computational-basis measurements, where all gates and measurements are nonnegative and the input states are the only source of Wigner negativity.
Acknowledgements
A.G.M. acknowledges the financial support provided by the IIT Goa Startup Grant (No. 2025/SG/AGM/058).
References
Supplementary Information
This Supplementary Information collects the essential notations, preliminary information and illustrative examples, the numerical data, and the comparison with direct Wigner tomography that support the main text. The proofs of these results are given in the main text and are not repeated here.
The stabilizer formalism provides an efficient description of quantum states through commuting subgroups of generalized Pauli operators [51 ] . A pure stabilizer state ∣ ψ ⟩ |\psi\rangle ∣ ψ ⟩ is the unique common + 1 +1 + 1 eigenstate of a maximal abelian subgroup of the Pauli group. To formulate this framework for qudit systems, we briefly introduce the generalized Pauli operators, the Heisenberg-Weyl group, and the Clifford group [11 ] .
For a d d d -dimensional quantum system with computational basis { ∣ j ⟩ } j = 0 d − 1 \{|j\rangle\}_{j=0}^{d-1} { ∣ j ⟩ } j = 0 d − 1 , the generalized Pauli operators are defined as
X ∣ j ⟩ = ∣ j + 1 ( mod d ) ⟩ , Z ∣ j ⟩ = ω j ∣ j ⟩ , (117) X|j\rangle= |j+1\ (\operatorname{mod} d)\rangle,\quad Z|j\rangle= \omega^j|j\rangle, \tag*{(117)} X ∣ j ⟩ = ∣ j + 1 ( mod d )⟩ , Z ∣ j ⟩ = ω j ∣ j ⟩ , (117)
where ω = e 2 π i / d \omega=e^{2\pi i/d} ω = e 2 π i / d and Z X = ω X Z ZX=\omega XZ Z X = ω X Z . The operators X X X and Z Z Z , often referred to as the shift and phase operators, respectively, generate the Heisenberg-Weyl group H d \mathcal{H}_d H d , which describes translations in discrete phase space. For odd d d d , the displacement operator associated with the phase-space point u = ( p , q ) ∈ Z d × Z d \mathbf{u}=(p,q)\in\mathbb{Z}_d\times\mathbb{Z}_d u = ( p , q ) ∈ Z d × Z d is
T u ≡ T ( p , q ) = ω − ( 2 − 1 p q ) Z p X q , ( p , q ) ∈ Z d × Z d , (118) T_{\mathbf{u}}\equiv T_{(p,q)}=\omega^{-(2^{-1}pq)}Z^pX^q,\quad(p,q)\in\mathbb{Z}_d\times\mathbb{Z}_d, \tag*{(118)} T u ≡ T ( p , q ) = ω − ( 2 − 1 pq ) Z p X q , ( p , q ) ∈ Z d × Z d , (118)
where 2 − 1 = d + 1 2 2^{-1}=\frac{d+1}{2} 2 − 1 = 2 d + 1 is the multiplicative inverse of 2 in Z d \mathbb{Z}_d Z d . For n n n qudits, the Heisenberg-Weyl operators are tensor products of the local ones,
T u = T ( p 1 , q 1 ) ⊗ T ( p 2 , q 2 ) ⊗ ⋯ ⊗ T ( p n , q n ) , (119) T_{\mathbf{u}}=T_{(p_1,q_1)}\otimes T_{(p_2,q_2)}\otimes\cdots\otimes T_{(p_n,q_n)}, \tag*{(119)} T u = T ( p 1 , q 1 ) ⊗ T ( p 2 , q 2 ) ⊗ ⋯ ⊗ T ( p n , q n ) , (119)
where u = ( p 1 , q 1 , … , p n , q n ) ∈ Z d 2 n \mathbf{u}=(p_1,q_1,\ldots,p_n,q_n)\in\mathbb{Z}_d^{2n} u = ( p 1 , q 1 , … , p n , q n ) ∈ Z d 2 n labels the full phase-space point.
The Clifford group C d \mathcal{C}_d C d is the normalizer of H d \mathcal{H}_d H d in the unitary group, i.e., the set of unitaries that map Heisenberg-Weyl operators to Heisenberg-Weyl operators under conjugation,
C d = { U ∈ U ( d n ) ∣ U T u U † ∈ H d ∀ T u ∈ H d } . (120) \mathcal{C}_d=\{U\in\mathrm{U}(d^n)\mid UT_{\mathbf{u}}U^\dagger\in\mathcal{H}_d\ \forall T_{\mathbf{u}}\in\mathcal{H}_d\}. \tag*{(120)} C d = { U ∈ U ( d n ) ∣ U T u U † ∈ H d ∀ T u ∈ H d } . (120)
Clifford operations therefore map stabilizer states to stabilizer states. If S ∈ H d S\in\mathcal{H}_d S ∈ H d stabilizes ∣ ψ ⟩ |\psi\rangle ∣ ψ ⟩ , then for any U ∈ C d U\in\mathcal{C}_d U ∈ C d the state ∣ ψ ′ ⟩ = U ∣ ψ ⟩ |\psi'\rangle=U|\psi\rangle ∣ ψ ′ ⟩ = U ∣ ψ ⟩ satisfies ( U S U † ) ∣ ψ ′ ⟩ = U S ∣ ψ ⟩ = ∣ ψ ′ ⟩ (USU^\dagger)|\psi'\rangle=US|\psi\rangle=|\psi'\rangle ( U S U † ) ∣ ψ ′ ⟩ = U S ∣ ψ ⟩ = ∣ ψ ′ ⟩ , and since U S U † ∈ H d USU^\dagger\in\mathcal{H}_d U S U † ∈ H d , ∣ ψ ′ ⟩ |\psi'\rangle ∣ ψ ′ ⟩ is again a stabilizer state.
This closure property underlies the Gottesman-Knill theorem: circuits built from stabilizer-state preparations, Clifford operations, and Pauli measurements, together with classical processing, can be simulated efficiently on a classical computer [2 ] . Stabilizer operations alone are thus insufficient for universal quantum computation [3 ] . Universality can be restored by supplementing them with non-stabilizer resources, commonly called magic states , which constitute the fundamental resource for quantum computational advantage beyond the stabilizer framework. Motivated by this central role, here we develop an efficient method for certifying magic states. As discussed below, the discrete Wigner representation is particularly well suited to this task, since Wigner negativity is intimately connected to magic in odd and prime power dimensional systems.
Discrete Wigner Function and Wigner Negativity
The Wigner function provides a phase-space representation of a quantum state and plays a role analogous to a joint probability distribution over position and momentum in classical statistical mechanics [52 ] . Unlike a genuine probability distribution, however, it is only a quasiprobability distribution and can take negative values. Such negativity is a signature of nonclassicality, even though the marginals of the Wigner function still reproduce the probability distributions of the corresponding observables. Its finite-dimensional counterpart, the discrete Wigner function (DWF), extends this description to qudit systems [53 ] . For odd and prime-powered-dimensional systems, the DWF formalism is particularly relevant to the resource theory of quantum magic, as its negativity is closely connected to nonstabilizerness and the limitations of efficient classical simulation [10 , 11 ] .
For a qudit of odd prime dimension d d d , the discrete phase space consists of d 2 d^2 d 2 points u = ( p , q ) ∈ Z d × Z d \mathbf{u}=(p,q)\in\mathbb{Z}_d\times\mathbb{Z}_d u = ( p , q ) ∈ Z d × Z d . The associated phase-space point operators A u A_{\mathbf{u}} A u are constructed from the Heisenberg-Weyl displacement operators. Specifically,
A 0 = 1 d ∑ v T v , A u = T u A 0 T u † (121) A_0=\frac{1}{d}\sum_{\mathbf{v}}T_{\mathbf{v}},\qquad A_{\mathbf{u}}=T_{\mathbf{u}}A_0T_{\mathbf{u}}^\dagger \tag*{(121)} A 0 = d 1 v ∑ T v , A u = T u A 0 T u † (121)
These operators are Hermitian and form an orthogonal operator basis satisfying
Tr ( A u ) = 1 , Tr ( A u A v ) = d δ u , v . (122) \operatorname{Tr}(A_{\mathbf{u}})=1,\qquad\operatorname{Tr}(A_{\mathbf{u}}A_{\mathbf{v}})=d\delta_{\mathbf{u},\mathbf{v}}. \tag*{(122)} Tr ( A u ) = 1 , Tr ( A u A v ) = d δ u , v . (122)
The DWF of a quantum state ρ \rho ρ is then defined as
W ρ ( u ) = 1 d Tr ( A u ρ ) , u ∈ Z d × Z d . (123) W_\rho(\mathbf{u})=\frac{1}{d}\operatorname{Tr}(A_{\mathbf{u}}\rho),\qquad\mathbf{u}\in\mathbb{Z}_d\times\mathbb{Z}_d. \tag*{(123)} W ρ ( u ) = d 1 Tr ( A u ρ ) , u ∈ Z d × Z d . (123)
It is real valued and normalized, ∑ u W ρ ( u ) = 1 \sum_{\mathbf{u}}W_\rho(\mathbf{u})=1 ∑ u W ρ ( u ) = 1 , but need not be nonnegative. Moreover, the state can be reconstructed from its DWF through
ρ = ∑ u W ρ ( u ) A u . (124) \rho=\sum_{\mathbf{u}}W_\rho(\mathbf{u})A_{\mathbf{u}}. \tag*{(124)} ρ = u ∑ W ρ ( u ) A u . (124)
For an n n n -qudit system, these definitions extend naturally to the phase space Z d 2 n \mathbb{Z}_d^{2n} Z d 2 n , with phase-space point operators given by tensor products of the corresponding single-qudit operators.
The connection between Wigner negativity and quantum magic is formalized by the discrete Hudson theorem [10 ] , which establishes that a pure state of odd prime-dimensional qudits has a nonnegative DWF if and only if it is a stabilizer state:
∣ ψ ⟩ is a stabilizer state ⟺ W ψ ( u ) ≥ 0 ∀ u . (125) |\psi\rangle\text{ is a stabilizer state}\Longleftrightarrow W_\psi(\mathbf{u})\ge0\quad\forall\,\mathbf{u}. \tag*{(125)} ∣ ψ ⟩ is a stabilizer state ⟺ W ψ ( u ) ≥ 0 ∀ u . (125)
Consequently, for pure states, W ψ ( u ) < 0 W_\psi(\mathbf{u})<0 W ψ ( u ) < 0 for some u ⟺ ∣ ψ ⟩ \mathbf{u}\Longleftrightarrow|\psi\rangle u ⟺ ∣ ψ ⟩ is non-stabilizer.
Illustrative Wigner distributions and moment thresholds
Thus, Wigner negativity provides a necessary and sufficient criterion for nonstabilizerness in pure states. For mixed states, however, the equivalence does not hold: while Wigner negativity certifies magic, a nonnegative DWF does not necessarily imply membership in the stabilizer polytope. These observations motivate the development of experimentally accessible criteria for certifying Wigner negativity without reconstructing the complete quasiprobability distribution.
Pure-state examples
The examples below give the detailed calculations supporting the concise illustrations in Results. The strange-state DWF was defined in Eq. (126) .
a . a. a . Example: d = 3 d=3 d = 3 (i) We first consider the qutrit strange state [54 ]
∣ ψ 1 ⟩ = ∣ 1 ⟩ − ∣ 2 ⟩ 2 , (126) |\psi_1\rangle=\frac{|1\rangle-|2\rangle}{\sqrt{2}}, \tag*{(126)} ∣ ψ 1 ⟩ = 2 ∣1 ⟩ − ∣2 ⟩ , (126)
with the DWF
W ψ 1 ( p , q ) = { 1 3 , ( p , q ) = ( 0 , 0 ) , 1 6 , ( p , q ) ≠ ( 0 , 0 ) . W_{\psi_1}(p,q)=
\begin{cases}
\frac{1}{3}, & (p,q)=(0,0),\\
\frac{1}{6}, & (p,q)\ne(0,0).
\end{cases} W ψ 1 ( p , q ) = { 3 1 , 6 1 , ( p , q ) = ( 0 , 0 ) , ( p , q ) = ( 0 , 0 ) .
The corresponding second and third Wigner moments are w 2 = 1 3 w_2=\frac{1}{3} w 2 = 3 1 , w 3 = 0 w_3=0 w 3 = 0 . Therefore, w 2 2 − w 3 = 1 9 > 0 w_2^2-w_3=\frac{1}{9}>0 w 2 2 − w 3 = 9 1 > 0 . Thus, ∣ ψ 1 ⟩ |\psi_1\rangle ∣ ψ 1 ⟩ violates the moment inequality and is therefore certified as a nonstabilizer or magic state.
(ii) As a second example, consider ∣ ψ 2 ⟩ = 1 3 ( ∣ 0 ⟩ + ∣ 1 ⟩ + ∣ 2 ⟩ ) |\psi_2\rangle=\frac{1}{\sqrt{3}}(|0\rangle+|1\rangle+|2\rangle) ∣ ψ 2 ⟩ = 3 1 ( ∣0 ⟩ + ∣1 ⟩ + ∣2 ⟩) . Its DWF is given by
W ψ 2 ( p , q ) = { 1 3 , p = 0 , q ∈ { 0 , 1 , 2 } , 0 , otherwise . (127) W_{\psi_2}(p,q)=
\begin{cases}
\frac{1}{3}, & p=0,\quad q\in\{0,1,2\},\\
0, & \text{otherwise}.
\end{cases} \tag*{(127)} W ψ 2 ( p , q ) = { 3 1 , 0 , p = 0 , q ∈ { 0 , 1 , 2 } , otherwise . (127)
Accordingly, w 2 = 1 3 w_2=\frac{1}{3} w 2 = 3 1 , w 3 = 1 9 w_3=\frac{1}{9} w 3 = 9 1 , which gives w 2 2 − w 3 = 0 w_2^2-w_3=0 w 2 2 − w 3 = 0 . Hence, ∣ ψ 2 ⟩ |\psi_2\rangle ∣ ψ 2 ⟩ saturates the moment inequality. In fact, ∣ ψ 2 ⟩ |\psi_2\rangle ∣ ψ 2 ⟩ is a stabilizer state, consistent with the prediction of our criterion.
b . b. b . Example: d = 5 d=5 d = 5 (i) We next consider representative states in dimension d = 5 d=5 d = 5 . First, let ∣ ψ 3 ⟩ = 1 5 ( ∣ 0 ⟩ + ∣ 1 ⟩ + ∣ 2 ⟩ + ∣ 3 ⟩ + ∣ 4 ⟩ ) |\psi_3\rangle=\frac{1}{\sqrt{5}}(|0\rangle+|1\rangle+|2\rangle+|3\rangle+|4\rangle) ∣ ψ 3 ⟩ = 5 1 ( ∣0 ⟩ + ∣1 ⟩ + ∣2 ⟩ + ∣3 ⟩ + ∣4 ⟩) . The corresponding DWF is
W ψ 3 ( p , q ) = { 1 5 , p = 0 , q ∈ Z 5 , 0 , otherwise . (128) W_{\psi_3}(p,q)=
\begin{cases}
\frac{1}{5}, & p=0,\quad q\in\mathbb{Z}_5,\\
0, & \text{otherwise}.
\end{cases} \tag*{(128)} W ψ 3 ( p , q ) = { 5 1 , 0 , p = 0 , q ∈ Z 5 , otherwise . (128)
The second and third Wigner moments are therefore w 2 = 1 5 w_2=\frac{1}{5} w 2 = 5 1 , w 3 = 1 25 w_3=\frac{1}{25} w 3 = 25 1 , which yields w 2 2 − w 3 = 0 w_2^2-w_3=0 w 2 2 − w 3 = 0 . Thus, ∣ ψ 3 ⟩ |\psi_3\rangle ∣ ψ 3 ⟩ saturates the moment inequality. Indeed, ∣ ψ 3 ⟩ |\psi_3\rangle ∣ ψ 3 ⟩ is a stabilizer state, consistent with our moment-based criterion.
(ii) As a contrasting example, consider ∣ ψ 4 ⟩ |\psi_4\rangle ∣ ψ 4 ⟩ ,
∣ ψ 4 ⟩ = ∣ 0 ⟩ − ∣ 1 ⟩ + ∣ 2 ⟩ + ∣ 3 ⟩ + ∣ 4 ⟩ 5 . (129) |\psi_4\rangle= \frac{|0\rangle- |1\rangle+ |2\rangle+ |3\rangle+ |4\rangle}{\sqrt{5}}. \tag*{(129)} ∣ ψ 4 ⟩ = 5 ∣0 ⟩ − ∣1 ⟩ + ∣2 ⟩ + ∣3 ⟩ + ∣4 ⟩ . (129)
Its DWF is
W ρ = [ 1 25 1 25 1 25 1 25 1 25 1 + 5 25 0 1 + 5 25 1 − 5 25 1 − 5 25 1 − 5 25 0 1 − 5 25 1 + 5 25 1 + 5 25 1 − 5 25 0 1 − 5 25 1 + 5 25 1 + 5 25 1 + 5 25 0 1 + 5 25 1 − 5 25 1 − 5 25 ] , (130) W_\rho=
\begin{bmatrix}
\frac{1}{25} & \frac{1}{25} & \frac{1}{25} & \frac{1}{25} & \frac{1}{25}\\
\frac{1+\sqrt{5}}{25} & 0 & \frac{1+\sqrt{5}}{25} & \frac{1-\sqrt{5}}{25} & \frac{1-\sqrt{5}}{25}\\
\frac{1-\sqrt{5}}{25} & 0 & \frac{1-\sqrt{5}}{25} & \frac{1+\sqrt{5}}{25} & \frac{1+\sqrt{5}}{25}\\
\frac{1-\sqrt{5}}{25} & 0 & \frac{1-\sqrt{5}}{25} & \frac{1+\sqrt{5}}{25} & \frac{1+\sqrt{5}}{25}\\
\frac{1+\sqrt{5}}{25} & 0 & \frac{1+\sqrt{5}}{25} & \frac{1-\sqrt{5}}{25} & \frac{1-\sqrt{5}}{25}
\end{bmatrix}, \tag*{(130)} W ρ = 25 1 25 1 + 5 25 1 − 5 25 1 − 5 25 1 + 5 25 1 0 0 0 0 25 1 25 1 + 5 25 1 − 5 25 1 − 5 25 1 + 5 25 1 25 1 − 5 25 1 + 5 25 1 + 5 25 1 − 5 25 1 25 1 − 5 25 1 + 5 25 1 + 5 25 1 − 5 , (130)
where the rows are labelled by p = 0 , … , 4 p=0,\ldots,4 p = 0 , … , 4 and the columns by q = 0 , … , 4 q=0,\ldots,4 q = 0 , … , 4 . In this case, the DWF contains negative phase-space values, indicating its nonclassical character. The corresponding Wigner moments are w 2 = 0.2 w_2=0.2 w 2 = 0.2 , w 3 = 0.02464 w_3=0.02464 w 3 = 0.02464 and hence w 2 2 − w 3 = 0.01536 > 0 w_2^2-w_3=0.01536>0 w 2 2 − w 3 = 0.01536 > 0 . The moment inequality is therefore violated, which certifies, by Theorem 1 of the main text, ∣ ψ 4 ⟩ |\psi_4\rangle ∣ ψ 4 ⟩ as a nonstabilizer or magic state.
In all four cases the criterion gives the correct answer, as guaranteed by Theorem 1 of the main text. In terms of the rescaled third moment,
D 2 w 3 = { 1 , ∣ ψ 2 ⟩ , ∣ ψ 3 ⟩ (stabilizer) , 0 , ∣ ψ 1 ⟩ (strange state) , 0.616 , ∣ ψ 4 ⟩ , (131) D^2w_3 =
\begin{cases}
1, & |\psi_2\rangle, |\psi_3\rangle\quad\text{(stabilizer)},\\
0, & |\psi_1\rangle\quad\text{(strange state)},\\
0.616, & |\psi_4\rangle,
\end{cases} \tag*{(131)} D 2 w 3 = ⎩ ⎨ ⎧ 1 , 0 , 0.616 , ∣ ψ 2 ⟩ , ∣ ψ 3 ⟩ (stabilizer) , ∣ ψ 1 ⟩ (strange state) , ∣ ψ 4 ⟩ , (131)
so the stabilizer states reach the maximal value D 2 w 3 = 1 D^2w_3=1 D 2 w 3 = 1 , while both magic states fall strictly below it.
Mixed-state distributions
a. Example: d = 3 d=3 d = 3 Here, we first consider the convex mixture of strange state and maximally mixed state of qudit system, i.e., ρ 1 = p ∣ S ⟩ ⟨ S ∣ + 1 − p 3 I 3 \rho_1=p|\mathcal{S}\rangle\langle\mathcal{S}|+\frac{1-p}{3}\mathbb{I}_3 ρ 1 = p ∣ S ⟩ ⟨ S ∣ + 3 1 − p I 3 with p ∈ [ 0 , 1 ] p\in[0,1] p ∈ [ 0 , 1 ] . Its DWF is given by
W ρ 1 ( u ) = { 1 9 ( 1 − 4 p ) , u = ( 0 , 0 ) 1 9 ( 1 + p 2 ) , ∀ u ∈ ( Z 3 × Z 3 ) − { ( 0 , 0 ) } W_{\rho_1}(\mathbf{u}) =
\begin{cases}
\frac{1}{9}(1-4p), & \mathbf{u}=(0,0)\\
\frac{1}{9}\left(1+\frac{p}{2}\right), & \forall\ \mathbf{u}\in(\mathbb{Z}_3\times\mathbb{Z}_3)-\{(0,0)\}
\end{cases} W ρ 1 ( u ) = { 9 1 ( 1 − 4 p ) , 9 1 ( 1 + 2 p ) , u = ( 0 , 0 ) ∀ u ∈ ( Z 3 × Z 3 ) − {( 0 , 0 )}
Accordingly, w 2 = 1 9 ( 2 p 2 + 1 ) w_2=\frac{1}{9}(2p^2+1) w 2 = 9 1 ( 2 p 2 + 1 ) , w 3 = 1 81 ( 1 − p ) ( 7 p 2 + p + 1 ) w_3=\frac{1}{81}(1-p)(7p^2+p+1) w 3 = 81 1 ( 1 − p ) ( 7 p 2 + p + 1 ) and w 2 2 − w 3 = 1 81 p 2 ( p + 2 ) ( 4 p − 1 ) w_2^2-w_3=\frac{1}{81}p^2(p+2)(4p-1) w 2 2 − w 3 = 81 1 p 2 ( p + 2 ) ( 4 p − 1 ) . The corresponding witness is plotted in Figure 1 of the main text.
b. Example: d = 5 d=5 d = 5 In this particular example, we consider the convex mixture of ∣ ψ 4 ⟩ |\psi_4\rangle ∣ ψ 4 ⟩ (129) and maximally mixed state of d = 5 d=5 d = 5 system, i.e., ρ 2 = p ∣ ψ 4 ⟩ ⟨ ψ 4 ∣ + 1 − p 5 I 5 \rho_2=p|\psi_4\rangle\langle\psi_4|+\frac{1-p}{5}\mathbb{I}_5 ρ 2 = p ∣ ψ 4 ⟩ ⟨ ψ 4 ∣ + 5 1 − p I 5 with p ∈ [ 0 , 1 ] p\in[0,1] p ∈ [ 0 , 1 ] . The DWF of this mixed state comes out to be
following:
W ρ = [ 1 25 1 + 4 p 25 1 25 1 25 1 25 1 + p 5 25 1 − p 25 1 + p 5 25 1 − p 5 25 1 − p 5 25 1 − p 5 25 1 − p 25 1 − p 5 25 1 + p 5 25 1 + p 5 25 1 − p 5 25 1 − p 25 1 − p 5 25 1 + p 5 25 1 + p 5 25 1 + p 5 25 1 − p 25 1 + p 5 25 1 − p 5 25 1 − p 5 25 ] (132) W_\rho=
\begin{bmatrix}
\frac{1}{25} & \frac{1+4p}{25} & \frac{1}{25} & \frac{1}{25} & \frac{1}{25}\\
\frac{1+p\sqrt{5}}{25} & \frac{1-p}{25} & \frac{1+p\sqrt{5}}{25} & \frac{1-p\sqrt{5}}{25} & \frac{1-p\sqrt{5}}{25}\\
\frac{1-p\sqrt{5}}{25} & \frac{1-p}{25} & \frac{1-p\sqrt{5}}{25} & \frac{1+p\sqrt{5}}{25} & \frac{1+p\sqrt{5}}{25}\\
\frac{1-p\sqrt{5}}{25} & \frac{1-p}{25} & \frac{1-p\sqrt{5}}{25} & \frac{1+p\sqrt{5}}{25} & \frac{1+p\sqrt{5}}{25}\\
\frac{1+p\sqrt{5}}{25} & \frac{1-p}{25} & \frac{1+p\sqrt{5}}{25} & \frac{1-p\sqrt{5}}{25} & \frac{1-p\sqrt{5}}{25}
\end{bmatrix} \tag*{(132)} W ρ = 25 1 25 1 + p 5 25 1 − p 5 25 1 − p 5 25 1 + p 5 25 1 + 4 p 25 1 − p 25 1 − p 25 1 − p 25 1 − p 25 1 25 1 + p 5 25 1 − p 5 25 1 − p 5 25 1 + p 5 25 1 25 1 − p 5 25 1 + p 5 25 1 + p 5 25 1 − p 5 25 1 25 1 − p 5 25 1 + p 5 25 1 + p 5 25 1 − p 5 (132)
The second and third order moments of DWF are w 2 = 1 25 ( 1 + 4 p 2 ) w_2=\frac{1}{25}(1+4p^2) w 2 = 25 1 ( 1 + 4 p 2 ) and w 3 = 1 3125 ( 12 p 3 + 60 p 2 + 5 ) w_3=\frac{1}{3125}(12p^3+60p^2+5) w 3 = 3125 1 ( 12 p 3 + 60 p 2 + 5 ) . Therefore, w 2 2 − w 3 = 4 p 2 3125 ( 20 p 2 − 3 p − 5 ) w_2^2-w_3=\frac{4p^2}{3125}(20p^2-3p-5) w 2 2 − w 3 = 3125 4 p 2 ( 20 p 2 − 3 p − 5 ) .
The criterion certifies the mixed state ρ 2 \rho_2 ρ 2 as nonstabilizer for p ∈ ( 3 + 409 40 , 1 ] p\in\left(\frac{3+\sqrt{409}}{40},1\right] p ∈ ( 40 3 + 409 , 1 ] . Note that 3 + 409 40 ≈ 0.58056 \frac{3+\sqrt{409}}{40}\approx0.58056 40 3 + 409 ≈ 0.58056 (see Figure 1 (b) in the main text).
The noisy strange-state fourth-moment witness is
w 2 3 − w 4 = p 2 ( p + 2 ) ( 4 p − 1 ) ( 4 p 2 − 7 p + 6 ) 1458 . (133) w_2^3-w_4=\frac{p^2(p+2)(4p-1)(4p^2-7p+6)}{1458}. \tag*{(133)} w 2 3 − w 4 = 1458 p 2 ( p + 2 ) ( 4 p − 1 ) ( 4 p 2 − 7 p + 6 ) . (133)
Since 4 p 2 − 7 p + 6 > 0 4p^2-7p+6>0 4 p 2 − 7 p + 6 > 0 , its detection threshold is also p > 1 / 4 p>1/4 p > 1/4 . For the ququint family, the DWF values are ( 1 + 4 p ) / 25 (1+4p)/25 ( 1 + 4 p ) /25 , 1 / 25 1/25 1/25 , ( 1 − p ) / 25 (1-p)/25 ( 1 − p ) /25 , ( 1 + p 5 ) / 25 (1+p\sqrt{5})/25 ( 1 + p 5 ) /25 , and ( 1 − p 5 ) / 25 (1-p\sqrt{5})/25 ( 1 − p 5 ) /25 , with multiplicities 1 , 4 , 4 , 8 , 8 1,4,4,8,8 1 , 4 , 4 , 8 , 8 , respectively. Substituting their power sums into H m H_m H m yields Table 1 .
Table 1. Detection thresholds for ρ 2 \rho_2 ρ 2 . Level m m m of the hierarchy of Theorem 3 detects Wigner negativity for p p p above the listed value.
Comparison with direct Wigner tomography
We now estimate the number of copies required to reconstruct the DWF of an unknown quantum state. Consider a system of n n n qudits, each of local dimension d d d , with total Hilbert-space dimension D = d n D=d^n D = d n . For odd d d d , the DWF is defined as
W ρ ( u ) = 1 D Tr [ A u ρ ] , (134) W_\rho(\mathbf{u})=\frac{1}{D}\operatorname{Tr}[A_{\mathbf{u}}\rho], \tag*{(134)} W ρ ( u ) = D 1 Tr [ A u ρ ] , (134)
where u \mathbf{u} u labels a point in the discrete phase space containing D 2 D^2 D 2 points. The phase-point operators A u A_{\mathbf{u}} A u are Hermitian and satisfy A u 2 = I A_{\mathbf{u}}^2=\mathbb{I} A u 2 = I . Consequently, their measurement outcomes belong to { − 1 , + 1 } \{-1,+1\} { − 1 , + 1 } , and
− 1 ≤ r u ≡ Tr [ A u ρ ] ≤ 1. (135) -1\le r_{\mathbf{u}}\equiv\operatorname{Tr}[A_{\mathbf{u}}\rho]\le1. \tag*{(135)} − 1 ≤ r u ≡ Tr [ A u ρ ] ≤ 1. (135)
To reconstruct the complete DWF, we consider a direct measurement strategy in which the expectation value of each phase-point operator is estimated independently. Suppose that m m m copies of ρ \rho ρ are allocated to each phase-space point. The total number of copies required is therefore
N = D 2 m . (136) N=D^2m. \tag*{(136)} N = D 2 m . (136)
Let r ^ u \hat{r}_{\mathbf{u}} r ^ u denote the empirical average of the m m m measurement outcomes associated with A u A_{\mathbf{u}} A u . Since the outcomes are independent and bounded in [ − 1 , 1 ] [-1,1] [ − 1 , 1 ] , Hoeffding’s inequality gives
Pr [ ∣ r ^ u − r u ∣ ≥ ϵ ] ≤ 2 exp ( − m ϵ 2 2 ) . (137) \Pr[|\hat{r}_{\mathbf{u}}-r_{\mathbf{u}}|\ge\epsilon]\le2\exp\left(-\frac{m\epsilon^2}{2}\right). \tag*{(137)} Pr [ ∣ r ^ u − r u ∣ ≥ ϵ ] ≤ 2 exp ( − 2 m ϵ 2 ) . (137)
The corresponding estimator of the DWF is
W ^ ρ ( u ) = r ^ u D . (138) \widehat{W}_{\rho}(\mathbf{u}) = \frac{\widehat{r}_{\mathbf{u}}}{D}. \tag*{(138)} W ρ ( u ) = D r u . (138)
Thus, an additive error ϵ \epsilon ϵ in the expectation value translates into an error ϵ / D \epsilon/D ϵ / D in the DWF:
∣ W ^ ρ ( u ) − W ρ ( u ) ∣ = 1 D ∣ r ^ u − r u ∣ . (139) \left|\widehat{W}_{\rho}(\mathbf{u}) - W_{\rho}(\mathbf{u})\right| = \frac{1}{D}\left|\widehat{r}_{\mathbf{u}} - r_{\mathbf{u}}\right|. \tag*{(139)} W ρ ( u ) − W ρ ( u ) = D 1 ∣ r u − r u ∣ . (139)
Accordingly,
Pr [ ∣ W ^ ρ ( u ) − W ρ ( u ) ∣ ≥ ϵ D ] ≤ 2 exp ( − m ϵ 2 2 ) . (140) \Pr\left[\left|\widehat{W}_{\rho}(\mathbf{u}) - W_{\rho}(\mathbf{u})\right| \ge\frac{\epsilon}{D}\right] \le2\exp\left(-\frac{m\epsilon^2}{2}\right). \tag*{(140)} Pr [ W ρ ( u ) − W ρ ( u ) ≥ D ϵ ] ≤ 2 exp ( − 2 m ϵ 2 ) . (140)
We next require the prescribed accuracy to hold simultaneously at every phase-space point. Define the failure event
B u = { ∣ W ^ ρ ( u ) − W ρ ( u ) ∣ ≥ ϵ D } . (141) B_{\mathbf{u}} = \left\{\left|\widehat{W}_{\rho}(\mathbf{u}) - W_{\rho}(\mathbf{u})\right| \ge\frac{\epsilon}{D}\right\}. \tag*{(141)} B u = { W ρ ( u ) − W ρ ( u ) ≥ D ϵ } . (141)
Applying the union bound over all D 2 D^2 D 2 phase-space points, we obtain
Pr [ ⋃ u B u ] ≤ ∑ u Pr ( B u ) ≤ 2 D 2 exp ( − m ϵ 2 2 ) . (142) \Pr\left[\bigcup_{\mathbf{u}} B_{\mathbf{u}}\right] \le\sum_{\mathbf{u}}\Pr(B_{\mathbf{u}}) \le2D^2\exp\left(-\frac{m\epsilon^2}{2}\right). \tag*{(142)} Pr [ u ⋃ B u ] ≤ u ∑ Pr ( B u ) ≤ 2 D 2 exp ( − 2 m ϵ 2 ) . (142)
To ensure that the probability of at least one estimation error exceeding ϵ / D \epsilon/D ϵ / D is at most δ \delta δ , it is sufficient to impose
2 D 2 exp ( − m ϵ 2 2 ) ≤ δ . (143) 2D^2\exp\left(-\frac{m\epsilon^2}{2}\right) \le\delta. \tag*{(143)} 2 D 2 exp ( − 2 m ϵ 2 ) ≤ δ . (143)
Solving for m m m gives
m ≥ 2 ϵ 2 ln ( 2 D 2 δ ) . (144) m \ge\frac{2}{\epsilon^2}\ln\left(\frac{2D^2}{\delta}\right). \tag*{(144)} m ≥ ϵ 2 2 ln ( δ 2 D 2 ) . (144)
Using Eq. (136) , a sufficient total copy budget for reconstructing the complete DWF is therefore
N ≥ 2 D 2 ϵ 2 ln ( 2 D 2 δ ) . (145) N \ge\frac{2D^2}{\epsilon^2}\ln\left(\frac{2D^2}{\delta}\right). \tag*{(145)} N ≥ ϵ 2 2 D 2 ln ( δ 2 D 2 ) . (145)
Here and throughout, integer rounding of the required number of measurement repetitions is understood. This choice guarantees
Pr [ max u ∣ W ^ ρ ( u ) − W ρ ( u ) ∣ ≥ ϵ D ] ≤ δ . (146) \Pr\left[\max_{\mathbf{u}}\left|\widehat{W}_{\rho}(\mathbf{u}) - W_{\rho}(\mathbf{u})\right| \ge\frac{\epsilon}{D}\right] \le\delta. \tag*{(146)} Pr [ u max W ρ ( u ) − W ρ ( u ) ≥ D ϵ ] ≤ δ . (146)
For a system of n n n qudits, substituting D = d n D = d^n D = d n into Eq. (145) yields
N ≥ 2 d 2 n ϵ 2 ln ( 2 d 2 n δ ) . (147) N \ge\frac{2d^{2n}}{\epsilon^2}\ln\left(\frac{2d^{2n}}{\delta}\right). \tag*{(147)} N ≥ ϵ 2 2 d 2 n ln ( δ 2 d 2 n ) . (147)
Consequently, the direct pointwise measurement strategy achieves the sample-complexity scaling
N = O ( d 2 n ϵ 2 ln d 2 n δ ) . (148) N = O\left(\frac{d^{2n}}{\epsilon^2}\ln\frac{d^{2n}}{\delta}\right). \tag*{(148)} N = O ( ϵ 2 d 2 n ln δ d 2 n ) . (148)
Thus, reconstructing the complete DWF with fixed accuracy in the rescaled phase-space values D W ρ ( u ) DW_{\rho}(\mathbf{u}) D W ρ ( u ) requires a number of copies that grows exponentially with the number of qudits under this direct measurement strategy. This should be contrasted with the bounded-outcome few-copy moment-estimation protocol, for which the rescaled moment witness can be estimated to fixed additive accuracy using a number of copies independent of D D D , whenever the required bounded-outcome estimators are available.