Qubit measurements for testing contextuality through the violation of Liang-Spekkens-Wiseman-Yu-Oh inequality

Contextuality is a striking feature of our nature predicted by quantum theory and tested by various experiments. In a qubit system, testing contextuality requires scenarios distinct from traditional ones for systems with dimension of three or greater. In this paper, we consider the noncontextuality inequality developed by Liang-Spekkens-Wiseman and Yu-Oh, and investigate the set of three qubit measurements that can be used to test and violate this inequality. Our numerical results show that two of the three measurements can be almost arbitrary. Moreover, we have singled out several extremely interesting sets of measurements, e.g. one measurements can be white noise while the other two are arbitrarily close to white noise. These sets fulfill our knowledge about contextuality in this minimum quantum system.


Introduction
Contextuality is a striking feature of our nature that was predicted by quantum theory [1][2][3] and have been tested by various experiments [4][5][6][7]. It has also been recognized as a critical resource for many quantum information processes [8][9][10][11][12][13]. An experiment provides a test of contextuality if its behavior contradicts with the prediction of any theory that assumes noncontextuality (NC). Here, NC means outcomes of measurements are predetermined by hidden variables and do not depend on whether it is measured together with other jointly measurable ones. A typical form of such contradiction is the violation of NC inequality. For systems with dimension of three or greater, there are many well-known NC inequalities [14][15][16][17] and countless inequalities can be constructed using graph-theoretical approach [18][19][20]. These traditional inequalities can be violated by sets of rank-1 projective measurements that includes both compatible and incompatible measurements. For a qubit system, compatible rank-1 projective measurements are trivially equivalent. Therefore, testing contextuality in a qubit system requires different scenarios [21][22][23]. In this paper, we investigate the sets of qubit measurements for testing contextuality in Liang-Spekkens-Wiseman (LSW) framework [23].
In LSW framework, there are three unsharp measurements, which correspond to positive operator-valued measurements (POVM) with two rank-2 elements in a qubit system. It is interesting that these three measurements are pairwise jointly measurable [23] and can even be triplewise jointly measurable [17]. This is striking different from inequalities using rank-1 projective measurements, where it is necessary that some measurements cannot be jointly measurable [24].
The original LSW inequality has been violated in a photonic qubit system with a very special setting of measurements and state [25,26]. In 2013, Yu and Oh (YO) have rigorously re-derived and generalized the LSW inequality, which we termed as LSW-YO inequality [27]. The re-derived inequality is based rigorously on the assumption of NC alone and allows the measurements have different sharpness. This generalized inequality is much easier to be violated. Violations can be obtained even when the three measurements are triple-wise jointly measurable, which has been considered a hallmark of contextuality.
In this paper, we numerically analyze the sets of three qubit measurements that enable violations of LSW-YO inequality. The sets are construct via properly choosing a measurement for two arbitrarily given measurements. Among these sets, we single out several extremely interesting ones, which seem implausible to test contextuality. This paper is organized as Follows. In section 2, we briefly introduce the basical notions about contextuality in qubit system. In section 3, we give our main result of testing contextuality with two arbitrarily given measurements as well as some interesting observations of testing LSW-YO inequality. The results are summarized and discussed in section 4.

Method: joint measurements and LSW-YO inequality
In this paper, we consider unbiased measurements M i with two outcomes ±1. Two measurements M i and M j are jointly measurable if there is a measurement G ij with four outcomes (µ, ν) for µ, ν = ±1 whose marginals reveal the statistics of these two measurements as P(µ|M i ) = ∑ ν P(µ, ν|G ij ) and P(ν|M j ) = ∑ µ P(µ, ν|G ij ). Here, the measurement G ij is called a joint measurement of M i and M j . Given three pairwise jointly measurable qubit measurements, one can measure the anti-correlation P(µ, −µ|G i,j ) between each pair of measurements through implementing their joint measurement. The LSW-YO inequality considers the average anti-correlation of these measurements as In a NC realistic model, measurement is a physical process that reveals realistic values predetermined by hidden variables. The outcome of a sharp measurement is exactly a predetermined value. However, an unsharp measurement may give a wrong response to the actual predetermined value. For a two-outcome measurement, this wrong response directly leads to that the probability of each outcome cannot be exactly one or zero for arbitrary state. By considering a general response function of joint measurement and assuming NC, Yu and Oh have strictly rederived an NC inequality for the average anti-correlation as where η m = max{η 1 , η 2 , η 3 } denotes the maximum sharpness [27].
In quantum theory, a generalized measurement M i of qubit is characterized by a POVM with two rank-2 elements as where 1 is the identity operator, 0 ⩽ η i ⩽ 1, ⃗ σ = (σ x , σ y , σ z ) are the Pauli matrices, ⃗ λ i ∈ R 3 and | ⃗ λ i | = 1. Two extreme cases are sharp and purely noisy measurement, which correspond to the sharpness η i = 1 and η i = 0, respectively. Two qubit measurements M i and M j are jointly measurable iff [28] or equivalently [29] When both the two measurements are sharp ones as η i = η j = 1, these criteria degenerate to ⃗ λ i = ± ⃗ λ j . Note that two measurements are equivalent as M i = ±M j if η i = η j and ⃗ λ i = ± ⃗ λ j , because they are either identical or will be identical after relabeling the outcomes of a measurement. For two jointly measurable qubit measurements, the most general form of their joint measurement G i,j is given by a POVM with four elements [28] G µ,ν for µ, ν = ±, where Z ij , τ ij ∈ R, ⃗ z ij ∈ R 3 , and |⃗ z ij | = 1. This joint measurement is not unique and can be chosen with only the requirement of positivity for all elements, that is G µ,ν ij ⩾ 0 for all µ, ν = ±. For example, to obtain maximum anti-correlation between the two measurements, the optimal choice of joint measurement is that with parameters [27]. With this joint measurement, the maximum anti-correlation (1 − η i η j ⃗ λ i · ⃗ λ j + √ H ij )/2 is obtained by measuring the state (1 + ⃗ σ ·⃗ z ij )/2. Therefore, the the quantum average anti-correlation is where ρ is the state being measured. This value is possible to violate LSW-YO inequality in equation (2).

Contextuality for a given pair of measurements
The main question considered in this paper is: given a pair of jointly measurable qubit measurements M 1 and M 2 , is there a third measurement so that the whole triple can be used to violate LSW-YO inequality? Without loss of generality, we consider that the given pair of measurements have vectors as which lie in the ZX-plane with an angle θ (seeing figure 1). Arbitrary two measurements can be transformed into this form with a certain unitary operation. Since measurements with same sharpness and opposite vectors are equivalent, a pair of measurements with parameters (η 1 , η 2 , θ) are equivalent to that with (η 1 , η 2 , π − θ). Therefore, we only consider the angle within the interval as Moreover, according the criterion in equation (4), the two measurements are jointly measurable iff Without loss of generality, we assume η 1 ⩾ η 2 . Therefore, the sharpnesses (η 1 , η 2 ) for the measurements being jointly measurable lie in the intervals as where The joint measurement is chosen with parameters Z 12 = η 1 η 2 cos θ, τ 12 = √ H 12 , ⃗ z 12 = (0, 1, 0), which yields maximum anti-correlation when measuring the state (1 + σ y )/2.
To test LSW-YO inequality requires a third measurement that is jointly measurable with both M 1 and M 2 . We choose the third measurement M 3 with a vector ⃗ λ 3 = (sin ϕ, 0, cos ϕ) also lies in the ZX-plane. With this choice, the maximum anti-correlations of joint measurements G 13 and G 23 are also obtained by measuring the state (1 + σ y )/2. Thus, the quantum average anti-correlation in equation (7) is Hence, our question becomes a mathematical one: Given parameters (θ, η 1 , η 2 ) that satisfies H 12 ⩾ 0, are there parameters ϕ and η 3 so that H 13 , H 23 ⩾ 0 and R Q > 1 − ηm 3 .

Contextuality with the optimal third measurement
We numerically address the question by sampling over all measurements M 1 and M 2 , which are characterized by parameters (θ, η 1 , η 2 ). For each pair of measurements M 1 and M 2 , the issue is to find a measurement M 3 characterized by ϕ and η 3 so that the LSW-YO inequality is violated. We first address this issue through the maximization problem as subject to H 13 , H 23 ⩾ 0 (13) Note that we use η m = max{η 1 , η 3 } due to η 1 ⩾ η 2 assumed before. We use two approaches to sample over the parametrics (θ, η 1 , η 2 ), that are quasi-uniform and random sampling. In quasi-uniform sampling, we first uniformly choose values of θ from the interval in equation (9). Then, for each θ, we uniformly choose values of η 2 from the interval of η 2 in equation (10) with a distance of Γ 2 /⌈Γ 2 /∆ 2 ⌉, where ∆ 2 denotes the upper bound of distance. Finally, for each θ and η 2 , we uniformly choose values of η 1 from the interval as equation (10) with a distance of Γ 1 /⌈Γ 1 /∆ 1 ⌉ This quasi-uniform sampling ensures that the samples include parameters on the boundary of the interval. In random sampling, we randomly generate values of (θ, η 1 , η 2 ) and remove those outside the interval described by equations (9) and (10).
We have generated 3362 samples of parameters (θ, η 1 , η 2 ). For all these samples, we solve the maximization problem as equation (12). The results are shown in figure 2. Within these samples, these is only one as (θ, η 1 , η 2 ) = (π, 1, 1) that has no violation. We further sample over the parameters near this special sample. With these additional 2394 samples, the special sample remains the only one that has no violation. Note that the two measurements of this special sample are equivalent projective measurements.
These numerical results support that for almost all pairs of joint measurable measurements, there is a third measurement so that these three measurements can rule out noncontextual realism. Moreover, these results suggest a conjecture that a pair of equivalent projective measurements is the only case with which one can neither observe uncertainty nor test contextuality in LSW framework.

Contextuality with a pretty good third measurements
The choice of the third measurement above requires optimization process. In this subsection, we introduce a geometric choice of the measurement, and show it is pretty good for obtaining contextuality.
In the ZX-plane, the two vectors η 1 ⃗ λ 1 and η 2 ⃗ λ 2 define a triangle OA 1 A 2 as shown in figure 1, where We first show that a third measurement M 3 is always jointly measurable with jointly measurable measurements M 1 and M 2 if it is chosen as η 3  According to the above choice of the third measurement, we have where The equations (15) and (16) imply that where the second inequality is due to the criterion of joint measurability as equation (5) for measurements M 1 and M 2 . Hence, measurements M 1 and M 3 are jointly measurable. The joint measurability between M 2 and M 3 can also be proved is a similar way by switching the subscriptions 1 and 2.
We now further investigate the violation with this pretty good third measurement. With this choice of M 3 , the violation V is a function of θ, η 2 , and η 1 . For samples of (θ, η 2 ), we maximize the second order deviation ∂ 2 V ∂η 2 1 over η 1 . Note here the parameters (θ, η 2 ) are sampled over the whole interval with a restriction η 2 ̸ = Γ 2 , since η 1 has only one value as η 1 = η 2 when η 2 = Γ 2 . As shown in figure 3(c), the second order deviation is alway less than 0. Therefore, for certain (θ, η 2 ), the minimum violation must be the smaller one of V l with η 1 = η 2 or V r with η 1 = Γ 1 . These two violations are positive except for the three cases (C0), (C1), and (C2). Thus, pair of jointly measurable measurements other than these cases can be used in a test of contextuality.
Let us now show that the two cases (C1) and (C2) can violate LSW-YO inequality with other two choices of third measurements. For the case (C1), the two measurements are purely noisy ones that always gives outcomes randomly. These measurements are jointly measurable with arbitrary measurement. With an arbitrary M 3 , the quantum value the anti-correlation is and the corresponding NC bound is 1 − η 3 /3. Therefore, the violation ( is greater than 0 when choosing 0 < η 3 < 1, which attains the maximum value 1 3 ( For the cases (C2), the measurement M 1 is a sharp one and M 2 is a purely noisy one. Therefore, the choice of measurement M 3 is only restricted by the joint measurability with M 1 , which is −η 2 3 + η 2 3 cos 2 ( θ 2 + ϕ) ⩾ 0. Here, we choose ϕ = π − θ 2 so that the quantum average anti-correlation is and the NC bound is 2/3. Therefore, the violation (R Q − 2 3 ) = 1 6 ( is greater than 0 for 0 < η 3 < 1, which attains the maximum value 1 6 ( According to the pretty good choice and two specific choices of measurements, only the pair of measurements in (C0) can not be used to test contextuality in LSW framework, which coincidence with our conjecture in the previous subsection.

Interesting observations 3.4.1. Contextuality for a given measurement
It is natural to further ask if one can violate LSW-YO inequality with a given measurement. The numerical results above suggest that for arbitrary measurement, one can find two measurements so that the three measurements can violate LSW-YO inequality. We now prove this statement.

Contextuality with interesting settings
In the analysis in section 3.1, some interesting settings of measurements to violate LSW-YO inequality emerge.
Interesting setting 1: η 3 = 0. The first interesting observation is that even purely noise measurement can be used to test contextuality. Here, we further investigate this by consider the test of LSW-YO inequality with two arbitrary jointly measurable measurements and a purely noisy measurement. With the purely noisy measurement M 3 , η 3 = 0, the quantum average anti-correlation is and the NC bound is R NC = 1 − η1 3 . We calculate this violation with the samples for pretty good measurement. The results are shown in figure 4. It is interesting that even with a purely noisy measurement, most pairs (except 240 of the 135 042 samples) of measurements M 1 and M 2 can be used to test contextuality. When M 2 is also purely noisy, η 2 = 0, the quantum average anti-correlation becomes R Q = 1 6 (4 + 2 , that is no violation can be obtained. Interesting setting 2: M 3 = −M 1 . Another interesting thing is that two of the three measurements can be equivalent, that is M 3 = ±M 1 or M 3 = ±M 2 . It is easy to find that the case of M 3 = −M 1 is the best one (seeing appendix), which has a quantum average anti-correlation as and a NC bound as 1 − η1 3 . With the samples for pretty good measurement, the violations in this case are shown in figure 4(b). Within these samples, only 2249 of the 135 042 pairs of jointly measurable measurements cannot test contextuality with themselves. When η 2 = 0, the quantum average anti-correlation becomes This is quite surprising that contextuality can be tested with a purely noisy measurement and two others being arbitrary close to purely noisy ones.
Interesting setting 3: Contextuality with three equivalent measurements. We further investigate the situation that the three measurements are equivalent. It is no loss of generality to consider η 1 = η 2 = η 3 = η and θ = 0,and ϕ ∈ {0, π}. In this case, the NC bound is 1 − η 3 and the larger quantum anti-correlation is obtained by ϕ = π as Therefore, the quantum violation 1 is greater than 0 for 0 < η < 1, that is the measurement is neither a sharp nor a purely noise one. This means contextuality can be tested even with three measurements being close to the purely noisy one.

Conclusion and discussion
In summary, we have numerically studied the sets of three qubit measurements that can be used to test and violate LSW-YO inequality. Our numerical results show that two of the three measurements can be almost arbitrary and provide strong evidence for that a pair of equivalent projective measurement is the only exception. A strict proof of the conjecture is worth further investigation, for which choosing the third measurement as the pretty good one in this paper might be a potential candidate.
Among the sets, we single out three interesting families of sets for testing contextuality in a qubit system. These interesting cases show that at most one of the three measurements can be purely noisy, even when other two are close to purely noisy ones. These observations seems to be physically impossible since purely noisy measurement is believed to be classical. However, this is reasonable by recall that one requires specific POVM as the joint measurement to observe the violation even when the measurement is purely noisy. This is in accordance with the conclusion in [27] that the contextuality in LSW framework is due to the incompatibility between joint measurements rather than that between original measurement.
It is simple to consider that experimental realization of each element G µ,ν ij has a white noise, that is the realized element becomes qG µ,ν ij + (1 − q)1/4. In this case, the measured correlation becomes qR Q + (1 − q)/2, and the NC bound improves to 1 − qη/3. As shown in figure 5, noise in the joint measurement would drown out violations of LSW inequalities.
In traditional NC inequalities that can be violated with projective measurements, it is necessary that some measurements cannot be jointly measured [24]. It seems that uncertainty principle [30,31], which forbids certain pairs of observables from being jointly measurable, might be a crucial resource of contextuality. However, the three measurements to violate LSW inequality can be even triple-wise jointly measurable. The relation between uncertainty and contextuality worth further investigations. In addition, our new findings call for experimental demonstrations [32].

Data availability statement
No new data were created or analysed in this study. Hence, the choice of M 3 = −M 1 is the best one of these four cases.