ARTICLE OPEN Self-testing of a single quantum system from theory to experiment Xiao-Min Hu 1,2,3,16 , Yi Xie 4,5,16 , Atul Singh Arora 6,7,16 , Ming-Zhong Ai 1,2,3,16 , Kishor Bharti 8,9,10,16 , Jie Zhang 4,5 , Wei Wu 4,5,11 , Ping-Xing Chen 4,5,11 ✉, Jin-Ming Cui 1,2,3 , Bi-Heng Liu 1,2,3 ✉, Yun-Feng Huang 1,2,3 ✉, Chuan-Feng Li 1,2,3 , Guang-Can Guo 1,2,3 , Jérémie Roland 6 , Adán Cabello 12,13 ✉and Leong-Chuan Kwek 8,14,15 ✉ Self-testing allows one to characterise quantum systems under minimal assumptions. However, existing schemes rely on quantum nonlocality and cannot be applied to systems that are not entangled. Here, we introduce a robust method that achieves self-testing of individual systems by taking advantage of contextuality. The scheme is based on the simplest contextuality witness for the simplest contextual quantum system—the Klyachko-Can-Binicioğlu-Shumovsky inequality for the qutrit. We establish a lower bound on the fidelity of the state and the measurements as a function of the value of the witness under a pragmatic assumption on the measurements. We apply the method in an experiment on a single trapped 40 Ca + using randomly chosen measurements and perfect detection efficiency. Using the observed statistics, we obtain an experimental demonstration of self-testing of a single quantum system. npj Quantum Information (2023) 9:103 ; https://doi.org/10.1038/s41534-023-00769-7 INTRODUCTION There is strong reason to believe that quantum devices can outperform their classical counterparts on various fronts 1 . Yet, certifying that a quantum device is functioning as intended (or claimed) becomes challenging as the device becomes increasingly complex 2 . More concretely, consider the two traditional methods for characterising a quantum system—tomography and classical simulation. Both methods fail for large systems. Tomography requires resources which scale exponentially (in the size of the quantum system being characterised) 3 . Similarly, since we have strong evidence showing that quantum computations are intractable for classical computers, characterisation by classical simulation also fails for large systems 4 . Thus, methods for characterising quantum systems are crucial for building useful large-scale quantum devices. Many such methods are known with varying strengths and weaknesses. Restricting to efficient methods, one can classify them according to several parameters, such as the assumptions they make about the system (the weaker the better) and the knowledge they provide about the system (the more the better). In this work, we focus on self-testing and related methods, which solely aim to minimise the assumptions needed. Self-testing is a property of a configuration—a state and a set of measurements—which requires that every other configuration which produces the same measurement statistics is, in fact, identical to it up to (local) isometries. (Self-testing initially was defined to be a property of a quantum state alone (and not the measurements)). Clearly, without some assumption about the underlying system, no configuration can be self-tested (this is simply because the device could classically store and reproduce whatever statistics the self-test is required to satisfy. One of these assumptions is that the system is bipartite, and the two parts of the system cannot communicate). Indeed, the term “self-testing” was coined in 2004 by Mayers and Yao 5 , who showed that (in the bipartite no-communication setting) this property holds for a pair of maximally entangled qubits. The underlying ideas, however, were already present in earlier works 6–10 . Self-testing has since been an area of active investigation 11 and the notion has been extended to various settings, such as bipartite (all pure states can be self-tested 12–14 ), multi-partite (various families can be selftested 15–18 ), Bell state measurement 19,20 , prepare-and- measure 21,22 , steering 23–25 , among others. Returning to device characterisation, a central technological challenge of our times is the construction of a large-scale quantum computer—a single complex quantum system, where the aforementioned results do not hold. Thus, it is natural to ask if one can extend self-testing to the single system setting. RESULTS Here, we tackle this question by approaching self-testing via noncontextuality inequalities—linear inequalities 26,27 , similar to Bell inequalities, the experimental violation of which 28,29 can be used 1 CAS Key Laboratory of Quantum Information, University of Science and Technology of China, 230026 Hefei, China. 2 CAS Center For Excellence in Quantum Information and Quantum Physics, University of Science and Technology of China, 230026 Hefei, China. 3 Hefei National Laboratory, University of Science and Technology of China, 230088 Hefei, China. 4 Department of Physics, College of Liberal Arts and Sciences, National University of Defense Technology, 410073 Changsha, Hunan, China. 5 Hunan Key Laboratory of Mechanism and Technology of Quantum Information, 410073 Changsha, Hunan, China. 6 Centre for Quantum Information & Communication, Université libre de Bruxelles, B-1050 Bruxelles, Belgium. 7 Institute of Quantum Information and Matter, Department of Computing and Mathematical Sciences, California Institute of Technology, Pasadena, USA. 8 Centre for Quantum Technologies, National University of Singapore, Singapore, Singapore. 9 Joint Center for Quantum Information and Computer Science and Joint Quantum Institute, NIST/University of Maryland, College Park, Maryland 20742, USA. 10 Institute of High Performance Computing, Agency for Science, Technology and Research (A*STAR), 1 Fusionopolis Way, Connexis, Singapore 138632, Singapore. 11 Hefei National Laboratory, 230088 Hefei, PR China. 12 Departamento de Física Aplicada II, Universidad de Sevilla, E-41012 Sevilla, Spain. 13 Instituto Carlos I de Física Teórica y Computacional, Universidad de Sevilla, E-41012 Sevilla, Spain. 14 MajuLab, CNRS-UNS-NUS-NTU International Joint Research Unit, Singapore UMI 3654, Singapore. 15 National Institute of Education, Nanyang Technological University, Singapore 637616, Singapore. 16 These authors contributed equally: Xiao-Min Hu, Yi Xie, Atul Singh Arora, Ming-Zhong Ai, Kishor Bharti. ✉email:
[email protected];
[email protected]; [email protected]; [email protected]s; [email protected].sg www.nature.com/npjqi Published in partnership with The University of New South Wales 1234567890():,;
to witness non-classicality. Their advantage is precisely that they can be tested in a single system. Unlike the aforementioned selftesting schemes based on Bell nonlocality, which assume no communication (between parts of the device), we make a mild assumption on the measurements that we call KCBS orthogonality. Similar self-testing schemes, based on non-contextuality inequalities, have recently been proposed 30–33 . However, these works can only be applied when the experimental statistics exactly match the ideal statistics. (While some of the works prove that their self-test is “robust”in principle, they fail to show how to apply their result for any experiment which even mildly deviates from the ideal case). We remedy this stifling shortcoming by providing the first contextuality self-testing robustness curve, which enables one to self-test single quantum systems in the laboratory—the curve quantifies the fidelity of the system’s configuration (to the ideal configuration) as a function of the deviation of the observed statistics (from the ideal statistics). We then perform an experiment on a single 40 Ca + ion and apply this self-test scheme to characterise the system. We find that our characterisation is consistent with that obtained by conventional tomography. We emphasise that even though our self-test scheme was designed to minimise the assumptions one needs to make, it is nevertheless crucial to ensure that these are satisfied by the experiment. In addition to the KCBS orthogonality condition, one must ensure that the detection efficiency is nearly perfect and that the measurement settings are chosen randomly (to assure that noncontextual models are not simulating contextual correlations 34 ). In our experimental setup, we quantify the deviation from these requirements and find that they are, indeed, negligible (see Supplementary Note 1). Overview and organisation We first outline our theoretical contributions (“Results: The self-test scheme”). We informally introduced self-testing but did not explain the KCBS orthogonality condition (Assumption 1). Informally, for any odd number nof measurements, the condition requires that the measurements are projective and satisfy the relations of orthogonality corresponding to an n-cycle graph (vertices represent measurements and edges relations of orthogonality). For simplicity, we henceforth implicitly take n=5 (It turns out that, in this setup, n=5 is the smallest cyclic graph which separates quantum behaviour from its classical counterpart). We denote our self-test by I(Equation 1), which is a linear expression in the input/output probabilities associated with the device. Ican be made 0 by a quantum device, but every classical device must yield IQC>0, where Qand Care constants, independent of the device once nis fixed. It is known 30 that the configuration (the states and measurements associated with the device) are unique for any device which yields I¼0; the uniqueness is up to a global isometry. Such a configuration is termed the Klyachko-Can-Binicioğlu-Shumovsky (KCBS) configuration. Note that, using a global isometry, one can trivially change any state ϕ jito any other state ξ ji . This might prompt one to think that showing equivalence up to global isometries is meaningless. This is not true. If there are two configurations that attain I¼0, we require the same global isometry to map the state as well as the measurement settings from one configuration to another (see Fig. 2). (For readers familiar with Bell nonlocalitybased self-testing: for a single system, the notion of local isometry anyway does not make sense). Consider a configuration for which Iis close to zero. To quantify the closeness of it to the KCBS configuration, we define the total fidelity,F(Equation 5). F=6 for the KCBS configuration. (In general, F=n+1asitsumsthefidelity to nmeasurements and one state. For the (simplest) KCBS configuration, n=5). We give a lower bound on Fas a function of I.Theideaistodefine an isometry in terms of the measurement operators of the device itself, which maps a device’sconfiguration to the KCBS configuration when I¼0. The expression for Fwhen I>0 becomes an optimisation problem which can be relaxed to a hierarchy of semidefinite programs (SDPs). This, in turn, can be solved numerically to obtain lower bounds on F.Thedetailsof the proof appear in “Methods: Lower bound using an SDP relaxation”and those of the numerical solution in “Methods: Numerics to evaluate fidelity lower bounds”. Obtaining the numerical solution was challenging. This is primarily because the description of the SDP we obtained is implicit. Therefore, we first find this explicit description by performing symbolic computation and, subsequently, solve the resulting SDP (with over 15,000 constraints). We now outline the experiment. We apply this self-test to an experimental setup based on a single trapped 40 Ca + ion. The KCBS configuration can be realised using a qutrit and projective measurements (see Fig. 2). In the experiment, the three levels of the qutrit are formed by the ground state and the first excited state, which is further split by the presence of a magnetic field. The measurements are executed by rotating between the ground state and the excited state using 729 nm lasers, performing a photon number measurement (via fluorescence detection), followed by an inverse of the rotation (see Fig. 1and “Results: Experimental Setup”). The initial state and the rotation angles can be chosen such that they correspond directly to the KCBS configuration (“Results: Realising the KCBS configuration”). The actual experimental setup, of course, requires numerous details to be first addressed (“Results: Experimental Setup”) for this correspondence to work. Using this setup, we perform two types of experiments (“Results: Experiments that are self-tested”), both of which are deviations from the KCBS configuration, constructed to ensure the KCBS orthogonality condition (Assumption 1) still holds. First, we leave the measurements unchanged but progressively depolarise the initial state. Second, we change the measurement settings, parameterised by an angle θand tilt the initial state. In effect, these experiments determine I, and the robustness curve immediately lower-bounds the total fidelity of the underlying configuration to the KCBS configuration. By performing conventional tomography, we determine the actual fidelity to the KCBS configuration and find that the lower bound is indeed satisfied, as expected (Fig. 1, Table 2). Relation to prior work Before delving into the details, we give a brief comparison to prior works. Comparison to another single-system self-testing scheme. Selftesting in a single system has recently been studied under cryptographic assumptions 35 ; however, such proposals require over a thousand qubits and thus remain elusive in practice (see Supplementary Note 6 for details). Comparison to other contextuality experiments. In our experiment, we simultaneously quantify and minimise divergence from the basic assumptions—perfect detection, random selection of measurements, compatibility and sharpness—which, to the best of our knowledge, makes it the most comprehensive contextuality experiment to be reported (see Table 1). Compared to other contextuality experiments, the terminology used here is slightly different since our approach here is more pragmatic—our KCBS orthogonality condition may be seen as the analogue of compatibility and sharpness of measurements (see Supplementary Note 6). Swap isometry. One of our theoretical constructions (the swap isometry, explained in “Methods: Lower bound using an SDP relaxation”) is motivated by the corresponding construction in X.-M. Hu et al. 2 npj Quantum Information (2023) 103 Published in partnership with The University of New South Wales 1234567890():,;
ref. 36 . While the construction in ref. 36 works for Bell scenarios, our construction applies to the single-party setting. The self-test scheme Suppose we have a set of (independent) identical devices, each of which takes a string as input and produces a string as output. Let p i denote the probability of event i, where an event is an instance of an input-output. Let I:¼Piqipidenote a linear combination of these probabilities, where qi2R. We say that ðI;cÞ, for some c2R, self-tests the device if the following holds—if the device satisfies I¼c, then the device is uniquely described as containing a specific quantum state, the inputs corresponding to selecting specific measurements, the outputs correspond to the action of the measurement on the aforementioned quantum state, up to a global isometry. (Later, we use “self-tests the device”to succinctly say “self-tests the configuration in the device”). As stated earlier, no self-test can exist without additional assumptions. We make the following assumption about the device we wish to self-test. To describe it, we set up some notation. We denote the ith binary measurement by M i ≔(Π 0∣i ,Π 1∣i ), where Π 0∣i denotes the measurement operator corresponding to the zeroth output and Π 1∣i denotes that corresponding to the first output. Being measurement operators, they satisfy the probability conservation condition Πy 0jiΠ0jiþΠy 1jiΠ1ji¼I. We say the binary measurement is repeatable and Hermitian if Π2 bji¼Πbjifor b∈0, 1 and Πy bji¼Πbji, respectively. Assumption 1 For an odd n, the quantum state in the device is ρand the measurements M 1 ,M 2 ,…,M n are repeatable and Hermitian binary measurements (as described above) satisfying Π 1∣i ⋅Π 1∣j =0 for {i,j}∈{{1, 2}, {2, 3}, …,{n−1, n}, {n, 1}} =:E. At first, one might think that restricting to projective measurements, instead of POVMs, is without loss of generality due to Naimark’s theorem (according to which the statistics of any quantum measurement can also be obtained using a projective measurement since any positive-operator-valued measure can be seen as a projective-valued measure in a larger Hilbert space). However, this conclusion no longer holds for sequential measurements where post-measurement states become relevant. (To properly address this issue, one must consider quantum instruments instead and define the notion of orthogonality accordingly. In the present work, we do not pursue this direction). In any case, Table 1. A comparison of our experiment to previous experimental results on contextuality. Year System Self-test Compatibility Sharp measurement Random basis selection Detection loophole 2011 Photon 29 × quantified not checked × not addressed 2013 Yb + ion 46 × quantified not checked × closed 2016 Superconducting 47 × quantified not checked × closed 2017 Photon 48 × quantified not checked × not addressed 2018 Ca + ion 49 × quantified not checked × closed 2019 Photon 50 × quantified not checked × not addressed 2020 Ba + ion 51 × quantified not checked × closed 2022 Ca + ion [this work] ✓quantified quantified ✓closed Fig. 1 Experimental results. a–crepresents the 40 Ca + ion experimental setup, while dillustrates the agreement of the observations with the theory. aThe energy level diagram of the 40 Ca + ion. bA schematic of the experimental setup. cThe sequence of operations used in our experiment to measure p i via Pr(10∣ij), i.e., the probability of obtaining (a,b)=(1, 0) when M i and M j are measured. We choose (i,j)∈E(edges of afive-cycle graph) at random using a quantum random number generator. Each measurement M i is implemented by performing a rotation U i , afluorescence measurement (performed using a photo-multiplier tube), and undoing the rotation. For each measurement, the experiment is repeated over 10,000 times. dThe x-axis represents ∑ k p k (which we call the KCBS value), while the y-axis represents the total fidelity, F, to the ideal KCBS configuration. Recall that I¼QnPkpk. The bottom curve (blue), obtained by solving a semidefinite program, lower bounds Fas a function of ∑ k p k . The top curve (orange) is similarly obtained by assuming, in addition, that p 1 =p 2 =⋯=p 5 . The points represent various experiments which (nearly) satisfy Assumption 1. The xcoordinates of these points represent ∑ k p k , while the ycoordinate is evaluated by performing tomography and computing the fidelity to the ideal KCBS configuration. We note that ∑ k p k exceeds ffiffiffi 5 p(the maximum quantum value for projective measurements). This is warranted because our experiments are nearly perfect, and even small deviations from the underlying assumptions cause the KCBS value to deviate from the ideal one. It is worth noting that the left end of the error bar (±1.96σ, where σdenotes standard deviation), however, is well within the ffiffiffi 5 plimit. X.-M. Hu et al. 3 Published in partnership with The University of New South Wales npj Quantum Information (2023) 103
the aforementioned is a mild requirement and our experimental setup almost perfectly satisfies it (see Supplementary Note 1). For a device satisfying Assumption 1, we consider the self-test I I:¼QnX n i¼1 pi;(1) where pi:¼trðΠiρÞ¼ Πi hiand Qn:¼ncosðπ=nÞ 1þcosðπ=nÞis the “quantum value”. This particular form is of interest because, informally, any classical (i.e., non-contextual) model satisfying Assumption 1 cannot result in Pn i¼1pi>Cn, where C n ≔(n−1)/2 while quantumly, for the KCBS configuration (see Definition 3) one obtains Pn i¼1pi¼Qn, the highest possible 37 . The self-test measures how close one is to the maximum quantum value, Q n . The maximum value of ∑ i p i that is classically achievable (i.e., when all measurements commute) is (n−1)/2. The quantum value Q n is achieved by PiΠi hi for the KCBS configuration (ρKCBS;fΠKCBS ig), where ρ KCBS is a qutrit in a pure state and ΠKCBS iare projectors (see Definition 3 below), yielding I¼0. Definition 2. (An ideal KCBS configuration) Consider a threedimensional Hilbert space spanned by the basis f0 ji ;1 ji ;2 jig . Let ul ji :¼cos θ0 ji þsin θsin ϕl1 ji þsin θcos ϕl2 ji ;(2) where ϕ l ≔lπ(n−1)/nfor 1 ≤l≤nand cos2θ¼cosðπ=nÞ 1þcosðπ=nÞ.Define ψKCBS :¼0 ji ;(3) ΠKCBS i:¼ui ji ui hj :(4) It was shown in ref. 30 that any quantum realisation (ρ,{Π i }) which satisfies Assumption 1 and yields I¼0, must be the same as the KCBS configuration, up to a global isometry. (In fact, they also showed that if I¼ϵis close to zero, then the quantum realisation must be close to the KCBS configuration. However, their analysis did not yield the exact function corresponding to Equation (5)—they only had an asymptotic bound (on the fidelity to the KCBS configuration) of the form Oð ffiffiffiϵ pÞ). Recall that for clarity, we restricted to n=5 but the arguments readily generalise. Suppose the device corresponds to a quantum realisation (ρ,{Π i }) for which I¼ϵis small but not exactly zero. In this case, we derive a lower bound on the fidelity of (ρ,{Π i }) to ðρKCBS;fΠKCBS igÞ(up to a global isometry). More precisely, we lower bound the value of the following function F:¼min ρ;fΠigmax VX 5 i¼1FðtrH½VΠiρΠiVy;ΠKCBS iρKCBSΠKCBS iÞþFðtrH½VρVy;ρKCBSÞ "# ; (5) where ðρ;fΠig5 i¼1Þis a quantum realisation of fpig5 i¼1satisfying I¼ϵ,Vis an isometry from Hto HHKCBS, i.e., from the space on which ρ;fΠig5 i¼1are defined, to itself tensored with the 3-dimensional space where ρKCBS;fΠKCBS ig5 i¼1are defined, and Fðσ;τÞ:¼tr ffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffi σ1=2τ1=2 jj pis the fidelity of ρ≥0toσ≥0. This lower bound can be approximated by a sequence of semidefinite programs and can be evaluated for any I¼ϵ, yielding the robustness curve (see Fig. 1). We defer the detailed analysis to “Methods: Lower bound using an SDP relaxation”. (Instead of the sum ∑ i p i , one could impose constraints on the values of p i individually. In fact, this is what we do in our analysis as it yields a better bound). Experimental setup We describe our experimental setup, which is designed to realise the ideal KCBS configuration. We use a 40 Ca + ion trapped in a blade-shaped Paul trap. The qutrit basis states are encoded into three Zeeman sub-levels of the 40 Ca + ion, with 0 ji¼S1=2;mJ¼1=2 ;(6) 1 ji¼D5=2;mJ¼3=2 ;(7) 2 ji¼D5=2;mJ¼1=2 ;(8) as shown in Fig. 1a. Unitary operations on these qutrits are performed by shining a linear polarised narrow-linewidth 729 nm laser beam, propagating along the trap axis at an angle of 45° with respect to the quantisation axis. For k∈{1, 2}, the laser can be frequency modulated to be in resonance with the specific transition between the states 0 jiand k jiby an acousto-optic modulator (AOM). The coupling strength Ω k , duration tand phase ϕ k of this laser pulse then can be controlled by the AOM to perform a rotation, R k (θ k ,ϕ k ) between the states 0 ji and k ji , where θ k =Ω k tand ϕ k represent the polar angle and the azimuthal angle respectively, i.e., R1ðθ1;ϕ1Þ¼ cos θ1 2isin θ1 2eiϕ10 isin θ1 2eiϕ1cos θ1 20 001 0 B @1 C A;(9) R2ðθ2;ϕ2Þ¼ cos θ2 20isin θ2 2eiϕ2 01 0 isin θ2 2eiϕ20 cos θ2 2 0 B @1 C A:(10) The parameters of the rotation are controlled by varying the duration and phase of the corresponding laser pulse under constant intensity via the acoustic-optic modulator with high fidelity. Using R 1 and R 2 , one can perform an arbitrary rotation in the qutrit space. Measurements in our setup are performed by fluorescence detection, i.e., counting photons. Realising the KCBS configuration The preceding operations can be combined to perform various experiments that (nearly) satisfy Assumption 1. Here, we describe, at a high level, the procedure for realising the KCBS configuration (see Definition 3). Detailed experimental steps are deferred to “Methods: Experimental setup”. Using the notation introduced in Assumption 1, we denote the binary measurements of interest by M i ≔(Π 0∣i ,Π 1∣i ) and the quantum state of our system by ρ. To realise the KCBS configuration, we require Π1ji¼ui ji ui hjand ρ¼0 ji0 hj .To implement the measurement Π 1∣i , as a composition of the operations our setup permits, we first compute a qutrit rotation U i which maps ui ji to 0 ji . This, in turn, is used to compute the parameters θ 1,i ,θ 2,i and ϕ 1,i ,ϕ 2,i such that U i =R 2 (θ 2,i ,ϕ 2,i )⋅ R 1 (θ 1,i ,ϕ 1,i ). Observe that defining Π1ji:¼Ui0 ji0 hj Uy iand Π0ji:¼ UiðI0 ji0 hjÞ Uy iresults in the KCBS configuration. Neglecting experimental imperfections (which are indeed negligible in our experiment; see Supplementary Note 1), it is evident that Assumption 1 is satisfied, i.e., Π 1∣i ⋅Π 1∣j =0 for (i,j)∈E and Π2 1ji¼Π1ji. Further, it is clear that pi¼Prð1jiÞ¼Prð10jijÞ¼trðΠ0jjΠ1jiρΠy 1jiΠy 0jiÞ;(11) where Pr(ab∣ij) denotes the probability of obtaining outcomes (a,b) when measurements (M i ,M j ) are performed and Pr(a∣i) denotes the probability of obtaining outcome agiven M i was measured. Finally, we note that Pr(10∣ij)=Pr(01∣ji). As illustrated in Fig. 1,∑ k p k is estimated randomly (using a quantum random number generator; see Supplementary Note 1) by choosing (i,j)∈E, measuring M i followed by M j and counting X.-M. Hu et al. 4 npj Quantum Information (2023) 103 Published in partnership with The University of New South Wales
N(10∣ij), the number of times the output was (1, 0), i.e., piNð10jijÞ Pa;b2f0;1gNðabjijÞ:(12) Experiments that are self-tested To study the self-testing property of a device, we perform experiments which deviate from the standard KCBS configuration in two qualitatively different ways. (a) p-configuration. Consider the realisation ðρ0ðpÞ;fMigÞ parametrised by 0 ≤p≤1. Here, M i correspond to projectors along ui ji as before, but instead of initialising the state of the device to ρ¼0 ji0 hj , we initialise it to a mixture of ρand the maximally mixed state, i.e., ρ0ðpÞ:¼ð1pÞ0 ji0 hj þp 9I:(13) For p=0, we recover the ideal KCBS configuration for which I¼0. However, for p> 0, Assumption 1 still holds (neglecting the imperfections in the measurements) but I¼ϵ>0. The experiment was performed for p=0, 0.1, and 0.2. (b) θ-configuration. Consider the realisation ðu0 0 u0 0 ;fM0 iðθÞgÞ parametrised by the vector u0 0 and the angle θ. Here, unlike the previous case, the state is pure. Further, the measurements M0 i¼ðΠ0 1ji;Π0 0jiÞnow correspond to projections on u0 i for i∈{1, 2…5}. (The projections are defined exactly as M i was defined using ui ji;Π0 1ji¼U0 i0ji0hjU0y iand Π0 0ji¼UiðI0 ji0 hjÞ U0y iwith U0 iencoding a rotation from u0 i to 0ji). These vectors u0 i are chosen to be u0 1 ¼ð1;0;0ÞT;(14) u0 2 ¼ð0;0;1ÞT;(15) u0 3 ¼ðcosðθÞ;sinðθÞ;0ÞT;(16) u0 4 ¼ðsinðθÞ;cosðθÞ;sinðθÞÞT ffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffi 1þsin2ðθÞ p;(17) u0 5 ¼ð0;sinðθÞ;cosðθÞÞT;(18) which ensures that Assumption 1 holds for all angles θ. We take u0 0 to be the eigenvector of PkΠ0 kwith the largest eigenvalue. We performed the experiment for θ=22.041 and 150.612. Table 2summarises our findings for experiments implementing both pand θ-configurations, which are in agreement with our theoretical results. Here, we briefly explain how the data was obtained and analysed, deferring the details to “Methods: Analysing the data”. For a given configuration, we performed 10,000 sequential measurements and used Equation (12) to estimate the mean μ(p i ) and standard deviation σ(p i ) for each p i . Note, for instance, to measure p 2 , one could measure in normal order:M 2 followed by M 3 ,orinreverse order:M 2 followed by M 1 . We used a quantum random number generator to choose the measurement and its order. To apply our self-test, we have two options: impose the constraint corresponding to either (1) ∑ k p k or (2) p k for each k individually. Option (2) would be unequivocally better than option (1) if σwas 0 (illustrated by the orange curve in Fig. 1, Right). As σ> 0, we use both methods and pick the bestperforming among them. When σ> 0 for a random variable, we evaluate μ−1.96σto get an estimate for the random variable, which lower bounds its value with over 95% confidence (assuming the data is normally distributed). When such an estimate is used, sometimes option (1) can give a better bound than option (2). DISCUSSION Quantifying deviations from assumptions In all self-testing experiments, deviations from the assumptions must be quantitatively accounted for in the robustness curve. All reported self-test schemes, to the best of our knowledge, have neglected this aspect in their analysis. In more detail, for our setting, the lower bounds on total fidelity obtained using semidefinite programming only hold when Assumption 1 is satisfied. Relaxing this assumption (see Supplementary Note 1) to allow for measurements with errors ϵin repeatability (i.e., quantifying jΠ2 ajiΠajij) and δin orthogonality (i.e., quantifying ∣Π 1∣i ⋅Π 1∣i+1 ∣) is left as an open question. A full analysis should yield a lower bound on the total fidelity as a function of the KCBS value, δand ϵ. Note that the experimental points in Fig. 1lie above our robustness curve. The robustness curve obtained via the full analysis cannot be above the present curve and thus will still lower bound the total fidelity for the experimental data points. Similarly, the existing robustness curves in the Bell setting also only consider fidelity lower bound as a function of quantum value. Their analogous full analysis ought to include errors emanating from detection and locality loopholes. Table 2. Summary of our experimental and numerical results (see “Methods: Analysing the data”). Configuration ∑p k Fidelity (tomography) Fidelity (lower bound) using μσμ−1.96σμ σ μ−1.96σðPpkÞðμ1:96σÞððpkÞðμ1:96σÞÞk p=0 2.249 0.009 2.233 5.965 0.016 5.933 5.296 4.170 p=0 2.255 0.011 2.236 5.965 0.016 5.933 5.892 4.026 p=0.1 2.207 0.011 2.186 5.901 0.016 5.870 2.934 3.002 p=0.1 2.203 0.011 2.182 5.901 0.016 5.870 2.842 2.933 p=0.2 2.140 0.011 2.118 5.812 0.019 5.775 1.654 2.343 p=0.2 2.145 0.011 2.124 5.812 0.019 5.775 1.753 2.386 θ=22.021 2.078 0.010 2.058 3.989 0.017 3.956 0.740 2.561 θ=22.041 2.077 0.010 2.057 3.989 0.017 3.956 0.726 2.579 θ=150.612 2.062 0.010 2.043 4.050 0.017 4.017 0.533 2.222 θ=150.612 2.068 0.010 2.048 4.050 0.017 4.017 0.601 2.579 X.-M. Hu et al. 5 Published in partnership with The University of New South Wales npj Quantum Information (2023) 103
A naïve application of current techniques fails because Algorithm 4 no longer yields a valid isometry. Complementary to this, improving the sharpness (i.e., projectiveness) and exclusivity of measurements in the experiment is also an obvious yet important goal, which, if properly achieved, may render the aforesaid irrelevant. Future directions Extending the analysis to n> 5 (by making the algorithm more efficient), adapting it to more involved settings (possibly to anticycles), dropping the IID assumption (perhaps by using martingale analysis), obtaining analytic bounds (possibly via techniques from convex optimisation), we believe, are interesting avenues for further exploration. METHODS Lower bound using an SDP relaxation We briefly describe our algorithm for estimating Fand outline an argument which shows that this algorithm always yields a lower bound (on F). First, we drop the maximisation over Vin Equation 5 and replace it with a particular isometry Vwhich is expressed in terms of ρ;fΠig5 i¼1. Then, as we shall see, the expression for fidelity appears as a sum of terms of the following form. Let wbe a word created from the lettersfI;Π1;Π2;¼;Π5;^ Pg, with ^ Py^ P¼I, Π2 i¼Πi, and Π i Π j =0if(i,j)∈E, i.e., when i,jare exclusive. (We introduced ^ Pfor completeness; its role is explained later). The fidelity is a linear combination of these words, i.e., F¼min whifg Pwαww hi , where tr½wρ¼:w hi , subject to the constraint that fw hig wcorresponds to a quantum realisation. The advantage of casting the problem in this form is that one can now relax the problem to a sequence of semidefinite programs. i.e., construct an NPA-like hierarchy 38 . The idea is simple to state. Treat w hifg was a vector. Denote by Qthe set of all such vectors which correspond to a quantum realisation (of pi fg 5 i¼1). It turns out that one can impose constraints on words with kletters, for instance. Under these constraints, denote by Q k the set that is obtained. Note that Q k ⊇Qfor it may contain vectors which do not correspond to the quantum realisation. In fact, Q k can be characterised using semidefinite programming constraints (which, in turn, means they are efficiently computable). Intuitively, one expects that limk!1 Qk¼Q. Further, it is clear that F¼ minfwhig w2QPwαwwhimin w hifg w2QkPwαwwhias we are minimising over a larger set on the right-hand side. We now proceed formally. We begin with defining the ideal KCBS configuration referred to above. Definition 3. (An ideal KCBS configuration). Consider a threedimensional Hilbert space spanned by the basis f0 ji ;1 ji ;2 jig . Let ul ji :¼cos θ0 ji þsin θsin ϕl1 ji þsin θcos ϕl2 ji ;(19) where ϕ l ≔lπ(n−1)/nfor 1 ≤l≤nand cos2θ¼cosðπ=nÞ 1þcosðπ=nÞ.Define ψKCBS :¼0ji;(20) ΠKCBS i:¼ui ji ui hj :(21) For concreteness, we first consider a unitary U SWAP instead of an isometry, which acts on two spaces Aand A0, i.e., USWAP :AA0!AA 0. The space A0is three-dimensional and Ais an arbitrary Hilbert space. Informally, we want to construct the unitary U SWAP to be such that it takes a realisation in Aand maps it to a realisation in A0which has a large overlap with the KCBS configuration. To this end, we first assume that Ais three-dimensional. In particular, suppose that the Aregister is in the state σ2fψKCBS ψKCBS g∪fΠKCBS iψKCBS ψKCBS ΠKCBS ig5 i¼1 |fflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflffl{zfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflffl} :¼SKCBS :(22) Then, at the very least, we want U SWAP to map σA0 ji0 hj A0to 0 ji0 hj AσA0(see Fig. 2). Our strategy is to construct U SWAP in this seemingly trivial case and then express it in terms of the state and measurement operators on A. The rationale is that by construction, U SWAP will work for the ideal case and therefore should also work for cases close to the ideal. This should become clear momentarily. Note that any circuit that swaps two qutrits should let us achieve our simplified goal (because all elements of S KCBS are defined on a three-dimensional Hilbert space). One possible qutrit swapping unitary/circuit (a special case of the general qudit swapping unitary/circuit defined in ref. 36 ) may be defined as S00 SWAP :¼TUVU, where T:¼IAP 2 k¼0kjikhj A0; U:¼P 2 k¼0 Pk Ak jik hj A0; V:¼P 2 k¼0 k k APk A0; (23) where P:¼P2 i¼0kþ1 k is a translation operator, the arithmetic operations are modulo 3 and f0 ;1 ;2 gis a basis for the qutrit space A. We omit the proof that S00 SWAP indeed performs a swap operation (for a proof see ref. 36 ). To generalise this idea and to construct an isometry, we relax the assumption that Ais a three-dimensional Hilbert space. We re-express/replace the operations in T,U,V, which act on the Aspace by linear combinations of monomials in fΠig5 i¼1. We obtain the coefficients Fig. 2 Swap isometry. In this illustration, Aand A0are three-dimensional Hilbert spaces. The KCBS configuration is denoted by ψ0 jiand fn0 i g which represent the state and measurements (projectors along the vectors), respectively. The transformation illustrates how U SWAP acts on an arbitrary configuration (in A) and produces the KCBS configuration (in A0). In general, U SWAP is expressed in terms of the measurement operators specifying the arbitrary configuration to begin with. It serves as a key ingredient in obtaining a bound on the total fidelity. X.-M. Hu et al. 6 npj Quantum Information (2023) 103 Published in partnership with The University of New South Wales
used in these linear combinations by assuming the space A0is three-dimensional. The idea is simply that this map reduces to a swap operation when we re-impose the assumptions, and for cases close to it, we expect it to behave appropriately. We describe this procedure more precisely below. Algorithm 4. (Constructing an isometry). Let ●A0be a three-dimensional Hilbert space spanned by an orthonormal basis 0ji A0;1ji A0;2ji A0 , ●ρKCBS;fΠKCBS ig5 i¼1be an ideal KCBS configuration (see Definition 3) on A0, ●Abe a Hilbert space with dimension at least 3 containing orthonormal vectors 0 A;1 A;2 A no , ●ρ;fΠig5 i¼1be an arbitrary quantum realisation defined on A. Define T,U,Vas in Equation 23 and let S0 SWAP :¼TUVU with the following changes. Let WKCBS :¼ffΠKCBS ig5 i¼1;fΠKCBS iΠKCBS jg5 i;j¼1;¼g(24) and W:¼ffΠig5 i¼1;fΠiΠjg5 i;j¼1;¼g(25) be the set of “words”formed by the KCBS projectors and those of the arbitrary quantum realisation, respectively. ●Translation operator: Express PA0as a linear combination of elements in W, i.e., PA0¼PlKCBS2WKCBS αllKCBS. Define PA:¼Pl2Wαll. ●Basis projectors: Formally replace, in V, the operators (a) 0 0 Aby Π 1 , (b) 1 1 Aby Π 2 , and (c) 2 2 Aby ðIΠ1ÞðIΠ2Þ. Thus, Vnow becomes Π1IA0þΠ2P1 A0þðIΠ1Þ ðIΠ2ÞP2 A0. Wefoundanexplicitlinearcombinationforstep1(a)of Algorithm 4. (Using prior results, we expect one can prove the existence of such a linear combination, but we do not pursue this here). Thus, the algorithm always succeeds at constructing S0 SWAP.We must show that S0 SWAP is in fact an isometry. This is important because of the following reason. Recall that our objective was to lower bound the fidelity given in Equation (II.2) of the main text. To this end, we said we drop the maximisation over all possible Vs(fora given quantum realisation ðρ;Πi fg 5 i¼1Þ) and instead insert a specific isometry S0 SWAP (which is a function of ðρ;fΠig5 i¼1Þ). Note that this argument for lower bounding fidelity breaks if S0 SWAP is not an isometry. In fact, PAas produced by the algorithm is not necessarily unitary (viz. Py APA¼IAmay not hold). To address this, we use the localising matrix technique introduced in ref. 39 .Let^ PAbe unitary matrix satisfying ^ PP 0, where we dropped the subscript for clarity. Consider the case where Pis not unitary. In that case, one can use polar decomposition to write P¼P jj U(not to be confused with the Uabove; where P jj0andUyU¼I) so choosing ^ P¼Uysatisfies ^ PP 0. Thus for each P, the constraint can be satisfied. Consider the other case, i.e., where P=Uis unitary. Then (explained below), ^ P¼Uy. Thus, in the ideal case, we recover the same unitary and for the case close to ideal, we are guaranteed that there is some solution (which we expect should also work reasonably). Combining these, we can construct S SWAP , which is an isometry. (To see why ^ P¼Uy, write the polar decomposition of ^ P¼^ P E (where ^ P 0 and EyE¼I). Then, ^ PU ¼^ P EU, which is a polar decomposition of ^ PU. The polar decomposition of a positive semidefinite matrix Malways has the form MI. Using M¼^ PU, and identifying EU with I, we have E=U † ). Lemma 5.(S SWAP is indeed an isometry). Let S0 SWAP be the map produced by Algorithm 4 and define S SWAP to be S0 SWAP with PA replaced by ^ PA. Then S SWAP is an isometry if the following conditions hold ^ Py A^ PA¼IA;(26) ^ PAPA0:(27) Proof. It suffices to show that ψ hj A0ASy SWAPSSWAP ψ ji A0A¼1 for all normalised ψji A0A. We express S SWAP =TUVU, where Tis as in Equation 23,U:¼P2 k¼0 ^ Pk Ak k A0and V:¼Π1IA0þ Π2P1 A0þðIΠ1ÞðIΠ2ÞP2 A0. Observe that TyT¼IAA0¼ UyUsince ^ Py A^ PA¼IA. Further, we have that VyV¼Π1IA0þΠ2IA0þðIΠ1ÞðIΠ2ÞIA0 ∵Π1Π2¼0;Py A0PA0¼IA0 (28) ¼IAA0:(29) Hence, Sy SWAPSSWAP ¼IAA0establishing that S SWAP is, in fact, unitary and thus also an isometry.□ We can now combine all the pieces to write the final optimisation problem we solve. We use GðfaigÞ to denote the set of all letters Algorithm 6. (The SDP for lower bounding the fidelity of a given realisation with the ideal KCBS realisation) The algorithm proceeds in two parts. Notation: Let ●Arepresent an arbitrary Hilbert space and A0represent a three-dimensional Hilbert space, ●Wbe the set of “words”constructed using fΠig5 i¼1,^ Pand ^ Py, i.e., W ¼ GðfΠig5 i¼1;^ P;^ PyÞ, and ●define whi:¼trAðρwÞand assume (Without loss of generality, one can purify a state by increasing the dimension and have the operators leave that space unaffected (for any given quantum realisation)). ρ¼ψ jiψ hj so that w hi ¼ψ hj wψ ji for all w2W. Input: ●(Implicit) Π i .Π j =0 for all i,j∈E(G), where Gis a five-cycle graph and Eare its edges, indexed [1, 2, …, 5]. ●Observed statistics: (To obtain a better bound, one can add more fine-grained statistics as well, such as the values of p i individually for each i). Evaluation ∣Part 1. ●Evaluate S SWAP as described in Lemma 5 using Algorithm 4. ●Define the objective function fas fρ;Πi fg 5 i¼1 ¼X 5 i¼1FtrASSWAP ΠiρAΠi0 ji0 hj A0 Sy SWAP hi ; ΠKCBS iρKCBS A0ΠKCBS i(30) þF trASSWAP ρA0ji0hj A0 Sy SWAP hi ;ρKCBS A0 (31) and evaluate the coefficients f w so that (This was done using symbolic computation). f¼X w2W fww hi :(32) ●Again, from Algorithm 4, evaluate PAas a linear combination of w hi . X.-M. Hu et al. 7 Published in partnership with The University of New South Wales npj Quantum Information (2023) 103
Evaluation ∣Part 2. Solve the following SDP: Fnoiseless ¼min fw hig w2W P w2W fww hi s:t:ΓðkÞðIÞ0∵all gram matrices are 0 ΓðkÞðIÞv;w¼ΓðkÞðIÞv0;w0if vyw¼v0yw0 ΓðkÞð^ PAPAÞ0ðlocalising matrixÞ ΓðkÞð^ PAPAÞv;w¼ΓðkÞð^ PAPAÞv0;w0if vy^ PAPAw¼v0y^ PAPAw0 P 5 i¼1 Πi hi ¼cðobserved statisticÞ where Γ (k) (X) is a matrix which is ●indexed by letters w, ●whose matrix elements are given by ΓðkÞðXÞv;w¼ψ hj vyXw ψ ji , ●where kdefines the maximum number of letters that appear in the words wwhich index the matrix Γ (k) , and, where in the first two equality constraints, we use the following relations: ●Π i .Π j =0 for all i,j∈E(G) and ●^ Py A^ PA¼^ PA^ Py A¼IA. Output: F noiseless (c). Remark 1. Note that ^ PP 0)ΓðkÞð^ PPÞ0. This follows readily by letting AyA¼^ PP for some A(which must exist for any positive semidefinite matrix; one can use spectral decomposition). Then Γ (k) (A † A) is a Gram matrix and thus ≥0. Remark 2. We solved this SDP with whirestricted to being real, but it has been shown that this is without loss of generality (see, e.g., §V.A in ref. 36 ). We thus have an algorithm which can calculate the required lower bound on fidelity, given the observed value of the KCBS operator. Experimental setup The calcium ions, in which two dark states and one bright state are chosen to encode the states { 1 ji ,2 ji } and 0 ji , respectively. Every experimental sequence starts with 1 ms Doppler cooling using a 397 nm laser and a resonant 866 nm laser. The 397 nm laser is red detuned approximately half a natural linewidth from resonating with the cycling transition between S 1/2 and P 1/2 manifolds. This is followed by a 300 μs electromagnetically induced transparency (EIT) cooling sequence, which cools the ion down to near the motional ground state. After that, a 10 μs optical pumping laser is applied to initialise the qutrit to the 0 jistate with 99.5% fidelity. When needed, a 729 nm pulse sequence is applied to prepare a certain initial state. Measurements of the observables {A i } are performed through coherent rotations R 2 (θ 2 ,ϕ 2 )R 1 (θ 1 ,ϕ 1 ), a fluorescence detection followed by the operation Ry 1ðθ1;ϕ1ÞRy 2ðθ2;ϕ2Þwhich undoes the previous rotation. The first fluorescence detection lasts for 220 μs and uses laser settings close to those of Doppler cooling to minimise the motional heating due to photon recoil (in case of a bright state). However, this brings the temperature of the bright state close to the Doppler limit. Therefore, a 150 μs EIT cooling sequence followed by 10 μs optical pumping pulses is applied to cool the bright state ion. The detection and cooling time are greatly suppressed to minimise the random phase accumulation between the sequential measurement. Neither fluorescence detection nor the EIT cooling process affects the temperature of a dark state ion, which is slightly heated at a rate of 140 quanta per second due to electronic noise. The second fluorescence detection uses a resonant laser pulse and 300 μs integrating time, which lowers detection error. The result is acquired by counting the number of photons collected from the photo-multiplier tube (PMT) within the detection time. The statistical probability is calculated by repeating the same measurement 10,000 times. In our experiments, the 2πpulse time for both transitions is adjusted to around 142 μs; that is, the Rabi frequency is as low as Ω 1/2 =(2π)7 KHz, making the AC-Stark shift below 100 Hz. The separation between 1 jiand 2 jiis ω 2 −ω 1 =(2π)8.69 MHz with corresponding magnetic field B=5.18 G. The maximum probability of off-resonant excitation Ω2=ðω2ω1Þ2is about 6.5 × 10 −7 , small enough to ensure the independence of each Rabi oscillation 40,41 . Analysing the data The data. The complete data set can be accessed on GitHub 42 . Table 2shows a summary of our experimental and numerical results. In the table, configuration refers to the pand θ configurations discussed in “Results: Experiments that are selftested”. Each row represents the statistics obtained after running 10,000 experiments. White (grey) rows represent normal (reverse) order (again, see “Results: Experiments that are self-tested”). The values in the last two columns show lower bounds on the total fidelity obtained using our self-test scheme (i.e., solving the semidefinite programme in Algorithm 6), evaluated in two slightly different ways. These arise as we consider μ−1.96σ(where μis the mean and σis the standard deviation) to estimate the smallest possible value of our observed variables, with 95% confidence. Note the lower bounds on fidelity (last two columns) are satisfied by the value obtained using conventional tomography. For the normal (reverse) ordered case, the results are plotted in Fig. 1 (Supplementary Fig. 1). Why two curves?. As noted earlier, there are two robustness curves in the aforementioned figures. We now detail why. Notice that the observed statistic constraint in the SDP corresponding to Algorithm 6 can be tightened by specifying the value of each Πi hi term. Obviously, if one specifies the value of Πi hi , the value for their sum automatically gets fixed. Based on the experimental data, we have access to the value of each of the Πi hi and thus we can always obtain a tighter bound compared with the bound obtained via the sum constraint in the SDP for Algorithm 6. We illustrate this by plotting the robustness curve obtained in the special case p 1 =p 2 =p 3 =p 4 =p 5 (p i and 〈Π i 〉are interchangeable). One could have just as easily taken a different choice for the values of p i such that their sum remains equal to the appropriate KCBS value and obtain a different robustness curve. All such curves, obtained by providing the value for p i s, will be lower bound by the curve obtained via the sum constraint (the blue curve). For our experimental data point with mean μand standard deviation σ, we base our analysis on μ−1.96σ, which is the smallest possible value with 95% confidence for normally distributed data. Analysing the p-configuration. As mentioned above, we base our analysis on μ−1.96σfor the appropriate values of μand σ. This, however, has consequences on the constraint that we impose via the observed statistics. For our experimental data, we observe that Piðμpi ðÞ1:96σpi ðÞÞis upper bounded by μPipi 1:96σ Pipi . Since our robustness curves are very sensitive to minor changes near the region of maximum KCBS value Pipi , the lower bound on the fidelity provided by the sum constraint can be better than the (nearly) equal statistic constraint (p 1 ≈p 2 ≈p 3 ≈ p 4 ≈p 5 ). Since our goal is to provide tight lower bounds, we take the largest value, which is the one obtained from the sum constraint close to the region of the maximum KCBS value. Away X.-M. Hu et al. 8 npj Quantum Information (2023) 103 Published in partnership with The University of New South Wales
from the maximum KCBS value region, (nearly) equal statistic constraint provides a better estimate (as is evident from the plots in Fig. 1). We also computed the fidelity of these quantum realisations to the ideal KCBS configuration by performing state and measurement tomography. We found that the self-testing lower bounds are satisfied. Results for p-configuration. For p=0, 0.1, and 0.2, we obtained ∑ k p k to be 2.233, 2.186, and 2.118, respectively, for the normal ordered case. By solving the SDP outputted by Algorithm 6 with these values as inputs, the self-testing lower bounds on the total fidelity of these realisations to the KCBS configuration are 5.296, 3.002, and 2.343, respectively. For the reverse-ordered experiments the corresponding values for ∑ k p k are 2.236, 2.182, and 2.124, respectively. The self-testing lower bound on the total fidelity for these cases were 5.892, 2.933, and 2.386, respectively. On the other hand, conventional tomography yielded 5.965, 5.901, and 5.812, respectively. The values are the same for normal and reverse-ordered experiments (because an experiment being normal or reverse is determined by a quantum random number generator and has no explicit difference otherwise at the level of measurements and the state involved). As expected, the total fidelity obtained from conventional tomography is indeed above the lower bound on it obtained using our self-test. Analysing the θ-configuration. To obtain the self-test lower bounds, we proceeded as before. However, finding a lower bound on the fidelity using conventional tomography is slightly more involved in this case. The idea is to first find the fidelity between the experimental setup and the θconfiguration and then between θconfiguration and the KCBS configuration (up to an isometry). Using a form of triangle inequality, one can lower bound the total fidelity. In more detail, our goal is to find the total fidelity of the experimentally realised configuration with a configuration which is related to the KCBS configuration via an isometry. In the previous case, this isometry was an identity matrix (a trivial isometry). Since the optimal configuration is unique up to an isometry, any configuration which is related to the KCBS configuration via an isometry can be considered an optimal configuration. Our goal is to calculate the total fidelity of the experimental realisation of ðuθ 0 uθ 0 ;uθ i uθ i 5 i¼1Þ, say ðρE 0;ME i 5 i¼1Þto an optimal configuration, say ðuO 0 uO 0 ;uO i uO i 5 i¼1Þ. Let us denote the fidelity of uE i to uO i as FE;O i. Here, FE;O idenotes the fidelity of the ith component of the experimental realisation to that of the ideal configuration. Similarly, other fidelities are denoted by FE;θ iand Fθ;O i. We know that fidelity is not a valid metric, and hence, we will not be able to apply triangle inequality directly. However, we can use trace distance as a proxy to relate the aforementioned three configurations. After some simple calculations, we obtain the following expression for the lower bound on the total fidelity P5 i¼0FE;O i (see Supplementary Note 4 for details) X 5 i¼0 FE;I i6X 5 i¼0ffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffi 1FE;θ i q ! X 5 i¼0ffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffi 1Fθ;O i q ! :(33) Based on the experimental data, we can calculate P5 i¼0ffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffi 1FE;θ i q . The second total fidelity expression P5 i¼0ffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffi 1Fθ;O i q can be evaluated using numerical optimisation. Results for the θ-configuration. We obtained ∑ k p k to be 2.058 and 2.043, respectively, for the normal ordered case. For the reverseordered experiments, the corresponding values were 2.057 and 2.048, respectively. The self-testing lower bound on the total fidelity for the normal ordered case was 2.561 and 2.222, and the corresponding values for the reverse ordered case were 2.579 and 2.579, respectively. Conventional tomography, on the other hand, yielded 3.956 and 4.050, respectively (for both normal normal and reverse order). Again, the self-testing lower bounds are satisfied, as expected. Numerics to evaluate fidelity lower bounds As previously stated, obtaining the numerical solution was quite involved, owing to the fact that the description of the semidefinite program we obtain is implicit. Consequently, one first needs to find this explicit description through symbolic computation and then solve the resulting semidefinite program. After performing the symbolic computation to find the objective and constraints, we solve an SDP over a 192 × 192 matrix with 16,859 constraints. The terms in the objective function must appear in the SDP matrix in order for us to impose appropriate constraints. This is because the optimisation program would otherwise be undefined. The unusually large size of the SDP matrices (compared to similar selftest schemes) reflects the complexity of the objective function in our case, which would have been difficult to obtain without symbolic computation. To capture all the terms that appear in the objective, we needed words with three letters (the matrices involved scale exponentially in the number of letters). Further, we require 769 localising matrix constraints. We used Jupyter notebooks (based on Python) as our programming environment. We used sympy 43 for symbolic computations and cvxpy 44,45 for translating the resulting SDP into an instance that MOSEK (an SDP solver) could solve. Our implementation is available on GitHub 42 . DATA AVAILABILITY The data backing up the graphs and findings presented in this paper can be found on GitHub 42 . Received: 23 April 2023; Accepted: 26 September 2023; REFERENCES 1. Deutsch, I. H. Harnessing the power of the second quantum revolution. PRX Quantum 1, 020101 (2020). 2. Eisert, J. et al. Quantum certification and benchmarking. Nat. Rev. Phys. 2, 382–390 (2020). 3. O’Donnell, R. & Wright, J. Efficient quantum tomography. In Proc. Forty-eighth Annual ACM Symposium on Theory of Computing, 899–912 (2016). 4. Cirac, J. I., Pérez-García, D., Schuch, N. & Verstraete, F. Matrix product states and projected entangled pair states: concepts, symmetries, theorems. Rev. Mod. Phys. 93, 045003 (2021). 5. Mayers, D. & Yao, A. Self testing quantum apparatus. Quantum Inf. Comput. 4, 273–286 (2004). 6. Tsirel’son, B. S. Quantum analogues of the bell inequalities. The case of two spatially separated domains. J. Math. Sci. 36, 557–570 (1987). 7. Summers, S. J. & Werner, R. Bell’s inequalities and quantum field theory. I. General setting. J. Math. Phys. 28, 2440–2447 (1987). 8. Popescu, S. & Rohrlich, D. Generic quantum nonlocality. Phys. Lett. A 166, 293–297 (1992). 9. Braunstein, S. L., Mann, A. & Revzen, M. Maximal violation of bell inequalities for mixed states. Phys. Rev. Lett. 68, 3259 (1992). 10. Mayers, D. & Yao, A. Quantum cryptography with imperfect apparatus. In Proc. 39th Annual Symposium on Foundations of Computer Science (Cat. No. 98CB36280), 503–509 (IEEE, 1998). X.-M. Hu et al. 9 Published in partnership with The University of New South Wales npj Quantum Information (2023) 103