Witnesses of non-classicality for simulated hybrid quantum systems

The task of testing whether quantum theory applies to all physical systems and all scales requires considering situations where a quantum probe interacts with another system that need not obey quantum theory in full. Important examples include the cases where a quantum mass probes the gravitational field, for which a unique quantum theory of gravity does not yet exist, or a quantum field, such as light, interacts with a macroscopic system, such as a biological molecule, which may or may not obey unitary quantum theory. In this context a class of experiments has recently been proposed, where the non-classicality of a physical system that need not obey quantum theory (the gravitational field) can be tested indirectly by detecting whether or not the system is capable of entangling two quantum probes. Here we illustrate some of the subtleties of the argument, to do with the role of locality of interactions and of non-classicality, and perform proof-of-principle experiments illustrating the logic of the proposals, using a Nuclear Magnetic Resonance quantum computational platform with four qubits.

The task of testing whether quantum theory applies to all physical systems and all scales requires considering situations where a quantum probe interacts with another system that need not obey quantum theory in full. Important examples include the cases where a quantum mass probes the gravitational field, for which a unique quantum theory of gravity does not yet exist, or a quantum field, such as light, interacts with a macroscopic system, such as a biological molecule, which may or may not obey unitary quantum theory. In this context a class of experiments has recently been proposed, where the non-classicality of a physical system that need not obey quantum theory (the gravitational field) can be tested indirectly by detecting whether or not the system is capable of entangling two quantum probes. Here we illustrate some of the subtleties of the argument, to do with the role of locality of interactions and of non-classicality, and perform proof-of-principle experiments illustrating the logic of the proposals, using a Nuclear Magnetic Resonance quantum computational platform with four qubits.
A recently proposed class of experiments has brought the possibility of testing quantum effects in gravity closer to current experimental capabilities [1,2]. The remarkable feature of these experiments is that they are based on a general argument, whereby if an intermediate system (which need not obey quantum theory) can mediate entanglement between two quantum systems, then it itself must be non-classical. By a system being non-classical we mean, following [1], that the system has at least two noncommuting variables. This is a weaker property than displaying full quantum coherence: it means, operationally, that the system has at least two variables with the property that they cannot be measured simultaneously to an arbitrarily high accuracy. This is a remarkably general argument, which can be applied to any mediator whatever its physical origin happens to be. It therefore generalises theoretical considerations [3,4], which date back to Feynman's and DeWitt's arguments for the quantisation of gravity, aiming at hybrid systems (those composed of a quantum probe system, that obeys quantum theory, and another system whose dynamics and scale are not fully specified). The argument sets a novel paradigm which will be crucial for the exploration of tests beyond currently known dynamical laws, specifically to witness non-classicality in systems that may not obey quantum theory.
In preparation for an actual experiment involving superposed masses interacting through gravity, in this paper we intend to further clarify the logic of the argument, using a quantum simulation. Specifically we shall illustrate how the degree of non-commutativity of relevant variables of the entanglement mediator relates to the final entanglement of the probes, in a specific quantum model, and the important role of locality of interactions in the argument.
Based on this, we also propose an experimental simulation using four Nuclear Magnetic Resonance (NMR) qubits arranged in a linear chain. The local transfer of entanglement takes place from one end of the chain to the other, through a mediator which may be non-classical, in the sense that it may have a pair of non-commuting observables. In this simulation, the mediator is the third qubit in the chain, which can either be undisturbed or undergo dephasing, which simulates the classical limit in which only one observable of the qubit can be accessed, effectively making it behave like a classical bit. We show that mediated entanglement disappears in the presence of complete dephasing, which corresponds to the mediator behaving classically, i.e. not being able to access at least two non-commuting degrees of freedom.

I. QUANTUM GATE MODEL
The idea of the test of non-classicality is elegant and can be illustrated via a quantum simulation, as follows.
Consider three systems: two qubits, Q 1 and Q 2 , and another system S (the mediator), which is only assumed to have a classical observable T , meaning one that can in principle be perfectly measured. This mediator system could be the gravitational field, for example, but could be more general.
Suppose that they are all initialised in a state where they are not entangled and that interactions are allowed between Q 1 and S, and between Q 2 and S, but (and this is essential) not between Q 1 and Q 2 . If at some point later in the evolution Q 1 and Q 2 become entangled, then one can infer that S must have at least another variable W that is complementary to T , meaning that T and W cannot be perfectly measured by the same device. Therefore T and W can be represented as two non-commuting degrees of freedom of S.
For the purpose of our simulation, the formation of entanglement through non-commuting degrees of freedom of the mediator can be modelled in a number of equivalent ways using quantum theory. In [3] two of us proposed a Hamiltonian model in linear quantum field theory, applicable to either gravity or electromagnetism, where the system S is treated as a single harmonic oscillator, while Q 1 and Q 2 are two masses that can be put into spatial superpositions of two different locations. Here we focus instead on two quantum network models, with the aim of eventually realising a quantum simulation of the effect.
The first network is chosen so that the interaction between Q 1 and Q 2 is symmetric, mirroring the original quantum field theory Hamiltonian interaction.
To uncover the role of the non-commuting variables of the mediator S in mediating entanglement, it is illuminating to resort to the Heisenberg picture for quantum information (see, for example, [5,6]). The Heisenberg picture is more suitable to track the information transfer residing in non-commuting observables, which establishes entanglement. The two pictures are, of course, equivalent, but the Heisenberg one is more direct for our purposes.
Consider a chain of four qubits, A, B, C, and D. Let q xα denote an operator representing the x-component of qubit α, and similarly for the y and z components. These operators act on the 2 4 -dimensional Hilbert space of the four qubits. We have q zα q xα = iq yα , q 2 zα = id and likewise for all the other components, while components of different qubits commute. If the gate U (t n ) operates between time t n and t n+1 , we shall denote by the operator representing the observable O of system α after its action. The initial conditions are fixed by choosing particular values for q xα (t 0 ), q yα (t 0 ), q zα (t 0 ), for all α's, and by the Heisenberg state ρ H . The state of each qubit α at time t is completely specified by at least two components, e.g. {q xα (t), q zα (t)}. The state of the joint system is likewise reconstructed given all of the observables in the set {q xα (t), q zα (t)}, because by unitarity. Therefore for present purposes it is enough to track the evolution of {q xα (t), q zα (t)} only. Suppose one intends to entangle qubits A and D by local interactions existing only between qubits A and B, B and C, and C and D, while more distant pairs, such as A and D, are not allowed to interact directly. In this case, A and D correspond to Q 1 and Q 2 , while B and C represent the mediator S. The Hamiltonian of the qubits is assumed to contain nearest neighbour interactions on the chain, but not to couple qubits A and D directly. We choose a representation such that the initial conditions are expressed as q za (t 0 ) = Z ⊗ id ⊗3 ≡ q za , where Z is a Pauli matrix, and so on. We choose the Heisenberg state to be ρ H = |0 0|, the +1 eigenstate of the operator A symmetric way of performing the maximally entangling gate between A and D is represented by the circuit in Fig. 1. First one applies a Bell gate between A and B, and between D and C; then one performs a controlled phase on qubits B and C; and finally one applies cnot 2 plicable to either gravity or electromagnetism, where the system S is treated as a single harmonic oscillator; while Q 1 and Q 2 are two masses that can be put into spatial superpositions of two different locations.
Here we focus instead on two quantum network models. The first network is chosen so that the interaction between Q 1 and Q 2 is symmetric, mirroring the original quantum field theory Hamiltonian interaction.
To uncover the role of the non-commuting variable of S, it is illuminating to resort to the Heisenberg picture, [5]. The Heisenberg picture is not much used in quantum information, but we believe it is clearer than the Schrödinger picture in this case, when we need to track the information transfer residing in non-commuting observables, which establishes entanglement. The two pictures are, of course, equivalent but the Heisenberg one is more direct for our purposes.
Consider a chain of four qubits, A, B, C, and D. Let X α denote an operator representing the x-component of qubit α, and similarly for the y and z components. These operators act on the 2 4 -dimensional Hilbert space of the four qubits. We have Z α X α = iY α , Z 2 α = id and likewise for all the other components, while components of different qubits commute. If the gate U (t n ) operates between time t n and t n+1 , we shall denote as A α (t n+1 ) = U (t n ) † A alpha (t n )U (t n ) the operator representing the observable A of system α. The initial conditions are fixed by choosing particular values for X α (t 0 ), The state of each qubit α at time t is completely specified by the Heisenberg state ρ H , which never changes with the evolution, and by at least two components, e.g. {X α (t), Z α (t)}. The state of the joint system is likewise reconstructed given all of the observables in the set {X α (t), Z α (t)}, because U (t n )X α (t n )Z α (t n )U † (t n ) = X α (t n+1 )Z α (t n+1 ) by unitarity. Therefore for present purposes it is enough to track the evolution of {X α (t), Z α (t)} only.
Suppose one intends to entangle qubits A and D by local interactions only existing between qubits A and B, B and C, and C and D, while more distant pairs, such as A and D, are not allowed to interact directly. In this case, A and D correspond to Q 1 and Q 2 , while B and C represent the mediator S. The Hamiltonian of the qubits only contains nearest neighbour interactions on the chain, but does not couple qubits A and D directly. We choose a representation such that the initial conditions are expressed as Z A (t 0 ) = Z ⊗ id ⊗3 ≡ Z α , where Z is a Pauli matrix, and so on. We choose the Heisenberg state to be ρ H = |0 0|, the +1 eigenstate of the operator 1 2 (id + Z) ⊗4 . A symmetric way of performing the maximally entangling gate is represented by the circuit in Fig. 1. First one applies a Bell gate between A and B, and between C and D; then one performs a controlled phase on qubits B and C; and finally one applies cnot gates between A and  Table 1.
From this table, one can compute the degree of entanglement between qubits A and D at time t 4 . The most straightforward measure to use is the sum of correlations in two complementary directions written as which for the this network has a value of 2. This is effectively what is measured in the NMR simulation discussed below. Disentangled states cannot exceed the value of 1 as far as this observable is concerned (which therefore also makes it a useful entanglement witness in more general contexts, very closely related to Bell's inequalities). Note that by tracking the evolution of the descriptors in the table one can see the explicit role of locality in the arguments presented in [1,2]. The descriptors of system D at time t 3 become dependent on the descriptors of A at time t 0 , and similarly for the descriptors of A at time t 3 . This is precisely the advantage one obtains from using the Heisenberg picture, because it makes the locality of interaction and the role of the non-commuting observables explicit. The entanglement between A and D is possible because at time t 1 and t 2 the non-commuting degrees of freedom of qubits B and C have acted as mediators.
We shall now simulate a reduction of non-classicality, via gradually making the mediators more and more classical by means of decoherence, and show that their ability to transfer entanglement is gradually reduced.

Decoherence
We now consider applying some decoherence on qubit C. For example, one can apply a phase-flip channel with intensity p at time t 2 , just before the final CNOT gates in the above network. Consider the Heisenberg picture representation of noisy channels, whereby for a general observable A, A → a M † a AM a where the M a are the Kraus operators of the channel: In this picture, the phase flip will modify the gates between A and B, and D and C. The gates applied at their respective times are represented as follows: The resulting evolution of the Heisenberg descriptors {q xα (t), q zα (t)} at each of the four times indicated in the figure is shown in Table 1.
From this table, one can compute the degree of entanglement between qubits A and D after time t 3 . The most straightforward measure to use is the sum of correlations in two complementary directions written as which for the this network has a value of 2. Disentangled states cannot exceed the value of 1 as far as this observable is concerned (which therefore also makes it a useful entanglement witness in more general contexts, very closely related to Bell's inequalities). By tracking the evolution of the descriptors in the table one can see the explicit role of locality of interactions, which couple Q 1 and Q 2 separately with the mediator S, but not Q 1 and Q 2 directly [1,2,7]. The descriptors of system D at time t 3 (representing Q 2 in the simulation) become dependent on the descriptors of A (representing Q 1 in the simulation) at time t 0 , and similarly for the descriptors of A at time t 3 , via a sequence of nearestneighbour interactions. Now we can relate the final degree of entanglement between A and D to the degree of non-classicality of the mediator. A and D become entangled at time t 3 because at time t 1 and t 2 the non-commuting degrees of freedom q zb , q xb , and q zc , q xc , of qubits B and C have acted as mediators. The relevant degree of non-classicality of the mediator represented by each of the qubits B and C will be taken to be the norm of the operators [q xα (t), q zα (t)], that is, the commutator between the two observables that are relevant for the couplings between the mediator qubits B and C and the two qubits to be entangled, A and D. This is a dynamical quantity, which is of course invariant under unitary dynamics. We shall now simulate the transition to a classical mediator via introducing decoherence on qubits B and C, which affects that degree of non-commutativity and therefore the capacity of the mediator to create entanglement.

A. Decoherence
We will now simulate the transition between the case where the mediator S consists of a fully fledged two-qubit system, and the case where it consists of a hybrid system with a lower degree of non-classicality. This will be represented in our simulation by applying some decoherence to qubits B and C. Specifically, we apply a phase-flip channel with intensity p at time t 2 , after the phase gate and before the final cnot gates in the above network, to both qubits B and C separately.
We will consider the regime where the decoherence rate is faster than the timescales over which the observables of the qubits B and C can be measured. In such a situation, we can consider the mediator to be described by an effective description, where the descriptors of qubits B and C are acted upon by the noisy operation. To model this effective system (equivalent to qubit B and C each "dressed" by decoherence), we shall use the Heisenberg picture representation of noisy channels, where for a general observable O α (t) of qubit α, the phase-flip channel has the effect where the M a are the Kraus operators of the channel: . Note that after this operation, the generators of the algebra of qubit α undergoing decoherence are affected as The effect of decoherence on the overall entanglement generation can be retrieved by computing the evolution of the components of the qubits, as in Table 2. Computing again the degree of entanglement on qubits A and D at time t 3 , we see that it is reduced by a factor (1 − 2p) compared to Eqn. 6.
Correspondingly, the degree of commutativity of the variables of each decohered qubit involved in entanglement generation is reduced by the factor (1 − 2p) compared to the case without decoherence: This is the dual of the channel's action on quantum states, which need not preserve the inner product between two generic quantum states. The mediator S consisting of qubits B and C together with the environment that decoheres both of the qubits, can be effectively described as a physical system whose descriptors are the decohered versions of the generators of qubits B and C. This can be seen as a special case of a hybrid quantumclassical dynamics, closely related to the proposals reviewed in [8].
In the limiting case of complete dephasing, p = 1/2, the entanglement vanishes and so does the degree of non-commutativity between the different components of the mediator consisting of the fully decohered mediator qubits B and C, thereby simulating the transition of the mediator to a completely classical system. The physical interpretation of this is that in the limit of maximal decoherence the qubits mediating the interaction become effectively two classical bits, in that only their z component can be used for information processing. Their x and y components become effectively suppressed, and the qubits are turned into effectively classical systems with only one classical Boolean observable, along z. This is a powerful illustration of the fact that the mediator S must have at least two non-commuting observables to mediate entanglement between A and D: if the degree of commutativity (i.e. non-classicality) of the relevant variables mediating entanglement is reduced, the final entanglement is too. Of course the mediator in this quantum simulation obeys the laws of quantum theory, but this scenario serves to illustrate the more general principle of the argument for non-classicality, which could also apply to systems that are not necessarily quantum, e.g. quantum gravity. Note also that having entanglement created in this way is a sufficient condition for nonclassicality of the mediator. Not having entanglement, on the other hand, may or may not imply the classicality of the mediator. One important difference between this model and the field-theory model, when the mediator is, for example, gravity, is that in the linearised Hamiltonian the interaction between the qubits is weak-it cannot be  of dephasing the transfer of entanglement does not happen, because, as explained above, the dephasing causes a progressive reduction of the non-classicality of the system C. This achieves exactly what the fully symmetric scenario we described earlier does, but is more conducive to the experiments we performed with NMR. In this network, it is enough to have one qubit "classicalised" in order to prevent establishment of entanglement across the chain, thus making it easier to realise it via NMR simulation. More specifically, in the simulation we realise a version of the above network where the two swap gates are achieved through a sequence of n partial swap gates, which can potentially be interrupted by decoherence on qubit C: such decoherence is easily simulated by applying Z gates probabilistically with p = 0 for the simple quantum case and p = 1/2 for the completely dephased classical case. NMR systems operate at room temperature, which is high in comparison with the energy gap between spin states, and so NMR spin states are normally highly mixed, with only a small excess population in the lower energy state. Preparation of a pure initial state is only possible in special cases [11], and instead most quantum information processing (QIP) experiments are performed using pseudo-pure states [12,13], or effective pure states [14,15] of the form where 1 n is the maximally mixed state of an n-spin system and |0 is the desired initial state. As the maximally mixed state does not evolve under unitary transformations and is not detectable in NMR experiments, pseudo-pure states behave exactly like pure states except that the signal intensity is reduced to a fraction α.
The poor scaling of this signal intensity with the number of qubits means that conventional NMR cannot be used to perform QIP with large numbers of qubits [16]. More fundamentally, the absence of entanglement in thermal pseudo-pure states has led some authors to question whether NMR devices are really quantum at all [17], implying that NMR experiments may be only simulations of simulations. It has, however, proved impossible to develop a fully classical model of NMR QIP [18], and NMR quantum computations run using entangled states produce identical results to those with pseudo-pure states with the exception of the increased signal size [19].
A second issue which arises in NMR QIP is the absence of true projective measurements, as the NMR signal detection corresponds to ensemble averaged weak measurements. This makes a convincing NMR implementation of the symmetric circuit ( Fig. 1) challenging, but in the case of the asymmetric circuit ( Fig. 2) a particularly simple observation scheme can be used which immediately demonstrates the transfer or otherwise of the entangled state along the chain.

II. EXPERIMENTAL SIMULATION
Our experimental qubits are the four 13 C nuclei in fully labelled crotonic acid dissolved in deuterated acetone [20] at 300 K, as shown in Fig. 3. Experiments were performed on a 600 MHz Varian Unity Inova spectrometer. The 13 C NMR spectrum of the thermal equilibrium state with 1 H decoupling, shown at the bottom, shows that the four multiplets (one from each spin as indicated) are well separated and so can be individually addressed. The spin system can be approximated by a linear chain, with strong nearest-neighbour couplings and modelled as a Bell gate. But this is only a superficial difference and that interaction, despite its weakness, still leads to maximal entanglement at the end, as explained in [1,2].

B. An asymmetric equivalent formulation
In the next section, we will illustrate the idea of the test with an experimental simulation in an NMR spin system [9,10] with four qubits. For this simulation it is more convenient to use an alternative asymmetric discretised network, as shown in Fig. 2. In this alternative network the qubits A, B and D are fully quantum, while the qubit C could undergo decoherence. The logic is to prepare a maximally entangled pair on the qubits A and B and then transfer the entanglement to qubit D via two swap gates acting locally on qubits B and C and qubits C and D. See Table III, where this process is described in the Heisenberg picture.
At the end of the process, in the absence of decoherence, qubits A and D are maximally entangled (i.e., at time t 3 the witness in Eqn. 6 has value 2). In the presence of dephasing the transfer of entanglement does not happen, because the dephasing causes a progressive reduction of the non-classicality of the system C. This achieves exactly what the fully symmetric scenario we described earlier does, but is more conducive to the experiments we performed with NMR. In this network, it is enough to have one qubit "classicalised" in order to prevent establishment of entanglement across the chain, thus making it easier to realise via NMR simulation. More specifically, in the simulation we realise a version of the above network where the two swap gates are achieved through a sequence of n partial swap gates, which can potentially be interrupted by decoherence on qubit C. Such decoherence is easily simulated by applying Z gates probabilistically with p = 0 for the simple quantum case and p = 1/2 for the completely dephased classical case. NMR systems operate at room temperature, which is high in comparison with the energy gap between spin states, and so NMR spin states are normally highly mixed, with only a small excess population in the lower energy state. Preparation of a pure initial NMR state is only possible in special cases [11], and instead most quantum information processing (QIP) experiments are performed using pseudo-pure states [12,13], or effective pure states [14,15] of the form where 1 is the maximally mixed state of the spin system and |0 is the desired initial state. As the maximally mixed state does not evolve under unitary transformations and is not detectable in NMR experiments, pseudopure states behave exactly like pure states except that the signal intensity is reduced to a fraction . The poor scaling of this signal intensity with the number of qubits means that conventional NMR cannot be used to perform QIP with large numbers of qubits [16]. More fundamentally, the absence of entanglement in thermal pseudo-pure states has led some authors to question whether NMR devices are really quantum at all [17], implying that NMR experiments may be only simulations of simulations. It has, however, proved impossible to develop a fully classical model of NMR QIP [18], and NMR quantum computations run using entangled states produce identical results to those with pseudo-pure states with the exception of the increased signal size [19].
A second issue which arises in NMR QIP is the absence of true projective measurements, as the NMR signal de-  then transfer the entanglement to qubit D through a sequence of n partial swap gates, which can potentially be interrupted by decoherence on qubit C: such decoherence is easily simulated by applying Z gates probabilistically as indicated with p = 0 for the simple quantum case and p = 1/2 for the completely dephased classical case. In the presence of dephasing the transfer of entanglement does not happen, because, as explained in the theory section above, the dephasing causes a progressive reduction of the non-classicality of the system C.
Entangled states are not directly detectable in NMR: the observed signal depends on the expectation values of single-spin off-diagonal operators [6], and these are all zero for entangled states. Here, however, we use an indirect witness [7], which corresponds effectively to measuring the observable in Eqn. (1). Consider the initial entangled state of qubits A and B, and the effect of apply a Hadamard gate to qubit A before observing the NMR spectrum. This generates a pair of lines in the multiplet of transitions of spin A, one with positive intensity and other with negative intensity, called an antiphase doublet. However it also generates another antiphase doublet in the multiplet of spin B, even though spin B was not directly excited. There are no signals in the multiplets corresponding to spins C or D. In general, if we have an entangled singlet state between two qubits then applying a Hadamard gate to one of them generates antiphase doublets in both multiplets, so we can very easily follow the progress of the entangled state from AB to AD tection corresponds to ensemble averaged weak measurements. This makes a convincing NMR implementation of the symmetric circuit ( Fig. 1) challenging, but in the case of the asymmetric circuit ( Fig. 2) a particularly simple observation scheme can be used which immediately demonstrates the transfer or otherwise of the entangled state along the chain.

II. EXPERIMENTAL SIMULATION
Our experimental qubits are the four 13 C nuclei in fully labelled crotonic acid dissolved in deuterated acetone [20] at 300 K, as shown in Fig. 3. Experiments were performed on a 600 MHz Varian Unity Inova spectrometer. The 13 C NMR spectrum of the thermal equilibrium state with 1 H decoupling, shown at the bottom, shows that the four multiplets (one from each spin as indicated) are well separated and so can be individually addressed. The spin system can be approximated by a linear chain, with strong nearest-neighbour couplings and much weaker next-nearest-neighbour couplings. Fortuitously the long-range AD coupling is large enough to be easily resolved, rendering the detection of long-range entanglement straightforward. The circuit implemented in our experiment is shown in Fig. 4. NMR experiments with this spin system have recently been used [21] to simulate spinfoam vertex amplitudes for loop quantum gravity.

A. Initial state preparation
A pseudo-pure initial state (PPS) was prepared by spatial averaging following the methods in [22,23]. The use of robust GRAPE pulses, as described below, was found to almost double the observed signal intensity, which was then enhanced still further using the nuclear Overhauser effect from 1 H nuclei to generate a non-thermal initial state with enhanced polarization [24]. We chose the initial state |1100 as this leads to a singlet entangled state, which is the most robust of the four Bell states to naturally occurring decoherence processes.

B. Robust GRAPE pulses
All the gates used in the PPS preparation sequence as well as the quantum circuit were implemented using GRAPE [25]. In addition to four 13 C nuclei (the system qubits) crotonic acid also contains five 1 H nuclei (environment qubits) which have strong interactions with the system qubits. (The remaining three nuclei comprise two 16 O nuclei, which are spin-0 and so can be safely ignored, and a sixth 1 H nucleus in the hydroxyl group which undergoes rapid chemical exchange, averaging out its interactions with the main spins [9]). The traditional approach is to apply 1 H decoupling to the environment qubits throughout the experiment, usually with a composite pulse based broadband decoupling sequence such as WALTZ-16 [26]. In principle such decoupling can completely trace out the environment qubits, leaving a simple four-spin system. In practice, however, it is not possible to achieve completely effective decoupling without using high RF powers which are ruled out by hardware limits and the effects of sample heating. Our simulations suggest that imperfect 1 H decoupling is the main source of errors in current NMR implementations of GRAPE pulses in crotonic acid.
Here we adopt a quite different approach: leaving the 1 H nuclei untouched throughout the pulse sequence which implements quantum logic gates, and applying decoupling only during the final detection stage. In this case the 1 H nuclei are entirely passive, and can be thought of as providing a fixed frequency shift, which is different in each molecule, depending on the hydrogen spin states in that particular molecule. As there are five hydrogen spins there are 2 5 = 32 possible spin states, although these give rise to only 16 distinct frequency shifts, as the three hydrogens attached to carbon A, forming a methyl group, are completely equivalent. The GRAPE pulses are then designed by optimising for all 16 background Hamiltonians simultaneously, defining the overall fidelity as the average of the individual fidelities [25]. This approach completely avoids errors arising from imperfect decoupling, as decoupling is not applied during GRAPE pulses or free evolution periods. As usual it is possible to design pulses which can tolerate the RF amplitude inhomogenity over the macroscopic sample, by evaluating the fidelity over a range of RF amplitudes. Although preparing such GRAPE pulses is computationally expensive, one can greatly speed it up by employing subsystem methods [27] and using GRAWME [28] during the initial stages of the optimisation.

C. SWAP gates and dephasing
The swap gates were implemented in eight stages using and similarly for U CD . Poor experimental results are obtained if the same GRAPE pulse is applied repeatedly, as the small errors which inevitably occur in any experimental implementation build up linearly on repeated application [29]. Instead multiple GRAPE pulses were designed for each gate, by using different random starting points in the GRAPE search. As each pulse has different implementation errors the total error will only grow with the square-root of the number of gates, leading to visibly better results. Dephasing can be implemented using either spatial averaging, using magnetic field gradients [12], or by temporal averaging [15], in which spectra are recorded both with and without the application of Z gates at any given point and the results combined. Temporal averaging has the advantage that it is much simpler to implement selective dephasing on a single qubit, but if performed naively requires 2 n separate experiments, where dephasing is applied at n separate points, rendering such experiments infeasible in all but the simplest cases [30].
Instead we adopted the method of randomized temporal averaging [15], in which exhaustive averaging is replaced by averaging over a sample of possible sequences. Specifically, we designed two further gates, V BC = Z C U BC and V CD = Z C U CD , and used a randomly chosen sequence of U and V gates, containing four of each. When the number of stages is small, as used here, the final result depends on the precise pattern of gates used, and so results were averaged over 16 different dephasing patterns.

D. Detection
Entangled states are not directly detectable in NMR: the observed signal depends on the expectation values of single-spin off-diagonal operators [31], and these are all zero for entangled states. Here, however, we use an indirect witness [32], which corresponds effectively to measuring the observable in Eqn. 6.
Consider the initial entangled state of qubits A and B, and the effect of performing a Hadamard operation on qubit A before observing the NMR spectrum. This will generate a pair of lines in the multiplet of transitions of spin A, one with positive intensity and another with negative intensity, called an antiphase doublet. However it also generates another antiphase doublet in the multiplet of spin B, even though spin B was not directly excited. There are no signals in the multiplets corresponding to spins C or D. In general, if we have an entangled singlet state between two qubits then applying a Hadamard gate to one of them generates antiphase doublets in both multiplets, so we can very easily follow the progress of the entangled state from AB to AD by applying a Hadamard to qubit A and observing the signal on spins B, C and D.

E. Experimental results
The experimental results are shown in Fig. 5. Each spectrum is obtained after applying a Hadamard gate to spin A with a two step phase cycle to reduce errors [10]; the 1 H environment nuclei were decoupled throughout signal acquisition. Individual multiplets were then cut out of spectra like that shown in Fig. 3, permitting an expanded horizontal scale, and then rearranged into spin order. Antiphase signal on both spins r and s with a coupling J rs indicates that spins r and s were entangled; smaller peaks are due to remaining experimental errors.
An AB singlet state was initially prepared, as shown by the antiphase doublets split by J AB on both spins A and B in spectrum (a). The transfer of entanglement from spins A and B to spins A and D is clearly seen in (b), while dephasing suppresses this transfer as shown in (c). This suppression can be seen as a generalisation of the quantum Zeno effect in NMR [33] where rapid dephasing suppresses coherent evolution. The phase shift on spin B in spectrum (c) arises from the zz component of the swap Hamiltonian which commutes with the dephasing process and so is not suppressed by the Zeno effect.
The small additional peaks are due to experimental errors, and simulations suggest that these can be largely modelled by weak uniform depolarisation during the swap process. This apparent depolarisation arises from the accumulation of small errors in the U and V gates, which can be treated as random because of the way in which particular implementations of these gates are selected from a larger set.

III. CONCLUSIONS
We have illustrated, with our theoretical analysis and the experimental simulation, the relevance of noncommuting degrees of freedom in the physical system mediating an entangling gate between two spatially separated qubits. The capacity to generate entanglement can thus be used as an indirect witness of non-classicality in physical systems that need not obey quantum theory, such as a macroscopic system or the gravitational field [34]. Future applications of this general scheme will include exploring experimental schemes to witness nonclassicality in bio-molecules, including living systems, which are notorious for being hard to manipulate directly, but can easily be accessed by quantum probes [35]. Also, a worthwhile future experimental direction is to probe different regimes of decoherence and their effect on entanglement transfer.