Sequential modular position and momentum measurements of a trapped ion mechanical oscillator

The non-commutativity of position and momentum observables is a hallmark feature of quantum physics. However this incompatibility does not extend to observables which are periodic in these base variables. Such modular-variable observables have been suggested as tools for fault-tolerant quantum computing and enhanced quantum sensing. Here we implement sequential measurements of modular variables in the oscillatory motion of a single trapped ion, using state-dependent displacements and a heralded non-destructive readout. We investigate the commutative nature of modular variable observables by demonstrating no-signaling-in-time between successive measurements, using a variety of input states. In the presence of quantum interference, which we enhance using squeezed input states, measurements of different periodicity show signaling-in-time. The sequential measurements allow us to extract two-time correlators for modular variables, which we use to violate a Leggett-Garg inequality. The experiments involve control and coherence of multi-component superpositions of up to 8 coherent, squeezed or Fock state wave-packets. Signaling-in-time as well as Leggett-Garg inequalities serve as efficient quantum witnesses which we probe here with a mechanical oscillator, a system which has a natural crossover from the quantum to the classical regime.

One of the fundamental notions of quantum mechanics is that position and momentum operators do not commute. This restricts the possible states a particle can be prepared in to fulfill the Heisenberg uncertainty principle: ∆x∆p ≥ 1 2 | [x,p] | with [x,p] = i , and limits the ability to perform simultaneous position and momentum measurements [1][2][3][4]. However this is different for measurements of position and momentum modulo a characteristic length/momentum scale (i.e.X mod l x , P mod l p ), which can commute. Such variables were first discussed in the context of the seminal Aharonov-Bohm effect [5] and provide new perspectives in the study of fundamental aspects of quantum mechanics. For example, they exhibit non-local Heisenberg equations of motion [6]. Modular variables have been proposed for testing macro-realism via Leggett-Garg Inequalities (LGI) [7] as well as contextuality with continuous-variable systems [8]. The commutation of modular position and momentum allows their use as stabilizers for fault-tolerant continuous variable computation, as proposed by Gottesman, Kitaev and Preskill (GKP) [9]. Additionally, sequences of these measurements have been proposed to prepare approximate GKP code states [10,11]. In contrast, for incompatible modular position and momentum measurement settings we expect the first measurement to influence the statistics of the subsequent measurement, which has previously been defined as Signaling-In-Time (SIT) [12,13]. Observation of SIT and LGI violations provide means to exclude macro-realistic theories and often serve as quantum witnesses [12][13][14][15].
In this Letter we implement and analyze sequences of modular position and momentum measurements of a quantum harmonic oscillator realized in the axial motional oscillation of a single trapped calcium 40 atomic ion. The observables are measured by coupling the oscillator to the ion's internal qubit states using state-dependent forces, and subsequently reading out the qubit using resonance fluorescence [16]. We analyze SIT between the measurements and violate a LGI. Using both methods we confirm the quantum nature of the motional states using a small number of measurements. In addition we test the commutation of modular measurements by observing Non-Signaling-In-Time (NSIT) on a variety of input states.
In a first set of measurements, we perform "symmetric" modular measurements using a bi-chromatic laser field resonant with both the red and blue sideband of the quadrupole transition between the |↓ ≡ S 1/2 , m j = 1/2 and |↑ ≡ D 5/2 , m j = 3/2 internal states [17].
In an ideal scenario, the measurement would project into the state |ψ ± ∝Ê ± |ψ in conditional on the measurement result. In practice, we measure the qubit using state-dependent resonance fluorescence, which for the detection of |↑ (no photons scattered) closely realizes the ideal scenario. However, measuring the |↓ state involves scattering of around 1000 photons which randomizes the oscillator state. We thus perform the measurement in a heralded fashion, and only analyze the subsequent state (or continue to further measurements) if the detection is dark. This decision is made in real-time using an FPGA to save data acquisition time. In half of our experiments we invert the qubit prior to the fluorescence detection, allowing projection into |ψ + ∝Ê + |ψ in as a dark measurement result.
In quantum mechanics, the measurement of one quantity often influences a subsequent measurement of a different quantity. We consider two symmetric modular variable measurements A, B with measurement settings controlled through the respective displacements α A and α B . The measurement outcomes are a, b ∈ {+1, −1}. Measurement B is either performed alone or subsequent to a measurement of A, resulting in probabilities P B (b) or P B(A) (b) ≡ a P BA (b, a) respectively, where we have defined the joint probability P BA (b, a) ≡ P A (a)P B|A (b|a). For some settings, the statistics of measurement B change if measurement A is performed before it (SIT), while for other settings the statistics of measurement B do not depend on the presence of measurement A (NSIT). Since the measurement is binary, we can quantify SIT of A to B using S = P B (b = +1) − P B(A) (b = +1), which for our experiments results in where m α ≡ ψ in |D(α) |ψ in and Φ = Im(α * A α B ) is the geometric phase which arises from the non-commutation of the displacement operatorsD(α A )D(α B ) = e iΦD (α A + α B ) [18]. From this expression we see that SIT will not occur for any state if either the geometric phase Φ = 2πk, k ∈ Z or the wave packet overlap |m α B | = 0. We analyze these dependencies in two experiments.
In the first we examine the effect of wave packet overlap using squeezed vacuum states |ψ in =Ŝ(r) |0 witĥ S(r) = e r(â 2 −â †2 )/2 and where the phase is chosen such that the squeezing parameter r is real and positive. These states can be readily prepared using reservoir engineering [19]. We choose the measurement displacement α B = 3.1i, which is aligned with the anti-squeezed axis of the input state. By varying r, we can control the wave packet interference, which in this case scales as m α B = e −|α B | 2 e −2r /2 [20]. We choose α A = 3.02 ≈ 3π/|α B | to ensure that for a given overlap maximal SIT is observed. Experimental results are shown in figure 1 (a), exhibiting agreement with the ideal theoretical expectation. Deviations between the two for large r are primarily due to FIG. 1. Dependence of SIT of measurement A to measurement B on (a) interference and (b) geometrical phases. Solid lines show the expectations for an ideal experimental system and the error bars of S are propagated from the shot noise standard errors of the mean (SEM) of the directly measured probabilities PB(b), PA(a) and P B|A (b|a). (a): The SIT measurement settings αB = 3.1i, αA = 3.02 ≈ 3π/|αB| are applied to squeezed input statesŜ(r) |0 where the squeezed axis was aligned with position. (b): The geometric phase is varied by sweeping the displacement amplitude αA of measurement A, for a "Schrödinger's cat" input superposition (D(−αB/2) +D(αB/2)) |0 with αB = iπ.
imperfect squeezed state preparation.
The input state |ψ in = (D(−α B /2)+D(α B /2)) |0 exhibits a constant non-zero level of interference |m α B | ≈ 1/2. Thus we use this state to illustrate the dependence of SIT on the geometric phase. This is done by setting α B = 3.1iand varying α A which is taken to be real. Data is shown in figure 1 (b) showing oscillations of S with amplitude |m α B |. These oscillations illustrate the periodic effect of the geometric phase. NSIT is seen for this measurement when α A = 2πk/|α B | ≈ 2k.
If NSIT is observed for all possible input states, then it follows that the underlying observables commute. The converse is not true for the non-projective measurements considered here (see Supplemental Information (SI)). The commutation of observables is hard to verify in practice given the infinite nature of the harmonic oscillator Hilbert space. As a reduced investigation, we examine this property using 150 input states of the form |ψ in = (D(−|α B |e iφ I /2) +D(|α B |e iφ I /2)) |φ , where |φ is chosen to be one of (i) the ground state |0 , (ii) a squeezed stateŜ(−0.82) |0 or (iii) the first excited state |1 , and for each |φ 50 values of φ I evenly spaced between zero and 2π are used. To investigate the commutation of modular position and momentum for large displacements we choose the NSIT geometric phase with k = 2 (Φ ≈ 4π), which we implement using the measurement settings: α B = iπ, α A = 4.09.
Data and a histogram of all measured values of S are shown in figure 2 (a)-(c). For comparison in (c), we also plot theoretical calculations for α B = iπ, α A = 3, resulting in Φ = 3π which corresponds to maximal SIT but with the same m α B as used in the experiment. The maximal |S| value measured is 0.087 ± 0.003 while the maximum calculated is 0.5. Additionally the standard deviation of the SIT theory histogram is 5.5 times larger than that of the experimentally measured distribution.
Theoretical Wigner function plots for one input state example (|φ =|0 and φ I = 1.22 rad) through the experimental sequence are shown in figure 2 (d). The created states are superpositions of up to 8 displaced |φ states with separations of up to ∆α ≈ 8.3. These measurements illustrate the high level of control for the implemented sequential modular measurements. The ability to tune them from SIT to NSIT demonstrates the quantum nature of the created states and additionally confirms the possibility of modular position and momentum measurements to commute.
An additional means by which successive measurements can be related to one another is through the correlation function of the measurement results, which is defined by C AB = a,b abP BA (b, a). For the measurements described above, the correlation function between the two measurements is . This is independent of the geometric phase Φ.
The multiplication of the Kraus operators by an arbitrary unitaryÛ leads to new Kraus operatorsF ± = UÊ ± but produces the same modular measurement op-eratorQ. We explore in the following the "asymmetric" modular measurement implementationF ± (φ, α) = 1 2 (1 ± e iφD (α)) which corresponds toÛ =D(α/2). Furthermore we add flexibility to our measurement by controlling the relative phase φ between un-displaced and displaced components. The generalized observable is thenQ(φ, α) = cos(φ + 2Im(α)X − 2Re(α)P ). This is experimentally achieved using a third energy level in the ion (see SI). For this asymmetric implementation we find S = sin(Φ)|m α B | sin(Φ + φ B + arg (m α B )) and the correlation function is This implementation reintroduces the geometric phase to the correlator. A measurement of the correlation function using the asymmetric implementation as a function of α B is shown in figure 3 (a). The experimental parameters were α A = 2.1, φ A = 0, φ B = π/2 and the input state was the ground state |ψ in = |0 . The correlation function then reads C AB = −(e −|2.1−α B | 2 /2 + e −|2.1+α B | 2 /2 ) sin(Φ)/2 with the geometric phase Φ = 2.1Im(α B ). The pre-factor is non-zero for α B ≈ ±2.1, in this case wave-packets overlap in the post-measurement state of B leading to interference effects during the measurement. The sign change of the correlator across the real axis is solely due to the geometric phase Φ. The extreme values of C AB are reached as a compromise between the wave-packet overlap and the geometric phase. Correlation functions lie at the heart of many tests of the quantum nature of physical systems [15,21,22]. For systems measured at sequential times, the best known is the Leggett-Garg inequality, for which one form is given by where a time sequence of three measurements A, B, C is considered. The bound is derived under two assumptions, which are that the measurement results are of macroscopic quantities which are pre-determined in advance of the experiment, and that they are unchanged by the act of measurement [15]. Therefore to exclude macroscopic realism Non-Invasive Measurements (NIM) need to be used in the experiment, which is hard to ensure in practice.
A protocol for testing LGI using modular variable measurements has been proposed previously [7]. There, it was shown that in the absence of any claim regarding NIM, violation of the LGI can be used to differentiate between an oscillator described by a classical variable and a quantum mechanical oscillator [7]. The classical variable does not allow the observation of SIT. Thus both the observation of SIT or LGI violations can be used to confirm the presence of states showing quantum features. In previous work, revivals and oscillations of qubit excitation in single-time detections performed over a range of settings were taken as an indirect measure for the creation of quantum superposition states [20,23,24]. These singletime detection features can be produced by the coupling to an adequate classical field distribution (see example in SI), which is not the case for LGI or SIT based on sequential measurements.
To measure L for our oscillator, we measure two-time correlations between each pair of three modular measurements A, B, C while leaving out the third [7]. The modular displacement settings used for the measurements can be parametrized as α A = |α|e iθ A , α B = |α|e iθ B , α C = |α|e iθ C , with the respective angles θ A = ωt 1 , θ B = ωt 2 , θ C = ωt 3 arranged to meet the constraints of successive measurements at times t 1 , t 2 , t 3 . For a fixed α and an initial thermal state of the oscillator we numerically find values for θ A , θ B , θ C and the phases φ A , φ B and φ C which maximize the expected value of L, and use these for the experiments. L was measured for three thermal input states with average occupations n ≈ 0, n ≈ 0.23 and n ≈ 0.42. This allows testing the robustness of the protocol with respect to finite thermal occupations. Results are shown in figure 3 (b), showing L > 1 for displacements up to α = 3. We notice that L is sensitive to noise in the experimental implementation, because it involves measuring three extremal correlations. The dashed lines in figure 3 (b) show the expected violations for an ideal experiment and the solid lines show simulations using the level of motional and qubit dephasing which was observed in previous experiments performed in The points highlighted with a diamond violate the LGI when being penalized by the inbuilt theoretical amount of SIT. The discrepancy between the data and the simulation at n = 0.42 is due to additional experimental fluctuations in the preparation of this higher thermal occupation. All error bars are propagated from the SEM errors due to quantum projection noise.
the same apparatus [25]. Spin decoherence limits the violation at small α, and the sharp drop in violation above α = 2 is caused by motional dephasing. For any experiment in which SIT is observed, protocols can be designed for which L > 1 (see SI). NSIT was previously discussed as a means to experimentally test the NIM condition [12] and efforts have been undertaken to improve the LGI test by adding additional NSIT constraints and exploring their implications [26]. An alternative route is to penalize the value of L by accounting for SIT between the measurements [27]. The protocol we implement approaches NSIT for large displacements. If we penalize our measurement values using the theoreti-cal value of SIT expected for our settings, only the data points highlighted by diamonds in figure 3 (b) produce a LGI violation (see SI for further details). For fixed displacement, the performance of the LGI protocol could be improved in the future using squeezed input oscillator states. This leads to experimentally more robust measurements, larger ratio of separation and r.m.s. wavepacket size and thus less SIT between the measurements (see SI).
The measurement techniques demonstrated here provide new tools for examining the quantum-classical divide with harmonic oscillators and could be applied in a range of experimental systems [7]. Both the Leggett-Garg correlation method and SIT provide quantum signatures using few measurements, although we find experimentally that they require excellent frequency stability of the oscillator mode. Extensions to multiple oscillators would allow tests of local realism and noncontextuality with continuous variables [28]. Alongside these fundamental applications, the combination of squeezed states and modular variable measurements demonstrated here could be used to prepare approximate GKP error-correction code states [10,11]. Ideal code states would exhibit strong SIT giving S = 1. The control demonstrated here provides a toolbox for investigating these fault-tolerant schemes [9], opening up a new path to large-scale quantum computing with continuous variables.
We thank Thanh Long Nguyen for careful checking of the manuscript, and Peter Rabl, Renato Renner, Joseba Alonso and Maciej Malinowski for useful discussions. We acknowledge support from the Swiss National Science Author Contributions: Experimental data were taken and analyzed by CF, using an apparatus with significant contributions from VN, MM, CF. The paper was written by CF and JPH, with input from all authors. Ex-periments were conceived by CF and JPH. The authors declare that they have no competing financial interests.

Supplementary Information
We choose definitions of dimensionless position and momentum such that we have a simple connection to phase space:X = mω 2 x andP = 1 2mω p leads to α|X|α = Re(α), α|P |α = Im(α) and [X,P ] = i/2. This definition simplifies working with position, momentum and displacement operators simultaneously.

PULSE SEQUENCE REALIZING THE ASYMMETRIC IMPLEMENTATION
We implement the asymmetric modular measurements making use of three internal energy levels. Besides the levels |↓ , |↑ we additionally use a second level in the D 5/2 manifold |a ≡ D 5/2 , m j = −1/2 . The measurement is implemented with the sequence of operations (read right to left) . The Pauli matricesσ k are taken to act on the |a , |↓ basis for k = 1 and |↓ , |↑ basis for k = 2. Spin rotations are implemented using resonant pulses on the two transitions, while the state-dependent displacement uses a bi-chromatic laser field resonant with both the red and blue sideband of transition k = 2 [17]. If the pulse sequence is applied to an ion initially in the |↓ level then the first pulse puts half the population in the |a state. This part of the population is then not affected by the following block of operationŝ R 2 (0)D(α(t)σ x,2 )R 2 (π) which acts on transition 2. In this block the two rotations around the SDF pulse effectively rotate the state-dependence form σ x,2 to σ z,2 . This block therefore displaces the motion entangled with the population in |↓ . The finalR 1 (φ) pulse then creates the state −e −iφ |↓ ψ (+,φ) + |a ψ (−,φ) with ψ (±,φ) = (1 ± e iφ1D (α)) |ψ in . We note that in the asymmetric implementation the effective qubit is given by transition 1: |↓ , |a . The computational basis prior to fluorescence detection is swapped in this implementation by changing the last pulse phase R 1 (φ) to R 1 (φ + π) instead of adding an additional π-pulse.

TIME SCALES OF EXPERIMENTAL SEQUENCE
Cooling of the calcium ion is done by precooling (1000 µs), Doppler cooling (500 µs), Electromagnetically Induced Transparency cooling (400 µs) and finally resolved sideband cooling on the axial motional mode (250 µs) to a mean occupation of about n ≈ 0.05 quanta. π/2-pulses on transition 2 take roughly 1.5 µs while on transition 1 we need around 4 µs. Displacement operation take between 20 − 90 µs. Fluorescence detection takes 60 µs. We experimentally investigate the asymmetric implementationÛ2 = 1, the symmetric implementationÛ2 =D(−α/2) and free oscillator evolution The decision of the FPGA whether to continue with the experiment or to restart the sequence takes 50 µs.

CALIBRATION OF MODULAR MEASUREMENTS
We calibrate the SDF pulse and perform two additional laser phase calibrations. These together with automated calculations of phases due to Stark-shifts using the known pulse durations and timings allows us to run in-principle arbitrarily long sequences of modular measurements.

SDF pulse
The SDF pulse is calibrated by first roughly balancing blue-and red-sideband powers and applying it to an initial ground state cooled oscillator in the |↓ internal level for a time t SDF . The decrease of P (↓) probability is observed and iteratively we find better balanced laser powers and a Stark-shift of our transition by smoothing out the P (↓) signal at 0.5 probability for the timescales required in the experiment. From the calibrated SDF pulse we extract the proportionality factor between pulse time and displacement size by fitting the qubit decay to its expected form P (↓) = 1 2 (1 + e −2(ctSDF) 2 ) with c the floated proportionality constant. Typical values of c obtained from these fits are: c ≈ 0.035 − 0.028 µs −1 An example of this calibration is given in figure 5 (a).

laser-transition phase evolution
To realize the modular measurements in the asymmetric implementation we need the relative laser-transition phases as well as the oscillator time evolution to be phase-locked. The SDF pulse addresses transition 2 with a bi-chromatic pulse where the average of this two frequencies addresses transition 2 while the difference acts on the motional space:Ĥ SDF = η Ω 2 (σ + e −iφ + σ − e iφ )(âe i∆φ/2+iδt +â † e −i∆φ/2−iδt ) with the phases φ and ∆φ given by the average and difference of the blue and red sideband laser phases. The average frequency when addressing transition 2 with the SDF differs by the calibrated Stark-shift to the frequency used in a resonant carrier pulse. To account for this mismatch in phase evolution we match the phase of the first R 2 rotation to the SDF and calculate the phases of following R 2 (ϕ) pulses based on the calibrated Stark-shift and the timing of our sequence. The action of the calibrated block R 2 (0)D(α(t)σ x,2 )R 2 (π) on |↓ gives a constant probability P (↓) ≡ 1 independent of the displacement size. An example using this characteristic for calibration is given in figure 5 (b).

Superposition phase controlled by R1(φ) pulse
The phases of transition 1 pulses R 1 (φ) are solely calibrated on the expected physics. We note that after each modular measurement the qubit is detected and projected to |↑ . Therefore in contrast to the oscillator the laser-transition 1 and 2 phase is reset at the start of each modular measurement. Thus for two sequential measurements with the same duration of the SDF pulse the phase is identical. A single modular measurement with a general displacement α does not allow to calibrate φ. This is because for large enough displacements P (↓) ≡ 0.5 which is independent of φ. Instead we calibrate the phase φ by a correlation measurement with settings α A = −α B , varying φ A and φ B jointly and fitting to the theoretical expectation. An example is given in figure 5 (c).

COMPARISON OF THE TWO IMPLEMENTATIONS
The symmetric implementation besides its simpler pulse sequence has several further advantages: The transition |↓ , |↑ has ≈ 6 times more laser power available and half the magnetic field sensitivity compared to qubit used in the asymmetric implementation |↓ , |a . Therefore whenever possible we use the symmetric implementation. Both implementations can be represented in the circuit model by the circuit given in figure 4.

QUBIT READOUT
In a temporal sequence of measurements the last measurement is performed as a long fluorescence detection with a typical readout time of 200 µs. All the preceding measurements are performed with a shorter fluorescence time of 60 µs having a detection error of short ≈ 4 · 10 −3 and giving an average of roughly 10 counts for a bright detection result. Our imaging system collects 4.4% of the emitted photons and the PMT quantum efficiency is roughly 26.5%. This amounts in an average scattering of 1000 photons from the ion for this shorter detection.

NSIT, OBSERVABLES, KRAUS OPERATORS AND COMMUTATORS
If the order of measurements A, B does not matter then for projective measurements their respective observables commute. For the generalized measurements considered in this work this no longer holds which we can see by the following argument. Still there exists a general relation between Kraus operators and NSIT: [Ê A a ,Ê †B bÊ B b ] = 0 ⇒ NSIT. This relation is derived here: Asym : Therefore if the commutator of the observables vanishes with an odd k 3 number then Im(α B α * A ) = πk odd = 2πk 1 , thus the symmetric implementation is SIT. This is a general case for which the observables commute but the sequential measurements are SIT. In figure 9 additional data for SIT and NSIT experimental sequences are shown. In particular one can compare the two different implementations and see that NSIT does not imply commutation of the observables.

THEORETICAL WIGNER FUNCTION PLOTS OF EXPERIMENTALLY CREATED STATES
In the main text figure 2 (c) we plotted the Wigner functions of the states created during our measurement of NSIT for modular position and momentum for one example of input state. The chosen state was a superposition of a ground state cooled oscillator but the same experiment was also performed with either an oscillator in a squeezed state or in the first excited state. In figure  12 the equivalent plot as in the main text with the same orientation of initial superposition but now based on a (a) first excited or (b) a squeezed state are shown.

CORRELATOR FULL DATA SET
The full measurement data of the correlation measurements presented in figure 3 (a) of the main text are shown in figure 10. Besides the measured correlators also the probabilities measured in the first measurement A and the second measurement B are shown.

LEGGETT-GARG VIOLATION MEASUREMENT SETTINGS
In order to find the measurement settings with which we violate the LGI we calculate the analytic expression for the value of L depending on the initial ion temperature and the displacement size α as well as the measurement settings A: (θ 1 , φ A ), B: (θ 2 , φ B ) C: (θ 3 , φ C ). For each temperature and displacement α we maximize the found analytic expression over θ 1 , θ 2 , θ 3 and φ A , φ B , φ C using Mathematica. To do so we first find a local maximum for a small displacement α = 0.2, then we use the settings found from this analysis as an initial guess for the maximization for a slightly larger displacement α = 0.25 like this we find successively the settings for larger displacements. In figure 11 some raw data of L violations measurements together with the used experimental settings are shown.
The temperature of the oscillator is calibrated by shortening the cooling sequence used and subsequently reading out the Fock state populations of the oscillator fitting them to a thermal state of the oscillator. Before each Leggett-Garg experiment the phase φ is calibrated for the displacement size and temperature in the manner described before. Based on this single calibration the three correlations are measured.

EFFECT OF NOISE ON LEGGETT-GARG INEQUALITY VIOLATIONS
The motional dephasing is accounted for by solving the Lindblad master equation during the state-dependentforce pulses with a dephasing operator √ 30(ââ † +â †â ) with 30 dephasing jumps/s. The line-with of the transition 1 is known from Ramsey measurements to be l ≈ 665 Hz FWHM and varies on timescales longer than an experimental shot thus we include it by averaging over 4000 randomly chosen phases φ from a normal distribution with σ = lπt SDF √ 2 ln(2) + 0.087 where the last term accounts for phase calibration errors.

PENALIZED LGI
The paper by Kujala et al. [27] considers cyclic contextuality inequalities. Some LGIs, for example C AB + C BC + C CA < 1, are special cases of these cyclic contextuality inequalities. The paper addresses the problem that even if an experimenter intends to perform compatible measurements due to experimental fluctuations and imprecisions, there will still be a certain amount of SIT between the sequential measurements performed. The work derives penalized contextuality bounds to account for these imprecisions. The derived penalization is expressed in the notation of this work T S = 2(| S AB | + | S BC | + | S CA |) and can be interpreted as a total amount of SIT observed. They consider cyclic measurements, thus each measurement is performed once as the first measurement in the sequence and once as a second measurement. This allows the penalization to be extracted directly from the contextuality bound measurements.
In contrast, the inequality we considered in this work is not cyclic C AB + C BC − C AC < 1. Only B is once performed as a first measurement and another time as a second measurement. From this we extract S AB . Performing an additional measurement of C directly on the input state would allow to extract | S BC | and | S AC | and then to calculated a penalized L value: L pen. = L − 2(| S AB | + | S BC | + | S AC |) = L − T S.
In this penalization we assumed that there is no backward SIT. This means that if we perform first a measurement A then B that P A (a) = P (B)A (a) ≡ b P BA (b, a), which in a real experiment again will only be approximately given. The penalization for the cyclic inequalities also contain this type of fluctuation to some extent. Further, there might be subtleties which we miss at this stage.
Our LGI protocol is based on performing incompatible measurements thus we expect SIT between the measurements. Analytic calculation of the amount of inbuilt SIT in our protocol, see figure 6 (a), shows that this is indeed the case for displacements of around α = 1. But the amount of SIT approaches zero for the larger displacements. From this we conclude that for large displacements the ideal protocol approaches L=1.5 with NSIT measurements at the two-time level. If we subtract the theoretical amount of inbuilt SIT from our data, see figure 6 (b), then at our experimentally achieved size of displacements some points violate the LGI in this penalized fashion. These are the points highlighted with diamonds in the main part of the paper. Further, we can get a feeling for how close our experiment resembles the theoretical amount of inbuilt SIT, by extracting | S AB | from our experimental data, see figure 6 (c). The theoretical expectation for | S AB | is around zero and never exceeds 0.02. The amount of SIT we measure is close to zero but slightly higher than this theoretical expectation. The higher amount of SIT is expected given the accuracy with which we can calibrate and perform our experiments. A number of methods have been proposed for performing a LGI test using NSIT measurements, see for example [12] where the key is to use mixed input states. In the work [26] a LGI test using two time NSIT measurements is called a test of an intermediate form of MR.
LGI AND SIT AS EFFICIENT QUANTUM WITNESSES This work shows the violation of an LGI using a mechanical oscillator, a system which allows to explore the quantum to classical transition in a natural way. Further, we explore SIT as an alternative quantum witness. Both require few measurements for the confirmation of the quantum states: LGI needs 12 fluorescence detections while SIT needs 6. This is much less than we typically require to extract a negative Wigner function point. For the latter we extract the Fock state populations of the oscillator from a sideband flopping curve which requires around 200 fluorescence detections [19]. We find that that the LGI methods require excellent frequency stability of the mechanical oscillator under test. The SIT quantum witness has the advantage of involving only measurements at two times. But SIT has the need of m α B to be non zero, which requires more involved oscillator input states.

RAMSEY ANALOGY AND ADVANTAGE OF SEQUENTIAL MEASUREMENTS
The modular measurements presented can be viewed as Ramsey measurements coupling to a quantum field which is given by the oscillator phase space. Thus the best semi-classical comparison is given by a Ramsey measurement coupling to a classical variable x(t): H ∝ |↑ ↑|x(t) ∝ |↑ ↑|(âe i∆φ/2 +â † e −i∆φ/2 ). An extensive discussion of this comparison can be found in the supplemental material of [7].
In previous experiments with superposition states, single detection results were used to confirm the creation of superposition states [20,23,24]. Such single time detection results could in principle emerge from the coupling to a classical variable x(t). In particular if x(t) contains dominant frequency components a variety of os-cillations and revivals in the qubit probabilities can be observed. As illustration we consider a simple example: x(t) = A cos(2πf t) is given by a single frequency component f with a fluctuating amplitude A. The amplitude fluctuates on slow time scales compared to a single experimental shot and its probability distribution is given by the Gaussian , and the experiment is synchronized with respect to the noise frequency (an example of such a noise source would be noise due to the mains lines measured by a line triggered experiment). For such a periodic noise source we find Q = P (+1) − where T is given by the Ramsey interaction time and φ is the phase of the second Ramsey pulse.
Q is plotted in figure 8, where we can see that it exhibits very similar oscillations to those observed in experiments like [23]. Single measurements thus have a hard time proving that the experiments actually create Schrödinger cat like superpositions. Nature could be malicious and one could always just couple to a classical variable x(t) giving rise to the observed oscillations and revivals.
The distinction between the coupling to a classical field or a quantum field is easier when considering sequential measurements. In the quantum case the first measurement creates a superposition state of the quantum field which can change the statistics of the second measurement (SIT). In the classical case the variable x(t) is not changed by the first measurement and SIT will not be observed between two measurements.

SIT MEASUREMENTS VIOLATING A LEGGETT-GARG INEQUALITY
Here we give an explicit procedure how to violate the Leggett-Garg inequality L = C AB +C BC −C AC ≤ 1 having observed SIT between two modular measurements on an input state. This procedure is equivalent to the one used and discussed in [29] and is briefly commented on in [14]. We consider two measurements B, C which we read out by coupling them to an ancilla qubit. Thus the measurement of the qubit has two possible outcomes, Up and Down, which we label U and D. The only assumption we make about the measurements B and C is that B is SIT to C when the input state |ψ is measured. This means P C (c) = b P CB (c, b) = P C(B) (c). Thus one of the two probabilities needs to be bigger than the other. Without loss of generality we choose P C (D) < P C(B) (D) and we define a ≡ P C(B) (D) − P C (D) to be the difference between the two. (In the case of P C (U) > P C(B) (U) we can modify the protocol slightly). Measurement A is simply the state preparation or confirmation of the state preparation of |ψ . The key point of the protocol is to assign different measurement results to the outcomes U, D in each of the measurements A, B, C. The assigned results are always r = ±1 which is compatible with the assumption |r| ≤ 1 used in the proof of the LGI [14]. To be specific the three measurements violating the LGI are given by: Note that the assignment of a constant value for measurement B can be interpreted as performing the measurement but not looking at the result. We can now calculate the violation of the LGI. C AB = 1 since measurement A always gives an Up result and in measurement B we assigned the constant value of +1. The correlator C AC = c f C (c)P C (c) simplifies to be the expectation value of measurement C since measurement A is only confirming the state preparation.
simplifies since we assigned in measurement B the constant value of +1 Thus: We can also see that in the case of P C (D) > P C(B) (D) we can change the assignment of results in measurement C to f C (U) = 1, f C (D) = −1.

GKP STATE ALLOWING S=1
This can be seen in various ways lets consider the formula for S in the symmetric implementation: S = 1 2 (1 − cos(Φ)) |m α B | cos(arg(m α B )). S=1 requires Φ = π and m α B = 1. This is fulfilled if we choose a GKP input state with periodicity α B ∈ R:

POTENTIAL IMPROVEMENT OF LGI VIOLATION USING SQUEEZED OSCILLATOR INPUT STATES
We maximize the L value for squeezed initial oscillator statesŜ(ξ) |0 withŜ(ξ) = e (ξ * â2 −ξâ † 2 )/2 , ξ = re iφ the squeezing operator and parameter. Comparing a squeezed state with r ≈ 0.9 to a ground state we find that with the same displacement size the squeezed state allows higher violation see figure 7 (a). The simulation of realistic dephasing noise, figure 7 (b) shows that this advantage is still present in a realistic scenario. Further the SIT inbuilt in the measurements drops much quicker for the squeezed state. Analytic calculations of the inbuilt SIT are shown in figure 7 (c). Also the created states for a fixed |α| are in some sense more macroscopic since the ratio of separation to relevant wave-packet extend (approximately the squeezed axis for larger α) is larger. For r = 0.9 the ratio is improved by a factor of ≈ 2.5.

DATA AVAILABILITY
The data that support the plots within this paper and other findings of this study are available from the corresponding authors on request. * christaf@phys.ethz.ch † jhome@phys.ethz.ch Calibrations: (a) shows a calibrated SDF pulse applied to a ground state cooled ion and a fit to the expected behavior P (↓) = 1 2 (1+e −2(ct SDF ) 2 ). From this fit we extract the proportionality constant c between displacement size and tSDF which we use in all analytic calculations of expected measurement results. (b) shows the phase matching between addressing transition 2 with single frequency or with a bi-chromatic pulse. The sequence consist out of a single π/2-pulse followed by an SDF pulse here with tSDF = 200 µs. Whenever the π/2-pulse phase ϕ is matched to the SDF no superposition will be created instead the full wave-packet gets displaced and therefore the P (↓) ≡ 1 for any SDF duration. Finally we need to calibrate the phase of the R1(φ) pulse using an experimental calibration shown in (c). We use a sequence of two modular measurements with the same duration and opposite SDF directions in order to be able to observe a signal. We sweep both phases φA and φB simultaneously and readout the relevant minimum.    figure 3 (b) of the main text. The data is from the set n ≈ 0 and n ≈ 0.23. Data is shown as red points while the expectations for an ideal experiment are shown as bars. Blue bars are the detection data and the three red bars show the correlations calculated from these detections. We see qualitatively good agreement for smaller α which decreases for higher displacements, which is mainly due to dephasing noise in the experimental system. The settings θ1 and θ2 correspond to θ1 = θB − θA, θ2 = θC − θB.