Towards minimal self-testing of qubit states and measurements in prepare-and-measure scenarios

Self-testing is a promising approach to certifying quantum states or measurements. Originally, it relied solely on the outcome statistics of the measurements involved in a device-independent (DI) setup. Extra physical assumptions about the system make the setup semi-DI. In the latter approach, we consider a prepare-and-measure scenario in which the dimension of the mediating particle is assumed to be two. In a setup involving four (three) preparations and three (two) projective measurements in addition to the target, we exemplify how to self-test any four- (three-) outcome extremal positive operator-valued measure using a linear witness. One of our constructions also achieves self-testing of any number of states with the help of as many projective measurements as the dimensionality of the space spanned by the corresponding Bloch vectors. These constructions are conjectured to be minimal in terms of the number of preparations and measurements required. In addition, we implement one of our prepare-and-measure constructionson IBM and IonQ quantum processors and certify the existence of a complex qubit Hilbert space based on the data obtained from these experiments.


I. INTRODUCTION
Quantum technological applications need certified devices.Ideally, certification does not rely on any assumption about the internal functioning of the devices involved in the protocol, in which case it is called deviceindependent (DI) [1,2].In particular, if the characterization of the preparation and measurement apparatuses is solely based on observed measurement statistics, we speak of self-testing in the original sense, as proposed by Mayers and Yao [3].Such a self-testing is made possible by exploiting the Bell nonlocal property of multipartite quantum correlations [4,5].
However, fully DI certification is difficult to implement.This has led to the appearance of the so-called semi-device-independent (semi-DI) approach, where certain extra physical assumptions are made about the devices [6].Particular assumptions refer to bounds on overlap [7,8], mean energy [9], entropy of prepared states [10], or may be based on the response of physical systems to spatial rotations [11].In addition, still in the semi-DI framework, all measurement devices can be considered as fully trusted [12,13] or only some of them can be considered as trusted [14].In the standard prepare-andmeasure (PM) scenario, which will form the framework for self-testing in our paper, the most widely accepted assumption is an upper bound on the dimension of the communicated quantum system (see, e.g., [15][16][17][18][19][20][21][22][23][24][25]).
In the PM scenario, there are two parties, say Alice and Bob.Upon receiving an input x, Alice prepares a state ρ x and sends it to Bob, who performs a measurement on this state.The choice of his measurement setting is determined by his input y, and the outcome is labeled b.A self-test is performed if using the statistics of the outcomes of the measurements, P (b|xy), one can prove that the states and the measurement settings are the ones they are claimed to be (up to some symmetry transformation).Within the PM scenario, only semi-DI tests can be performed [26].In fact, suppose that the dimension d of the mediating particle can be arbitrarily large to perfectly encode the input x.Then Alice simply sends x encoded into a d dimensional classical message to Bob, who has all the information about both Alice's and his own input and can therefore simulate any possible conditional probability P (b|xy).
Our aim in this paper is to provide possibly minimal PM setups, in terms of the number of involved states and measurement settings, for self-testing any member of a rather general class of measurements, that of extremal four-or three-outcome positive operator-valued measures (POVMs) defined over a two-dimensional Hilbert space; in the most general form, this will be achieved by constructing possibly minimal PM setups for self-testing an arbitrary number of pure states of the same Hilbert space.
An O-outcome POVM is defined by its O elements, which are positive semidefinite operators whose sum is the identity operator [27,28].A POVM is said to be extremal if it cannot be written as a convex combination of other POVMs.If a POVM has more outcomes than the dimensionality of the corresponding Hilbert space, it is necessarily non-projective, that is, its elements are not orthogonal projectors, which is a constraint defining a traditional von Neumann measurement [29].Nonprojective POVMs provide benefits through enhanced entanglement detection [30,31] and state discrimina-tion [32,33].Among their applications, we can list quantum protocols such as quantum coin flipping, quantum money, and quantum cryptography [34].
Most recently, the task of self-testing arbitrary ensembles of pure states and arbitrary sets of extremal POVMs in PM scenarios of arbitrary Hilbert space dimension has already been accomplished in Ref. [41].However, this work does not, in general, rely on a minimal number of preparations and measurement settings.We also have to mention Ref. [42], where arbitrary rank-one extremal measurements are self-tested within the so-called onesided DI framework [43].In addition to the assumption that the measurement device is trusted, another important difference from our work is the use of EPR steering [44,45] as a resource.
For our construction, we will adopt the scheme introduced in Ref. [21] for self-testing non-projective POVMs in a PM scenario where Alice prepares qubits, that is, states in a two-dimensional Hilbert space.This scheme is based on choosing the preparations of Alice and a set of "auxiliary" measurement settings on Bob's side, all of them projective, such that the maximum value of a carefully constructed linear witness (that is, a function of the probabilities P (b|xy) associated with each measurement outcome b conditioned on the inputs x and y) self-tests the target POVM which enters as the "main" measurement of Bob.Moreover, we will closely follow the particular path developed in our preceding study [40] in which the members of a specific class of non-projective measurements, the semi-SIC POVMs [39,46], are self-tested, and heavily build on certain results obtained in that context.We emphasize that our self-testing methodology is fully analytic and does not address the effect of noise.However, in addition to self-testing, we present a method to certify a complex qubit Hilbert space in the PM scenario in the presence of experimental noise.
The paper is organized as follows.We start by defining the setup and laying down the basic ideas in Section II.We continue in Section III by providing universal considerations with regard to the self-testing of the prepared states for later use.In Section IV, we construct a potentially minimal setup for self-testing four-outcome POVMs.A more general construction is presented in Section V, which covers the self-testing of POVMs with four, but also three outcomes and any number of prepared states.We conclude in Section VI.Appendix A is devoted to an illustrative example, while Appendix B presents an alternative method for self-testing four-outcome POVMs, although not relying on a minimal setup, as a special case of the results obtained in Ref. [41].In Appendix C, we construct a particular complex qubit witness in the prepare-and-measure setup, which we implement on IBM and IonQ quantum processors thereby certifying a complex qubit Hilbert space from observed data.The details of the implementation of the setup on quantum processors can be found in Appendix D.

II. PRELIMINARIES
In the qubit space, the element corresponding to outcome b, b ∈ {1, . . ., O}, of an O-outcome POVM can be written in terms of its Bloch vector ⃗ n b as: where and the components of ⃗ σ are the Pauli matrices.Note that only extremal POVMs can be self-tested with a linear witness (see, e.g., Ref. [41]).The maximum number of outcomes for an extremal POVM in the qubit space is four.Such a POVM is extremal if and only if its four Bloch vectors are unit vectors that span the three-dimensional space (actually, due to the condition b λ b ⃗ n b = 0, any three of them do).In the case of three outcomes, the Bloch vectors must span a two-dimensional subspace for extremality.In the case of two outcomes, the extremal POVMs are projective measurements.We will deal with self-tests of four-and three-outcome cases.
To perform the self-test, we consider the PM setup proposed in Ref. [21] and described as follows.Let the number of input values for Alice be denoted by M m and be equal to the number of outcomes of the POVM, that is, M m = O. (Under certain circumstances, we will deviate from this equality, but it does not affect the relevant considerations.)Let the number of input values for Bob, that is, the number of measurement settings, be M v + 1.Let the first M v settings be two-outcome projective measurements with outcomes labeled by b, b ∈ {0, 1}, while the (M v + 1)th one the POVM to be self-tested.
Let us also adopt the assumption that Alice prepares qubits, that is, states of the form where the Bloch vectors ⃗ m The linear witness introduced in Ref. [21] reads as: with where P (b|xy) is the conditional probability of Bob getting outcome b given x and y, while k is a positive number.
For the self-test, the prepared states must be pure, | ⃗ m x | = 1, and their Bloch vectors must be anti-aligned with the ones of the POVM to be self-tested such that ⃗ m x = −⃗ n b for b = x.Furthermore, the matrices of elements w xy and the M v projective binary measurements of Bob must be chosen such that the formula given in Eq. ( 4) should be appropriate to self-test these binary measurements and the states with the previously mentioned Bloch vectors; that is, W should be maximal for these states and measurements, and only for them.With these choices, the expression in Eq. ( 3) is appropriate to self-test the non-projective POVM [the (M v + 1)th measurement], too; the optimum value of the second term is zero, and it takes this value only if ⃗ n x = − ⃗ m b for x = b.The Bloch vectors ⃗ n b uniquely define the POVM if it is extremal, because then there is only one way to combine the zero vector from them.It is not so when, for example, there are four vectors in the same plane, which corresponds to a non-extremal POVM.

III. GENERAL CONSIDERATIONS ON SELF-TESTING THE PREPARED STATES
We address here the self-testing of the prepared states without specifying the form of the matrices of elements w The witness for self-testing the prepared states is given by Eq. (4).Using P (0|xy) + P (1|xy) = 1, this equation can be rewritten as: We note that P (0|xy) − P (1|xy) is the expectation value of an observable that takes on the values +1 and −1 upon the measurement outcomes b = 0 and b = 1, respectively.The conditional probability of getting outcome b when a POVM measurement is performed on a qubit state ρ x is the following: where M b|y is the POVM element of measurement y corresponding to outcome b.A qubit state ρ x is characterized by its Bloch vector ⃗ m x according to Eq. ( 2).The most general form of POVM elements M b|y , b ∈ {0, 1}, of a two-outcome measurement setting y can be written as: with the Bloch vectors satisfying where |⃗ v y .The values µ y = 0 and µ y = ±1 correspond to a genuine von Neumann measurement and the degenerate measurements (fixed outcome), respectively.From the above equations, the difference of the two POVM elements is: Using Eqs.(2,6,7), and Eq. ( 10) one can show that: To obtain the maximum value of W (which we denote as Q ≡ W C 2 with reference to being a maximum attainable quantum mechanically or, more specifically, by means of complex qubits), it is clear that if , then µ y = 0, therefore, a genuine von Neumann measurement should be performed, while if x w xy ⃗ m x • ⃗ v y < | x w xy |, the optimal measurement is degenerate.In the latter case, the measurement is useless and w xy is inappropriate for the self-test.If x w xy = 0, that is, the sum of the elements of the yth column is zero, then the contribution of the degenerate measurement is zero.However, it follows from Appendix B of Ref. [40] that if all ⃗ m x are optimal and not all elements of the yth column of w xy are zero, then the contribution of the genuine two-outcome von Neumann measurement corresponding to the optimal ⃗ v y is positive.Therefore, if w xy is such that the sum of its elements in all columns is zero, the optimum does not contain any degenerate measurement.
Restricting ourselves only to genuine two-outcome measurements, that is, taking µ y = 0 in Eq. (11), the expression to maximize in terms of unit vectors ⃗ m x and ⃗ v y is: We will follow the procedure presented in [40].It is easy to see that the optimum choice for ⃗ m x if vectors ⃗ v y are given is: where if |⃗ u x | ̸ = 0, which condition is always true for all x if ⃗ v y is optimal and each row of w xy contains at least one nonzero element, as it is proven in Appendix B of Ref. [40].Using Eqs.(12)(13)(14) it is easy to see that the value of W with the optimal choice of ⃗ m x for given ⃗ v y can be written as: This expression is valid even if ⃗ v y is such that |⃗ u x | = 0 for some x (in this case, any ⃗ m x is optimal for the given x).Using Eq. ( 14), |⃗ u x | can be written as: where γ yy ′ ≡ ⃗ v y • ⃗ v y ′ is an element of the Gram matrix of the set ⃗ v y (as ⃗ v y are normalized, the diagonal elements of the Gram matrix are 1).We need to find the maximum of Q v in terms of ⃗ v y .The set of ⃗ v y is never unique, it may only be determined up to a global orthogonal transformation.It is the Gram matrix of this set of vectors that can be uniquely defined.It has been proven in Appendix C of Ref. [40] that if the number M v of the binary measurement settings is equal to the dimensionality of the space, and the derivatives of Q v = |u x | with respect to γ yy ′ , y < y ′ , vanish somewhere, then the value of Q v takes its global maximum there, provided that these γ yy ′ values correspond to a legitimate Gram matrix (that is, the symmetric matrix whose diagonal elements are 1 and the yy ′ th element is γ yy ′ is positive semidefinite).The Gram matrix is uniquely defined if the condition is valid at a single point.
Recall that we are, in fact, interested in constructing a witness matrix w and choosing corresponding vectors ⃗ v y that make self-testing possible for given ⃗ m x .Therefore, even if the optimal ⃗ v y and ⃗ m x are determined for a given w xy only up to a global orthogonal transformation, we will need to specify ⃗ v y in terms of a particularly oriented set of ⃗ m x .

IV. SELF-TESTING FOUR-OUTCOME POVMS
For the specific task of self-testing four-outcome POVMs, O = 4 (which implies M m = 4 unless otherwise stated), we fix the number of binary measurement settings to M v = 3, and construct an appropriate witness matrix, in terms of which the appropriate Bloch vectors can also be determined.
Let us consider a witness matrix of the following form: with From Eqs. 16 and 17 it follows that From Eqs. 15 and 19 it is easy to see that if q y ̸ = 0 for all y, the condition for the partial derivatives can be written as: This means that Substituting Eq. ( 19) into the square of the equations above we get: From the sum of the equations above it follows that u = 2. Then from Eq. ( 21) we get that |⃗ u x | = 2p 2 x , and the optimum value of Q v , and consequently Here we also used Eq.(18).We get the optimum values of γ 12 , γ 13 and γ 23 if we add the fourth, the third and the second line of Eq. ( 22) to the first one, respectively: If the equations above together with γ yy ′ = γ y ′ y and γ yy = 1 result in a legitimate Gram matrix, it corresponds to the unique solution of the problem, and it determines the optimum ⃗ v y up to an orthogonal transformation.For an optimum set ⃗ v y the optimum ⃗ m x can be written as: which follows from Eqs. (13,14) and Eq. ( 17), and from x .However, our objective is not to find the vectors that maximize W for the given matrix w, but to find the appropriate matrix w if the ⃗ m x vectors are given, which, multiplied by minus one, define the four-outcome POVM to be self-tested.From Eq. ( 24) it follows that If ⃗ m x span the three-dimensional space, this, together with the normalization condition, uniquely defines the parameters p x in Eq. ( 17) up to an overall sign.In terms of the parameters q y concerned, from the first two lines of Eq. ( 24) we get Let us choose the sign of q 1 positive (choosing it negative would simply reverse the direction of the optimal ⃗ v 1 ).We can get the values q 2 and q 3 analogously, the result is: It can be proven that the q y values calculated this way satisfy the normalization condition, Eq. ( 18).We follow with a remark on p x .The linear combination of the Bloch vectors ⃗ n b with the coefficients appearing in the expression for the POVM elements, λ b , gives the null vector, all those coefficients are positive, and their sum is one.As ⃗ m x = −⃗ n b for x = b, it then follows from Eq. ( 25) that those p x are just proportional to λ b for x = b, and they are all positive.They should just be renormalized.The vectors ⃗ n b define the coefficients λ b uniquely if they span a three-dimensional space.If not, an infinite number of POVMs can be defined with the same Bloch vectors; therefore, such POVMs cannot be self-tested, which is what is expected, as such POVMs are not extremal.
The w matrix constructed here is such that the maximum of Eq. ( 12) is given by the Bloch vectors of the states to be self-tested.Moreover, the solution is unique up to orthogonal transformations.This is actually true for any set of four qubit states, including those that do not define a POVM (not all p x are positive).However, depending on the set of vectors, it may well happen that an even larger value can be obtained if degenerate measurements are allowed, as in Eq. ( 11).This must always be checked, because if this is the case, the w matrix is inappropriate for the self-test.A way to solve this problem is to add four additional rows to w containing the same elements as the first four rows but with opposite signs.The set of states with Bloch vectors of opposite directions should also be included in the self-test, therefore, Alice has to be able to prepare twice as many states.As the sum of the elements of each column of w will obviously be zero now, the degenerate measurements will always be inferior, making the self-test feasible.
Once an appropriate w matrix has been fixed as above, one also has to determine, in terms of ⃗ m x , the corresponding Bloch vectors ⃗ v y characterizing the projective measurements that lead to the maximum value of the witness.This could be done by inverting Eqs.(24).However, in analogy with the proof presented in Appendix B of Ref. [40], it can be shown that the optimum ⃗ v y can be expressed in terms of w xy and ⃗ m x as: We will now briefly discuss two special configurations of the vectors ⃗ m x .First, if they are in the same plane, they do not define p x uniquely.Then the optimum of Eq. ( 12) will be given by the same set of vectors ⃗ m x using any of the possible choices for p x , so that the states corresponding to ⃗ m x can still be self-tested, even though the corresponding POVM will not be uniquely defined, as discussed earlier.Another interesting arrangement is three coplanar vectors with the fourth one orthogonal to them.In this case the fourth row of w becomes zero.If we omit this row and the fourth vector, then the resulting 3×3 matrix is appropriate to self-test three coplanar vectors, provided that the three genuine two-outcome measurements given by the optimal ⃗ v y vectors are the most advantageous.Otherwise, the number of rows and states can be doubled, as before.In this way, it is possible to self-test three-outcome extremal POVM measurements with the help of three additional measurement settings.We will see that with a different method, the same is possible with just two settings.

V. SELF-TESTING ANY NUMBER OF STATES AND POVMS OF FOUR AND THREE OUTCOMES
Now we will discuss how to self-test a set of qubit states of arbitrary number in a possibly minimal PM setup.The corresponding witness W is defined by Eq. ( 4), and we will rely on the corresponding considerations of Section III.Whenever the Bloch vectors ⃗ m x of the states uniquely define a POVM according to Eq. ( 1) through ⃗ n b = − ⃗ m x for b = x, that POVM can also be self-tested by choosing ⃗ m x = −⃗ n b for x = b and extending the witness according to Eq. ( 3).We will use this fact to show how to self-test three-outcome POVMs in a possibly minimal setup beyond four-outcome POVMs.
In particular, only two projective measurements are required in this general framework if the Bloch vectors are coplanar, which is the case for three-outcome POVMs.The number of projective measurements remains three for Bloch vectors spanning the three-dimensional space, such as for extremal four-outcome POVMs.In general, the number M v of projective measurements must be equal to the dimensionality of the space spanned by the Bloch vectors ⃗ m x of the M m states to be self-tested.In any case, the appropriate projective measurements are orthogonal to each other.There is also considerable freedom in choosing the w matrix, which may be used to make sure that all degenerate measurements are inferior to the genuine two-outcome ones so that w is appropriate indeed, and possibly to optimize properties of the selftest.
Let the elements of the w matrix be where From Eq. ( 16) it follows that for the present choice of the w matrix where The conditions for the partial derivatives to maximize Q v = x |⃗ u x |, as defined in Eq. ( 15), can be written as Let the parameters of the w matrix satisfy for all y 1 < y 2 .Then the conditions for the derivatives in Eq. ( 31) are satisfied if all γ yy ′ = 0, that is, orthogonal Bloch vectors for the measurement settings are an optimal choice (it maximizes Q v ).In this case, |⃗ u x | = |r x | from Eq. ( 30), and Let all r x be positive.Then it follows, according to Eq. ( 13), that that is, the yth component of ⃗ m x in the coordinate system defined by the orthonormal set of the measurement vectors is nothing else than µ xy (hence the equality between the number M v of measurement settings and the dimensionality of the space spanned by the M m vectors ⃗ m x ).A matrix w defined through such parameters µ xy may only be appropriate for the self-test if γ yy ′ = 0 is the only optimum, we will discuss this question later.
To self-test a given set of M m qubit states characterized by Bloch vectors ⃗ m x , we have to choose the parameters µ xy to be the components of ⃗ m x in a coordinate system.However, only some frames are appropriate.For example, Eqs. ( 32) cannot be satisfied if all µ xy1 µ xy2 have the same sign for all x for any y 1 < y 2 .If µ xy1 and µ xy2 are components of ⃗ m x in a frame, then µ xy1 µ xy2 is an offdiagonal component of the outer product of ⃗ m x with itself in the same frame.This outer product ⃗ m x ⊗ ⃗ m x is the projection operator corresponding to ⃗ m x .Then Eq. ( 32) means that the matrix of the operator x r x ⃗ m x ⊗ ⃗ m x is diagonal.Therefore, we can construct a w choosing r x to be some positive numbers, and µ xy to be the components of the set ⃗ m x in the coordinate system in which x r x ⃗ m x ⊗ ⃗ m x is diagonal.Such a frame exists as the operator is positive semidefinite.
For w to be appropriate for the self-test it is necessary that all degenerate measurements give smaller W values than the optimal non-degenerate ones.This is not true for all choices of r x .For vectors ⃗ m x that define POVM measurements as discussed at the beginning of the section, one can always ensure that all degenerate measurements are inferior by choosing r x such that the linear combination of the vectors with r x is the null vector.It is possible as the combination coefficients in this case are all positive.If a linear combination is zero in a given frame, it is zero in all frames, including the one where the components of the vectors are µ xy , therefore x r x µ xy = x w xy = 0, that is, the sum of the elements in all columns of w is zero, therefore, the maximum of W is given by genuine two-outcome measurements, indeed.However, this is a sufficient condition and not a necessary one, and it is not even sure that this is the best choice for the self-test.Therefore, there still remains some freedom to choose r x .At the same time, if the null vector cannot be given as a linear combination of vectors ⃗ m x with strictly positive coefficients, we do not know if it can always be achieved with an appropriate choice of r x that the degenerate measurements are inferior.However, even in that case it is not necessary to double the number of rows of w and the number of states to be self-tested: it is always sufficient to add one single state.Taking any positive numbers r ′ x and adding the vector − x r ′ x ⃗ m x normalized, one gets a set of M m + 1 vectors from which one can combine the null vector with positive coefficients.
Another requirement for w to be appropriate for the self-test is that γ yy ′ = 0 must be the only optimum solution.This is true if the Hessian is negative definite.It has been shown in Appendix D of Ref. [40] that negative semidefiniteness always holds, so that it is sufficient that the rank is maximal, that is, M v (M v − 1)/2.The rank is the same as the rank of the matrix whose elements are t xα = r 2 x µ xy µ xy ′ , where the pair of indices yy ′ has been replaced by the single index α on the lefthand side.This matrix has M m rows and M v (M v − 1)/2 columns, and due to Eq. ( 32) its rows are linearly dependent.Therefore, the Hessian may only have maximal rank if M m ≥ M v (M v − 1)/2 + 1 holds.The optimum will not be unique otherwise.
Note that this condition implies, e.g., that self-testing a configuration of three states with non-coplanar Bloch vectors is only possible if we introduce an additional, auxiliary preparation.However, even if the condition is satisfied, the rank can still be lower than maximum, but only if the states to be self-tested and the parameters r x are chosen in a very special way.When this is the case, one may choose a different set of r x , or, as a last resort, add some additional state to the set to be self-tested.
In Appendix A, we provide an example that illustrates how the algorithm presented in this section to determine an appropriate matrix w and vectors ⃗ v y works.For this purpose, we choose three coplanar vectors ⃗ m x .

VI. CONCLUSION
We have addressed the issue of certifying nonprojective measurements on qubits.For this purpose, we have considered a PM scenario and aimed at designing self-tests within this framework.In particular, we have adopted the scheme proposed by Tavakoli et al. in Ref. [21] and exemplified how to self-test, by means of linear witnesses, (i) any four-or three-outcome extremal POVM with the help of three and two projective measurements, respectively, and also (ii) any number of states with the help of as many projective measurements as the dimensionality of the space spanned by the corresponding Bloch vectors.These setups are conjectured to be minimal in terms of the number of preparations and projective measurements and represent a considerable improvement in this regard compared to the more general method of Navascués et al. [41].The results of that work count six projective measurements for the selftesting of four-outcome qubit POVMs.In Appendix B, we heuristically construct a witness to implement this self-test.
We emphasize here that utilizing a nonlinear witness could not lead to any advantage, since our problem is convex, according to allowing for shared randomness.For non-convex problems, nonlinear witnesses can be useful; see, e.g., Ref. [47] for how to generate them.
As any self-test in a PM scenario, our methods are semi-DI; as explained in the Introduction, it is impossible to design fully DI certification schemes within the PM framework.The physical assumption is a dimension bound in our case.In particular, as mentioned, we restrict the preparations to the qubit space.The work of Navascués et al. [41], addressing Hilbert spaces of any dimension, motivates us to pose the open problem of finding PM setups and corresponding self-testing schemes involving preparations in higher dimensions with as few preparations and projective measurements as possible.Different kinds of physical assumptions also form a natural direction for generalization.However, perhaps the most intriguing question is whether we have really found the minimal setups or whether further simplification is possible.
It is certainly true that the number of "auxiliary" measurements can be further decreased by considering nonprojective POVMs for this purpose [48].Notwithstanding, we can actually show that two projective measurements are not sufficient to self-test an arbitrary set of prepared states.In particular, according to Section III, one must be able to express the Bloch vectros of all of the states to be self-tested as linear combinations of the Bloch vectors characterizing the measurements.If we have only two of the latter, their linear combinations will span a two-dimensional plane, not allowing to self-test configurations of states whose Bloch vectors span the threedimensional space.Note that the argumentation of Section III relies on a linear witness, but we have pointed out that no advantage can be provided by nonlinear witnesses in our scenario.
Whether or not all of our setups are truly minimal, we believe that they may contribute to an efficient implementation of the certification of non-projective measurements or configurations of states relevant for practice.To achieve this, it is necessary to address the effect of noise.
While noise inhibits achieving a self-test in a strict sense in any real-world setup, a witness designed for self-testing can be used to certify, up to sampling uncertainty, a single but well-defined qualitative property that the targeted measurement or configuration possesses but some restricted set of all possible measurements or configurations does not, as in, e.g., Ref. [21].This is because the maximum witness value attainable within such a restricted set will be strictly lower than the ideal witness value.We exemplify this approach in Appendix C through the certification of the non-coplanar nature of Bloch vectors characterizing an actual configuration of states.For this purpose, we consider a witness from the family of Eq. ( 17) that is constructed to self-test a specific configuration that we call umbrella-like.
To illustrate that this methodology is not just a farfetched theoretical one, we have implemented this setup in the form of quantum circuits on publicly available quantum processors.By our experimental results, presented in the same Appendix, we have successfully certified the non-coplanar nature of actual Bloch vectors and thereby the existence of a complex Hilbert space in these experiments under the assumption of a dimensionality of two.Details on the implementation are given in Appendix D.
As a future research direction, we are also aiming at robust self-tests in the traditional sense [49].Ref. [41] has fully characterized robust self-testing in the dimension-bounded prepare-and-measure scenario in terms of upper bounds on distances from the target; however, the scaling of these bounds makes them impractical, so that determining tighter bounds would be essential.Once semi-DI certification becomes established in real-world scenarios, it may open the avenue to the anticipated quantum technological applications.measurement settings are chosen in Eq. (B3), the expression to be maximized in terms of the Bloch vectors of the states ⃗ m x is: This is analogous to the case when the dependence on ⃗ v y is kept by choosing the optimal ⃗ m x vectors, like in Eq. (15).
Actually, our aim is not to find the optimal ⃗ m x vectors for given parameters F ij , but to find F ij such that Eq. ( B4) is maximal with the predefined set of vectors (which are anti-aligned with the vectors defining the extremal POVM to be self-tested).
It is not difficult to see that Eq. (B4) corresponds to minus one times the potential energy of a simple mechanical system.The ⃗ m x vectors are the positions of point objects whose motion is confined to the surface of a unit sphere ( ⃗ m x are normalized), with a constant F ij repulsive force acting between them (we may define The potential energy is minimal and, consequently, Eq. ( B4) is maximal where the system is in a stable equilibrium.This happens when the resulting force acting on any of the objects points outwards, in the direction of the radius of the unit sphere.This condition can be expressed as: where we have defined F ji ≡ F ij for i < j.
We obtain the value of τ i by taking the scalar product of both sides of the equation with ⃗ m i : As τ i is always positive, the condition of the stability of the equilibrium is satisfied.This is not surprising: the radial component of a repulsive force between objects on the surface of a sphere obviously points outwards.
If we substitute τ i from Eq. (B6) into Eq.(B5), a simple calculation leads to: (B7) Notice that the left-hand side of the expression above is a linear combination of the ⃗ m x vectors, which gives the zero vector.As the ⃗ m x vectors are minus one times the Bloch vectors ⃗ n x of the POVM to be self-tested [see Eq. ( 1)], they satisfy x λ x ⃗ m x = 0.Moreover, if the POVM is extremal, all linear combinations of ⃗ n x and, consequently, also of ⃗ m x that give zero are proportional to each other.Therefore, the coefficients in Eq. (B7) for each i must be proportional to λ j , from which it follows, considering the first sum, that with c i > 0, for j ̸ = i.By substituting this into the second sum in Eq. (B7), one finds that the coefficient of ⃗ m i is c i λ i , that is, it does have the appropriate value.Moreover, as F ji = F ij , c i must be proportional to λ i .As an overall constant is irrelevant, we may choose c i = λ i .Therefore, the choice for F ij to get an appropriate witness matrix specified in Eq. (B1) for the self-test of an extremal POVM is, according to Eq. (B8) and ⃗ m x = −⃗ n x : This method may also be used to self-test threeoutcome extremal POVMs using three projective measurements (that is, M v = 3).It can also be extended to self-test vectors from which the null vector may be combined with not all coefficients positive.Only the signs of the appropriate rows of the w matrix have to be changed.
We refer the reader to a more general method introduced in Ref. [41] which allows one to self-test arbitrary ensembles of pure quantum states and arbitrary extremal D ≥ 2-dimensional quantum measurements in prepareand-measure scenarios.The method presented in the Appendix is a special case of the one described there.
Appendix C: Certifying complex qubit state space and an implementation on quantum processors For illustrative purposes, we pick a one-parameter family from the witness matrix (17), the so-called umbrellalike construction; see the matrix (C2) parameterized by c ∈ [0, 3] below.According to the construction of the witness matrix (17), the maximum value of the witness attainable by qubit preparations is 2 irrespective of c.However, to obtain this value for 0 < c < 3, both the preparations and the measurements must span the complex qubit space, as shown by the self-testing argument in Sec.IV.That is, coplanar arrangements of the Bloch vectors are not sufficient to achieve the value of 2. In this section, we provide actual bounds on the maximum value that can be attained with real qubit preparations for given c values.In addition, we implement the PM setup with quantum circuits for specific values of c, and certify, based on the umbrella-like linear witness, that preparations with coplanar Bloch vectors are not sufficient to achieve the experimentally measured witness values in a wide range of c.

The umbrella-like construction
We define the parameters in the coefficient matrix (17) by setting where c ∈ [0, 3].This way we obtain the witness matrix On the other hand, let us define the following unit Bloch vectors: We call this set of Bloch vectors umbrella-like.It has the property that ⃗ m 1 • ⃗ m x are the same for x = 2, 3, 4 and ⃗ m x • ⃗ m x ′ are the same for all other distinct pairs (x, x ′ ) ∈ {(2, 3), (2,4), (3,4)}.
It can be shown that the results presented in Sec.IV imply that the maximum value W (c) = 2 of the witness is achieved if Alice's preparations are given by Bloch vectors ⃗ m x for x ∈ {1, 2, 3, 4} in (C3) and Bob's projective measurements are where r = 1/(2 √ 9 + 3c 2 ) is a normalization constant.Moreover, the above set of vectors is unique up to a rotation and a reflection through the origin.Note that apart from c = 0 and c = 3, both the preparation and measurement unit Bloch vectors span the full three-dimensional space.In fact, for c = 3 all the Bloch vectors are either aligned or anti-aligned, and the witness value of 2 can be obtained simply by preparing classical bits.

Certifying complex qubit preparations
Recall that the witness matrix (C2) is constructed such that the maximum witness with preparations of complex qubits is 2 for all c.Our aim here is to compute bounds on the witness using real qubit preparations.That is, we consider the witness matrix (C2) for a given c and we calculate the maximum value of the witness attainable with real qubit preparations and real-valued measurements.Let us call this bound by W R 2 (c) for a given c.
We provide a family of preparations below that appears to saturate the bound for real qubits.Actually, there are two separate families, one for c ≤ 1 and an other for c ≥ 1.When c = 1, the two families are the same up to a relabeling of the inputs x.It turns out that W R 2 (c) < 2 for any 0 < c < 3 according to these families.Hence, our witness parameterized by c enables us to differentiate between real and complex two-level systems across the entire range of 0 < c < 3.
For 0 ≤ c ≤ 1, the following co-planar preparations are conjectured to reach the real qubit bound W R 2 (c): where the angle α(c) is given by For 1 ≤ c ≤ 3, on the other hand, the following set of preparations is conjectured to reach the real qubit bound W R 2 (c) of the witness: where For both families, any rotation and a reflection through the origin is permitted, and also any relabeling involving the indices x ∈ {2, 3, 4} but not x = 1.However, for c = 1, α(c) = β(c) = γ(c), and the two families coincide up to a relabeling involving x = 1.
In geometric terms, there are two Bloch vectors that coincide for any c.For c < 1, ⃗ m 1 must be among them, and for c > 1, ⃗ m 1 must not be among them, while both possibilities are permitted for c = 1.For c ≤ 1, the two non-coinciding Bloch vectors are symmetric to the coinciding ones, whereas they are not for 1 < c < 3.In particular, ⃗ m 1 forms a greater angle with the coinciding vectors than the other non-coinciding one.In the limit of c = 3, ⃗ m 1 becomes opposite to the rest which all coincide, and we thus recover the ideal configuration which is also classical.
All this is illustrated in Fig. 1, where witness values W (c) are also displayed as a function of c within the entire range 0 ≤ c ≤ 3.In particular, we show the maximum classical value W class (c) of the witness (see below) and the maximum real qubit witness W R 2 (c) in comparison with the maximum W C 2 (c) ≡ Q of the complex qubit witness; note that W C 2 (c) ≡ Q = 2 in the entire range 0 ≤ c ≤ 3. The range 0 < c < 3 in the figure demonstrates the distinctions between the classical bit, real qubit, and complex qubit cases.Moreover, it provides a means to certify the existence of complex qubit Hilbert spaces.
The maximum value W class (c) attainable by classical bits is straightforward to determine and is obtained as On the other hand, we compute W R 2 (c) for Fig. 1 directly from the Bloch vectors specified by (C5-C9) by assuming corresponding optimal measurements in Eq. ( 12) which then simplifies to the form x ∥ y w xy ⃗ m x ∥, cf.Eq. ( 27); the coefficients w xy are taken from (C2).One may ask if the analytic formulae (C5-C9) merely define some generic lower bound on the exact value of W R 2 (c) or the bound is tight.To address this question, we numerically upper-bound the expression (12), i.e., x,y w x,y ⃗ m x •⃗ v y , with assuming ⃗ m x and ⃗ v y to be generic coplanar Bloch vectors.The expression is a quadratic function of the parameters defining the Bloch vectors, featuring quadratic constraints ∥ ⃗ m x ∥ ≤ 1 and ∥⃗ v y ∥ ≤ 1.To determine an upper bound W (U) R 2 (c), we turned to the semidefinite programming approach of Lasserre [50] which introduces moment relaxations and is applied, e.g., in Refs.[51,52].In particular, we used the corresponding module built in the YALMIP package [53] with secondorder relaxation.We considered several samples of c and found in each case that the numerical upper bound W (U) R 2 (c) obtained for real qubit preparations is saturated with our analytic lower bound up to high numerical precision.In particular, the two bounds always coincide to 7 decimals at least.We note that for such a problem, the finite-dimensional semidefinite programming techniques introduced in Refs.[37,[54][55][56] could also be applied.After determining W R 2 (c) to high precision, we may ask if it is violated in certain experimental settings.In particular, we implemented the PM setup for the umbrella-like configuration as quantum circuits on quantum processors of IBM [57] and IonQ [58]; details of the implementation can be found in Appendix D.
We considered various values of c and repeated most experiments several times to study reproducibility.We present the best experimentally measured witness values for each considered c, separately for IBM and IonQ, in Table I and include them in Fig. 1 as well.The experimental data, in comparison with the numerical upper bounds W (U) R 2 (c), show convincingly that we can certify complex qubit preparations in the PM setup by making use of the umbrella-like witness defined through (C2).
However, not all values of c are suitable for this purpose; for c = 2.5, we could not even certify qubits, as the best experimental witness value can be achieved with classical bits as well.Furthermore, the IBM processors do not appear to be very stable: as an extreme example, the experimental witness value for c = 0.625 dropped from 1.95 to 1.55 in 25 hours on qubit N o 7 of ibm_osaka, and calibration data indicating the quality drop were not released by the time of the execution of the first affected experiment.Results for the witness and its estimated standard deviation from all of our experiments performed on quantum processors, along with metadata including calibration data for the machine associated with the individual experiments, are provided in Supplementary Table 1; the corresponding raw outcome counts can also be accessed [59].
Note that a similar distinguishability of real and complex Hilbert spaces of given dimensionality can also be considered in the Bell nonlocality setup.In this scenario, one compares the maximum quantum violation of Bell inequalities achieved using real qubit component spaces with that achieved using complex qubit component spaces.See, e.g., Ref. [60] and Appendix B in Ref. [61].In addition, the more demanding task of distinguishing real and complex Hilbert spaces without fixing their dimension has been achieved in the network configuration [62][63][64][65] along with experimental validations [66,67].
Appendix D: Details of implementing the PM setup on a quantum processor Our task is to implement the preparations and measurements of a PM scenario as a set of quantum circuits.These can then be submitted to quantum processors.
From the computational basis state |0⟩, an arbitrary state α|0⟩ + β|1⟩ can be obtained by applying the unitary gate Quantum processors are designed to perform projective measurements in the computational basis.In order to emulate a projective measurement in a different basis, one can define a unitary gate by identifying the rows of the corresponding matrix U proj with the complex conjugates of the desired basis states.If this unitary operator is applied to a given state, then performing a measurement in the computational basis on the new state will be equivalent to performing a measurement in the desired basis on the original state.In terms of a Bloch vector ⃗ v = (v 1 , v 2 , v 3 ) characterizing the first basis state defining the desired projective measurement, U proj is obtained as where are defined through the polar and azimuthal angles θ and ϕ of ⃗ v, if v 2 1 + v 2 2 ̸ = 0 (U proj = 1 or U proj = σ 1 otherwise).We shall substitute ⃗ v = ⃗ v y for each y ∈ {1, 2, 3} from Eq. (C4).
After these considerations, both elements are given to build the quantum circuits that implement the PM setup for the umbrella-like preparations.In fact, this requires a collection of 12 different quantum circuits, each realizing one preparation (out of four) from Alice and one measurement (out of three) from Bob.The practical implementation has been carried out with Qiskit [68].
In principle, when constructing the outcome statistics for computing the witness, one of the 12 different circuits should be chosen randomly for each shot.However, it is equivalent and much more resource efficient to perform a random but predefined number of shots consecutively with each circuit.Following Ref. [69], we further simplify the experiments by performing the same number, N , of shots with each circuit.
With this choice, the standard deviation σ W corresponding to the sampling distribution of the witness (4) can be calculated in terms of the conditional probabilities P (b|xy); the witness matrix is given by (C2) for the PM setup for the umbrella-like preparations.Each term in Eq. ( 4) has a binomial sampling distribution, and the perfect anticorrelation between the opposing outcomes of a projective measurement has to be taken into account for the propagation of the error through the summation.
As in Ref. [69], we estimate the standard deviation characterizing each experiment by substituting the experimentally obtained relative frequencies in place of the conditional probabilities.We furthermore note that the standard deviation corresponding to ideal umbrella-like preparations and associated measurements can be analytically computed, as a function of c, as )

w
xy − w (1) xy [P (0|xy) − P (1|xy)] .(5) The first term is an irrelevant constant, we can get rid of it without loss of generality by choosing w xy ≡ w xy (or, alternatively, by dropping the constant and introducing the notation w xy ≡ w xy [P (0|xy) − P (1|xy)] .

1 ,
and ⃗ v y is defined as the longer one of ⃗ v

Figure 1 .
Figure 1.The prepare-and-measure witness (c) defined through the matrix (C2) as a function of c ∈ [0, 3].The upper part of the figure presents the maximum witnesses attainable using classical strategies (W class ), real qubits (W R 2 ), and complex qubits (W C 2 ).The best experimentally measured values are also displayed for specific values of c, separately for IonQ and IBM machines.The error bars correspond to the estimated standard deviation associated with the finite sample size (see Appendix D).The lower part of the figure shows the optimal angles (C6) and (C9) of the Bloch vectors corresponding to the maximum value of the real-qubit case for c ≤ 1 and c ≥ 1, respectively.

b 2 2 ̸
D1) where the second column follows from unitarity and is determined up to a factor of −1.The coefficients α and β are related to the coordinates of the corresponding Bloch vector ⃗ b = (b 1 , b 2 , b 3 ) = 0 for β (in the opposite case, β = 0).For our purposes, we shall identify ⃗ b with each ⃗ m x , x ∈ {1, 2, 3, 4}, of Eq. (C3).

Table I .
The best experimentally measured witness W for different values of c, separately for IonQ and IBM machines, in comparison with the corresponding numerical upper bounds W The standard deviation σW is associated with the finite number of shots (8192 in all cases) and has been estimated from the experimentally obtained probabilities (see Appendix D).