Quantifying Qubit Magic Resource with Gottesman-Kitaev-Preskill Encoding

Quantum resource theories are a powerful framework to characterize and quantify relevant quantum phenomena and identify processes that optimize their use for different tasks. Here, we define a resource measure for magic, the sought-after property in most fault-tolerant quantum computers. In contrast to previous literature, our formulation is based on bosonic codes, well-studied tools in continuous-variable quantum computation. Particularly, we use the Gottesman-Kitaev-Preskill code to represent multi-qubit states and consider the resource theory for the Wigner negativity. Our techniques are useful to find resource lower bounds for different applications as state conversion and general unitary synthesis, in which measurements, auxiliary states, and classical feed-forward are allowed. The analytical expression of our magic measure allows us to extend current analysis limited to small dimensions, easily addressing systems of up to 12 qubits.

Identifying and quantifying which properties of quantum mechanics, or resources, are responsible for the predicted advantage of quantum computers over classical ones is the object of intense theoretical and experimental effort.Within the field of resource theories [1][2][3][4][5][6][7][8][9][10], the quantification of magic for fault-tolerant quantum computation occupies a prominent role.The leading architectures of fault-tolerant quantum computers are based on stabilizer codes [11].In this approach, certain operations are easy to implement and constitute a nonuniversal [12] set that is fault-tolerant by having a transversal implementation -such that these operations do not propagate errors within a code block [13].This restricted set of easy or free operations called stabilizer operations includes Clifford gates, preparation of stabilizer states, and computational basis measurements.Stabilizer operations alone cannot provide quantum computational advantage, as the calculations can be efficiently classically simulated [14].To unlock universal quantum computation, one needs to include difficult or resourceful operations -for example, through magic state injection-which naturally leads to the so-called magic state model [15].However, the preparation of high-quality magic states typically involves costly procedures such as magic state distillation, which makes it desirable to optimise the number of magic states used for a given quantum computation -although alternative routes to magic state distillation exist [16].
The need for optimizing non-stabilizer resources has driven the area of resource theory of magic and therefore the definition of several magic measures for both qudit -ddimensional-and qubit systems.Early works focused on resource theories of magic for odd-dimensional qudits [17], relying on a well-defined discrete Wigner function and its negativity [8] , and its extensions to infinite dimensions [9,10].The more defying case of multi-qubit systems -for which the definition of the discrete Wigner function remains challenging [18][19][20][21]-has undergone substantial progress in recent years with the development of several magic measures.Among these, the relative entropy of Magic [8], the Robustness of Magic [22], the dyadic negativity, the mixed state extent, and the generalized robustness [23] have been defined for general density matrices, while the stabilizer rank or extent [24][25][26], the stabilizer nullity, and the dyadic monotone [27] only account for the magic content of pure states.The availability of these measures has been essential to find (in few cases optimal) lower bounds in magic state distillation schemes and in non-Clifford unitary synthesis [22,23,27].Moreover, magic monotones have inspired classical simulators of quantum computing architectures [23][24][25][26].However, in general, it is impractical to compute these measures for large numbers of qubits ( 5), and several lower bounds in the literature apply to distinct scenarios in which not always all easy operations are considered free -for instance, the measures do not always account for measurements and classical feed-forward as free operations.Therefore, it is desirable to provide new measures that are practically computable for larger number of qubits, and combine different quantifiers of magic to find tighter bounds applicable to general scenarios and to identify how quantum computations can be optimized.
Here, we develop a new magic measure for multi-qubit pure states by borrowing tools and notions from continuousvariable (CV) systems in the context of bosonic codes.Moreover, we connect this independently developed magic measure with the st-norm [22,28], and with the stabiliser Rényi entropy [29], measured recently on a quantum processor [30].
The CV framework provides a way to upgrade the st-norm status to a fully-fledged measure and brings new insight on its properties and tools for its computation.We exploit the encoding of discrete-variable systems into the infinite-dimensional Hilbert space of CV systems provided by bosonic codes, the main alternative to conventional error-correction codes with growing theoretical and experimental efforts [31][32][33][34].In contrast to all previous magic monotones, the CV mathematical formulation of our monotone allows for transferring results from CV quantum computation to magic quantification.Specifically, we map qubit systems into an infinitedimensional Hilbert space via the Gottesman-Kitaev-Preskill (GKP) encoding [35] and then derive an expression for their Wigner logarithmic negativity (WLN) [9,10,36].Using this expression, we develop a new magic measure that we call GKP Magic.The Wigner function is well-defined for CV systems and allows us to evaluate the GKP Magic for signifi-cantly larger systems than previously known measures, easily reaching up to 12-qubit systems.The GKP Magic properties that we prove enable the analysis of the magic resource cost in the most general scenario, where probabilistic protocols are allowed, and measurements, auxiliary qubits, and classical feed-forward are free operations.In this context, we find analytical expressions of the GKP Magic for relevant building blocks of quantum algorithms yielding lower bounds for the corresponding T -count, a known indicator of the difficulty to implement fault-tolerant quantum circuits.
Definition of the GKP Magic measure.-Weconsider a general n-qubit state in the Ẑ eigenbasis, represented by the density operator with |u = |u 1 . . .u n and |v = |v 1 . . .v n a tensor product of the single-qubit states in the computational basis, F n 2 the n-dimensional binary linear space, and ρ u,v complex coefficients.With the GKP encoding in square lattices, the code words |u i -with u i ∈ {0, 1}correspond to the infinite superpositions of position q eigenstates Then, the Wigner function associated to the GKP-encoded density operator of Eq. ( 1) is given by and it constitutes the foundation of the GKP Magic measure.The negativity of the Wigner function is a necessary condition for achieving exponential speed-up in continuousvariable quantum computing architectures [37].A measure of this resource is the WLN, defined as [9,10] with d n q and d n p the n-dimensional volume differentials corresponding to q and p, and σ a bosonic Hermitian operator.Firstly, we compute the negativity of the Wigner function given in Eq. (3).Since the WLN of an ideal non-normalized GKP codeword is infinite, we consider the periodicity of the Wigner function and restrict the computation to the lattice unit cell to obtain a finite value.We reduce the integration domain in Eq. ( 4) to a hypercube in phase space, with the domain . Therefore, we define the WLN of one unit cell as The integral over the absolute values of the Wigner function can be evaluated and is obtained as with i • k = n j=1 i j k j mod 2 the standard binary inner product, and k+j the bitwise sum (k+j Quantifying the cell Wigner negativity of a n-qubit GKP state in Eq. ( 6) allows us to define the GKP Magic G(|ψ ), a new Magic monotone for pure states.This definition was first motivated by noticing that the cell WLN of encoded GKP states saturates to a constant value for encoded stabilizer states, while it is maximal for the |T and |H magic states [39,40].We emphasize the generality of the previous Wigner function logarithmic negativity calculations by using ρ to denote any mixed or pure state.For the sake of clarity, since we only demonstrate the monotonic properties of the GKP Magic for pure states ρ = |ψ ψ|, we stress the difference by denoting the quantum state as |ψ from now on.
Crucially, we notice that GKP-encoded pure stabilizer states contain an inherent amount of WLN in one lattice cell.Therefore, we define our GKP Magic measure by subtracting the inherent cell negativity of (2/ √ π) n to enforce that G(|ψ S ) = 0 for |ψ S a pure stabilizer state.We provide an explicit counterexample for mixed states in [38,Sec.IV].
In the case of pure states |ψ = i∈F n 2 c i |i , the GKP Magic measure is finally obtained as where we made use of Eq. ( 6).The Wigner negativity in the argument of the logarithm is equivalent to the st-norm [38, Sec.III], initiallly regarded as a one-way magic witness.In turn, this also implies that it is equivalent to the stabiliser Rényi entropy [29][38, Sec.III] for α = 1 2 .These equivalences upgrade the st-norm to a fully fledged magic measure.
Using the properties of the WLN enables us to demonstrate the following properties for our GKP Magic measure G [38, Sec.II]: Using our newly defined magic measure, we compute the most magic states and unitaries [38,Sec. V].
Distillation and gate synthesis.-Magicmonotones play a central role in the leading approaches to fault-tolerant quantum computation, and have been used to bound the number of resourceful states for state conversion and gate synthesis [22,27].Additionally, fundamental bounds have been found on the Gaussian conversion between GKP-encoded Hadamard eigenstates |H and the logical GKP-state |0 in continuous-variable settings [40].Using our GKP Magic measure, we can lower bound the number of copies of a given resource state needed to implement a desired target unitary or to produce certain state when non-unitary and probabilistic protocols are allowed.
Firstly, we address distillation protocols to extract a particular target state.We consider a stabilizer protocol [8] -a set of Clifford unitaries, composition with stabilizer states, computational basis measurements, and Pauli operations conditioned on measurement outcomes-that converts k copies of |ψ to m copies of the target state |φ .The GKP Magic does not increase with such stabilizer protocol, and therefore we can bound the number of input resource states by where we have used the additive property of our measure, G(|ψ ⊗k ) = kG(|ψ ).We notice that this property also allows us to establish bounds even when catalyst states -loaned magic states returned at the end of the protocol-are allowed.Moreover, we analyze probabilistic stabilizer protocols for distillation that convert k copies of an r-qubit state |ψ to m copies of the s-qubit target state |φ with probability p.That is, we consider stabilizer protocols that can include postselection upon specific measurement outcomes and operations entailing partial traces that can create mixed quantum states.Despite the GKP Magic monotone being only defined for pure states, its direct link with the WLN allows us to consider lower bounds of required resource states when intermediate mixed states are involved.The system's WLN restricted to the code's unit cell is additive and does not increase on average with such probabilistic stabilizer protocol [38,Sec.IV], so that We can establish a lower bound on the average number of copies E[n] of |ψ needed to distill |φ ⊗m proportional to the ratio of the monotones.Since one must run the probabilistic protocol 1/p times to get a successful outcome, we require Finally, for input and output pure states the WLN per cell is directly related with the GKP Magic as where we have subtracted the corresponding intrinsic logarithmic negativity per cell of a pure n-qubit stabilizer state |ψ S , given by N 0 (n) = (2/ √ π) n .Hence, we can rewrite the bound as This bound is strictly looser in the case of p = 1 [38, Sec.IV].
Besides characterizing distillation protocols, magic measures have been used to bound gate synthesis.A quantum gate can be synthesized with purely unitary processes [41] or, more generally, allowing auxiliary qubits, measurements and classical feed-forward [42][43][44][45].In the field of fault-tolerant quantum computation, gates of the third level of the Clifford hierarchy -C 3 such that [15] with the n-qubit Pauli group C 1 -are the standard and most convenient non-Clifford elements to enable universal quantum computing when Clifford gates (elements in C 2 ) are available [15].Although any circuit can have an equivalent teleportation gadget, C 3 gates can be implemented with the corresponding resource states and conditional operators in the Clifford group, so that the state and gate costs coincide [15,46] In particular, we estimate the number of T gates (or number of |H states) needed to implement different unitaries from C 3 .We quantify the T -count, i.e. the number of T gates needed, since the {Clifford, T } constitutes a universal gate set [47].Equivalently, we can measure the |H -cost -the number of required |H = (|0 + e iπ/4 |1 )/ √ 2 states-since the |H magic state can be consumed to implement the non-Clifford gate T [47].We analyze the gates characterized with the Robustness of Magic [22], which allowed for improved gate synthesis and proved the optimality of several circuits.The lower bound obtained with the GKP Magic coincides with the lower bound given by the Robustness of Magic for these cases [38,Sec. V].
Moreover, we study the multiply-controlled phase gates Mφ , which are from the third level of the Clifford hierarchy [48] and have a diagonal representation in computational basis

G
The multiply controlled Phase-Gate where n is the number of qubits.The family of unitaries Mφ of Eq. ( 13) belong to diagonal gates of the third level of the Clifford hierarchy, and the state |M φ can be teleported to generate the corresponding gate without additional cost.Here, φ = π corresponds to the The GKP Magic converge to a finite value for increasing numbers of qubits.
They include the multiply-controlled gates 2 ), and , where we use the notation for an n − 1 times controlled G gate as C n−1 G.
We derive analytically the GKP Magic value for any M φ gate dimension [38, Sec.V].Fig. 1 shows that the GKP Magic for different Mφ gates converges to a finite value as the number of qubits increases.We analyze analytically this asymptotic behavior [38, Sec.V].Furthermore, we give analytical expressions for the GKP Magic for the state |H , the quantum adder and the quantum Fourier transform [38, Sec.V].
Since there exist Clifford operations Û and V such that C n−1 X = Û C n−1 Z V , multiply controlled Xand Z-gates are expected to contain the same amount of magic.We confirm this numerically [38, Sec.V], and in particular we compare our obtained T -count for the C 3 Z gate with known values to implement a Toffoli-gate C 3 X.The T -count provided by our measure coincides with the count of the optimal teleportation gadget of the Toffoli gate [42], but it does not prove the optimality of the C n−1 X gate gadget with 4(n − 2) T gates.Notice that the optimal unitary circuit to synthesize the Toffoli and Fredkin gates includes 7 T gates [49], which does not contradict the optimal bound for general synthesis, where measurements and classical feed-forward are allowed.
In general, we can quantify the GKP Magic of any unitary by using the Choi-Jamiołkowski isomorphism [50,51], even those that are not diagonal unitaries from the third level of the Clifford hierarchy.With this correspondence, we map unitaries to quantum states suitable for our measure defined in Eq. ( 7) [38,Sec. V].The GKP Magic of general unitaries can be used as well to lower bound the resources needed for their implementation.For gates outside C 3 we do not expect tight bounds, as one may need to use non-Clifford gates to correct measurements in teleportation schemes or dispose of output states in probabilistic protocols.
Using the Choi-Jamiołkowski isomorphism we calculate numerical values for gates analyzed in [49].The largest system size we consider involves 12 qubits and corresponds to the C 5 X gate.The calculated values as well as the most magical two-qubit unitaries and the most magical 3-qubit states can be found in the Supplemental material [38,Sec. V].
GKP Magic and other magic quantifiers.-It is interesting to compare the GKP Magic to other magic quantifiers introduced previously in the literature.The sum negativity of a discrete Wigner function is a magic monotone for general odd qudit systems [8].However, the extension to qubit systems remains challenging [18][19][20][21].Even though the discrete Wigner function resembles the Wigner representation of a GKP-encoded qubit restricted to a unit cell, the corresponding magic monotones -the sum negativity and the GKP Magic-differ for the single-qubit case [38, Sec.IV], where both are valid measures.
In contrast to the stabilizer nullity and similarly to the Robustness of Magic, our measure assigns a small value close to stabilizer states.For instance, the GKP Magic of the pure single-qubit state |ψ = (|0 + e iφ |1 )/ √ 2 tends to zero for small angles φ → 0. This feature explains the GKP Magic of the multiply-controlled phase gates converging to a finite value, opposite to the stabilizer nullity for the C n Z gate [27].Through the GKP magic connection with the stabiliser Rényi entropy [29] and st-norm [22], we conclude that it lower bounds the Robustness [22] and the stabilizer nullity [38,Sec. III].
Crucially, in contrast to most other magic measures, the computation of our magic measure does not include optimization, while it allows us to find analytical expressions for nqubit states.Also note that the computation of GKP Magic in Eq. ( 7) does not require any explicit CV phase space calculations.
Numerically, our measure requires three sums that scale with 2 3n additions of matrix elements.While e.g. the Robustness of Magic could be computed for systems sizes of up to 5 qubits [22], or for product states with specific symmetries [52], in this work we calculate the GKP Magic for general states of up to n = 12 qubits.The computation for 12 qubits takes 962s on one core on a laptop CPU (Intel Core i7).We expect that larger system sizes are reachable, with 12 qubits not being a hard limit.These running times and the additivity of our measure open the possibility of exploring previously unreachable system sizes.
Discussion and perspective views.-Insummary, we have introduced a new additive magic measure for multi-qubit pure states, the GKP Magic, derived using bosonic codesthe GKP encoding-and considering the WLN in CV systems.Moreover, we have established a connection with the st-norm and stabiliser Rényi entropy, with the former initially introduced solely as a one-way magic witness.Crucially, the CV framework allows us to prove the properties of our measure by transferring properties of the WLN.The convenient expression of the GKP Magic in Eq. ( 7) allows us to lower bound the resources needed for general unitary synthesis and state conversion.In contrast to existing monotones, computing our measure does not require numerical optimization and we can outperform previous results involving up to ≈ 5 qubits for general states, easily reaching 12-qubit states.Therefore, the GKP magic can be used to address general gate synthesis -where unitary operations, measurements on auxiliary systems and classical feed-forward are allowed-and lower bound unitaries and states that were out of reach previously.We also confirm existing optimal lower bounds for several unitary gates studied previously, including the Toffoli gate.Moreover, we have derived analytical expressions of our measure for multiply-controlled phase gates, the quantum adder, and the quantum Fourier transform for an arbitrary number of qubits.Similar to the st-norm and the Robustness of Magic case, we find lower bounds for any multi-qubit state and the general scenario of probabilistic stabilizer protocols using the Wigner negativity per cell, well-defined for mixed states.
Since the GKP encoding can be applied to qudits of any dimension, it is natural to ask whether we can define a generalized GKP Magic and how it would be related to the discrete Wigner function for odd prime dimensions.Another interesting open question is weather the GKP magic quantifies the hardness of classical simulation of Clifford computation with additional resource states.Our work sheds new light on magic measures by investigating bosonic codes and CV state conversion.As such, it opens the question as to whether other properties of finite-dimensional systems could be assessed by mapping them to infinite-dimensional ones, and thereby bridging and transferring results from two independent areas of quantum information.Finally, the core idea of connecting concepts of CV and DV systems via bosonic codes can be interpreted as an operational blueprint for resource theories of finite-dimensional systems, beyond quantum computation.In this section, we derive the Wigner logarithmic negativity per GKP lattice cell.This quantity is the main ingredient to define our magic measure, the GKP magic.First, we give a general expression for the Wigner function of an n-qubit state encoded in the GKP code.We then rewrite the Wigner function in a way that makes it possible to read off the value at every point in phase space.The rewritten Wigner function enables us to perform the integral needed to calculate Wigner logarithmic negativity by splitting the integral.Consequently, we obtain a sum of coefficients that we then rewrite in a new compact form.

Wigner function of n-qubit encoded states
Encoding the information of finite-dimensional quantum systems into bosonic systems is an alternative strategy for quantum error correction.Here, we use the GKP encoding to describe the qubit states with the language of continuous quantum variables [35].Thus, we encode n qubits in the 2n-dimensional phase space of n oscillators, by exploiting the translational symmetry of the GKP code.The tensor product of Pauli operators can then be defined as displacements where α i , β i are real numbers and pi , qi canonical variables that satisfy the relation [q i , pj ] = iδ ij , with = 1.The GKP code space is the simultaneous +1 eigenspace of the stabilizer generators, Pauli operators that commute with each other.The Pauli operators of Eq. (A1) commute if ω(αβ, α β ) = α • β − α • β is an integer, and have a one-to-one correspondence to the points of a lattice in phase space through + + + + + < l a t e x i t s h a 1 _ b a s e 6 4 = " V X N 4 s K M 5 r / V j j 6 0 e s d m p   where a i are the 2N basis vectors of the lattice, each consisting of linear combinations of q and p, the n-tuples (q 1 , . . ., q n ) and (p 1 , . . ., p n ), and k i are integers to move from one cell to another.For a more in-depth treatment consult [35].For simplicity, we choose the code space lattice to be a hypercube of side-length 2 √ π generated by stabilizer operators that are linear combinations of qi variables, and separately, combinations of pi variables -codes of the CSS type [53,54].
The idea of our magic measure is to use the GKP encoding and compute the Wigner logarithmic negativity of one cell.To calculate the Wigner logarithmic negativity of a GKP state, we first need to derive a general expression for the Wigner function.In this section, we derive the n-qubit Wigner function in GKP encoding.The main ideas behind the definition of the GKP magic can be found in Fig. 2.
A common representation for quantum states and processes is the Wigner functions in a quantum phase space.The Wigner function is defined as where σ is the state of the continuous variable system.In the following we will denote as ρ = u,v∈F n 2 ρ u,v |u v| the state of the qubit system, to avoid confusion between the density operator of a qubit system and the representation of the qubit system in GKP-encoding.Starting from this general definition of the n-mode Wigner function and using the representation of a general n-qubit state in GKP encoding, we arrive at where each integral goes only over a single oscillator.The solution to each of these integrals is calculated in [39].The n-qubit Wigner function in GKP encoding is then given by The Wigner function consists of a sum of Dirac-δ distribution positioned at all lattice sites in phase space.

Wigner logarithmic negativity of n-qubit encoded states
We calculate in this section the Wigner logarithmic negativity, using the expression for the general n-qubit Wigner function and the technique to evaluate the integrals.Furthermore we will reformulate the recursions defined in Eqs.(A8) and (A9) to retrieve a more compact formula for the Wigner negativity of one GKP unit-cell.
As was mentioned before, the GKP magic is defined for pure states.We still write the more general density operator ρ to indicate that the results in the following sections hold for the more general case.We define the short hand notation where A is the row vectorization of matrix A. Additionally we define the block notation for the single qubit case. and where i, j ∈ F n−1

2
. We define the matrices W l,m If we look at our definition of W l,m in Table I, we see that the matrices repeat themselves with different global signs.The global signs are negligible, since we are summing absolute values of our coefficients w.Thus we get a multiplicity of 4 n if we only consider all the elements of the n-qubit Pauli group C 1 , the first level of the Clifford hierarchy [15].Using our notation, the leftmost matrix W l,m will act on the entries of block B n where the next one in then entries of B n−1 , etc..The rightmost W l,m will then act on the entries of B 1 , which are then different elements of the quantum state.
With this notation, we can simplify the Wigner negativity by rewriting the sum of the recursion formulas defined in Sec.A to

(A22)
We can evaluate the action of the matrices on a block This can be summarized in By repeatably applying the matrices on the blocks, we finally arrive at compact expression to calculate the Wigner negativity where ρ k,k+j are the matrix elements of the n-qubit density operator in σ z eigenbasis.i•k = n j=1 i j k j mod 2 is the standard binary inner product, and k+j the bitwise sum (k+j) i = k i +j i mod 2. So if we restrict ρ = |ψ ψ| with |ψ = i∈F n 2 c i |i as a pure state then the coefficients are given by ρ k,k+j = c * k+j c k .Note that we have shown here equivalently a different form of the coefficients in Eq. (A7) and the connection to Sec. C.
where we use the shorthand notation R n1...n 2N = 2N i=1 n i a i .In the following derivations, we will use the shorthand notation The results holds as well if we take the logarithm, since log(x) is a monotonous function for x.

Invariance under Clifford unitaries
We need to show that the Wigner negativity for one cell is invariant under Clifford unitaries ÛC ⊂ ÛG on the code space The Clifford unitaries map a code word to a different code word and leave the lattice thus invariant.It is known that the Wigner negativity is invariant under the action of Gaussian operations [9].Thus it needs to hold where we used that the Wigner negativity is invariant under Gaussian unitaries.Thus the value of one cell is invariant under Clifford unitaries as well.
Since our measure is defined as the GKP magic is invariant under Clifford unitaries as well.The offset

Additivity
We show that the GKP magic is additive since the Wigner negativity of one cell is multiplicative.It holds that where we used that the Wigner function factorizes for product states.Thus the Wigner negativity of one cell is multiplicative and the GKP magic additive, because the offset can be split accordingly as well

Faithfulness
Here, we prove that the GKP magic is a faithful monotone.That is, we want to enforce that G(|ψ S ) = 0 if and only if |ψ S is a stabilizer state.The GKP magic of an n-qubit pure state is defined in terms of the Wigner negativity per cell N C of the corresponding GKP encoded state, as shown in Eq. (B10).From the definition, we observe that the measure is faithful if we find a normalization N 0 (n) for n-qubit systems such that if and only if |ψ S is a stabilizer state.Firstly, we consider single-qubit systems, n = 1.As shown in Sec.D, the Wigner negativity per cell of single-qubit stabilizer states |ψ S is given by [39] Therefore, the normalization constant that guarantees that the GKP magic is zero for stabilizer states is We also need to show that the GKP magic vanishes only for stabilizer states.That is, that the Wigner negativity per cell is 2/ √ π only if the single-qubit state is a stabilizer state.We consider a general single-qubit state |ψ = cos θ 2 |0 + sin θ 2 e iφ |1 and its Wigner negativity per cell [39] which becomes 2/ √ π for qubit states characterized by θ and φ values satisfying The solutions are given by θ = kπ for any integer k and arbitrary φ; and by θ = (2k + 1) π 2 and φ = 0 or φ = (2 + 1) π 2 for any integers k and .These parameter values represent single-qubit stabilizer states, which proves the GKP magic faithfulness for the single-qubit pure states.Now, we address the general n-qubit systems case.First, we prove that if a state |ψ S is a stabilizer state, then G(|ψ S ) = 0. Multi-qubit stabilizer states are constructed via tensor product of single-qubit stabilizer states and the application of Clifford unitary operations.Since Clifford operations do not increase the Wigner negativity per cell N C , we can consider the normalization N 0 (n) for n-qubit product states without loss of generality.Taking into account the multiplicativity of the Wigner negativity, the normalization for n-qubit systems is given by This normalization is included in the definition of the GKP magic in Eq. (B10) and guarantees that it vanishes for any n-qubit stabilizer state.To complete the proof, we will now show that only pure stabilizer states can give zero GKP magic.
One can decompose arbitrary n-qubit states in the Hilbert-Schmidt basis as [55] ρ = 1 2 n  1 with a P ∈ R and a P ≤ 1 while C + 1 \ 1 is the set of elements of the n-qubit Pauli group with only positive signs, without the identity.We only consider pure states, for which Tr ρ2 = 1.That is, P ∈C + 1 \1 a 2 P = 2 n − 1, and one needs at least 2 n − 1 summands in the chosen decomposition to represent a pure state.
By definition, all pure states that have a stabilizer group S ⊂ C 1 of cardinality 2 n are called stabilizer states, with C 1 the n-qubit Pauli group.That is, a stabilizer state σ is a +1 eigenstate of 2 n elements of the n-qubit Pauli group and can be written as Therefore, in the general n-qubit pure state decomposition of Eq. (B22), stabilizer states' coefficients satisfy a P = 1 for P ∈ S, and zero otherwise.Therefore, pure stabilizer states have the minimal decomposition in the Hilbert-Schmidt basis.
The Wigner negativity per cell, related to the st-norm, for stabilizer states is An arbitrary pure non-stabilizer state ρ is given by where M ⊆ C + 1 is the set of Pauli operators with positive sign needed to represent the pure non-stabilizer state.If we compare the cardinalities of the sets, it holds that card(S) < card(M) ≤ card C + 1 , implying that the sum in Eq. (B25) involves more than 2 n terms.Indeed, we have shown that pure states need at least 2 n summands in the Hilbert-Schmidt decomposition, and that pure stabilizer states are expressed exactly with 2 n terms.Therefore, pure non-stabilizer states require necessarily more that 2 n summands.We notice that we cannot apply the same argument for the case of mixed states, since in general they can be expressed by less than 2 n terms.The number of summands in the Hilbert-Schmidt representation of pure states is connected with the Wigner function of the corresponding GKP encoded states.We observe that higher number of summands correspond to higher number of Dirac-delta peaks in the Wigner function of the continuous-variable state [39].That is, non-stabilizer states have a higher number of w l,m coefficients different from zero in Eq. (A7).
The Wigner negativity per cell for a general n-qubit non-stabilizer pure state ρ is The absolute values of the Wigner function can be rewritten as for N B the dimension of the measured subsystem, C the integral domain of the unit cell of the measured subsystem and where we used that λ Π λ = 1 with W [1](r) = 1 2π N B and that the Wigner function of Π λ is translational invariant.We need to keep in mind that if we restrict to one unit cell, the measurement is only allowed to have support in one cell as well.Thus we get where we used that the post-measurements states are still valid code words.Thus the Wigner negativity fulfills that Note again, by restricting the Wigner function to one unit cell, we get The GKP magic is therefore non-increasing under computational basis measurements as well, since the measurements in computational basis and post-selection conserve the purity of the input state.The post-measurement state will collapse to a stabilizer state in the measured subsystem.So consequently with where m λ is the probability amplitude associate with measurement outcomeλ and |m λ | 2 = p λ .

GKP magic and the discrete Wigner function
The properties of the continuous-variable Wigner function differ from those of the discrete Wigner function making the former suitable for magic quantification for qubit systems (upon the mapping with GKP states that we introduced), unlike the So the Wigner negativity is given as where we used the integral triangle equality.
The last step missing is to show how the partial trace acts on our code space and thus on one unit cell.The partial trace on the code space is Hence, we need to keep that in mind that for consistency the trace should only act within the unit cell if we restrict it to a unit cell.
Consequently, the Wigner negativity of one cell is non-increasing under the action of a partial trace Lower bounds for probabilistic gate synthesis As described in the main text, we can lower bound probabilistic stabilizer protocols that convert k copies of an r-qubit state |ψ to m copies of the s-qubit target state |φ with probability p.The following calculations will clarify the connection between the st-norm [28] and the GKP magic, namely that the logarithm of the st-norm -the Wigner logarithmic negativity restricted to one GKP cell, W C -lower bounds the GKP magic.Notice that we can define the GKP magic for mixed states mathematically, although it is not a magic measure.We highlight the parallelism with this lower bound and the lower bounds on the Robustness of Magic with the st-norm [22].
In Sec.B and D, we show that the Wigner logarithmic negativity of one unit cell is additive and does not increase under probabilistic stabilizer protocols, so that For the average number of copies E[n] of |ψ needed to distill |φ ⊗m it has to hold that where the protocol has to be run 1/p times for a successful outcome.The Wigner logarithmic negativity per cell is directly related with the GKP magic as where we have subtracted the intrinsic logarithmic negativity per cell of a pure n-qubit stabilizer state, given by log 2 [N 0 (n)] = (2/ √ π) n .Thus, the bound can be rewritten as For a deterministic protocol (p = 1), this bound simplifies to On the other hand, the GKP magic bound for deterministic protocols is We can thus compare both bounds of Eqs.(D15) and (D16) to determine which one is tighter.In particular, the lower bound given by the GKP magic in Eq. (D16) is higher when We observe that the inequality in Eq. (D18) always holds since the number of initial qubits kr is always higher or equal to the number of output qubits ms.Thus, kr/m ≥ s and s Hence, the lower bound provided by the Wigner logarithmic negativity per cell is strictly lower (less tight) than the lower bound given by the GKP magic.4 .We find two maximas in the investigated interval that are at the same time the maximal value for all possible single qubit unitaries.The red line symbolizes the angle for which the robustness of magic is maximized [22].As can be seen, our measure is in a local minimum for this angle.
The maximally entangled state for two qubits is given by The map can be retrieved probabilistically by a teleportation procedure.For our purposes, however this is not important.For a trace-preserving map Φ the Choi state ϕ is a proper normalised state, if Φ is unitary then φ is a pure quantum state.Thus if we define Φ/qty(ρ) = Û ρ Û † with Û ∈ SU(2 n ), we can calculate the GKP magic for arbitrary unitaries.For a n-qubit unitary, the Choi state is then given by For two qubits, the most magic state is given as For three qubits, the most magic state is the Hoggar state with G(|Ψ 3 ) = 1.459.
Using the Choi-Jamiołkowski isomorphism described in Sec.E, we can calculate the most magic unitary as well.Since we are mapping a unitary into states involving twice the number of qubits on which the unitary has support, the calculated values need to be smaller or equal than the most magic state of this number of qubits.
A general 2 × 2 unitary matrix can be parametrized as e iφ1 cos(α) e iφ2 sin(α) −e −iφ2 sin(α) e −iφ1 cos(α) . (E22) Thus we choose to represent a single qubit unitary operation Û ∈ SU(2) in the computational basis in the above-defined parametrization.By numerically optimizing over all one qubit unitaries, we found the maximal GKP magic with G(|ϕ U m = 0.585 at the optimal angles φ 1 = 0, φ 2 = π 4 , α = 0.6155 π 6 < α < π 5 .The angles agree well with [22] except that we do not have α = π 4 .A plot showing this difference can be seen in Fig. 4. In order to characterize the most magic multi-qubit unitary, we parametrize the unitaries by using the Cartan decomposition of SU(2 n ) [56] with n being the number of qubits.A explicit expression for the two qubit U 4 ∈ SU(2 2 ) case is given in [57].
The most GKP magic two-qubit unitary is then given by

GKP magic comparison and numerical results
In this section, we collect numerical values calculated with the GKP magic.A list of quantum states with their resource content can be found in Table II.Additionally to the gates described in the main text, whose T -count has been calculated in [49], we also compute the resource of the following 4-qubit circuits The results are given in Table III.The T -counts are again lower than the ones provided in [49], but those are given for unitary synthesis.However, we reproduce that U 1 has more resource than U 2 thus the same hierarchy as in [49].III.GKP magic computed using the Choi-Jamiołkowski isomorphism for gates analyzed classically with unitary synthesis protocols [49].In general, a unitary involving n qubits is mapped to a 2n-qubit state.The largest system size we consider involves 12 qubits and corresponds to the C 5 X gate.We do not recover the same T -cost given in [49], since the GKP magic admits more general gate synthesis than unitary synthesis.The same hierarchy however is given.

U
a stabilizer state (iv) Invariance under composition with stabilizer states:G(|ψ ⊗ |φ S ) = G(|ψ ) (v)Non-increasing under measurement in the computational basis.(vi) Non-increasing under Clifford operations conditioned on the outcomes of computational-basis measurements.
1 7 d w 0 V u 0 4 s h 2 Y y g o 7 x J Z / Y M E G P o i / w e l 0 Q T p c y d L x u e 9 z W S O F d U n y Z x R d u 3 7 j 5 q 2 D 2 / G d u / f u P x g f P j y z u j U c Z 1 x L b e Y M L E p R 4 8 w J J 3 H e G A T F J J 6 z 9 d v e f / 4 J r l P C I D i 7 7 / B Z 9 B 5 y M = < / l a t e x i t > G(| i) < l a t e x i t s h a 1 _ b a s e 6 4 = " Z 8 7 b e p E 1 D 9A m j J G J h r b F 2 i A Z a U A = " > A A A C x 3 i c b V H L b t Q w F P W E V w m v F p Z s L E a V W I 0 S h I B l B R v Y F Y l p K y Z R d e 3 c T K z x S 7 Z T Z h R l w T + w h S 3 f x N / g T G d B p l z J 0 v E 5 9 3 2 Z l c K H L P s z S W 7 d v n P 3 3 s H 9 9 M H D R 4 + f H B 4 9 P f O m d R z n 3 E j j L h h 4 l E L j P I g g 8 c I 6 B M U k n r P V h 0 E / v 0 L n h d F f w s Z i q W C p R S 0 4 h E h 9 L V Y Y u s J 6 0 V 8 e T r N Z t j V 6 E + Q 7 M C U 7 O 7 0 8 m v w u K s N b h T p w C d 4 v 8 s y G s g M X B J f Y p 0 X r 0 Q J f w R I X E W p Q 6 M t u 2 3 J P j y N T 0 d q 4 + H S g W / b f i A 6 U 9 x v F o q e C 0 P h 9 b S D / p y 3 a U L 8 r O 6 F t G 1 D z 6 0 J 1 K 2 k w d J i f V s I h D 3 I T A X A n Y q + U N + C A h 7 i l d F S G q f 6 Y M i M r O p Q Z S U 1 M 5 R z W 0 Q G q i m 6 / A d d x E L D A h I x 5 c d x z E H H 8 0 V I 6 2 2 y 8 4 H v k 0 o F t B F + P W W b M K g C L v m m h 8 R s 3 So G u u k K a p e D 9 I i + 7 r m C q m + Z 9 H 0 c e 1 j q 0 T J W p M E 3 j a f P 9 Q 9 4 E Z 6 9 m + Z t Z 9 v n 1 9 O T 9 7 s g H 5 D l 5 Q V 6 S n L w l J + Q j O S V z w o k m P 8 h P 8 i v 5 l J j k K l l f u y a T X c w z M r L k + 1 + U y + G q < / l a t e x i t > | i < l a t e x i t s h a 1 _ b a s e 6 4 = " r v b 6 H y z Q 4 FIG.2.A schematic representation of the GKP magic.First we map a general pure m-qubit state |ψ into the GKP-encoding, which are δ peaks on a lattice in the Wigner representation W |ψ ψ| .By using the translational invariance of the lattice, we only consider one unit cell.We then calculate the Wigner logarithmic negativity of the GKP-encoded states, which is equivalent to sum the weights of the δ peaks.By doing that we define a magic measure G(|ψ ) that classifies the distance to stabilizer states.

6 GFIG. 4 .
FIG.4.The GKP magic for various angle α of the parametrization defined in Eq. (E22) and fixed angles φ1 = 0 and φ2 = π 4 .We find two maximas in the investigated interval that are at the same time the maximal value for all possible single qubit unitaries.The red line symbolizes the angle for which the robustness of magic is maximized[22].As can be seen, our measure is in a local minimum for this angle.

j∈F n 2 |j
, j .(E19) GKP magic maximization of general states and unitaries Instead of asking what the resource content of a particular state is, we can ask what is the most magic state.We can find the most magic state by numerically optimizing over all states of constant size and maximize the GKP magic.The most magic single qubit state with G(|Ψ 1 ) = 0.450 corresponds to the state |T |Ψ 1 = |T = cos(β) |0 + sin(β)e i π 4 |1 , cos(2β) = 1 √ 3 .

TABLE II .
[22]arison between the GKP magic and the Robustness of Magic (RoM)[22]for states of the form |U = Û |+ ⊗n .The unitaries Û are diagonal gates from C3 and admit a resourceless implementation using the states |U .The GKP-Magic and the RoM give the same T -count.