Introduction

In nature, closed quantum systems exist only as a convenient approximation. When systems are subjected to perturbations or have strong interactions with their environment, open models yield a more reliable description. A complete statistical characterization of an open quantum system unavoidably involves knowledge on the expectation value of multi-time correlations of observables, which are related to measurable quantities1. Time-correlation functions are at the core of optical coherence theory2, and can also be used for the quantum simulation of Lindbladian dynamics3. A plethora of physical magnitudes, such as susceptibilities and transport coefficients, can be microscopically derived in terms of time correlation functions4,5. In a statistical approach4, linear response functions represent a powerful tool to compute the susceptibility of an observable to a perturbation on the system. Such functions are constructed in terms of time-correlation functions of unperturbed observables.

Despite the ubiquity of time correlations in physics, their measurement on a quantum mechanical system is not straightforward. This difficulty lies in the fact that in quantum mechanics the measurement process disturbs the system, leaving it unreliable for a later correlated observation. Statistical descriptions typically involve an averaging of the time-correlation functions over an ensemble of particles. In such a case, it is possible to measure operator \(A\) at time \({t}_{1}\) over a reduced number of particles of the ensemble, and operator \(B\) at time \({t}_{2}\) over particles that were not perturbed by the first measurement. However, it is not always possible to perform measurements discriminating a subset of particles out of an ensemble. Moreover, nowadays, single quantum systems offer a high degree of controllability, which legitimates the interest in measuring time-correlation functions on single quantum systems. A solution to this puzzle can be found in algorithms for quantum computation. It is known that introducing an ancillary two-level system and performing a reduced set of controlled operations, time-correlation functions of a system can be reconstructed from single-time observables of the ancilla6,7,8. In this article, we measure \(n\)-time correlation functions for pure states, up to \(n=10\), in a highly-controllable quantum platform as is the case of nuclear magnetic resonance (NMR). Moreover, we frame these correlation functions in the context of linear response theory to compute physical magnitudes including the susceptibility of the system to perturbations. Finally, the scalability of the approach is shown to be efficient for multi-time correlation functions.

The measurement of \(n\)-time correlation functions plays a significant role in the linear response theory. For instance, we can microscopically derive useful quantities such as the conductivity and the susceptibility of a system, with the knowledge of 2-time correlation functions. As an illustrative example, we study the case of a spin-\(\mathrm{1/2}\) particle in a uniform magnetic field of strength \(B\) along the z-axis, which has a natural Hamiltonian \({ {\mathcal H} }_{{\rm{0}}}=-\gamma B{\sigma }_{z}\), where \(\gamma \) is the gyromagnetic ratio of the particle. We assume now that a magnetic field with a sinusoidal time dependence \({B}_{0}^{^{\prime} }{e}^{-i\omega t}\) and arbitrary direction \(\alpha \) perturbs the system. The Hamiltonian representation of such a situation is given by \( {\mathcal H} ={ {\mathcal H} }_{{\rm{0}}}-\gamma {B}_{0}^{^{\prime} }{\sigma }_{\alpha }{e}^{-i\omega t}\), with \(\alpha =x,y,z\). The magnetic susceptibility of the system is the deviation of the magnetic moment from its thermal expectation value as a consequence of such a perturbation. For instance, the corrected expression for the magnetic moment in direction \(\beta \,({\mu }_{\beta }=\gamma {\sigma }_{\beta })\) is given by \({\mu }_{\beta }(t)={\mu }_{\beta }\mathrm{(0)}+{\chi }_{\alpha ,\beta }^{\omega }{e}^{-i\omega t}\), where \({\chi }_{\alpha ,\beta }^{\omega }\) is the frequency-dependent susceptibility. From linear response theory, we learn that the susceptibility can be retrieved integrating the linear response function as \({\chi }_{\alpha ,\beta }^{\omega }={\int }_{-\infty }^{t}{\phi }_{\alpha ,\beta }(t-s){e}^{-i\omega (t-s)}ds\). Moreover, the latter can be given in terms of time-correlation functions of the measured and perturbed observables, \({{\varphi }}_{\alpha ,\beta }(t)=\langle [\gamma {B}_{0}^{^{\prime} }{\sigma }_{\alpha },\gamma {\sigma }_{\beta }(t)]\rangle /(i\hslash )\), where \({\sigma }_{\beta }(t)={e}^{i/\hslash {H}_{0}t}{\sigma }_{\beta }{e}^{-i/\hslash {H}_{0}t}\), and the averaging is made over a thermal equilibrium ensemble. Notice that for a two level system, the thermal average can easily be reconstructed from the expectation values of the ground and excited states. So far, the response function can be retrieved by measuring the 2-time correlation functions of the unperturbed system \(\langle {\sigma }_{\alpha }{\sigma }_{\beta }(t)\rangle \) and \(\langle {\sigma }_{\beta }(t){\sigma }_{\alpha }\rangle \). It is noteworthy to mention that when \(\alpha =\beta \), \({\langle {\sigma }_{\alpha }(t){\sigma }_{\alpha }\rangle }^{\ast }=\langle {\sigma }_{\alpha }{\sigma }_{\alpha }(t)\rangle \), and it is enough to measure one of them. All in all, measuring two-time correlation functions from an ensemble of two level systems is not merely a computational result, but an actual measurement of the susceptibility of the system to arbitrary perturbations. Therefore, it gives us insights about the behavior of the system, and helps us characterize it. In a similar fashion, further corrections to the expectation values of the observables of the system will be given in terms of higher-order correlation functions. In this experiment, we will not only measure two-time correlation functions that will allow us to extract the susceptibility of the system, but we will also show that higher-order correlation functions can be obtained.

Results

Theoretical protocol

We will follow the algorithm introduced in ref.7 to extract \(n\)-time correlation functions of the form \(f({t}_{1},\,\mathrm{...,}\,{t}_{n-1})=\langle {\varphi }|{\sigma }_{\gamma }({t}_{n-1}\mathrm{)...}{\sigma }_{\beta }({t}_{1}){\sigma }_{\alpha }\mathrm{(0)|}{\varphi }\rangle \) from a two-level quantum system, with the assistance of one ancillary qubit. Here, \(|{\varphi }\rangle \) is the quantum state of the two-level quantum system and \({\sigma }_{\alpha }(t)\) is a time-dependent Pauli operator in the Heisenberg picture, defined as \({\sigma }_{\alpha }(t)={U}^{\dagger }(t;\,\mathrm{0)}{\sigma }_{\alpha }U(t;\,\mathrm{0)}\), where \(\alpha =x,y,z\), and \(U({t}_{j};{t}_{i})\) is the evolution operator from time \({t}_{i}\) to \({t}_{j}\). The considered algorithm of ref.7 is depicted in Fig. 1, for the case where nuclear spins of 13C and 1H respectively encode the ancillary qubit and the two-level quantum system, and consists of the following steps:

Figure 1
figure 1

Two-qubit quantum circuit for measuring general \(n\)-time correlation functions. The first line is the ancilla (held by the nuclear spin of 13C), and second line is the system qubit (held by the nuclear spin of 1H). The blue zone between the different controlled gates \({U}_{\alpha }^{k}\) on the line of qubit A represents the decoupling of the 13C nucleus from the nuclear spin of 1H, while the latter evolves according to \(U({t}_{k+1};{t}_{k})\). The measurement of the quantities \(\langle {\sigma }_{x}\rangle \) and \(\langle {\sigma }_{y}\rangle \) of the ancillary qubit at the end of the circuit will directly provide the real and imaginary values of the \(n\)-time correlation function for the initial state \({\rho }_{{\rm{in}}}=|\phi \rangle \langle \phi |\).

\((i)\) The input state of the probe-system qubits is prepared in \({\rho }_{{\rm{in}}}^{{\rm{CH}}}=|+\rangle \langle +|\otimes {\rho }_{{\rm{in}}}\), with \(|+\rangle =\mathrm{(|0}\rangle +\mathrm{|1}\rangle )/\sqrt{2}\) and \({\rho }_{{\rm{in}}}=|{\varphi }\rangle \langle {\varphi }|\).

\((ii)\) The controlled quantum gate \({U}_{\alpha }^{k}=\mathrm{|1}\rangle \langle \mathrm{1|}\otimes {S}_{\alpha }+\mathrm{|0}\rangle \langle \mathrm{0|}\otimes {{\mathbb{I}}}_{2}\) is firstly applied on the two qubits, with \({S}_{x}={\sigma }_{x}\), \({S}_{y}=-i{\sigma }_{y}\) and \({S}_{z}=i{\sigma }_{z}\). \({{\mathbb{I}}}_{2}\) is a \(2\times 2\) identity matrix.

\((iii)\) It follows a unitary evolution of the system qubit from \({t}_{k}\) to time \({t}_{k+1}\), \(U({t}_{k+1};\,{t}_{k})\), which needs not be known to the experimenter. In our setup, we engineer this dynamics by decoupling qubit 13C and 1H, such that only the system qubit evolves under its free-energy Hamiltonian. If we were to measure the time-correlation functions for the system following a different dynamics, the corresponding Hamiltonian should be imposed on the system at this stage of the protocol, while the system and the ancilla qubits are decoupled. Then, steps \((ii)\) and \((iii)\) will be iterated \(n\) times, taking \(k\) from \(0\) to \(n-1\) and avoiding step \((iii)\) in the last iteration. With this, all \(n\) Pauli operators will be interspersed between evolution operators with the time intervals of interest \(\{{t}_{k},{t}_{k+1}\}\).

\((iv)\) The final state of the probe-system qubits can be written as

$$\begin{array}{c}|{\phi }_{{\rm{out}}}\rangle =\frac{1}{\sqrt{2}}\mathrm{(|0}\rangle \otimes U({t}_{n-1};\,\mathrm{0)|}{\varphi }\rangle +\mathrm{|1}\rangle \otimes {S}_{\gamma }U({t}_{n-1};\,{t}_{n-2})\\ \,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,U({t}_{2};\,{t}_{1}){S}_{\beta }U({t}_{1};\,\mathrm{0)}{S}_{\alpha }|{\varphi }\rangle \mathrm{).}\end{array}$$
(1)

The time correlation function is then extracted as a non-diagonal operator of the ancilla, Tr(\(\mathrm{|0}\rangle \langle \mathrm{1|}{\phi }_{{\rm{out}}}\rangle \langle {\phi }_{{\rm{out}}}|\)). We further recall here that \(\mathrm{|0}\rangle \langle \mathrm{1|}=({\sigma }_{x}+i{\sigma }_{y}\mathrm{)/2}\), such that its measurement corresponds to

$$f({t}_{1},\,\mathrm{...,}\,{t}_{n-1})={i}^{r}{(-i)}^{l}(\langle {\sigma }_{x}\rangle +i\langle {\sigma }_{y}\rangle ),$$
(2)

which is in general a complex magnitude, and where integers \(r\) and \(l\) are the occurrence numbers of Pauli operators \({\sigma }_{y}\) and \({\sigma }_{z}\) in \(f({t}_{1},\,\mathrm{...,}\,{t}_{n-1})\). Notice that even if between the controlled operations the system can undergo dynamics that are unknown to the experimenter, the system still needs to be controllable in order for us to be able to perform the controlled-operations.

Experimental procedures and results

We will measure \(n\)-time correlation functions of a two-level quantum system with the assistance of one ancillary qubit by implementing the quantum circuit shown in Fig. 1. Experiments are carried out using NMR9,10,11, where the sample used is 13C-labeled chloroform. Nuclear spins of 13C and 1H encode the ancillary qubit and the two-level quantum system, respectively. With the weak coupling approximation, the internal Hamiltonian of 13C-labeled chloroform is

$${ {\mathcal H} }_{{\rm{int}}}=-\pi ({\nu }_{1}-{\nu }_{1}^{0}){\sigma }_{z}^{1}-\pi ({\nu }_{2}-{\nu }_{2}^{0}){\sigma }_{z}^{2}+0.5\pi {J}_{12}{\sigma }_{z}^{1}{\sigma }_{z}^{2},$$
(3)

where \({\nu }_{j}\) (\(j=\mathrm{1,}\,2\)) is the chemical shift, and \({{\rm{J}}}_{12}\) is the \(J\)-coupling strength as illustrated in the methods, while \({\nu }_{1}^{0}\) and \({\nu }_{2}^{0}\) are reference frequencies of 13C and 1H, respectively. We set \({\nu }_{1}={\nu }_{1}^{0}\) and \({\nu }_{2}-{\nu }_{2}^{0}={\rm{\Delta }}\nu \) such that the natural Hamiltonian of the system qubit is \({ {\mathcal H} }_{0}=-\pi {\rm{\Delta }}\nu {\sigma }_{z}\). The detuning frequency \({\rm{\Delta }}\nu \) is chosen as hundreds of Hz to assure the selective excitation of different nuclei via hard pulses. All experiments are carried out on a Bruker AVANCE 400 MHz spectrometer at room temperature.

The spatial averaging technique can be used to transform the system into the so-called pseudo-pure state (PPS) \(\mathrm{|00}\rangle \langle \mathrm{00|}\) from the thermal equilibrium state of an NMR ensemble, which is a highly-mixed state12,13,14. In Step \((ii)\), all controlled quantum gates \({U}_{\alpha }^{k}\) are chosen from the set of gates \(\{C-{R}_{z}^{2}(-\pi ),C-i{R}_{x}^{2}(\pi ),C-{R}_{y}^{2}(\pi )\}\) 15,16,17. The notation \(C-U\) means operator \(U\) will be applied on the system qubit only if the ancilla qubit is in state \(\mathrm{|1}\rangle \langle \mathrm{1|}\), while \({R}_{\hat{n}}^{j}(\theta )\) represents a single-qubit rotation on qubit \(j\) along the \(\hat{n}\)-axis, with the rotation angle \(\theta \). The corresponding pulse sequence can be found in the methods.

We will now apply the described algorithm to a collection of situations of physical interest. These include two-time correlation functions of a system evolving under time-independent and time-dependent Hamiltonians, as well as three-time correlation functions. In Fig. 2 we give the detailed NMR sequences employed for the measurement of the time-correlation functions in each of these cases. More especifically, Fig. 2(a) shows the experimental sequence for measuring \(\langle {\sigma }_{y}(t){\sigma }_{x}\rangle \). Other time-correlation functions, like \(\langle {\sigma }_{x}(t){\sigma }_{y}\rangle \), \(\langle {\sigma }_{y}(t){\sigma }_{y}\rangle \) or \(\langle {\sigma }_{x}(t){\sigma }_{z}\rangle \), can be measured in a similar fashion by replacing the corresponding controlled quantum gates. Figure 2(b) describes the NMR sequence for measuring the three-time correlation function \(\langle {\sigma }_{y}({t}_{2}){\sigma }_{y}({t}_{1}){\sigma }_{z}\rangle \) for different values of \({t}_{1}\) and \({t}_{2}\). Here we used a pair of \(\pi \) pulses, which change the sign of the Hamiltonian \({H}_{0}\), if \({t}_{1}\) is greater than \({t}_{2}\). Finally, Fig. 3(c) illustrates the NMR sequence corresponding to the measurement of the time-correlation function \(\langle {\sigma }_{x}(t){\sigma }_{x}\rangle \) with a time-dependent Hamiltonian of the form \( {\mathcal H} ^{\prime} (t)=500{e}^{-300t}{\rm{\pi }}{\sigma }_{y}\). The dynamics corresponding to this Hamiltonian are generated by a time-dependent radio-frequency pulse applied on the resonance of the nuclear spin of 1H, that is to say on the system qubit.

Figure 2
figure 2

NMR sequence to realize the quantum algorithm for measuring \(n\)-time correlation functions. The black line and blue line mean the ancillary qubit (marked by 13C) and the system qubit (marked by 1H). All the controlled quantum gates \({U}_{\alpha }^{k}\) are decomposed into the following sequence in the bottom of the plot. Gz means a \(z\)-gradient pulse which is used to cancel the polarization in \(x-y\) plane. (a) NMR sequence for measuring the 2-time correlation function \(\langle {\sigma }_{y}(t){\sigma }_{x}\rangle \). Other 2-time correlation functions can be similarly measured. (b) NMR sequence for measuring the 3-time correlation function \(\langle {\sigma }_{y}({t}_{2}){\sigma }_{y}({t}_{1}){\sigma }_{z}\rangle \). (c) NMR sequence for measuring the 2-time correlation function \(\langle {\sigma }_{x}(t){\sigma }_{x}\rangle \) with a time-dependent Hamiltonian \( {\mathcal H} ^{\prime} (t)=500{e}^{-300t}\pi {\sigma }_{y}\). The method to decouple the interaction between 13C and 1H nuclei is Waltz-4 sequence.

Figure 3
figure 3

Experimental results (dots) for 2-time correlation functions. In this case, only two controlled quantum gates \({U}_{\alpha }^{0}\) and \({U}_{\beta }^{1}\) are applied with an interval of \(t\). For example, \({U}_{\alpha }^{0}\) and \({U}_{\beta }^{1}\) should be chosen as \(C-i{R}_{x}^{2}(\pi )\) and \(C-{R}_{y}^{2}(\pi )\), respectively, to measure the 2-time correlation function \(\langle {\sigma }_{y}(t){\sigma }_{x}\rangle \). t is swept from 0.5 ms to 10 ms with a 0.5 ms increment. The input state of 1H nuclei \({\rho }_{{\rm{in}}}=|\phi \rangle \langle \phi |\) is shown on each diagram. All experimental results are directly obtained from measurements of the expectation values of \(\langle {\sigma }_{x}\rangle \) and \(\langle {\sigma }_{y}\rangle \) of the ancillary qubit. The orange and blue results respectively mean the real and imagine part of the observed 2-time correlation functions.

In Fig. 3, we show the measured two-time correlation functions \(\langle {\sigma }_{\alpha }(t){\sigma }_{\beta }\mathrm{(0)}\rangle \) for a collection of \(\alpha \) and \(\beta \), and different initial states. In this experiment the two-level system was evolving under the Hamiltonian \({ {\mathcal H} }_{0}=-100{\rm{\pi }}{\sigma }_{z}\). The observed oscillations correspond to the rotation of the two-level system along the z-axis of its Bloch sphere, as dictated by the evolution Hamiltonian. Consistently, the bottom plot of Fig. 3(d) shows no oscillations, as the time-dependent operator in this case is \({\sigma }_{z}(t)\), which is aligned with the oscillation axis. The plotted times correspond to the time-scales of the implemented dynamics. The chosen millisecond time-range is especially convenient, as the decoherence effects become significant only at longer times. In the experiment, \({ {\mathcal H} }_{0}\) is realized by setting \({\nu }_{1}={\nu }_{1}^{0}\) and \({\nu }_{2}-{\nu }_{2}^{0}=100\) Hz in Eq. (3). A rotation pulse \({R}_{y}^{1}(\pi \mathrm{/2)}\) is applied on the first qubit after the PPS preparation to create \({\rho }_{{\rm{in}}}^{{\rm{CH}}}=|+\rangle \langle +|\otimes \mathrm{|0}\rangle \langle \mathrm{0|}\). Similarly, a \({\rm{\pi }}\) rotation on the second qubit is additionally needed to prepare \({\rho }_{{\rm{in}}}^{{\rm{CH}}}=|+\rangle \langle +|\otimes \mathrm{|1}\rangle \langle \mathrm{1|}\) as the input state of the ancilla-system compound, or alternatively a \({R}_{y}^{2}({\rm{\pi }}\mathrm{/2)}\) rotation to generate the initial state \({\rho }_{{\rm{in}}}^{{\rm{CH}}}=|+\rangle \langle +|\otimes |+\rangle \langle +|\).

These correlation functions are enough to retrieve the response function for a number of physical situations corresponding to different magnetic moments and applied fields. On the other hand, extracting correlation functions for initial states \(\mathrm{|0}\rangle \) and \(\mathrm{|1}\rangle \) will allow us to reconstruct such correlation functions for a thermal state of arbitrary temperature.

In Fig. 4, we show the measured time-correlation function \(\langle {\sigma }_{x}(t){\sigma }_{x}\rangle \) for the initial state \(\mathrm{(|0}\rangle -i\mathrm{|1}\rangle )/\sqrt{2}\) evolving under the time dependent Hamiltonian \( {\mathcal H} ^{\prime} (t)=500{e}^{-300t}{\rm{\pi }}{\sigma }_{y}\). For this, we set \({\nu }_{1}={\nu }_{1}^{0}\) and \({\nu }_{2}={\nu }_{2}^{0}\) in Hamiltonian \({ {\mathcal H} }_{int}\) in Eq. (3), making the system free Hamiltonian \({ {\mathcal H} }_{0}=0\). The initial state \(|{\varphi }\rangle ={R}_{x}({\rm{\pi }}\mathrm{/2)|0}\rangle \) can be prepared by using a rotation pulse \({R}_{x}({\rm{\pi }}\mathrm{/2)}\) on the initial PPS. Two controlled quantum gates \({U}_{x}^{0}=C-i{R}_{x}^{2}({\rm{\pi }})\) and \({U}_{x}^{1}=C-i{R}_{x}^{2}({\rm{\pi }})\) are applied with a time interval \(t\). A decoupling sequence Waltz-418,19,20 is used to cancel the interaction between the 13C and 1H nuclei during the evolution between the controlled operations. During the decoupling period, a time-dependent radio-frequency pulse is applied on the resonance of the system qubit 1H to create the Hamiltonian, as explained above. From a physical point of view, this kind of correlations would be descriptive of a situation where the system is in a magnetic field with an intensity that is decaying exponentially in time, that is, the unperturbed system Hamiltonian turns now into a time-dependent \( {\mathcal H} =\gamma {B}_{0}{e}^{-at}{\sigma }_{y}\). A degradation in agreement between experiment and theory is observed at the upper end of times in Fig. 4. This is due to the cumulative effects of decoherence mechanisms and the power attenuation of the employed radio-frequency pulses at long times, which results in a weak NMR response of the nuclei and as a consequence in more imprecise spectroscopic results.

Figure 4
figure 4

Experimental results (dots) for a 2-time correlation function of the 1H nuclei evolving under a time-dependent Hamiltonian. For this experiment, the 1H nuclei have a natural Hamiltonian \({ {\mathcal H} }_{0}=0\) and an initial state \(|{\varphi }\rangle ={R}_{x}(\pi \mathrm{/2)|0}\rangle \). An evolution \(U(t\mathrm{;0)}\) between \({U}_{x}^{0}\) and \({U}_{x}^{1}\) is applied on the system, which is described by the evolution operator \({e}^{-i{\int }_{0}^{t} {\mathcal H} ^{\prime} (s)ds}\) with \( {\mathcal H} ^{\prime} (s\mathrm{)=500}{e}^{-300s}\pi {\sigma }_{y}\). \(t\) is changed from \(0.48\) ms to \(5.76\) ms with a \(0.48\) ms increment per step.

Third and higher-order time correlations

When the perturbation is not weak enough, for instance when the radiation field applied to a material is of high intensity, the response of the system might not be linear. In such situations, higher-order response functions, which depend in higher-order time-correlation functions, will be needed to account for the non-linear corrections4,21. For example, the second order correction to an observable \(B\) when the system suffers a perturbation of the type \(H(t)={H}_{0}+AF(t)\) would be given by

$${\rm{\Delta }}{B}^{\mathrm{(2)}}={\int }_{-\infty }^{t}{\int }_{-\infty }^{{t}_{1}}\langle [B(t),[A({t}_{1}),A({t}_{2})]]\rangle F({t}_{1})F({t}_{2})d{t}_{1}d{t}_{2}\mathrm{.}$$
(4)

In Fig. 5, we show real and imaginary parts of 3-time correlation functions as compared to their theoretically expected values. We measure the 3-time correlation function \(\langle {\sigma }_{y}({t}_{2}){\sigma }_{y}({t}_{1}){\sigma }_{z}\rangle \) versus \({t}_{1}\) and \({t}_{2}\). Like in the case of the two-time correlation functions, the oscillatory behavior of the measured three-time correlation functions reflects the rotation of the two-level system along the z-axis of its Bloch sphere. In this case, we simulate the system-qubit free Hamiltonian \({ {\mathcal H} }_{0}=-200{\rm{\pi }}{\sigma }_{z}\) for the initial state \({\rho }_{{\rm{in}}}=\mathrm{|0}\rangle \langle \mathrm{0|}\). For this, we set \({\nu }_{1}={\nu }_{1}^{0}\) and \({\nu }_{2}-{\nu }_{2}^{0}=200\) Hz in Eq. (3). The \(J\)-coupling term of Eq. (3) will be canceled by using a refocusing pulse in the circuit. Three controlled quantum gates \({U}_{\alpha }^{0}\), \({U}_{\beta }^{1}\) and \({U}_{\gamma }^{2}\) should be chosen as \(C-{R}_{z}^{2}(-{\rm{\pi }})\), \(C-{R}_{y}^{2}({\rm{\pi }})\) and \(C-{R}_{y}^{2}({\rm{\pi }})\). The free evolution of the 1H nuclei between \({U}_{\alpha }^{0}\) and \({U}_{\beta }^{1}\) is given by the evolution operator \({e}^{-i{ {\mathcal H} }_{0}{t}_{1}}\). Accordingly, the free evolution of the 1H nuclei between \({U}_{\beta }^{1}\) and \({U}_{\gamma }^{2}\) is given by \({e}^{-i{ {\mathcal H} }_{0}({t}_{2}-{t}_{1})}\). However, when \({t}_{2}\) < \({t}_{1}\), we perform the evolution \({e}^{-i(-{ {\mathcal H} }_{0})({t}_{1}-{t}_{2})}\) by inverting the phase of the Hamiltonian \({ {\mathcal H} }_{0}\), which is realized by using a pair of \({\rm{\pi }}\) pulses at the beginning and at the end of the evolution15.

Figure 5
figure 5

Experimental results for the \(3\)-time correlation functions. We plot \({ {\mathcal M} }_{zyy}^{3}=\langle {\sigma }_{y}({t}_{2}){\sigma }_{y}({t}_{1}){\sigma }_{z}\rangle \) for \({t}_{1}\) and \({t}_{2}\) going from 0.5 ms to 5 ms with 0.5 ms time step, showing the agreement of experimental results with theoretical predictions. The quantum circuit for measuring \({ {\mathcal M} }_{zyy}^{3}\) includes three controlled quantum gates \({U}_{z}^{0}\), \({U}_{y}^{1}\) and \({U}_{y}^{2}\), which are experimentally implemented by hard pulses.

For testing scalability, we also measure higher-order time-correlation functions, up to \(n\,=\,10\). In this case, we consider the free Hamiltonian \({ {\mathcal H} }_{0}=-100\pi {\sigma }_{z}\) and the input state \(|{\varphi }\rangle ={R}_{x}\mathrm{(1.41}{\rm{\pi }}\mathrm{/2)|0}\rangle \), and we measure the following high-order correlation functions as a function of the correlation order \(n\), with time intervals \({t}_{n-1}=\mathrm{0.3(}n-\mathrm{1)}\) ms,

$$\begin{array}{l}{ {\mathcal M} }_{xx}^{n}=\langle {\sigma }_{x}({t}_{n-1}){\sigma }_{x}({t}_{n-2}\mathrm{)...}{\sigma }_{x}({t}_{1}){\sigma }_{x}\rangle ,\\ { {\mathcal M} }_{xy}^{n}=\langle \mathrm{...}{\sigma }_{x}({t}_{2m}){\sigma }_{y}({t}_{2m-1}\mathrm{)...}{\sigma }_{y}({t}_{1}){\sigma }_{x}\rangle \mathrm{.}\end{array}$$
(5)

Here, the superscripts and subscripts of \( {\mathcal M} \) are the order of the correlation and the involved Pauli operators, respectively. Index \(m\) runs from \(1\) to \((n-\mathrm{1)/2}\) for odd \(n\), and to \(n\mathrm{/2}\) for even \(n\). The quantum circuit used to measure \({ {\mathcal M} }_{xx}^{n}\) and \({ {\mathcal M} }_{xy}^{n}\) is based in the gradient ascent pulse engineering (GRAPE) technique22,23, which is designed to be robust to the static field distributions (\({T}_{2}^{\ast }\) process) and RF inhomogeneities.

In Fig. 6, we show the measured results for high-order time-correlation functions, demonstrating the scalability of the technique and its high accuracy even for a \(10\)-time correlation function. With this we demonstrate that high-order correlation functions are efficiently accessible in NMR via our algorithm. In general, high-order time-correlation functions correspond to high-order corrections in perturbation theories. In our example, the jagged pattern of the measured data with the order of the time-correlation function can be explained in terms of each order corresponding to measurements in different axes of the Bloch sphere.

Figure 6
figure 6

Experimental results (dots) for high-order time-correlation functions \({ {\mathcal M} }_{xx}^{n}\) and \({ {\mathcal M} }_{xy}^{n}\) (\(n=\mathrm{2,}\,\mathrm{3,}\,\mathrm{...,}\,10\)). \(n\) controlled quantum gates \({U}_{\alpha }^{0}\), \({U}_{\beta }^{1}\), …, \({U}_{\gamma }^{n-1}\) are sequentially applied with a time interval \({\rm{\Delta }}t=0.3\) ms. Refocusing pulses are used to decouple the interaction between the nuclei of 13C and 1H, during the time intervals \(\Delta t\) between gates. For this experiment, we use the GRAPE pulsed technique to implement the quantum circuit. Using hard pulses like in the previous experiments would result in poor quality of the measured data due to the high number of pulses required and the cumulative effect of their imperfections.

Discussion

For systems of bigger size and complex dynamics our technique should be equally valid, and would be useful for computational purposes, when the dynamics of the system is not reproducible by classical means. In this case, the algorithm would also work with a single ancillary qubit, however, the controlled gates would pass from two-qubit gates to multi-qubit gates, which have been little studied in NMR. Nevertheless, multi-qubit gates like the Mø lmer-Sø rensen gate can always be efficiently decomposed into a circuit of c-NOT gates7, allowing for the measurement of multi-qubit time correlations in NMR.

For all cases here discussed, experimental data shows a high degree of agreement with the theoretical predictions. Error bars are not shown, as they are always smaller than the used dots themselves. The dephasing times \({T}_{2}\) of our spin-qubits are of the order of seconds, while the experimental time of a whole sequence is at most of \(10\) ms, allowing us to ignore the effect of dephasing effects during the experiment. In our setup, the sources of errors are related to the initialization of the PPS, and imperfections in the width of the employed hard pulses. Moreover, the latter effect is cumulative and can result in a snowball effect. Additionally, factors such as RF inhomogeneities, and measurement errors, bring in a signal loss.

In summary, we have shown that the measurement of time-correlation functions of arbitrary order in NMR is an efficient task, and that it can be used to obtain the linear response function of the system. Although the linear response function could be calculated indirectly with a precise determination of the Hamiltonian parameters of the system, this experiment can be considered its first direct measurement in NMR. For systems of bigger size and complex dynamics, the indirect estimation of this magnitude would become intractable, as an analytical or numerical solution of the dynamics is always required. However, a direct detection would still be possible following the ideas demonstrated in this experiment. Not only that, in this work, we have demonstrated that such magnitudes can be experimentally retrieved with high accuracy. This will be of interest for physicist and engineers, either to characterize systems that follow computationally intractable dynamics, or to use them for computation purposes, opening the door to the quantum simulation of physical models where time correlations play a central role. It is generally accepted, that NMR platforms scale poorly, and there is no indication that this will change in the foreseeable future. However, the central ideas demonstrated in this experiment do not rely on any property which is exclusive of NMR platforms. Therefore, it is our believe that other more scalable quantum platforms may extend the protocol demonstrated here to systems of arbitrary size, where a single ancillary qubit will always suffice.

Details of Experimental implementation

Experiments are carried out using nuclear magnetic resonance (NMR), where the sample 13C-labeled Chloroform is used as our two-qubit quantum computing processor. 13C and 1H in the Chloroform act as the ancillary qubit and system qubit, respectively. Figure 7 shows the molecular structure and properties of the sample. The top plot in Fig. 8 presents some experimental spectra, such as the spectra of the thermal equilibrium and pseudo pure states. The bottom plot in Fig. 8 shows NMR spectra which is created after we measure the 2-time correlation function \({ {\mathcal M} }_{xy}^{n}\) (\(n=2\)).

Figure 7
figure 7

Molecular structure and relevant parameters of 13C-labeled Chloroform. Diagonal elements and off-diagonal elements in the table provide the values of the chemical shifts (Hz) and \(J\)-coupling constant (Hz) between 13C and 1H nuclei of the molecule. The right table also provides the longitudinal time \({T}_{1}\) and transversal relaxation \({T}_{2}\), which can be measured using the standard inversion recovery and Hahn echo sequences.

Figure 8
figure 8

Experimental spectra of 13C nuclei. The blue line of the top plot shows the observed spectrum after a \(\pi \mathrm{/2}\) pulse is applied on 13C nuclei in the thermal equilibrium state. The signal measured after applying a \(\pi \mathrm{/2}\) pulse following the preparation of the PPS is shown by the red line of the top plot. The bottom plot shows the spectrum when we measure \({ {\mathcal M} }_{xy}^{n}\) (\(n=2\)). The red, blue and black lines represent the experimental spectra, fitting results and corresponding simulations, respectively.

Initial State Preparation

It is widely known that the thermal equilibrium state of an NMR ensemble is a highly-mixed state with the following structure

$${\rho }_{eq}\approx \frac{1-\varepsilon }{4}{{\mathbb{I}}}_{4}+\varepsilon (\frac{1}{4}{{\mathbb{I}}}_{4}+{\sigma }_{z}^{1}+4{\sigma }_{z}^{2})\mathrm{.}$$
(6)

Here, \({{\mathbb{I}}}_{4}\) is a \(4\times 4\) identity matrix and \(\varepsilon \approx {10}^{-5}\) is the polarization at room temperature. Given that \({{\mathbb{I}}}_{4}\) remains unchanged and that it does not contribute to the NMR spectra, we consider the deviation density matrix \({\rm{\Delta }}\rho =0.25{{\mathbb{I}}}_{4}+{\sigma }_{z}^{1}+4{\sigma }_{z}^{2}\) as the effective density matrix describing the system. The deviation density matrix can be initialized in the pure state \(\mathrm{|00}\rangle \langle \mathrm{00|}\) by the spatial averaging technique, transforming the system into the so-called pseudo-pure state (PPS). The top plot in Fig. 8 shows the spectra of the thermal equilibrium and pseudo pure states. Arbitrary input states \({\rho }_{{\rm{in}}}^{{\rm{CH}}}\) can be easily created by applying local single-qubit rotation pulses after the preparation of the PPS.

Gate Decomposition

We dcompose the family of controlled quantum gates \({U}_{\alpha }^{k}\) = \(\{C-{R}_{z}^{2}(-{\rm{\pi }}),C\,-\)\(i{R}_{x}^{2}({\rm{\pi }}),C-{R}_{y}^{2}({\rm{\pi }})\}\) in the following way

$$C-{R}_{z}^{2}(-\pi )=U(\frac{1}{2J}){R}_{z}^{2}(-\frac{\pi }{2}),$$
$$C-i{R}_{x}^{2}(\pi )=\sqrt{i}{R}_{z}^{1}(\frac{\pi }{2}){R}_{z}^{2}(-\frac{\pi }{2}){R}_{x}^{2}(\frac{\pi }{2})U(\frac{1}{2J}){R}_{y}^{2}(\frac{\pi }{2}),$$
$$C-{R}_{y}^{2}(\pi )={R}_{x}^{2}(\frac{\pi }{2})U(\frac{1}{2J}){R}_{x}^{2}(-\frac{\pi }{2}){R}_{y}^{2}(\frac{\pi }{2})\mathrm{.}$$
(7)

Here, \(U(\frac{1}{2J})\) is the \(J\)-coupling evolution \({e}^{-i\pi {\sigma }_{z}^{1}{\sigma }_{z}^{2}\mathrm{/4}}\). Moreover, any \(z\)-rotation \({R}_{z}(\theta )\) can be decomposed in terms of rotations around the \(x\) and \(y\) axes, \({R}_{z}(\theta )={R}_{y}(\pi \mathrm{/2)}{R}_{x}(-\theta ){R}_{y}(-\pi \mathrm{/2)}\). On the other hand, the decoupling of the interaction between 13C and 1H nuclei can be realized by using refocusing pulses or the Waltz-4 sequence.