Abstract
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 40Ca+ 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.
Similar content being viewed by others
Introduction
There is strong reason to believe that quantum devices can outperform their classical counterparts on various fronts1. Yet, certifying that a quantum device is functioning as intended (or claimed) becomes challenging as the device becomes increasingly complex2. 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 systems4. 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 Yao5, 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 works6,7,8,9,10. Self-testing has since been an area of active investigation11 and the notion has been extended to various settings, such as bipartite (all pure states can be self-tested12,13,14), multi-partite (various families can be self-tested15,16,17,18), Bell state measurement19,20, prepare-and-measure21,22, steering23,24,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 non-contextuality inequalities—linear inequalities26,27, similar to Bell inequalities, the experimental violation of which28,29 can be used to witness non-classicality. Their advantage is precisely that they can be tested in a single system. Unlike the aforementioned self-testing 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 proposed30,31,32,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 40Ca+ 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 non-contextual models are not simulating contextual correlations34). 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 n of 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 \({{{\mathcal{I}}}}\) (Equation 1), which is a linear expression in the input/output probabilities associated with the device. \({{{\mathcal{I}}}}\) can be made 0 by a quantum device, but every classical device must yield \({{{\mathcal{I}}}}\ge Q-C \,>\, 0\), where Q and C are constants, independent of the device once n is fixed. It is known30 that the configuration (the states and measurements associated with the device) are unique for any device which yields \({{{\mathcal{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 \(\left\vert \phi \right\rangle\) to any other state \(\left\vert \xi \right\rangle\). 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 \({{{\mathcal{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 nonlocality-based self-testing: for a single system, the notion of local isometry anyway does not make sense).
Consider a configuration for which \({{{\mathcal{I}}}}\) is 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 + 1 as it sums the fidelity to n measurements and one state. For the (simplest) KCBS configuration, n = 5). We give a lower bound on F as a function of \({{{\mathcal{I}}}}\). The idea is to define an isometry in terms of the measurement operators of the device itself, which maps a device’s configuration to the KCBS configuration when \({{{\mathcal{I}}}}=0\). The expression for F when \({{{\mathcal{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. The details of 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 40Ca+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. 1 and “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 \({{{\mathcal{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
Self-testing in a single system has recently been studied under cryptographic assumptions35; 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 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 pi denote the probability of event i, where an event is an instance of an input-output. Let \({{{\mathcal{I}}}}:= {\sum }_{i}{q}_{i}{p}_{i}\) denote a linear combination of these probabilities, where \({q}_{i}\in {\mathbb{R}}\). We say that \(({{{\mathcal{I}}}},c)\), for some \(c\in {\mathbb{R}}\), self-tests the device if the following holds—if the device satisfies \({{{\mathcal{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 Mi ≔ (Π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 \({{{\Pi }}}_{0| i}^{{\dagger} }{{{\Pi }}}_{0| i}+{{{\Pi }}}_{1| i}^{{\dagger} }{{{\Pi }}}_{1| i}={\mathbb{I}}\). We say the binary measurement is repeatable and Hermitian if \({{{\Pi }}}_{b| i}^{2}={{{\Pi }}}_{b| i}\) for b ∈ 0, 1 and \({{{\Pi }}}_{b| i}^{{\dagger} }={{{\Pi }}}_{b| i}\), respectively.
Assumption 1
For an odd n, the quantum state in the device is ρ and the measurements M1, M2, …, Mn 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, 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 \({{{\mathcal{I}}}}\)
where \({p}_{i}:= {{{\rm{tr}}}}({{{\Pi }}}_{i}\rho )=\left\langle {{{\Pi }}}_{i}\right\rangle\) and \({Q}_{n}:= \frac{n\cos (\pi /n)}{1+\cos (\pi /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 \(\mathop{\sum }\nolimits_{i = 1}^{n}{p}_{i}\, >\, {C}_{n}\), where Cn ≔ (n − 1)/2 while quantumly, for the KCBS configuration (see Definition 3) one obtains \(\mathop{\sum }\nolimits_{i = 1}^{n}{p}_{i}={Q}_{n}\), the highest possible37. The self-test measures how close one is to the maximum quantum value, Qn. The maximum value of ∑ipi that is classically achievable (i.e., when all measurements commute) is (n − 1)/2. The quantum value Qn is achieved by \({\sum }_{i}\left\langle {{{\Pi }}}_{i}\right\rangle\) for the KCBS configuration (\({\rho }^{{{{\rm{KCBS}}}}},\{{{{\Pi }}}_{i}^{{{{\rm{KCBS}}}}}\}\)), where ρKCBS is a qutrit in a pure state and \({{{\Pi }}}_{i}^{{{{\rm{KCBS}}}}}\) are projectors (see Definition 3 below), yielding \({{{\mathcal{I}}}}=0\).
Definition 2
(An ideal KCBS configuration) Consider a three-dimensional Hilbert space spanned by the basis \(\{\left\vert 0\right\rangle ,\left\vert 1\right\rangle ,\left\vert 2\right\rangle \}\). Let
where ϕl ≔ lπ(n − 1)/n for 1 ≤ l ≤ n and \({\cos }^{2}\theta =\frac{\cos (\pi /n)}{1+\cos (\pi /n)}\). Define
It was shown in ref. 30 that any quantum realisation (ρ, {Πi}) which satisfies Assumption 1 and yields \({{{\mathcal{I}}}}=0\), must be the same as the KCBS configuration, up to a global isometry. (In fact, they also showed that if \({{{\mathcal{I}}}}=\epsilon\) 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 \({{{\mathcal{O}}}}(\sqrt{\epsilon })\)).
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 \({{{\mathcal{I}}}}=\epsilon\) is small but not exactly zero. In this case, we derive a lower bound on the fidelity of (ρ, {Πi}) to \(({\rho }^{{{{\rm{KCBS}}}}},\{{{{\Pi }}}_{i}^{{{{\rm{KCBS}}}}}\})\) (up to a global isometry). More precisely, we lower bound the value of the following function
where \((\rho ,{\{{{{\Pi }}}_{i}\}}_{i = 1}^{5})\) is a quantum realisation of \({\{{p}_{i}\}}_{i = 1}^{5}\) satisfying \({{{\mathcal{I}}}}=\epsilon\), V is an isometry from \({{{\mathcal{H}}}}\) to \({{{\mathcal{H}}}}\otimes {{{{\mathcal{H}}}}}^{{{{\rm{KCBS}}}}}\), i.e., from the space on which \(\rho ,{\{{{{\Pi }}}_{i}\}}_{i = 1}^{5}\) are defined, to itself tensored with the 3-dimensional space where \({\rho }^{{{{\rm{KCBS}}}}},{\{{{{\Pi }}}_{i}^{{{{\rm{KCBS}}}}}\}}_{i = 1}^{5}\) are defined, and \({{{\mathcal{F}}}}(\sigma ,\tau ):= {{{\rm{tr}}}}\sqrt{\left\vert {\sigma }^{1/2}{\tau }^{1/2}\right\vert }\) is the fidelity of ρ ≥ 0 to σ ≥ 0. This lower bound can be approximated by a sequence of semidefinite programs and can be evaluated for any \({{{\mathcal{I}}}}=\epsilon\), yielding the robustness curve (see Fig. 1). We defer the detailed analysis to “Methods: Lower bound using an SDP relaxation”. (Instead of the sum ∑ipi, one could impose constraints on the values of pi 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 40Ca+ ion trapped in a blade-shaped Paul trap. The qutrit basis states are encoded into three Zeeman sub-levels of the 40Ca+ ion, with
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 \(\left\vert 0\right\rangle\) and \(\left\vert k\right\rangle\) by an acousto-optic modulator (AOM). The coupling strength Ωk, duration t and phase ϕk of this laser pulse then can be controlled by the AOM to perform a rotation, Rk(θk, ϕk) between the states \(\left\vert 0\right\rangle\) and \(\left\vert k\right\rangle\), where θk = Ωkt and ϕk represent the polar angle and the azimuthal angle respectively, i.e.,
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 R1 and R2, 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 Mi ≔ (Π0∣i, Π1∣i) and the quantum state of our system by ρ. To realise the KCBS configuration, we require \({{{\Pi }}}_{1| i}=\left\vert {u}_{i}\right\rangle \left\langle {u}_{i}\right\vert\) and \(\rho =\left\vert 0\right\rangle \left\langle 0\right\vert\). To implement the measurement Π1∣i, as a composition of the operations our setup permits, we first compute a qutrit rotation Ui which maps \(\left\vert {u}_{i}\right\rangle\) to \(\left\vert 0\right\rangle\). This, in turn, is used to compute the parameters θ1,i, θ2,i and ϕ1,i, ϕ2,i such that Ui = R2(θ2,i, ϕ2,i) ⋅ R1(θ1,i, ϕ1,i). Observe that defining \({{{\Pi }}}_{1| i}:= {U}_{i}\left\vert 0\right\rangle \left\langle 0\right\vert {U}_{i}^{{\dagger} }\) and \({{{\Pi }}}_{0| i}:= {U}_{i}({\mathbb{I}}-\left\vert 0\right\rangle \left\langle 0\right\vert ){U}_{i}^{{\dagger} }\) results 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 \({{{\Pi }}}_{1| i}^{2}={{{\Pi }}}_{1| i}\). Further, it is clear that
where Pr(ab∣ij) denotes the probability of obtaining outcomes (a, b) when measurements (Mi, Mj) are performed and Pr(a∣i) denotes the probability of obtaining outcome a given Mi was measured. Finally, we note that Pr(10∣ij) = Pr(01∣ji).
As illustrated in Fig. 1, ∑kpk is estimated randomly (using a quantum random number generator; see Supplementary Note 1) by choosing (i, j) ∈ E, measuring Mi followed by Mj and counting N(10∣ij), the number of times the output was (1, 0), i.e.,
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 \(({\rho }^{{\prime} }(p),\{{M}_{i}\})\) parametrised by 0 ≤ p ≤ 1. Here, Mi correspond to projectors along \(\left\vert {u}_{i}\right\rangle\) as before, but instead of initialising the state of the device to \(\rho =\left\vert 0\right\rangle \left\langle 0\right\vert\), we initialise it to a mixture of ρ and the maximally mixed state, i.e.,
$${\rho }^{{\prime} }(p):= (1-p)\left\vert 0\right\rangle \left\langle 0\right\vert +\frac{p}{9}{\mathbb{I}}.$$(13)For p = 0, we recover the ideal KCBS configuration for which \({{{\mathcal{I}}}}=0\). However, for p > 0, Assumption 1 still holds (neglecting the imperfections in the measurements) but \({{{\mathcal{I}}}}=\epsilon\, >\, 0\). The experiment was performed for p = 0, 0.1, and 0.2.
-
(b)
θ-configuration. Consider the realisation \((\left\vert {u}_{0}^{{\prime} }\right\rangle \left\langle {u}_{0}^{{\prime} }\right\vert ,\{{M}_{i}^{{\prime} }(\theta )\})\) parametrised by the vector \(\left\vert {u}_{0}^{{\prime} }\right\rangle\) and the angle θ. Here, unlike the previous case, the state is pure. Further, the measurements \({M}_{i}^{{\prime} }=({{{\Pi }}}_{1| i}^{{\prime} },{{{\Pi }}}_{0| i}^{{\prime} })\) now correspond to projections on \(\left\vert {u}_{i}^{{\prime} }\right\rangle\) for i ∈ {1, 2…5}. (The projections are defined exactly as Mi was defined using \(\left\vert {u}_{i}\right\rangle\); \({{{\Pi }}}_{1| i}^{{\prime} }={U}_{i}^{{\prime} }\left\vert 0\right\rangle \left\langle 0\right\vert {U}_{i}^{{\prime} {\dagger} }\) and \({{{\Pi }}}_{0| i}^{{\prime} }={U}_{i}({\mathbb{I}}-\left\vert 0\right\rangle \left\langle 0\right\vert ){U}_{i}^{{\prime} {\dagger} }\) with \({U}_{i}^{{\prime} }\) encoding a rotation from \(\left\vert {u}_{i}^{{\prime} }\right\rangle\) to \(\left\vert 0\right\rangle\)). These vectors \(\left\vert {u}_{i}^{{\prime} }\right\rangle\) are chosen to be
$$\left\vert {u}_{1}^{{\prime} }\right\rangle ={(1,0,0)}^{T},$$(14)$$\left\vert {u}_{2}^{{\prime} }\right\rangle ={(0,0,1)}^{T},$$(15)$$\left\vert {u}_{3}^{{\prime} }\right\rangle ={(-\cos (\theta ),\sin (\theta ),0)}^{T},$$(16)$$\left\vert {u}_{4}^{{\prime} }\right\rangle =\frac{{(\sin (\theta ),\cos (\theta ),\sin (\theta ))}^{T}}{\sqrt{1+{\sin }^{2}(\theta )}},$$(17)$$\left\vert {u}_{5}^{{\prime} }\right\rangle ={(0,\sin (\theta ),-\cos (\theta ))}^{T},$$(18)which ensures that Assumption 1 holds for all angles θ. We take \(\left\vert {u}_{0}^{{\prime} }\right\rangle\) to be the eigenvector of \({\sum }_{k}{{{\Pi }}}_{k}^{{\prime} }\) with the largest eigenvalue. We performed the experiment for θ = 22.041 and 150.612.
Table 2 summarises our findings for experiments implementing both p and θ-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 μ(pi) and standard deviation σ(pi) for each pi. Note, for instance, to measure p2, one could measure in normal order: M2 followed by M3, or in reverse order: M2 followed by M1. 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) ∑kpk or (2) pk 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 best-performing 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 \(| {{{\Pi }}}_{a| i}^{2}-{{{\Pi }}}_{a| i}|\)) 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. 1 lie 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.
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 anti-cycles), 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 F and outline an argument which shows that this algorithm always yields a lower bound (on F). First, we drop the maximisation over V in Equation 5 and replace it with a particular isometry V which is expressed in terms of \(\rho ,{\{{{{\Pi }}}_{i}\}}_{i = 1}^{5}\). Then, as we shall see, the expression for fidelity appears as a sum of terms of the following form. Let w be a word created from the letters\(\{{\mathbb{I}},{{{\Pi }}}_{1},{{{\Pi }}}_{2},\ldots ,{{{\Pi }}}_{5},\hat{P}\}\), with \({\hat{P}}^{{\dagger} }\hat{P}={\mathbb{I}}\), \({{{\Pi }}}_{i}^{2}={{{\Pi }}}_{i}\), and ΠiΠj = 0 if (i, j) ∈ E, i.e., when i, j are exclusive. (We introduced \(\hat{P}\) for completeness; its role is explained later). The fidelity is a linear combination of these words, i.e., \(F=\mathop{\min }\nolimits_{\left\{\left\langle w\right\rangle \right\}}{\sum }_{w}{\alpha }_{w}\left\langle w\right\rangle\), where \({{{\rm{tr}}}}[w\rho ]=:\left\langle w\right\rangle\), subject to the constraint that \({\{\left\langle w\right\rangle \}}_{w}\) corresponds 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 hierarchy38.
The idea is simple to state. Treat \({\left\{\left\langle w\right\rangle \right\}}_{w}\) as a vector. Denote by Q the set of all such vectors which correspond to a quantum realisation (of \({\left\{{p}_{i}\right\}}_{i = 1}^{5}\)). It turns out that one can impose constraints on words with k letters, for instance. Under these constraints, denote by Qk the set that is obtained. Note that Qk ⊇ Q for it may contain vectors which do not correspond to the quantum realisation. In fact, Qk can be characterised using semidefinite programming constraints (which, in turn, means they are efficiently computable). Intuitively, one expects that \(\mathop{\lim }\nolimits_{k\to \infty }{Q}_{k}=Q\). Further, it is clear that \(F=\mathop{\min }\nolimits_{{\{\left\langle w\right\rangle \}}_{w}\in Q}{\sum }_{w}{\alpha }_{w}\left\langle w\right\rangle \ge \mathop{\min }\nolimits_{{\left\{\left\langle w\right\rangle \right\}}_{w}\in {Q}_{k}}{\sum }_{w}{\alpha }_{w}\left\langle w\right\rangle\) as 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 three-dimensional Hilbert space spanned by the basis \(\{\left\vert 0\right\rangle ,\left\vert 1\right\rangle ,\left\vert 2\right\rangle \}\). Let
where ϕl ≔ lπ(n − 1)/n for 1 ≤ l ≤ n and \({\cos }^{2}\theta =\frac{\cos (\pi /n)}{1+\cos (\pi /n)}\). Define
For concreteness, we first consider a unitary USWAP instead of an isometry, which acts on two spaces \({{{\mathcal{A}}}}\) and \({{{{\mathcal{A}}}}}^{{\prime} }\), i.e., \({U}_{{{{\rm{SWAP}}}}}:{{{\mathcal{A}}}}\otimes {{{{\mathcal{A}}}}}^{{\prime} }\to {{{\mathcal{A}}}}\otimes {{{{\mathcal{A}}}}}^{{\prime} }\). The space \({{{{\mathcal{A}}}}}^{{\prime} }\) is three-dimensional and \({{{\mathcal{A}}}}\) is an arbitrary Hilbert space. Informally, we want to construct the unitary USWAP to be such that it takes a realisation in \({{{\mathcal{A}}}}\) and maps it to a realisation in \({{{{\mathcal{A}}}}}^{{\prime} }\) which has a large overlap with the KCBS configuration. To this end, we first assume that \({{{\mathcal{A}}}}\) is three-dimensional. In particular, suppose that the \({{{\mathcal{A}}}}\) register is in the state
Then, at the very least, we want USWAP to map \({\sigma }_{{{{\mathcal{A}}}}}\otimes \left\vert 0\right\rangle {\left\langle 0\right\vert }_{{{{{\mathcal{A}}}}}^{{\prime} }}\) to \(\left\vert 0\right\rangle {\left\langle 0\right\vert }_{{{{\mathcal{A}}}}}\otimes {\sigma }_{{{{{\mathcal{A}}}}}^{{\prime} }}\) (see Fig. 2). Our strategy is to construct USWAP in this seemingly trivial case and then express it in terms of the state and measurement operators on \({{{\mathcal{A}}}}\). The rationale is that by construction, USWAP 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 SKCBS 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 \({S}_{{{{\rm{SWAP}}}}}^{{\prime\prime} }:= TUVU\), where
where \(P:= \mathop{\sum }\nolimits_{i = 0}^{2}\left\vert \overline{k+1}\right\rangle \left\langle \bar{k}\right\vert\) is a translation operator, the arithmetic operations are modulo 3 and \(\{\left\vert \bar{0}\right\rangle ,\left\vert \bar{1}\right\rangle ,\left\vert \bar{2}\right\rangle \}\) is a basis for the qutrit space \({{{\mathcal{A}}}}\). We omit the proof that \({S}_{{{{\rm{SWAP}}}}}^{{\prime\prime} }\) 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 \({{{\mathcal{A}}}}\) is a three-dimensional Hilbert space. We re-express/replace the operations in T, U, V, which act on the \({{{\mathcal{A}}}}\) space by linear combinations of monomials in \({\{{{{\Pi }}}_{i}\}}_{i = 1}^{5}\). We obtain the coefficients used in these linear combinations by assuming the space \({{{{\mathcal{A}}}}}^{{\prime} }\) is 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
-
\({{{{\mathcal{A}}}}}^{{\prime} }\) be a three-dimensional Hilbert space spanned by an orthonormal basis \(\left\{{\left\vert 0\right\rangle }_{{{{{\mathcal{A}}}}}^{{\prime} }},{\left\vert 1\right\rangle }_{{{{{\mathcal{A}}}}}^{{\prime} }},{\left\vert 2\right\rangle }_{{{{{\mathcal{A}}}}}^{{\prime} }}\right\}\),
-
\({\rho }^{KCBS},{\{{{{\Pi }}}_{i}^{KCBS}\}}_{i = 1}^{5}\) be an ideal KCBS configuration (see Definition 3) on \({{{{\mathcal{A}}}}}^{{\prime} }\),
-
\({{{\mathcal{A}}}}\) be a Hilbert space with dimension at least 3 containing orthonormal vectors \(\left\{{\left\vert \bar{0}\right\rangle }_{{{{\mathcal{A}}}}},{\left\vert \bar{1}\right\rangle }_{{{{\mathcal{A}}}}},{\left\vert \bar{2}\right\rangle }_{{{{\mathcal{A}}}}}\right\}\),
-
\(\rho ,{\{{{{\Pi }}}_{i}\}}_{i = 1}^{5}\) be an arbitrary quantum realisation defined on \({{{\mathcal{A}}}}\).
Define T, U, V as in Equation 23 and let \({S}_{{{{\rm{SWAP}}}}}^{{\prime} }:= TUVU\) with the following changes. Let
and
be the set of “words” formed by the KCBS projectors and those of the arbitrary quantum realisation, respectively.
-
Translation operator:
-
Express \({P}_{{{{{\mathcal{A}}}}}^{{\prime} }}\) as a linear combination of elements in \({{{\mathcal{W}}}}\), i.e., \({P}_{{{{{\mathcal{A}}}}}^{{\prime} }}={\sum }_{{l}^{KCBS}\in {{{{\mathcal{W}}}}}^{KCBS}}{\alpha }_{l}{l}^{KCBS}\).
-
Define \({P}_{{{{\mathcal{A}}}}}:= {\sum }_{l\in {{{\mathcal{W}}}}}{\alpha }_{l}l\).
-
-
Basis projectors: Formally replace, in V, the operators
-
(a)
\(\left\vert \bar{0}\right\rangle {\left\langle \bar{0}\right\vert }_{{{{\mathcal{A}}}}}\) by Π1,
-
(b)
\(\left\vert \bar{1}\right\rangle {\left\langle \bar{1}\right\vert }_{{{{\mathcal{A}}}}}\) by Π2, and
-
(c)
\(\left\vert \bar{2}\right\rangle {\left\langle \bar{2}\right\vert }_{{{{\mathcal{A}}}}}\) by \(({\mathbb{I}}-{{{\Pi }}}_{1})({\mathbb{I}}-{{{\Pi }}}_{2})\).
-
(a)
Thus, V now becomes \({{{\Pi }}}_{1}\otimes {{\mathbb{I}}}_{{{{{\mathcal{A}}}}}^{{\prime} }}+{{{\Pi }}}_{2}\otimes {P}_{{{{{\mathcal{A}}}}}^{{\prime} }}^{-1}+({\mathbb{I}}-{{{\Pi }}}_{1})({\mathbb{I}}-{{{\Pi }}}_{2})\otimes {P}_{{{{{\mathcal{A}}}}}^{{\prime} }}^{-2}\).
We found an explicit linear combination for step 1 (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 \({S}_{{{{\rm{SWAP}}}}}^{{\prime} }\). We must show that \({S}_{{{{\rm{SWAP}}}}}^{{\prime} }\) 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 (for a given quantum realisation \((\rho ,{\left\{{{{\Pi }}}_{i}\right\}}_{i = 1}^{5})\)) and instead insert a specific isometry \({S}_{{{{\rm{SWAP}}}}}^{{\prime} }\) (which is a function of \((\rho ,{\{{{{\Pi }}}_{i}\}}_{i = 1}^{5})\)). Note that this argument for lower bounding fidelity breaks if \({S}_{{{{\rm{SWAP}}}}}^{{\prime} }\) is not an isometry. In fact, \({P}_{{{{\mathcal{A}}}}}\) as produced by the algorithm is not necessarily unitary (viz. \({P}_{{{{\mathcal{A}}}}}^{{\dagger} }{P}_{{{{\mathcal{A}}}}}={{\mathbb{I}}}_{{{{\mathcal{A}}}}}\) may not hold). To address this, we use the localising matrix technique introduced in ref. 39. Let \({\hat{P}}_{{{{\mathcal{A}}}}}\) be unitary matrix satisfying \(\hat{P}P\ge 0\), where we dropped the subscript for clarity. Consider the case where P is not unitary. In that case, one can use polar decomposition to write \(P=\left\vert P\right\vert U\) (not to be confused with the U above; where \(\left\vert P\right\vert \ge 0\) and \({U}^{{\dagger} }U={\mathbb{I}}\)) so choosing \(\hat{P}={U}^{{\dagger} }\) satisfies \(\hat{P}P\ge 0\). Thus for each P, the constraint can be satisfied. Consider the other case, i.e., where P = U is unitary. Then (explained below), \(\hat{P}={U}^{{\dagger} }\). 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 SSWAP, which is an isometry.
(To see why \(\hat{P}={U}^{{\dagger} }\), write the polar decomposition of \(\hat{P}=\left\vert \hat{P}\right\vert E\) (where \(\left\vert \hat{P}\right\vert \ge 0\) and \({E}^{{\dagger} }E={\mathbb{I}}\)). Then, \(\hat{P}U=\left\vert \hat{P}\right\vert EU\), which is a polar decomposition of \(\hat{P}U\). The polar decomposition of a positive semidefinite matrix M always has the form \(M\cdot {\mathbb{I}}\). Using \(M=\hat{P}U\), and identifying EU with \({\mathbb{I}}\), we have E = U†).
Lemma 5
(SSWAP is indeed an isometry). Let \({S}_{{{{\rm{SWAP}}}}}^{{\prime} }\) be the map produced by Algorithm 4 and define SSWAP to be \({S}_{{{{\rm{SWAP}}}}}^{{\prime} }\) with \({P}_{{{{\mathcal{A}}}}}\) replaced by \({\hat{P}}_{{{{\mathcal{A}}}}}\). Then SSWAP is an isometry if the following conditions hold
Proof
It suffices to show that \({\left\langle \psi \right\vert }_{{{{{\mathcal{A}}}}}^{{\prime} }{{{\mathcal{A}}}}}{S}_{{{{\rm{SWAP}}}}}^{{\dagger} }{S}_{{{{\rm{SWAP}}}}}{\left\vert \psi \right\rangle }_{{{{{\mathcal{A}}}}}^{{\prime} }{{{\mathcal{A}}}}}=1\) for all normalised \({\left\vert \psi \right\rangle }_{{{{{\mathcal{A}}}}}^{{\prime} }{{{\mathcal{A}}}}}\). We express SSWAP = TUVU, where T is as in Equation 23, \(U:= \mathop{\sum }\nolimits_{k = 0}^{2}{\hat{P}}_{{{{\mathcal{A}}}}}^{k}\otimes \left\vert \bar{k}\right\rangle {\left\langle \bar{k}\right\vert }_{{{{{\mathcal{A}}}}}^{{\prime} }}\) and \(V:= {{{\Pi }}}_{1}\otimes {{\mathbb{I}}}_{{{{{\mathcal{A}}}}}^{{\prime} }}+{{{\Pi }}}_{2}\otimes {P}_{{{{{\mathcal{A}}}}}^{{\prime} }}^{-1}+({\mathbb{I}}-{{{\Pi }}}_{1})({\mathbb{I}}-{{{\Pi }}}_{2})\otimes {P}_{{{{{\mathcal{A}}}}}^{{\prime} }}^{-2}\). Observe that \({T}^{{\dagger} }T={{\mathbb{I}}}_{{{{\mathcal{A}}}}{{{{\mathcal{A}}}}}^{{\prime} }}={U}^{{\dagger} }U\) since \({\hat{P}}_{{{{\mathcal{A}}}}}^{{\dagger} }{\hat{P}}_{{{{\mathcal{A}}}}}={{\mathbb{I}}}_{{{{\mathcal{A}}}}}\). Further, we have that
Hence, \({S}_{{{{\rm{SWAP}}}}}^{{\dagger} }{S}_{{{{\rm{SWAP}}}}}={{\mathbb{I}}}_{{{{\mathcal{A}}}}{{{{\mathcal{A}}}}}^{{\prime} }}\) establishing that SSWAP 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 \({{{\mathcal{G}}}}(\{{a}_{i}\})\) 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
-
\({{{\mathcal{A}}}}\) represent an arbitrary Hilbert space and \({{{{\mathcal{A}}}}}^{{\prime} }\) represent a three-dimensional Hilbert space,
-
\(\bar{{{{\mathcal{W}}}}}\) be the set of “words” constructed using \({\{{{{\Pi }}}_{i}\}}_{i = 1}^{5}\), \(\hat{P}\) and \({\hat{P}}^{{\dagger} }\), i.e., \(\bar{{{{\mathcal{W}}}}}={{{\mathcal{G}}}}({\{{{{\Pi }}}_{i}\}}_{i = 1}^{5},\hat{P},{\hat{P}}^{{\dagger} })\), and
-
define \(\left\langle w\right\rangle := t{r}_{{{{\mathcal{A}}}}}(\rho 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)). \(\rho =\left\vert \psi \right\rangle \left\langle \psi \right\vert\) so that \(\left\langle w\right\rangle =\left\langle \psi \right\vert w\left\vert \psi \right\rangle\) for all \(w\in {{{\mathcal{W}}}}\).
Input:
-
(Implicit) Πi .Πj = 0 for all i, j ∈ E(G), where G is a five-cycle graph and E are 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 pi individually for each i).
Evaluation ∣ Part 1.
-
Evaluate SSWAP as described in Lemma 5 using Algorithm 4.
-
Define the objective function f as
$$f\left(\rho ,{\left\{{{{\Pi }}}_{i}\right\}}_{i = 1}^{5}\right)=\mathop{\sum }\limits_{i=1}^{5}{{{\mathcal{F}}}}\left(t{r}_{{{{\mathcal{A}}}}}\left[{S}_{{{{\rm{SWAP}}}}}\left({{{\Pi }}}_{i}{\rho }_{{{{\mathcal{A}}}}}{{{\Pi }}}_{i}\otimes \left\vert 0\right\rangle {\left\langle 0\right\vert }_{{{{{\mathcal{A}}}}}^{{\prime} }}\right){S}_{{{{\rm{SWAP}}}}}^{{\dagger} }\right],{{{\Pi }}}_{i}^{KCBS}{\rho }_{{{{{\mathcal{A}}}}}^{{\prime} }}^{KCBS}{{{\Pi }}}_{i}^{KCBS}\right)$$(30)$$+{{{\mathcal{F}}}}\left(t{r}_{{{{\mathcal{A}}}}}\left[{S}_{{{{\rm{SWAP}}}}}\left({\rho }_{{{{\mathcal{A}}}}}\otimes \left\vert 0\right\rangle {\left\langle 0\right\vert }_{{{{{\mathcal{A}}}}}^{{\prime} }}\right){S}_{{{{\rm{SWAP}}}}}^{{\dagger} }\right],{\rho }_{{{{{\mathcal{A}}}}}^{{\prime} }}^{KCBS}\right)$$(31)and evaluate the coefficients fw so that (This was done using symbolic computation).
$$f=\mathop{\sum}\limits_{w\in {{{\mathcal{W}}}}}{f}_{w}\left\langle w\right\rangle .$$(32) -
Again, from Algorithm 4, evaluate \({P}_{{{{\mathcal{A}}}}}\) as a linear combination of \(\left\langle w\right\rangle\).
Evaluation ∣ Part 2. Solve the following SDP:
where Γ(k)(X) is a matrix which is
-
indexed by letters w,
-
whose matrix elements are given by \({{{\Gamma }}}^{(k)}{(X)}_{v,w}=\left\langle \psi \right\vert {v}^{{\dagger} }Xw\left\vert \psi \right\rangle\),
-
where k defines the maximum number of letters that appear in the words w which 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
-
\({\hat{P}}_{{{{\mathcal{A}}}}}^{{\dagger} }{\hat{P}}_{{{{\mathcal{A}}}}}={\hat{P}}_{{{{\mathcal{A}}}}}{\hat{P}}_{{{{\mathcal{A}}}}}^{{\dagger} }={{\mathbb{I}}}_{{{{\mathcal{A}}}}}\).
Output: Fnoiseless(c).
Remark 1
Note that \(\hat{P}P\ge 0\ \Rightarrow \ {{{\Gamma }}}^{(k)}(\hat{P}P)\ge 0\). This follows readily by letting \({A}^{{\dagger} }A=\hat{P}P\) 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 \(\left\langle w\right\rangle\) restricted 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 {\(\left\vert 1\right\rangle\),\(\left\vert 2\right\rangle\)} and \(\left\vert 0\right\rangle\), 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 S1/2 and P1/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 \(\left\vert 0\right\rangle\) state with 99.5% fidelity. When needed, a 729 nm pulse sequence is applied to prepare a certain initial state. Measurements of the observables {Ai} are performed through coherent rotations R2(θ2, ϕ2)R1(θ1, ϕ1), a fluorescence detection followed by the operation \({R}_{1}^{{\dagger} }({\theta }_{1},{\phi }_{1}){R}_{2}^{{\dagger} }({\theta }_{2},{\phi }_{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 \(\left\vert 1\right\rangle\) and \(\left\vert 2\right\rangle\) is ω2 − ω1 = (2π)8.69 MHz with corresponding magnetic field B = 5.18 G. The maximum probability of off-resonant excitation \({{{\Omega }}}^{2}/{({\omega }_{2}-{\omega }_{1})}^{2}\) is about 6.5 × 10−7, small enough to ensure the independence of each Rabi oscillation40,41.
Analysing the data
The data
The complete data set can be accessed on GitHub42. Table 2 shows a summary of our experimental and numerical results. In the table, configuration refers to the p and θ configurations discussed in “Results: Experiments that are self-tested”. 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 \(\left\langle {{{\Pi }}}_{i}\right\rangle\) term. Obviously, if one specifies the value of \(\left\langle {{{\Pi }}}_{i}\right\rangle\), the value for their sum automatically gets fixed. Based on the experimental data, we have access to the value of each of the \(\left\langle {{{\Pi }}}_{i}\right\rangle\) 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 p1 = p2 = p3 = p4 = p5 (pi and 〈Πi〉 are interchangeable). One could have just as easily taken a different choice for the values of pi 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 pis, 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 \({\sum }_{i}(\mu \left({p}_{i}\right)-1.96\sigma \left({p}_{i}\right))\) is upper bounded by \(\mu \left({\sum }_{i}{p}_{i}\right)-1.96\sigma \left({\sum }_{i}{p}_{i}\right)\). Since our robustness curves are very sensitive to minor changes near the region of maximum KCBS value \(\left({\sum }_{i}{p}_{i}\right)\), the lower bound on the fidelity provided by the sum constraint can be better than the (nearly) equal statistic constraint (p1 ≈ p2 ≈ p3 ≈ p4 ≈ p5). 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 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 ∑kpk 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 ∑kpk 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 \((\left\vert {u}_{0}^{\theta }\right\rangle \left\langle {u}_{0}^{\theta }\right\vert ,{\left\{\left\vert {u}_{i}^{\theta }\right\rangle \left\langle {u}_{i}^{\theta }\right\vert \right\}}_{i = 1}^{5})\), say \(({\rho }_{0}^{E},{\left\{{M}_{i}^{E}\right\}}_{i = 1}^{5})\) to an optimal configuration, say \((\left\vert {u}_{0}^{O}\right\rangle \left\langle {u}_{0}^{O}\right\vert ,{\left\{\left\vert {u}_{i}^{O}\right\rangle \left\langle {u}_{i}^{O}\right\vert \right\}}_{i = 1}^{5})\). Let us denote the fidelity of \(\left\vert {u}_{i}^{E}\right\rangle\) to \(\left\vert {u}_{i}^{O}\right\rangle\) as \({F}_{i}^{E,O}\). Here, \({F}_{i}^{E,O}\) denotes the fidelity of the ith component of the experimental realisation to that of the ideal configuration. Similarly, other fidelities are denoted by \({F}_{i}^{E,\theta }\) and \({F}_{i}^{\theta ,O}\). 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 \(\left(\mathop{\sum }\nolimits_{i = 0}^{5}{F}_{i}^{E,O}\right)\) (see Supplementary Note 4 for details)
Based on the experimental data, we can calculate \(\left(\mathop{\sum }\nolimits_{i = 0}^{5}\sqrt{1-{F}_{i}^{E,\theta }}\right)\). The second total fidelity expression \(\left(\mathop{\sum }\nolimits_{i = 0}^{5}\sqrt{1-{F}_{i}^{\theta ,O}}\right)\) can be evaluated using numerical optimisation.
Results for the θ-configuration
We obtained ∑kpk to be 2.058 and 2.043, respectively, for the normal ordered case. For the reverse-ordered 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 self-test 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 sympy43 for symbolic computations and cvxpy44,45 for translating the resulting SDP into an instance that MOSEK (an SDP solver) could solve. Our implementation is available on GitHub42.
Data availability
The data backing up the graphs and findings presented in this paper can be found on GitHub42.
References
Deutsch, I. H. Harnessing the power of the second quantum revolution. PRX Quantum 1, 020101 (2020).
Eisert, J. et al. Quantum certification and benchmarking. Nat. Rev. Phys. 2, 382–390 (2020).
O’Donnell, R. & Wright, J. Efficient quantum tomography. In Proc. Forty-eighth Annual ACM Symposium on Theory of Computing, 899–912 (2016).
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).
Mayers, D. & Yao, A. Self testing quantum apparatus. Quantum Inf. Comput. 4, 273–286 (2004).
Tsirel’son, B. S. Quantum analogues of the bell inequalities. The case of two spatially separated domains. J. Math. Sci. 36, 557–570 (1987).
Summers, S. J. & Werner, R. Bell’s inequalities and quantum field theory. I. General setting. J. Math. Phys. 28, 2440–2447 (1987).
Popescu, S. & Rohrlich, D. Generic quantum nonlocality. Phys. Lett. A 166, 293–297 (1992).
Braunstein, S. L., Mann, A. & Revzen, M. Maximal violation of bell inequalities for mixed states. Phys. Rev. Lett. 68, 3259 (1992).
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).
Šupić, I. & Bowles, J. Self-testing of quantum systems: a review. Quantum 4, 337 (2020).
Coladangelo, A., Goh, K. T. & Scarani, V. All pure bipartite entangled states can be self-tested. Nat. Commun. 8, 1–5 (2017).
Wang, J. et al. Multidimensional quantum entanglement with large-scale integrated optics. Science 360, 285–291 (2018).
Zhang, W.-H. et al. Experimentally robust self-testing for bipartite and tripartite entangled states. Phys. Rev. Lett. 121, 240402 (2018).
Kaniewski, J. Analytic and nearly optimal self-testing bounds for the Clauser-Horne-Shimony-Holt and Mermin inequalities. Phys. Rev. Lett. 117, 070402 (2016).
Wu, D. et al. Robust self-testing of multiparticle entanglement. Phys. Rev. Lett. 127, 230503 (2021).
Šupić, I., Coladangelo, A., Augusiak, R. & Acín, A. Self-testing multipartite entangled states through projections onto two systems. New J. Phys. 20, 083041 (2018).
Wu, D. et al. Closing the locality and detection loopholes in multiparticle entanglement self-testing. Phys. Rev. Lett. 128, 250401 (2022).
Renou, M. O., Kaniewski, J. & Brunner, N. Self-testing entangled measurements in quantum networks. Phys. Rev. Lett. 121, 250507 (2018).
Zhang, W.-H. et al. Experimental realization of robust self-testing of bell state measurements. Phys. Rev. Lett. 122, 090402 (2019).
Tavakoli, A., Smania, M., Vértesi, T., Brunner, N. & Bourennane, M. Self-testing nonprojective quantum measurements in prepare-and-measure experiments. Sci. Adv. 6, eaaw6664 (2020).
Farkas, M. & Kaniewski, J. Self-testing mutually unbiased bases in the prepare-and-measure scenario. Phys. Rev. A 99, 032316 (2019).
Šupić, I., Augusiak, R., Salavrakos, A. & Acín, A. Self-testing protocols based on the chained bell inequalities. New J. Phys. 18, 035013 (2016).
Gheorghiu, A., Kashefi, E. & Wallden, P. Robustness and device independence of verifiable blind quantum computing. New J. Phys. 17, 083040 (2015).
Shrotriya, H., Bharti, K. & Kwek, L.-C. Robust semi-device-independent certification of all pure bipartite maximally entangled states via quantum steering. Phys. Rev. Res. 3, 033093 (2021).
Klyachko, A. A., Can, M. A., Binicioğlu, S. & Shumovsky, A. S. Simple test for hidden variables in spin-1 systems. Phys. Rev. Lett. 101, 020403 (2008).
Cabello, A., Gühne, O. & Rodríguez, D. Mermin inequalities for perfect correlations. Phys. Rev. A 77, 062106 (2008).
Kirchmair, G. et al. State-independent experimental test of quantum contextuality. Nature 460, 494–497 (2009).
Lapkiewicz, R. et al. Experimental non-classicality of an indivisible quantum system. Nature 474, 490–493 (2011).
Bharti, K. et al. Robust self-testing of quantum systems via noncontextuality inequalities. Phys. Rev. Lett. 122, 250403 (2019).
Saha, D., Santos, R. & Augusiak, R. Sum-of-squares decompositions for a family of noncontextuality inequalities and self-testing of quantum devices. Quantum 4, 302 (2020).
Bharti, K., Ray, M., Varvitsiotis, A., Cabello, A. & Kwek, L.-C. Local certification of programmable quantum devices of arbitrary high dimensionality. Preprint at https://arxiv.org/abs/1911.09448 (2019).
Bharti, K. et al. Graph-theoretic approach for self-testing in bell scenarios. PRX Quantum 3, 030344 (2022).
Pearle, P. M. Hidden-variable example based upon data rejection. Phys. Rev. D 2, 1418 (1970).
Metger, T. & Vidick, T. Self-testing of a single quantum device under computational assumptions. Quantum 5, 544 (2021).
Bancal, J.-D., Navascués, M., Scarani, V., Vértesi, T. & Yang, T. H. Physical characterization of quantum devices from nonlocal correlations. Phys. Rev. A 91, 022115 (2015).
Araújo, M., Quintino, M. T., Budroni, C., Cunha, M. T. & Cabello, A. All noncontextuality inequalities for the n-cycle scenario. Phys. Rev. A 88, 022118 (2013).
Navascués, M., Pironio, S. & Acín, A. A convergent hierarchy of semidefinite programs characterizing the set of quantum correlations. New J. Phys. 10, 073013 (2008).
Pironio, S., Navascués, M. & Acin, A. Convergent relaxations of polynomial optimization problems with noncommuting variables. SIAM J. Optim. 20, 2157–2180 (2010).
Pan, Y. et al. Weak-to-strong transition of quantum measurement in a trapped-ion system. Nat. Phys. 16, 1206–1210 (2020).
Zhang, J. et al. Realizing an adiabatic quantum search algorithm with shortcuts to adiabaticity in an ion-trap system. Phys. Rev. A 98, 052323 (2018).
Arora, A. S. & Bharti, K. Numerics for self-testing of a single quantum system: theory and experiment. GitHub https://github.com/toAtulArora/swapKCBS (2022).
Meurer, A. et al. Sympy: symbolic computing in Python. PeerJ Comput. Sci. 3, e103 (2017).
Diamond, S. & Boyd, S. CVXPY: a Python-embedded modeling language for convex optimization. J. Mach. Learn. Res. 17, 1–5 (2016).
Agrawal, A., Verschueren, R., Diamond, S. & Boyd, S. A rewriting system for convex optimization problems. J. Control Decis. 5, 42–60 (2018).
Um, M. et al. Experimental certification of random numbers via quantum contextuality. Sci. Rep. 3, 1627 (2013).
Jerger, M. et al. Contextuality without nonlocality in a superconducting quantum system. Nat. Commun. 7, 1–6 (2016).
Zhan, X. et al. Experimental detection of information deficit in a photonic contextuality scenario. Phys. Rev. Lett. 119, 220403 (2017).
Malinowski, M. et al. Probing the limits of correlations in an indivisible quantum system. Phys. Rev. A 98, 050102 (2018).
Zhang, A. et al. Experimental test of contextuality in quantum and classical systems. Phys. Rev. Lett. 122, 080401 (2019).
Um, M. et al. Randomness expansion secured by quantum contextuality. Phys. Rev. Appl. 13, 034077 (2020).
Acknowledgements
This work was supported by the National Key Research and Development Program of China (No. 2017YFA0304100, No. 2021YFE0113100), NSFC (No. 11734015, No. 11874345, No. 11821404, No. 11904357, No. 12174367, No. 11904402, No. 12074433, No. 12174447, No. 12004430, and No. 12174448), Innovation Program for Quantum Science and Technology (No. 2021ZD0301200, No. 2021ZD0301605), the Fundamental Research Funds for the Central Universities, the Science and Technology Innovation Program of Hunan Province under Grant (No. 2022RC1194), USTC Tang Scholarship, Science and Technological Fund of Anhui Province for Outstanding Youth (2008085J02). A.C. is supported by Project Qdisc (Project No. US-15097, Universidad e Sevilla), with FEDER funds, QuantERA grant SECRET, by MINECO (Project No. PCI2019-111885-2), MICINN (Project No. PID2020-113738GB-I00), and by the EU-funded FoQaCiA project. L.C.K. thanks the Ministry of Education, Singapore and the National Research Foundation Singapore for their support. K.B. acknowledges funding by AFOSR, DoE QSA, NSF QLCI (award No. OMA-2120757), DoE ASCR Accelerated Research in Quantum Computing program (award No. DE-SC0020312), NSF PFCQC program, the DoE ASCR Quantum Testbed Pathfinder program (award No. DE-SC0019040), U.S. Department of Energy Award No. DE-SC0019449, ARO MURI, AFOSR MURI, and DARPA SAVaNT ADVENT. A.S.A. acknowledges support from the Institute for Quantum Information and Matter, an NSF Physics Frontier Center (GBMF-1250002) and MURI grant FA9550-18-1-0161. A substantial part of the work was done while A.S.A. was at the Université libre de Bruxelles and was supported by the Belgian Fonds pour la Formation à la Recherche dans l’Industrie 4959 et dans l’Agriculture (FRIA), under grant No. 1.E.081.17F. A.S.A. and J.R. were supported by the Belgian Fonds de la Recherche Scientifique (FNRS) under grant no R.50.05.18.F (QuantAlgo). The QuantAlgo project has received funding from the QuantERA European Research Area Network (ERA-NET) Cofund in Quantum Technologies implemented within the European Union’s Horizon 2020 program. We would like to express our gratitude to Jonathan Lau for his logistical assistance with computer-related matters. We thank Tobias Haug for various discussions.
Author information
Authors and Affiliations
Contributions
A.S.A. and K.B. developed the theoretical framework and contributed to analysing the data. X.-M.H., Y.X., M.-Z.A., J.Z., P.-X.C., B.-H.L., Y.-F.H. and C.-F.L. were involved in the experimental implementation and data analyses. G.-C.G., J.R., A.C. and L.-C.K. supervised the project and the drafting of the manuscript.
Corresponding authors
Ethics declarations
Competing interests
The authors declare no competing interests.
Additional information
Publisher’s note Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.
Supplementary information
Rights and permissions
Open Access This article is licensed under a Creative Commons Attribution 4.0 International License, which permits use, sharing, adaptation, distribution and reproduction in any medium or format, as long as you give appropriate credit to the original author(s) and the source, provide a link to the Creative Commons license, and indicate if changes were made. The images or other third party material in this article are included in the article’s Creative Commons license, unless indicated otherwise in a credit line to the material. If material is not included in the article’s Creative Commons license and your intended use is not permitted by statutory regulation or exceeds the permitted use, you will need to obtain permission directly from the copyright holder. To view a copy of this license, visit http://creativecommons.org/licenses/by/4.0/.
About this article
Cite this article
Hu, XM., Xie, Y., Arora, A.S. et al. Self-testing of a single quantum system from theory to experiment. npj Quantum Inf 9, 103 (2023). https://doi.org/10.1038/s41534-023-00769-7
Received:
Accepted:
Published:
DOI: https://doi.org/10.1038/s41534-023-00769-7