This paper was converted on www.awesomepapers.org from LaTeX by an anonymous user.
Want to know more? Visit the Converter page.

On the Hardness of Measuring Magic

Roy J. Garcia [email protected] Department of Physics, Harvard University, Cambridge, MA 02138, USA    Gaurav Bhole [email protected] Department of Physics, Harvard University, Cambridge, MA 02138, USA Department of Cancer Biology, Dana-Farber Cancer Institute, Boston, MA, 02215 USA Department of Biological Chemistry and Molecular Pharmacology, Harvard Medical School, Boston, MA, 02115 USA    Kaifeng Bu [email protected] Department of Physics, Harvard University, Cambridge, MA 02138, USA    Liyuan Chen [email protected] Department of Physics, Harvard University, Cambridge, MA 02138, USA John A. Paulson School of Engineering and Applied Science, Harvard University, Cambridge, MA 02138, USA    Haribabu Arthanari [email protected] Department of Cancer Biology, Dana-Farber Cancer Institute, Boston, MA, 02215 USA Department of Biological Chemistry and Molecular Pharmacology, Harvard Medical School, Boston, MA, 02115 USA    Arthur Jaffe [email protected] Department of Physics, Harvard University, Cambridge, MA 02138, USA
Abstract

Quantum computers promise to solve computational problems significantly faster than classical computers. These ‘speed-ups’ are achieved by utilizing a resource known as magic. Measuring the amount of magic used by a device allows us to quantify its potential computational power. Without this property, quantum computers are no faster than classical computers. Whether magic can be accurately measured on large-scale quantum computers has remained an open problem. To address this question, we introduce Pauli instability as a measure of magic and experimentally measure it on the IBM Eagle quantum processor. We prove that measuring large (i.e., extensive) quantities of magic is intractable. Our results suggest that one may only measure magic when a quantum computer does not provide a speed-up. We support our conclusions with both theoretical and experimental evidence. Our work illustrates the capabilities and limitations of quantum technology in measuring one of the most important resources in quantum computation.

I Introduction

Quantum computers [1, 2, 3] are powerful devices with the potential to solve problems in fields as diverse as biology [4, 5], chemistry [6, 7, 8], physics [1], cryptography [9], machine learning [10], and finance [11]. These devices can perform computations significantly faster than classical computers [12], a feat referred to as quantum advantage [9, 13, 14, 15, 16, 17, 18]. In recent years, claims of significant quantum advantages have been made for sampling problems [19, 20].

Quantum computers can only attain such computational speed-ups by utilizing a property known as magic [21, 22]. Without this property, quantum computers can perform computations no faster than supercomputers [12]. Informally, the amount of magic used by a quantum device quantifies its potential to solve computational problems quickly. Measuring this property is therefore important in assessing the capabilities of real-world quantum computers. However, previous experiments have suggested that such a measurement may be difficult [23]. In this work, we study whether magic can be measured experimentally on large-scale quantum computers.

Magic is measured by using functions known as magic monotones. Examples of well-known monotones include the robustness of magic [22], stabilizer rank [24], mana and the relative entropy of magic [21], among others [25, 26]. These functions have played a central role in finding applications of magic in quantum computation. They have been used to prove bounds on the time needed to classically simulate a computation [27, 28, 22, 29, 25, 30, 31, 32], which is useful to identify quantum advantages. Monotones have also been used to bound the cost of generating so-called magic states [33, 34, 35, 36]; these states are important in realizing an essential feat known as fault-tolerant, universal quantum computation [37, 38, 33, 39]. Furthermore, monotones have been used to link magic to interdisciplinary topics, such as quantum circuit complexity and statistical complexity [40, 41].

Our work investigates the hardness of measuring magic monotones in experiments. Monotones are thought to be difficult to measure, as they are typically defined as sums or optimizations over exponentially many variables. This measurement problem has received increasing attention in recent years [42, 23, 43, 44]. In 2021, Google conducted an experiment detecting signatures of magic on their Sycamore quantum processor [42]. In 2023, a magic monotone was introduced to explain this measurement [45]. In 2022, Google’s result was followed by a measurement of a new magic monotone on IBM’s quantum processor [23]. This experiment required a large number of physical measurements (exponentially large in the processor size), making it intractable for large systems.

It remained an open question whether other magic monotones could be measured on large-scale quantum computers. In 2023, a measurement of a magic monotone known as the additive Bell magic was made on IonQ’s quantum computer [43] and was believed to be tractable at the large scale. This was followed by a measurement of the additive Bell magic on a logical quantum processor [46]. We find that further inspection is needed to determine whether one can indeed measure magic on large quantum devices.

In this paper, we introduce a magic monotone, which we call Pauli instability, and measure it on the IBM Eagle quantum processor. We use Pauli instability to show that larger quantities of magic are more difficult to measure (Theorem 1). As the magic increases, the number of physical measurements needed grows exponentially. We show that sufficiently small quantities of magic can be efficiently measured on large-scale quantum computers. We also find that, when magic is extensive, measurement is intractable. We conjecture this to be true for any reliable magic monotone. Our results lead us to posit that one may only measure magic when a quantum computer does not exhibit a quantum advantage. Furthermore, our results showcase the role that chaos plays in measuring magic. Our techniques are compatible with quantum platforms with single-qubit readout [47, 19, 48].

II Preliminaries

We introduce the mathematical definition of magic. We define the set of nn-qubit Pauli strings as Qn={i=1nP(i):P(i){I,X,Y,Z}}{Q^{\otimes n}=\{\otimes_{i=1}^{n}P^{(i)}:P^{(i)}\in\{I,X,Y,Z\}\}}, where nn is the system size, II is the identity, and X,Y,ZX,Y,Z are Pauli operators. A Clifford unitary, UU, is defined as a unitary which maps any Pauli string PP to another Pauli string PP^{\prime} (up to a phase ϕ\phi) under conjugation: UPU=eiϕPU^{\dagger}PU=e^{-i\phi}P^{\prime}. All Clifford unitaries can be generated by the gate set {H,S,CNOT}\{H,S,\mathrm{CNOT}\}, where H=12(1111)H=\frac{1}{\sqrt{2}}\begin{pmatrix}1&1\\ 1&-1\end{pmatrix}, S=diag(1,i)S=\mathrm{diag}(1,i), and CNOT\mathrm{CNOT} denotes the controlled not gate.

Unitaries which are non-Clifford are defined to contain magic. Intuitively, magic quantifies the distance between a given unitary and the set of Clifford unitaries. The more magic a unitary contains, the more resourceful it is thought to be in completing computational tasks. The best-known example of a non-Clifford gate is the T gate, defined as T=diag(1,eiπ/4)T=\mathrm{diag}(1,e^{i\pi/4}).

III Main Results

We introduce a monotone, which we call Pauli instability, to measure the magic of a unitary.

Definition 1.

The Pauli instability of a unitary UU is

𝕀(U)=log[𝔼P1,P2Qn|OTOC(U,P1,P2)|],\mathbb{I}(U)=-\log\left[\underset{\tiny{P_{1},P_{2}\in Q^{\otimes n}}}{\mathbb{E}}\left|\mathrm{OTOC}(U,P_{1},P_{2})\right|\right], (1)

where OTOC(U,P1,P2)=12nTr{UP1UP2UP1UP2}\mathrm{OTOC}(U,P_{1},P_{2})=\frac{1}{2^{n}}\mathrm{Tr}\left\{U^{\dagger}P_{1}UP_{2}U^{\dagger}P_{1}UP_{2}\right\} and 𝔼\mathbb{E} denotes the uniform expectation over QnQ^{\otimes n}.

Here, OTOC(U,P1,P2)\mathrm{OTOC}(U,P_{1},P_{2}) is the out-of-time-ordered correlator. Pauli instability satisfies the following properties:

  1. 1.

    (Faithfulness) 𝕀(U)0\mathbb{I}(U)\geq 0 for all unitaries UU and 𝕀(U)=0\mathbb{I}(U)=0 iff UU is a Clifford unitary.

  2. 2.

    (Invariance) 𝕀(V1UV2)=𝕀(U)\mathbb{I}(V_{1}UV_{2})=\mathbb{I}(U), for any Clifford unitaries V1V_{1} and V2V_{2}.

  3. 3.

    (Additivity) 𝕀(U1U2)=𝕀(U1)+𝕀(U2)\mathbb{I}(U_{1}\otimes U_{2})=\mathbb{I}(U_{1})+\mathbb{I}(U_{2}).

  4. 4.

    (Scaling with T gates) 𝕀(TkInk)=klog(4/3)\mathbb{I}(T^{\otimes k}\otimes I^{\otimes n-k})=k\log(4/3).

Faithfulness guarantees that Clifford unitaries have no magic, while non-Clifford unitaries have positive magic. Invariance guarantees that appending a Clifford unitary to a circuit cannot increase the measure of magic. These two properties make Pauli instability a resource monotone. Furthermore, additivity implies that for any Clifford unitary, VV, one has the following invariance relation: 𝕀(UV)=𝕀(U){\mathbb{I}(U\otimes V)=\mathbb{I}(U)}. Scaling with T gates makes Pauli instability a reliable monotone, as the number of T gates in a unitary often gives an indication of its classical simulation cost [22]. This property holds regardless of the position of the T gates 111Namely, 𝕀(i=1nTki)=klog(4/3){\mathbb{I}(\otimes_{i=1}^{n}T^{k_{i}})=k\log(4/3)}, where kj{0,1}k_{j}\in\{0,1\} and j=1nkj=k\sum_{j=1}^{n}k_{j}=k..

Pauli instability can also be interpreted as a measure of chaos, since the OTOC is traditionally used to measure the onset of chaos in chaotic quantum systems [50]. The OTOC notably characterizes a feature of chaos known as scrambling, which describes the delocalization of quantum information. For example, a completely scrambling unitary UU can map a Pauli string PP to a superposition of many Pauli strings: UPU=iciPiU^{\dagger}PU=\sum_{i}c_{i}P_{i}; this is interpreted as ‘delocalization’ in Pauli space. This is a property of non-Clifford unitaries (this can be seen from the definition of Clifford unitaries). This property can result in |OTOC(U,P1,P2)|\left|\mathrm{OTOC}(U,P_{1},P_{2})\right| taking on values near 0, leading to a positive value of Pauli instability. By contrast, when UU is Clifford, |OTOC(U,P1,P2)|=1\left|\mathrm{OTOC}(U,P_{1},P_{2})\right|=1 and Pauli instability is 0. In this way, the monotone exploits the chaotic properties of unitaries to measure their magic. Furthermore, we name the monotone Pauli instability because it quantifies how well a unitary evolves a Pauli string away from itself.

We now introduce an approach to approximate Pauli instability. Due to the average over QnQ^{\otimes n} in Eq. (1), an exact measurement of Pauli instability necessitates computing 16n16^{n} terms. Such a measurement is not feasible for large-scale quantum systems. However, one can efficiently approximate Pauli instability by uniformly sampling NN pairs of Pauli strings {(P1(i),P2(i))}i=1N\{(P_{1}^{(i)},P_{2}^{(i)})\}_{i=1}^{N} from QnQ^{\otimes n}, where each string in the pair is sampled independently. We refer to NN as the Pauli sample complexity. By computing the OTOC for each pair of strings, one can construct an approximator of Pauli instability:

𝕀N(U)=log[1Ni=1N|OTOC(U,P1(i),P2(i))|].\mathbb{I}_{N}(U)=-\log\left[\frac{1}{N}\sum_{i=1}^{N}\left|\mathrm{OTOC}(U,P_{1}^{(i)},P_{2}^{(i)})\right|\right]. (2)

The finite sampling over QnQ^{\otimes n} introduces an error of approximation. One can use Hoeffding’s inequality to compute the Pauli sample complexity needed to approximate Pauli instability up to a given error.

Theorem 1 (Pauli sample complexity).

Let δ,η>0\delta,\eta>0. Then |𝕀N(U)𝕀(U)|<η\left|\mathbb{I}_{N}(U)-\mathbb{I}(U)\right|<\eta with probability at least 1δ1-\delta when the Pauli sample complexity is

N=e2𝕀(U)f(η,δ).N=e^{2\mathbb{I}(U)}f(\eta,\delta). (3)

Here, f(η,δ)=ln(1/δ)2(1egη)2f(\eta,\delta)=\frac{\ln(1/\delta)}{2(1-e^{g\eta})^{2}} and g=sign(𝕀(U)𝕀N(U))g=\mathrm{sign}(\mathbb{I}(U)-\mathbb{I}_{N}(U)).

Intuitively, Theorem 1 shows that measuring more magic requires exponentially more samples. This theorem can help us identify the regime where one can accurately and efficiently measure magic. Here, ‘efficiently’ means that the Pauli sample complexity satisfies N=poly(n)N=poly(n). We say that a measurement is intractable when N=exp(n)N=exp(n). ‘Accurately’ means that η\eta satisfies η=γ𝕀(U)\eta=\gamma\mathbb{I}(U), where 0<γ<10<\gamma<1 is a constant factor.

Corollary 1.

Magic can be efficiently and accurately approximated when 𝕀(U)=log(n)\mathbb{I}(U)=\log(n). However, an accurate approximation is intractable when 𝕀(U)=linear(n)\mathbb{I}(U)=linear(n).

Refer to captionRefer to captionRefer to caption

T gates

T gates

T gates

Magic

Magic

Magic

(a)

(b)

(c)

(d)

UkU_{k}UkU_{k}VkV_{k}UkU_{k}==TTTTkkVkV_{k}==HHHHHHHHSSSSSSSSTTHHHHHHHHSSSSSSSSTTLayer 22Layer 11\cdots
Figure 1: (a) Numerical simulations (blue points) of 𝕀N\mathbb{I}_{N} for a unitary UkU_{k} as in (c, top), which is a single layer of kk T gates. Black points are the exact values of the 𝕀\mathbb{I}: 𝕀(Uk)=klog(4/3)\mathbb{I}(U_{k})=k\log(4/3). The system size is n=10n=10, the Pauli sample complexity is 500 and the OTOC sample complexity is 500. (b) Experimental measurement of 𝕀N\mathbb{I}_{N} for UkU_{k}. The system size is n=5n=5, the Pauli sample complexity is 500, and the OTOC sample complexity is 500. (d) Experimental measurement of 𝕀N\mathbb{I}_{N} for the unitary VkV_{k} in (c, bottom), which contains kk layers. Layer ii is composed of a layer of H gates, two layers of staggered CNOT gates, a layer of S gates, and a single T gate applied to the ii-th qubit. The system size is n=4n=4, the Pauli sample complexity is 500500 and the OTOC sample complexity is 500500. In all plots, each data point is computed by independently measuring 𝕀\mathbb{I} (or 𝕀N\mathbb{I}_{N}) 5 times and averaging. The OTOC is measured using the circuit in Fig. 2.

Corollary 1 shows that circuits with small (large) quantities of magic can (cannot) be efficiently measured. To illustrate, we consider the unitary Uk=TkInk{U_{k}=T^{\otimes k}\otimes I^{\otimes n-k}}. Using Theorem 1, we find N=e8k/3f(η,δ){N=e^{8k/3}f(\eta,\delta)}. The sample complexity grows exponentially with the number of T gates, kk, in the circuit. The measurement is efficient when k=log(n)k=log(n) and is intractable when k=linear(n)k=linear(n).

In the case of more complex circuit architectures, one still typically expects the sample complexity to grow exponentially with the number of T gates. This is because magic typically scales with the number of T gates. This suggests that one can only measure the magic of circuits which are classically simulable (i.e., those containing log(n)log(n) T gates). These circuits cannot demonstrate a quantum advantage. This motivates the following conjecture.

Conjecture 1.

One cannot efficiently and accurately measure a magic monotone \mathcal{M} when =linear(n)\mathcal{M}=linear(n).

In other words, we conjecture that measuring \mathcal{M} for a circuit with a linear(n)linear(n) number of T gates is intractable (assuming that \mathcal{M} scales linearly with the number of T gates). Informally, this conjecture captures the idea that, as more T gates are added to a circuit, measuring any reliable magic monotone should become harder. This is because the sample complexity is expected to scale exponentially with the amount of magic (or alternatively, with the number of T gates). This is relevant to random quantum circuits, which typically contain large quantities of magic [51, 52, 53].

We sketch the following argument to support the conjecture. Many magic monotones which scale linearly with the number of TT gates (or T states), NTN_{T}, are defined in terms of logarithms. They can, for example, take on the form =log(exp(NT)){\mathcal{M}=-\log(exp(-N_{T}))}. The magic entropy [54], stabilizer Rényi entropy [55], and additive Bell magic [43] are some examples. Accurately extracting the exp(NT)exp(-N_{T}) value requires a measurement error exponentially small in NTN_{T}, leading to a sample complexity exponentially large in NTN_{T}. This makes the measurement intractable for large NTN_{T} (i.e., when NT=linear(n)N_{T}=linear(n)), consistent with the conjecture. In the Supplemental Information, we show that the additive Bell magic satisfies Conjecture 1.

Thus far, we have considered the complexity of Pauli sampling. We must also consider the number of physical measurements needed to measure the OTOC, which we call the OTOC sample complexity. Many OTOC measurement protocols have been constructed. Past examples have utilized: an interferometric approach [56], a randomized measurement toolbox [57, 58], a teleportation-based technique [59, 60], and the classical shadows formalism [61, 62]. Here, we use the method proposed by Swingle et al. [56], given by the circuit in Fig. 2 (we give an alternative circuit in the Supplemental Information which uses only n+1n+1 qubits). By running this circuit a finite number of times, we can approximate the OTOC up to a given error. The following proposition gives the OTOC sample complexity.

Proposition 1 (OTOC sample complexity).

With probability at least 1δ1-\delta, the number of samples needed to accurately measure OTOC(U,P1,P2)\mathrm{OTOC}(U,P_{1},P_{2}) up to an error of γOTOC(U,P1,P2)\gamma\mathrm{OTOC}(U,P_{1},P_{2}) (where 0<γ<10<\gamma<1) is

M=ln(1/δ)γ2OTOC(U,P1,P2)2.M=\frac{\ln(1/\delta)}{\gamma^{2}\mathrm{OTOC}(U,P_{1},P_{2})^{2}}. (4)
|0\ket{0}|0\ket{0}|0\ket{0}|0\ket{0}|+𝒞\ket{+}_{\mathcal{C}}RefSysHHHHP2P_{2}UUP1P_{1}UU^{\dagger}XXP2P_{2}XXHHRefer to caption
Figure 2: Quantum circuit to measure the OTOC for a unitary UU and Pauli strings P1P_{1} and P2P_{2}. ‘Ref’ denotes nn reference qubits and ‘Sys’ denotes nn system qubits. The control qubit is in the state |+𝒞=(|0𝒞+|1𝒞)/2\ket{+}_{\mathcal{C}}=(\ket{0}_{\mathcal{C}}+\ket{1}_{\mathcal{C}})/\sqrt{2}. The dotted box denotes a measurement in the XX basis. The circuit outputs the expectation value X𝒞=OTOC(U,P1,P2)\langle X_{\mathcal{C}}\rangle=\mathrm{OTOC}(U,P_{1},P_{2}), where 𝒞\mathcal{C} denotes the control qubit.

Proposition 1 shows that measuring smaller OTOC values requires more samples. The following corollary gives the regime where an accurate measurement is possible.

Corollary 2.

The OTOC can be efficiently and accurately approximated when OTOC(U)=1poly(n)\mathrm{OTOC}(U)=\frac{1}{poly(n)}. However, an accurate approximation is intractable when OTOC(U)=exp(n)\mathrm{OTOC}(U)=exp(-n).

In the case of Haar random unitaries, the value of the OTOC is typically exp(n)exp(-n). This renders the OTOC measurement intractable, as the required sample complexity is exponentially large in nn. Furthermore, introducing more magic into a quantum circuit can decrease the magnitude of the OTOC to near 0, as shown in [42]. By Proposition 1, a greater number of samples are subsequently required for an accurate measurement, demonstrating the effect of magic on measurement precision.

IV Simulations and Experiments

We numerically simulate a measurement of magic to understand how the measurement accuracy changes with the number of TT gates in a circuit. In Fig. 1 (a), we simulate 𝕀N\mathbb{I}_{N} for the unitary UkU_{k} in Fig. 1 (c, top), which contains kk T gates. Each data point is computed with n=10n=10 qubits and a Pauli sample complexity of N=500N=500. This is much smaller than the 161016^{10} samples required to compute the exact value of Pauli instability using Eq. (1).

The simulated data initially scales linearly with the number of T gates, agreeing with the exact value. When the number of TT gates is on the same order as the system size (10 in this case), the accuracy of the approximation breaks down. This is notably seen after adding 5 or more T gates. This shows that we require more samples to accurately approximate Pauli instability as more magic is introduced into the circuit. This is consistent with Theorem 1.

We experimentally measure magic on the IBM Eagle quantum processor. We perform the experiment on a small scale system of 4 to 5 qubits to mitigate noise effects. In Fig. 1 (b), we measure 𝕀N\mathbb{I}_{N} for the unitary UkU_{k} on a 5-qubit system (red points). The inherent noise in the processor results in the experimental values initially overestimating the true values (black points) and simulated values (blue points). The experimental values gradually approach the exact values, before giving an underestimate at 5 T gates. The simulated values also underestimate the exact values as the magic increases. These results again showcase that when magic is large, we require more samples for an accurate estimate.

To explain why noise can lead to an overestimate, we provide a simple example. Assume that UkU_{k} is subject to depolarizing noise with a strength of λ\lambda. Pauli instability becomes 𝕀(Uk)𝕀(Uk)log(1λ){\mathbb{I}(U_{k})\rightarrow\mathbb{I}(U_{k})-\mathrm{log}(1-\lambda)}. As the noise increases, the monotone increases, giving a false signature of magic, consistent with our data (notably, the first two red data points in Fig. 1 (b)).

In practice, circuits used in quantum computation have more complicated architectures than UkU_{k}. Namely, they contain multiple layers of Clifford and non-Clifford gates which generate entanglement [63, 64, 65, 66]. We experimentally verify that our monotone can capture an increase in magic as T gates are added to more complex circuits. This property verifies the monotone’s reliability. In Fig. 1 (d), we experimentally measure the magic of the circuit architecture, VkV_{k}, found in Fig. 1 (c, bottom). This circuit is composed of TT gates and entangling layers of Clifford gates. The plot displays a roughly linear relation with the number of T gates, similar to Fig. 1 (b). This agrees with the intuition that a monotone should typically increase as more T gates are added. Noise effects become more prevalent as the circuit depth increases, leading to larger experimental values of the monotone, compared to the simulated values.

V Conclusion

We have introduced a scalable measure of magic for large-scale quantum computers. Our measure allows us to prove that small quantities of magic (i.e., in the regime where there is no quantum advantage) can be approximated on large quantum devices. When the magic is extensive, measurement becomes intractable. We conjecture this to be true for any reliable magic measure. We further conjecture that measuring magic when a quantum computer exhibits a quantum advantage is hard. We leave the proof of these statements as an open problem.

Our result can be interpreted as a precision problem. As more magic is introduced into a quantum computer, a greater measurement precision is required, making our task more difficult. This is reminiscent of the barren plateau problem in quantum machine learning, where ultra-fine measurement precision prevents the training of certain learning models [67, 68]. As a consequence, only models providing no quantum advantage have been shown to be trainable [69, 70, 71]. Our results lead us to pose the following problem: can one prove that magic cannot generally be learned via quantum machine learning? We postulate that one should encounter a barren plateau.

We have shown, both theoretically and experimentally, that noise can lead to a false signature of magic. As quantum processors are inherently noisy, it is useful to develop measurement protocols which are robust to noise. Previous works have successfully measured chaos in the presence of noise [59]. We expect that one can use similar techniques to measure magic robustly.

VI Acknowledgements

We thank Dolev Bluvstein for discussions on magic. We thank Sieglinde Pfaendler for discussions on qiskit. This work was supported in part by the ARO Grant W911NF-19-1-0302, the ARO MURI Grant W911NF-20-1-0082, and the NIH grant GM136859.

References