State-independent test of quantum contextuality with either single photons or coherent light

Contextuality is a phenomenon at the heart of quantum mechanics different from classical behavior and has been recently identified as a resource in quantum information processing. Experimental demonstration of contextuality is thus an important goal. We experimentally demonstrate a test of state-independent contextuality in a four-dimensional Hilbert space with single photons and violate the inequality by at least 387 standard deviations. Despite imperfections and possible measurement disturbance, our results cannot be explained in non-contextual models. We also provide a theoretical analysis of a test of contextuality with a coherent light field and show how the definitions affect the emergence of non-classical correlations. Our result sheds new light on the conflict between quantum and classical physics.


INTRODUCTION
Contextuality has gained great importance in the development of quantum information and computation [1][2][3] . This key characteristic feature of quantum mechanics represents one of the most valuable quantum resources [4][5][6][7] . The well-known Bell-Kochen-Specker theorem [8][9][10][11][12][13] states that no non-contextual hidden-variable theory is able to reproduce the predictions of quantum mechanics. Peres 12 and Mermin 13 presented a simpler proof that became known in the literature as the Peres-Mermin square. Tests of quantum contextuality have been undertaken with various physical systems [14][15][16][17][18][19][20][21][22] . However, these tests required the generation of special quantum states. Cabello 23 and Yu et al. 24 derives a set of inequalities that are satisfied by a non-contextual hiddenvariable theory but are violated by quantum mechanics for any quantum state. This provides an opportunity to test noncontextuality with finite-precision experiments [25][26][27][28][29] without the requirement of special quantum states.
In this paper, we show an experimental proof of the Kochen-Specker theorem in a four-dimensional Hilbert space. We perform an experiment with single photons that demonstrates a state-independent conflict with non-contextuality 23 . Despite imperfections and possible measurement disturbance, our results cannot be explained in non-contextual models. We also provide a theoretical analysis of test of contextuality with a coherent light field and show how the definitions affect the emergence of nonclassical correlations.

RESULTS
Consider nine binary ±1 observables that can be measured on a single system. Based on the compatibility relations, these measurements can be performed in the following triples {A, a, α}, {B, b, β}, {C, c, γ}, {A, B, C}, {a, b, c}, {α, β, γ}. Any theory in which the nine observables have predefined non-contextual outcomes −1 or 1 must satisfy the following inequality where 〈A ⋅ B ⋅ C〉 denotes the ensemble average of the product of the three outcomes of measuring the mutually compatible observables A, B, and C. For any four-dimensional system, there is a set of observables for which the prediction of quantum mechanics is χ = 6 for any quantum state of the system 23,25 . We take as examples where X, Y, and Z are Pauli operators and test the prediction on different quantum states of a single-photon system.

Experimental test of state-independent contextuality
We demonstrate experimental test of the state-independent noncontextuality inequality. The purpose of the experiment is to test the prediction on different quantum states of a single-particle system. The physical system employed for this experiment is a single photon carrying two qubits of quantum information. The bases of quantum states are encoded as f 0 where U and D denote the upper and lower spatial mode of single photons, respectively, and H and V denote their horizontal and vertical polarizations, respectively.
First, we generate 26 photonic states shown in Table 1 to be tested. Photon pairs are generated via the spontaneous parametric down-conversion process as illustrated in Fig. 1. One of the photon is treated as a trigger and the other is the heralded single photon [30][31][32][33][34][35][36] . A polarization beam splitter (PBS), a beam displacer (BD), and half-wave plates (HWPs) are used to prepare photonic qudits in total with 15 pure quantum states being tested. To generate the rest 9 mixed states, we use a quartz crystal (QC) placed in front of the first BD to reduce the coherence of the photons in different spatial modes. After the first BD, the photons are separated into the upper and lower path depending on their polarizations 37,38 . Then QCs are inserted into two path and reduce the coherence of the photons with different polarizations. The coherence length of the photons is L c ≈ λ 2 /Δλ, where λ is the central wavelength of the source and Δλ is the spectral width of the source. Hence, the thickness of QCs should be at least 23.97 mm. In our experiment, it is about 28.77 mm.
Then we apply sequential measurements of three compatible observables on the 26 states shown in Table 1, where "measurement−i" (i = 1, 2, 3) describes the set-up for measuring one of the nine observables. After the preparation stage, the photons enter the device measurement−1 and result in one of the two possible outcomes of the measurement. The device measurement−i maps eigenstates of the observable to a fixed spatial mode and polarization. Then we need to recreate the eigenstates of the measured observable on the photonic qudit before photons entering measurement−2. After the third measurement is performed, finally, the photons are detected by the singlephoton avalanche photodiode (APD) placed at the outputs of the devices.
The measurements of observables a and B are just polarization rotations U M ¼ jHihψ þ j þ jVihψ À j, which can be implemented by wave plates at certain setting angles and a PBS performing the projective measurement of Z ¼ jHihHj À jVihVj. Here ψ ± j i are the eigenstates of X for the observable a and those of Y for B, respectively, whereas the measurements of observables A and b are performed only on the spatial modes. We use BDs to split and then combine the photons with certain polarizations into the same spatial mode, which equals to a transformation from the spatial mode to the polarization mode, and apply the polarization rotation via wave plates. After that, the projective measurement of Z is performed on the basis f H j i; V j ig. For the other observables α, β, C, c, and γ that are the products of two Pauli operators, those measurements can be implemented by a polarization rotation, a transformation between spatial and polarization modes, and another polarization rotation followed by a projective measurement of Z.
As illustrated in Fig. 1, we use the sequential measurement {A, a, α} as an example. The first step is to realize the measurement of A with HWPs (H4-H7), BDs (BD2-3), and PBS2, where two BDs and H4 and H5 build a Mach-Zehnder interferometer for a transformation from spatial to polarization modes, and H6 and H7 are used for a rotation on the polarization modes. Then, with HWPs (H8-13) and BDs (BD4-5), we recreate the corresponding eigenstates of A for further measurements. The second step is to realize the measurement of a with HWPs (H14-15 for a rotation on the polarization modes) and PBS3 and to recreate the eigenstates of a with HWPs (H16-17). The last step is to realize the measurement of α with HWPs, BDs, and PBS4, where H18 and H21-23 are used to realize polarization rotations before and after the basis transformation via BD6-7 and H19-20. We repeat this for eight times. The probability of the outcome is obtained by the coincidence counts of the APDs. We record clicks for 2 s and register about 20,000 single photons. The probability for more than one photon pair is <10 −4 , hence neglected. Coincidence counts are used to construct the measured probabilities of eight outcomes of each set of measurements.
The set-up in Fig. 1 only corresponds to one of the eight possible paths and that the input-output statistics have been Table 1. Experimental results of χ for 26 different states being tested.
Error bars indicate the statistical uncertainty, which is obtained based on assuming Poissonian statistics. SD standard deviation. To test the prediction of the state-independent violation of noncontextuality inequality χ 23 , we repeat the experiment for 26 quantum states. With the measured probabilities, the corresponding violations evaluated using the collected data are shown in Fig. 2a. We find that all values χ for the non-contextuality inequality fall within the range from 5.784(5) to 5.877(3), which meets the prediction of quantum mechanics. The inequality (1) is violated by at least 387 standard deviations. We also present measurement results for each experimental set-up for two states ψ 1 j i and ψ 15 j i (in Table 1). Probabilities for each outcome as well as values of the correlations are shown in Fig. 2b, c. The compatibility of measurements in contexts is an important issue in the experimental test of contextuality. Here, to resolve the compatibility problem, in the case of imperfect measurements from a hidden variable viewpoint, we test a violation of the disturbed hidden-variable inequality first presented in ref. 26 that determines jointly the probabilities of the results of all sequences of measurements where 〈A ⋅ α〉 denotes the ensemble average if A is measured before a and p(α ⋅ A ⋅ α) denotes the probability that measuring A introduces a change in the value of α if the sequential measurement of α ⋅ A ⋅ α is measured. We use the state Ψ j i / UH j iþð ffiffi ffi 2 p À 1Þ UV j iþið ffiffi ffi 2 p À 1Þ DH j iþi DV j i to test this inequality. For the inequality (1), we have χ = 5.831(4) > 4, which violates the inequality by 448 standard deviations. For the inequality (3), we have χ 0 ¼ 2:501ð11Þ > 2, which violates the inequality by 45 standard deviations. This proves that even disturbances of the hidden variables during not perfectly compatible measurements cannot explain the given experimental data.
We provide another method 26 to characterize the compatibility of different measurement by switching the orders of the measurements. We take ψ 8 j i ¼ ð 1 j i þ 2 j iÞ= ffiffi ffi 2 p as an example. In Fig. 3, we show the measured absolute values of the ensemble average of the products of observables for six possible permutations within rows and columns of the Peres-Mermin square, which fall within the range from 0.957(2) to 0.986(1) and agree with theoretical prediction 1. We find that all values for the noncontextual inequality fall within the range from 5.786(5) to 5.868 (4). Even with experimental imperfections, the experimental violation of the non-contextual inequality still agrees with the quantum-mechanical prediction.
All experimental tests of hidden-variable theories are subject to various possible loopholes. In our experiment, photon loss opens up a detection efficiency loophole. Thus, fair-sampling assumption is taken here, which assumes that the event selected out by the photonic coincidence is an unbiased representation of the whole sample [17][18][19] .
Theoretical analysis of test of contextuality with a coherent light field Although contextuality is considered as intrinsic signature of nonclassical behavior, a question on if or not classical light can be used to test contextuality has been always raised. We follow the Error bars indicate the statistical uncertainty, which is obtained based on assuming Poissonian statistics. Correlation measurements of all terms in the inequality (1) for the states ψ 1 j i (b) and ψ 15 j i (c). Experimentally estimated probabilities for each sequential measurement of q i . Colored bar at (+ + + ; a i a j a k ) indicates the probability to obtain the results a i = 1, a j = 1, and a k = 1. Theoretical predictions for each set of measurements are shown by the hollow bars. Fig. 3 Correlations within rows and columns of the Peres-Mermin square. To characterize the compatibility of different measurement, we switch the orders of the measurements. We take ψ 8 as an example. We show the measured absolute values of the ensemble average of the products of observables for six possible permutations within rows and columns of the Peres-Mermin square, which fall within the range from 0.957(2) to 0.986(1) and agree with theoretical prediction 1. We find that all values for the noncontextual inequality fall within the range from 5.786(5) to 5.868(4). Even with experimental imperfections, the experimental violation of the non-contextual inequality still agrees with the quantummechanical prediction.
idea in ref. 25 , which have been tested in refs. 21,39 , and show a different result by replacing the heralded single photons by the classical light. Compared to single photons providing a welldefined measurement event as for each set of measurements photons are all detected by D 1 associated with trigger photons at D 0 , the probability for multiple photons is not negligible for a coherent light field α j i as photon source as illustrated in Fig. 4. Thus, we need to redefine measurement events as E1 for only one detector clicking and E2 for more than one detector clicking (There is also a probability that no detector clicks due to the vacuum component of the coherent light. However, we can still use fair-sampling assumption to exclude this case and then only registered photons count.). For a perfect single photon source, E1 = E2, whereas, for a coherent light, E1 ⊂ E2. Based on the definition of the measurement events, we use the conditional probabilities P(a i ⋅ a j ⋅ a k |Eι) (ι = 1, 2) under Eι instead of P(a i ⋅ a j ⋅ a k ) to calculate the contribution from non-classical correction. The numerical simulations of the left-and right-hand sides of the inequality under E1 and E2 are shown in Fig. 5. We find that the violation of the non-contextuality inequality under E1 is similar to that of single photons, which reaches the quantum bound. That is because only one detector clicks and the coherent light is postselected into an imperfect single photon source with a small postselection probability, whereas, for E2, a significant violation is observed when n is small enough (<0.519). The violation disappears with the increase of n because the multi-photon probability cannot be negligible.
We derive the theoretical predictions of test of contextuality with a coherent light field α j i ¼ P n e À jαj 2 2 α n ðn!Þ 1=2 n j i. The probability of detecting n photons subjects to the Poissonian distribution PðnÞ ¼ hnjαi j j 2 ¼ e Àjαj 2 jαj 2n n! . Assume that the initial state is For the measurement {C, c, γ}, the final state is Whereas, for {α, β, γ}, the final state is According to the definitions of measurement events, for E1, we can derive the conditional probabilities of the set of measurement {α, β, γ} Pða i Á a j Á a k ¼ 1jE1Þ ¼ 1; Pða i Á a j Á a k ¼ À1jE1Þ ¼ 0:  For the event E 2 , we have 1 À e jαj 2 ; We use the conditional probabilities P(a i ⋅ a j ⋅ a k |Eι) (ι = 1, 2) under Eι instead of P(a i ⋅ a j ⋅ a k ) to calculate the contribution from non-classical correction. For the measurement event E1, we have and then χ E1 ¼ 6: Hence, the violation of the inequality (1) under E1 is similar to that of single photons, which reaches the quantum bound. For the measurement event E2, we have Thus, for E2, a significant violation is observed when n is small enough (<0.519). The violation disappears with the increase of n because the multi-photon probability cannot be negligible.

DISCUSSION
The Kochen-Specker theorem states that no non-contextual hidden-variable theory can reproduce the predictions of quantum mechanics for correlations between measurement outcomes of some sets of observables. In this work, we experimentally demonstrate a test of state-independent contextuality in a fourdimensional Hilbert space with single photons. We show that 26 different single-photon states violate an inequality that involves correlations between results of sequential compatible measurements by at least 387 standard deviations. Despite imperfections and possible measurement disturbance, under the assumption of fair sampling, our results cannot be explained in non-contextual models. We also provide a theoretical analysis of test of contextuality with a coherent light field and show how the definitions affect the emergence of non-classical correlations. Compared to single photons that manifest contextuality, contextuality for classical coherent light strongly depends on the specific definition of measurement events, which is equivalent to projecting the components of the inputs into the non-classical states. Our theoretical analysis shows the importance of the definition of measurement events to demonstrate contextuality. By this method, it is possible to figure the boundary between the non-classical photon source and the classical light field. Our theoretical analysis provides the new meaning of the classical simulations of the fundamental phenomena of quantum systems.
This work sheds new light on the role of quantum mechanics in quantum information processing. We expect this result to stimulate new applications of quantum contextuality for quantum information processing [40][41][42] .

METHODS
In the process of projection measurement, it is very important to select the appropriate projection basis. In our experimental conditions, the PBS we used allows horizontally polarized light to be projected and vertically polarized light to be reflected. Therefore, we need to perform polarization rotations U M ¼ jHihψ þ j þ jVihψ À j to convert the eigenstates of polarization and spatial modes of the observables to the eigenstates of Z ¼ jHihHj À jVihVj. After performing the projection measurement, the probability of obtaining measurement outcome 1 or −1 is equal to the probability of the photons being measured in the basis state i j i 2 f H j i; V j ig. Since in Fig. 3 it is clear that the outcome of each measurement of the sequence is encoded in the upper or lower path, thus which of the 2 3 = 8 possible outcomes for each sequence is given by which detector clicks. However, our experimental set-up corresponds to one of the eight paths, and the probability distributions of the eight outcomes are obtained by repeating the experiment. This experimental design will reduce the error caused by more experimental elements and make our experimental results more robust.

DATA AVAILABILITY
Any related experimental background information not mentioned in the text and other findings of this study are available from the corresponding author upon reasonable request.