A quantum measurement not only extracts information from a system but also modifies its state: the system is projected into an eigenstate of the measurement operator. Such projective measurements can be used to control and entangle qubits1,2,3,4,5,6,7,8,9. Of particular importance is the qubit parity measurement that can create maximally entangled states10,11,12,13, plays a central role in quantum error correction14 and enables deterministic two-qubit gates8,10.

Qubit parity is a joint property that indicates whether an even or odd number of qubits is in a particular eigenstate. For two qubits, an ideal parity measurement projects the qubits either into the subspace in which the qubits have the same value (even parity) or into the subspace in which they have opposite values (odd parity). Crucially, only information on the parity is extracted: the measurement must not reveal any other information about the state of the qubits or otherwise disturb it.

To realize such a parity measurement the use of an ancillary system is required, as illustrated in Fig. 1a. First, both qubits are made to interact with this system such that its state becomes correlated with the parity of the joint two-qubit state. A subsequent high-fidelity readout of the ancillary system then projects the two qubits into the even or odd parity subspace. For suitably chosen initial states, the parity measurement projects the qubits into a maximally entangled state. Implementations have been proposed for various qubit systems8,10,11,12,13, but owing to the high demands on qubit control and ancilla readout experimental realization has remained elusive.

Figure 1: Entanglement by measurement and qubits in diamond.
figure 1

a, Schematic illustration of entanglement by measurement. Two qubits are made to interact with an ancillary system, for instance an ancilla qubit to which both qubits couple. Subsequent readout of the ancilla can project the qubits in an entangled state without requiring a direct interaction between the qubits. b, The nitrogen-vacancy centre in diamond. The spins of a close-by 13C nucleus and the 14N nucleus of the nitrogen-vacancy centre serve as qubits. The nitrogen-vacancy electron spin is used as an ancilla. c, Energy level spectrum for the mS = 0 to mS = −1 electron spin transition. The data show photoluminescence (PL) against the applied microwave frequency. The transition splits into six well-resolved resonances owing to the hyperfine interactions with the 13C (hyperfine constant 12.796 MHz) and the 14N (hyperfine constant 2.184 MHz), enabling conditional operations on the electron (arrows). Our definitions of the qubit and ancilla states are indicated. The vertical arrows indicate transitions between the electron mS = 0 to mS = −1 transitions for the four different two-qubit states (dashed for the even states). d,e, Coherent single-qubit control of the 13C and 14N spins by radiofrequency (RF) pulses. PC(0) (PN(0)) is the probability to find the 13C (14N) spin in state |0〉. Solid lines are sinusoidal fits. The error bars are smaller than the symbols. f, Ramsey-type experiment on the 14N with a 5 ms delay between the two π/2-pulses. The phase φN of the second π/2-pulse is swept. From the phase difference between the curves for the 13C spin prepared in |0〉 and in |1〉 we estimate a direct interaction strength between the nuclear spins of (30±13) Hz. Solid lines are sinusoidal fits. All error bars are one statistical s.d. Sample size is 1,000 for d,e, and 100 for f.

We achieve a heralded qubit parity measurement on two nuclear spins in diamond by using the electron spin of a nitrogen-vacancy defect centre as a readout ancilla. We then use this parity measurement to project the two spins into any selected Bell state and verify the result by correlation measurements and quantum state tomography. Finally, we combine the measurement-based entanglement with a new two-qubit single-shot readout to demonstrate a violation of Bell’s inequality. As we eliminate all post-selection and do not assume fair sampling, this experiment firmly proves that our parity measurement generates high-purity entangled states of nuclear spins.

Our implementation capitalizes on the excellent spin control in diamond developed over the past years15,16,17,18,19 and on the recently attained single-shot electron spin readout20. We use the nitrogen nuclear spin |N〉 (14N, I = 1, |0〉:mI = 0, |1〉:mI = +1) associated with a nitrogen-vacancy centre and a nearby carbon nuclear spin |C〉 (13C, I = 1/2, |0〉:mI = +1/2, |1〉:mI = −1/2) as qubits (Fig. 1b). By working at a low temperature (T<10 K) we can perform efficient initialization and projective single-shot readout of the ancillary electron spin (S = 1) by spin-resolved resonant optical excitation20. As the electron spin is coupled to the nuclear spin qubits through hyperfine interaction (Fig. 1c), the nuclear spins can be initialized and read out by mapping their state onto the electron spin15,16,17,18,20.

The two nuclear spins are excellent qubits. They can be individually controlled with high precision in tens of microseconds by radiofrequency pulses (Fig. 1d,e) and they are well isolated from the environment: the dephasing time T2* exceeds a millisecond for both qubits. However, the direct interaction between the qubits (Fig. 1f) is weak compared with T2* and negligible on the timescales of our experiments (100 μs).

The implementation of the parity measurement is depicted in the circuit diagram of Fig. 2a. First, the ancilla is initialized into |1〉a. Then we apply two NOT gates on the ancilla controlled by the two qubits (Toffoli gates) through selective microwave pulses on the electron transitions for nuclear spin states |CN〉 = |00〉 and |11〉 (Fig. 1c). As a result, the ancilla is flipped to |0〉a if the qubits are in a state of even parity, that is, if both qubits have the value 0 (first gate) or if both have the value 1 (second gate). This operation correlates the ancilla and the parity of the two-qubit state. Finally the ancilla is read out, which projects the qubits into either the even- or odd-parity subspace and yields the corresponding measurement outcome.

Figure 2: Projection into a Bell state by a non-destructive qubit parity measurement.
figure 2

a, Circuit diagram of the parity measurement. We condition on outcome 0 for the ancillary electron readout. For outcome 1, the measurement is aborted. b, Circuit diagram of the protocol to create entanglement by measurement. We first initialize the qubits into |00〉 by measurement. After creating a maximal superposition state, the parity measurement projects the qubits into a Bell state. ce, Real part of the measured density matrix after initialization (c), for the maximal superposition state (d) and for the Bell state |Φ+〉 (e). For numbers, imaginary parts and errors, see Supplementary Information.

For the parity measurement to be useful in quantum protocols, it is required to be non-destructive so that the post-measurement state can be used for further processing. The key experimental challenge is to preserve the phase of all possible two-qubit states of definite parity, such as the Bell states, during ancilla readout. We note that this demanding requirement is not present for measurements in which the ancilla readout projects all qubits onto eigenstates17,19,20. Possible sources of nuclear qubit dephasing during prolonged optical readout are uncontrolled flips of the electron spin in the excited state20 and differences in hyperfine strength between the electronic ground and excited state21. To avoid such dephasing, we use a short ancilla readout time. By conditioning on detection of at least one photon (outcome |0〉a), we obtain a parity measurement that is highly non-destructive (measured ancilla post-readout state fidelity of (99±1)%) at the cost of a lower success probability ( 3%).

Our parity measurement is ideally suited to generate high-fidelity entangled states that are heralded by the measurement outcome. To also enable deterministic quantum gates, the measurement must yield a high-fidelity single-shot outcome for both measurement results |0〉a and |1〉a. This can be achieved by further improvement of the electron readout, for instance by increasing the photon collection efficiency22 or by reducing electron spin flips through proper tuning of electronic levels23.

We apply the parity measurement to project the two nuclear spin qubits into a Bell state. Figure 2b shows the circuit diagram of the protocol. We track the two-qubit state evolution by performing quantum state tomography at three stages. First, the qubits are initialized by projective measurement into |00〉 (Fig. 2c). The ancilla is reset to |1〉a to be re-used in the subsequent parity measurement and final readout. Then, we create a maximal superposition by applying a π/2-pulse to each of the qubits, so that the two-qubit state is |CN〉 = (|00〉+|01〉+|10〉+|11〉)/2 (Fig. 2d). This state contains no two-qubit correlations. Finally, the parity measurement projects the nuclear spins into the even subspace, and thus into the Bell state . We find a fidelity with the ideal state of F = 〈Φ+|ρm+〉 = (90±3)%, where ρm is the measured density matrix (Fig. 2e). The deviation from a perfect Bell state can be fully explained by imperfect microwave π-pulses that reset the ancilla to |1〉a after the projection steps. The high fidelity of the output state is consistent with the non-destructive nature of the parity measurement.

For a maximally entangled state, a measurement of a single qubit yields a random result, whereas two-qubit correlations are maximal. We access these correlations through two-qubit measurements in different bases (Fig. 3a). The π/2 pulses implementing the basis rotations effectively transform the original state into other Bell states, which results in oscillations in the parity (Fig. 3b). In contrast, the single-qubit outcomes are found to be random, independent of the measurement basis (Fig. 3b).

Figure 3: Bell state analysis.
figure 3

a, Readout in different single-qubit bases. The lines represent different measurement bases, achieved by single-qubit rotations before readout along Z. b, Measurement of |Φ+〉 in different bases, as defined in a. Probability for even correlations P (even) (outcome |00〉 or |11〉) versus the angle α between −X and the measurement basis for the 13C spin, Cα, for two different measurement bases for the 14N spin, NX and NY (filled dots). Solid lines are fits to the expected sinusoidal transformation behaviour. The probability for the single-qubit result 0 for the 13C spin, PC(0), shows no dependence on the measurement basis (open dots). Results in the Z-basis (no rotations applied after projection) are shown on the right-hand side. c, Adapted Toffoli gates for projection into the odd two-qubit subspace. d, Histograms of readout results (240 repetitions) for |Ψ+〉 and |Ψ〉 in the Z-basis of both qubits. e, Measurement for the Bell states |Ψ±〉 in bases Cα and NX. Solid lines are sinusoidal fits. All error bars are 1 s.d. The sample size is 240 for each data point.

The parity measurement can also project the qubits directly into each of the other Bell states. We create the states and by projecting into the odd subspace (Fig. 3c). The phase of the resulting state is pre-set deterministically by adjusting the phase of the pulses that create the initial superposition. We characterize the states |Ψ+〉 and |Ψ〉 by correlation measurements in different bases (Fig. 3d,e). The visibility yields a lower bound for the state fidelity of (91±1)% and (90±1)%, respectively (Supplementary Methods). These results are consistent with the value obtained from quantum state tomography (Fig. 2e) and confirm the universal nature of our scheme. Furthermore, our results indicate how the parity measurement could be used to implement a non-destructive Bell-state analyser8,13. Although |Ψ+〉 and |Ψ〉 show identical odd-parity correlations in the Z-basis (Fig. 3d), they can be distinguished by a second parity measurement after a basis rotation (Fig. 3e).

Finally, we use our measurement-based scheme to observe a violation of Bell’s inequality with spins in a solid. This experiment places high demands on both the fidelity of the entangled state and on its readout24, and therefore provides a pertinent benchmark for quantum computing implementations. We adapt the readout protocol to obtain a measurement of the complete two-qubit state in a single shot (Fig. 4a) and therefore do not rely on a fair-sampling assumption24,25. To fully eliminate the need for post-selection, we confirm before each experimental run that the nitrogen-vacancy centre is in its negative charge state19 and that the optical transitions are resonant with the readout and pump laser20.

Figure 4: Bell’s inequality violation.
figure 4

a, Characterization of the single-shot readout without post-selection. The readout fidelities for the four eigenstates states |00〉, |01〉, |10〉 and |11〉 are (90.0±0.9)%, (92.3±0.9)%, (92.6±0.8)% and (95.2±0.7)%, respectively. b, For all four Bell states, we measure S using a set of bases for which a maximum of |S| is expected. The bases correspond to rotating the 13C qubit by {π/4, 3π/4} and the 14N qubit by {0,π/2}, all around −Y. c, Histograms of the four single-shot measurements for |Φ〉(300 repetitions per measurement) and |Ψ+〉 (500 repetitions). d, CHSH parameters. The resulting values for |S| are 2.43±0.06, 2.28±0.05, 2.33±0.04 and 2.17±0.04 (from left to right). The dashed lines mark the classical (bottom) and quantum (top) limits. Error bars are 1 s.d.

We project into each of the four Bell states |Φ±〉 and |Ψ±〉and measure the correlation function E(φ,θ) = Pφ,θ(00)+Pφ,θ(11)−Pφ,θ(01)−Pφ,θ(10) for all combinations of the Bell angles φ1,2 = {π/4, 3π/4} and θ1,2 = {0, π/2}. Pφ,θ(X) is the probability to measure state X after a rotation of the 13C and 14N qubits around the −Y axis by angles φ and θ, respectively (Fig. 4b). Figure 4c shows the resulting data for |Φ〉 and |Ψ+〉. We determine S = E(φ1,θ1)−E(φ1,θ2)−E(φ2,θ1)−E(φ2,θ2) and observe a violation of the CHSH (Clauser–Horne–Shimony–Holt) inequality, |S|≤2, by more than 4 s.d. for each of the four Bell states, with a mean of 〈|S|〉 = 2.30±0.05 (Fig. 4d). The obtained values for S are lower than the theoretical maximum of owing to finite fidelities of the prepared Bell state and the single-shot readout. The main errors arise from imperfect microwave π-pulses. On the basis of the separate characterization of a created Bell state (Fig. 2e) and of the readout (Fig. 4a) we expect S = 2.31±0.09, in agreement with the experimental result. For a perfect readout, a value of S = 2.5±0.1 would be obtained.

This violation of Bell’s inequality without assuming fair sampling demonstrates that our heralded parity measurement creates high-purity entangled states that can be used as input for deterministic quantum protocols such as deterministic teleportation. In contrast, early pioneering experiments with solid-state nuclear spins considered a subset of the full state and generated pseudo-pure states that contain no entanglement16,26. Therefore, our work constitutes the first unambiguous demonstration of entanglement between nuclear spins in a solid.

We have generated entanglement between two nuclear spins in diamond through a qubit parity measurement. Our scheme does not require a direct interaction between qubits and uses the fast but more fragile electron spin exclusively as an ancilla for the measurement. The protocol can be directly applied to other hybrid electron–nuclear systems such as phosphorous donors in silicon27,28. The generation of entanglement within a local register can be supplemented with remote entanglement through optical channels7,29,30,31 to enable scalable quantum networks. Moreover, the presented parity measurements are a primary building block for deterministic measurement-based controlled NOT gates8 and quantum error correction14. Therefore, our results mark an important step towards quantum computation in the solid state based on entangling, manipulating and protecting qubits by measurement.


Sample and set-up.

We use a naturally occurring nitrogen-vacancy centre in high-purity type IIa chemical-vapour-deposition-grown diamond with a 〈111〉 crystal orientation. Details of the experimental set-up are given in ref. 20. All experiments are performed at temperatures between 8.7 and 8.85 K and with an applied magnetic field of 5 G. We determine the following dephasing times (T2*) by Ramsey-type measurements: (1.1±0.02) μs for the electron spin, (3.0±0.2) ms for the 13C nuclear spin and (11.0±0.7) ms for the 14N nuclear spin. The spectrum of the ms = 0 to ms = −1 transitions in Fig. 1c is measured by electron spin resonance with off-resonant optical excitation.

Nuclear spin initialization and readout.

The nuclear spins are initialized by measurement. First the ancilla electron is initialized by depleting |0〉a by optical pumping. Second the ancilla is flipped conditionally on state |00〉 and read out. Successful initialization in |0〉a|00〉 is heralded by a measurement outcome |0〉a. The two-qubit state is read out in two steps. First we initialize the ancilla in |1〉a. Second we sequentially probe each two-qubit eigenstate by flipping the ancilla conditional on the state probed and then reading out the ancilla. The result of the two-qubit readout is given by the first eigenstate for which the ancilla readout outcome is |0〉a. In the CHSH experiments we obtain single-shot readout by repeating the probing sequence until ancilla outcome |0〉a is obtained for one of the probed states.

For further details on the methods, characterization and error analysis see the Supplementary Information.