Introduction

Based on quantum phenomena, such as superposition, correlation and entanglement, quantum information processing (QIP) has provided great advantages over its classical counterpart1,2,3 in efficient algorithms,4,5 secure communication,6,7 and high-precision metrology.8,9,10,11,12,13,14,15,16

However, quantum superposition and correlation are fragile in an open quantum system. Notorious decoherence,17,18,19 which is caused by interactions with noisy environments, is a major hurdle in the realization of fault-tolerant coherent operation20,21 and scalable quantum computation. To further expand the implementation of QIP in open quantum systems, full understanding and control of environmental interactions are required.17,22,23,24 Many techniques have been developed to address this issue, including decoherence-free subspaces,25 dynamical decoupling (DD)13,26 and the geometric approach.27 However, actively utilizing the environmental interactions would represent a significant achievement, compared with passively shielding them.

Usually, the interaction of an open quantum system with a noisy environment exhibits memory-less dynamics with an irreversible loss of quantum coherence, that can be described by the Born–Markov approximation.28 However, because of strong system–environment couplings, structured or finite reservoirs, low temperatures, or large initial system-environment correlations, the dynamics of an open quantum system may deviate substantially from the Born–Markov approximation and follow a non-Markovian process.28,29,30,31,32 In such a process, the pronounced memory effect, which is the primary feature of a non-Markovian environment, can be used to revive the genuine quantum properties,28,29,30,31,32,33,34 such as quantum coherence and correlations. Consequently, improving the performance of QIP by utilizing memory effects as important physical resources in the non-Markovian environment is crucial.35,36 However, no real quantum algorithms have been demonstrated with the help of such memory effects. Here, we investigated the memory effects of non-Markovian environments using the quantum Deutsch–Jozsa algorithm37 with a solid spin in a diamond nitrogen-vacancy (NV) center. The memory effects were further applied as important physical resources28 to substantially improve the performance of the quantum algorithm with the assistance of the DD protection method.26

The Deutsch–Jozsa algorithm,38,39,40 which can be used to determine whether a coin is fair or fake in a single examination step,40,41 is one of the seminal algorithms used to demonstrate the advantages of quantum computations. Experimentally, the refined Deutsch–Jozsa algorithm (RDJA)38,39,40 was implemented with a single spin qubit of the NV center to study the memory effect of a non-Markovian environment, with a bidirectional flow of information between the spin qubit and the spin bath, as shown in Fig. 1a. The probability of success (POS) of RDJA presents an unexpected non-monotonic dependence on the delay time of the measurement, that is induced by memory effects of the environment and further confirmed by the non-Markovianity measurement of the open quantum system.29,31 Based on a complete understanding of the non-Markovian environment, we took advantage of the memory effect by applying the DD protection method26 to significantly enhance the POS of the RDJA to above 97% in a realistic solid spin system. This result represents a substantial improvement over previous results.39,42 In contrast, the transition from non-Markovian to Markovian dynamics of the NV center was experimentally realized with a magnetic field, where the POS of the RDJA decreases monotonically with the delay time of the measurement, as expected in the Markovian region. The experimental result clearly confirmed that the performance of a practical quantum algorithm can be improved by incorporating the memory effects from the non-Markovian environment as important quantum resources. This experimental result should stimulate the development of the control and application memory effects of non-Markovian environments for future quantum technologies.

Fig. 1
figure 1

a The single spin qubit of the NV center was used to study the memory effect of a non-Markovian environment with a bidirectional flow of information between the spin qubit and the spin bath. b Diagram of the MW pulse sequences used to realize the single-qubit RDJA. c The results of the RDJA. The POS for balanced operations (U3 and U4) is P0; whereas for constant operations (U1 and U2), it is 1 − P0. d The contrast between U3 and U1, corresponding to the POS of the RDJA. When the contrast is less than 50% as shown by the red dashed line, the advantage of quantum RDJA is lost completely. In addition, the quantum RDJA completely fails when the contrast is negative as denoted by the black dashed line

Results

Quantum qubit in diamond and RDJA

An NV center in diamond with an electron spin S = 1 was applied for the RDJA implementation at room-temperature. The ms = +1 and ms = −1 energy level degeneracy was lifted by applying a magnetic field along the symmetry axis of the NV center.

By tuning the microwave (MW) frequency to be resonant with ms = 0 ↔ m s  = +1, these two spin states in the NV center could be encoded as qubit \(\left| 0 \right\rangle\) and \(\left| 1 \right\rangle\), respectively. As shown in Fig. 1, 532 nm laser pulses were used for the initial spin state \(\left( {\left| 0 \right\rangle } \right)\) preparation and final state readout. The RDJA can be decomposed into two different unitary transformations: rotation operation and phase-controlled gate.39,40,42 The rotation operation can be realized by a (π/2) X pulse resonant with the transition between \(\left| 0 \right\rangle\) and \(\left| 1 \right\rangle\). Here ϕX(Y) denotes the rotation with angle ϕ around the X(Y) axis. The phase gates were realized with \(U = ( - \pi {\mathrm{/}}2)_X(\phi )_Y(\pi {\mathrm{/}}2)_X\), where \(\phi = 0,2\pi\) for constant operations (U1 and U2) and ϕ = 3π, π for balanced operations (U3 and U4) in the RDJA. After taking the commutation relations of Pauli matrices, unitary gates of the RDJA were constructed experimentally, as shown in Fig. 1b. Finally, another (π/2) X was applied with delay time τ immediately after MW operations to transfer the relative phase between \(\left| 0 \right\rangle\) and \(\left| 1 \right\rangle\) to the spin population for the quantum state measurement.

In theory, when balanced operations of the RDJA are applied, the ideal results for the NV center remain in the bright state \(\left| 0 \right\rangle\). The POS corresponds to \(P_0 = {\mathrm{tr}}\left( {\left| 0 \right\rangle \left\langle 0 \right|\rho } \right)\), where ρ is the state after operations. The dark state \(\left| 1 \right\rangle\) occurs for constant operations with the POS \(P_1 = {\mathrm{tr}}\left( {\left| 1 \right\rangle \left\langle 1 \right|\rho } \right) = 1 - P_0\). The results of applying the RDJA to a single NV center are shown in Fig. 1c. The POS of the RDJA is the contrast between the results of constant and balanced operations, where the contrast \(\left( {P_{0\left( {U_3} \right)} - P_{0\left( {U_1} \right)}} \right)\) between U3 and U1 is shown in Fig. 1d. Clearly, the POS of the constant (U1 and U2) operations, balanced (U3 and U4) operations, and RDJA show prominent oscillations with the delay time of the measurement. This result obviously contradicts previous results.40,42 In the Born–Markovian decoherence region,43 as the duration of the interaction of the quantum system with the environment increases, the degeneration of the coherence of the quantum system also increases. Consequently, the POS should decrease monotonically with the delay time of the measurement. Moreover, we also observed that quantum RDJA is worse than the classical method when the contrast is less than 50% and completely fails when the contrast is negative as shown in Fig. 1d. However, with an appropriate delay, the maximal POS is achieved, as shown by the green arrow in Fig. 1d.

Non-Markovian effect of noise environment on RDJA

These nontrivial phenomena deviate mainly from the quantum Born–Markovian process28,29,30,31 and reflect the occurrence of non-Markovian dynamics. To confirm this supposition and study how the memory effects of the environment affect the RDJA, we measured the non-Markovianity of the quantum system by employing the trace distance method,29,31,44 which is given by

$$N = \mathop {{{\mathrm{max}}}}\limits_{\rho _{1,2}(0)} {\int}_{\sigma > 0} \sigma \left( {t,\rho _{1,2}(0)} \right){\rm d}t,$$
(1)

where σ(t, ρ1,2(0)) = (d/dt)D(ρ1(t), ρ2(t)) is the rate of the change of the trace distance, and \(D\left( {\rho _1,\rho _2} \right) = \left\| {\rho _1 - \rho _2} \right\|{\mathrm{/}}2\), for the two states ρ1 and ρ2. When N > 0, the interaction process is non-Markovian. To experimentally characterize a non-Markovian quantum dynamics, optimal state pairs,45 \(\left| \circlearrowleft \right\rangle = \left( {\sqrt 2 {\mathrm{/}}2} \right)\left( {\left| 0 \right\rangle - i\left| 1 \right\rangle } \right)\) and \(\left| \circlearrowright \right\rangle = \left( {\sqrt 2 {\mathrm{/}}2} \right)\left( {\left| 0 \right\rangle + i\left| 1 \right\rangle } \right)\), were experimentally prepared. After the system had interacted with the environment, quantum state tomography was performed to analyze the dynamics of the quantum system, as presented in Fig. 2a. Figure 2b shows that the trace distance of the electron spin NV center decreases non-monotonically with the spin bath interactions. This behavior was the characteristic of the non-Markovianity of the environment. The measured value of the non-Markovianity is N = 1.96 ± 0.14, which is much larger than 0 and confirms that this environment is non-Markovian.

Fig. 2
figure 2

a Pulse sequences used to characterize the non-Markovianity of the spin environment. b The trace distance of the two optimal states shows the non-Markovianity of the spin environment with revivals. The red dots represent the experimental results of the trace distance evolution and the blue solid line denotes the fitting obtained with the supposed model

This non-Markovian environment of the NV center can be further characterized using a triple-mode spin bath. The experimental data in Fig. 2b can be fitted with \(D\left( {\rho _1,\rho _2} \right) = \left| {(a + b\,{\mathrm{cos}}(2\pi {\mathrm{\Delta }}t)){\mathrm{e}}^{ - t^2/T^2}} \right|\), where a and b relate to the mode density distribution of reservoir, and T relates to the width of reservoir. We obtained a = 0.105 ± 0.002, b = 0.218 ± 0.003, the splitting of the triple-mode reservoir Δ = (2.170 ± 0.005) MHz and T = 1382 ± 31 ns. So the width of each modes was 724 ± 16 kHz. From the type of lineshape which can be explained by coupling with a dark spin 1 system, the non-Markovian dynamics is from the coupling between the intrinsic 14N nuclear spin and the electron spin in NV center.

In fact, if the quantum operations are ideal, the RDJA process is similar to the preparation of optimal state pairs for the measurement of non-Markovianity. The oscillation of the trace distance and POS of RDJA implementation is identical, as shown in Figs. 1d and 2b by taking \(\left| {P_{0\left( {U_3} \right)} - P_{0\left( {U_1} \right)}} \right|\). The non-monotonic behavior can be interpreted as a bidirectional flow of information between the electron spin of the NV center and the spin bath, which induces the distance between the two states to decrease or increase. Because the rate of information exchange is on the same order of magnitude as the coherent operation speed, the flow of information begins and tightly accompanies with the RDJA implementation. Therefore, the maximal POS for the RDJA cannot be obtained using a delay of τ = 0 ns. Indeed, an appropriate delay (τ = 400 ns) is required to achieve the maximal POS when the information reflows from the environment, as shown in Fig. 1d.

The performance of DD-protected RDJA under a non-Markovian environment

The RDJA achieves a POS of approximately 78%, which is relatively high.39,40,42 However, a recent study revealed that the memory effects of a non-Markovian environment can be regarded as important physical resources28,33 to improve QIP in an open quantum system. To further enhance the POS of the RDJA, we utilized the memory effects of the non-Markovian environment, which can be extracted by the DD method26,39 to mitigate imperfect operations and decoherence.

As shown in Fig. 3a, a single π pulse between the RDJA and the measurement was applied to construct the simplest DD sequences: spin echo. Without complex design sequences,26 the DD-protected RDJA can be implemented in 700 ns which is mainly limited by the Rabi frequency. Figure 3b shows the results of the implementation of the DD-protected RDJA, where the positive and negative echoes correspond to the constant and balanced functions, respectively. Because balanced and constant operations are different in the quantum circuits, as shown in Fig. 3a, the echoes in these operations are expected to appear at different absolute times. Thus we shift each result to facilitate interpretation.39 Similar to the original results as shown in Fig. 1c, the POS also oscillates with the delay time of the measurement because of the non-Markovianity of the environment. However, corrected results can be obtained at the echo delay time, when t = 76, 170, and 400 ns. When t = 170 ns, which corresponds to the failed operation shown in Fig. 1d, we obtained a perfectly corrected result via the assistance of the non-Markovian environment, as presented in Fig. 3b.

Fig. 3
figure 3

a Diagram of the 532 nm laser and MW pulse sequence for the RDJA protected by spin echo sequences. b The results of the RDJA protected by spin echo sequences for t = 76 ns, 170, and 400 ns, with the maximal POS of the RDJA exceed 93, 97, and 91%, respectively. The positive and negative echoes are indicated by green arrows

The maximal POS exceeds 97% in the DD-protected RDJA. Moreover, the contrast between the next local maximum and minimum, which correspond to constant and balance operations, also exceeds 50% as shown in Fig. 3b. This finding indicates that the DD protection method can enhance the fidelity of coherent operation and extend the detection region under non-Markovian environment.

Transition from a non-Markovian to a Markovian environment

Generally, the non-Markovianity of the present NV center system, which arises from the structured environments, leads to a non-monotonic dependent relationship between the POS of the RDJA and the delay time of the measurement. Therefore, a non-monotonic behavior can be changed by polarizing the spin bath in diamond.46,47,48

Here we adopted this strategy46,47,48,49 by making use of a level anti-crossing in the excited state of the NV center to polarize the nuclear spins in diamond. By applying magnetic field along the axis of NV center, the tripe-mode spin bath was converted to a single mode system, as shown in Fig. 4a, b. Figure 4c shows that the non-Markovianity of spin bath decreases as the magnetic field magnitude increases, while maintaining its orientation along the symmetry axis of the NV center. When the magnetic field exceeded 35 mT, we realized the transition from non-Markovian to Markovian dynamics in realistic solid spin system at room-temperature. Since such a non-Markovian environment of NV center is caused by coupling with the single intrinsic 14N spin, the transition is always same for different single NV centers in diamond. In a Markovian environment, the information re-flow is turned off from spin bath to the electron spin of the NV center. Therefore, the POS of the RDJA decreases monotonically with the delay time of the measurement40,42 as shown in Fig. 4d. Because of the partial polarization of the spin bath, the maximal POS increases to 86% compared with the result obtained in the non-Markovian environment without delay.

Fig. 4
figure 4

a, b The resonance peaks of a single NV center system under different magnetic field. c The transition from the non-Markovian regime to the Markovian regime at B = 35 mT (denoted by green dotted line) with the orientation along the symmetry axis of the NV center. The non-Markovianity measure of Eq. (1) is obtained by the summation of the differences of the trace distance between the local minimum and subsequent maximum with a duration of 1 μs. The black solid line shows N = 0, which theoretically corresponds to Markovian dynamics. d The results of the RDJA in the Markovian environment and the pulse sequence shown as Fig. 1b. The contrast (i.e., the POS of the RDJA) decreases monotonically with the delay time of the measurement

Discussion

We studied the memory effects of non-Markovian quantum dynamics on the RDJA with a realistic solid spin system in diamond. The POS of the RDJA exhibits non-monotonic dependence on the delay time of the measurement. Specifically, we observed that the RDJA would be better than the classical method or fail completely depending on the delay time of the measurement. The POS was elevated beyond 97%, much higher than a similar result obtained previously,39,42 by utilizing the memory effects of the environment and the DD protection method. Furthermore, we also realized the transition from non-Markovian to Markovian dynamics in a realistic solid spin system by applying a magnetic field at room-temperature. Because of the turnoff of the information reflow from the spin bath to the electron spin of the NV center, the POS of the RDJA decreased monotonically with the delay time of the measurement.40,42 The memory effects in the non-Markovian process, obtaining the final measurement immediately after the operation is not an optimal strategy when the operation speed is comparable to the rate of information exchange between the system and the environment. However, using an appropriate delay time recovers the result. This study also demonstrated that the memory-effect-based non-Markovianity can be used as an important physical resource. Thus extracting and applying this resource for quantum information techniques is feasible. This finding will stimulate the application of these memory effects in non-Markovian quantum dynamics to improve the performance of practical QIP.

Furthermore, the spin state of the NV center in diamond was shown to be an excellent test platform for the study and application of non-Markovian dynamics beyond elaborate engineering systems.31,44 In the future, the electron spin of the NV center could be used to address some fundamental physical questions,28 such as the mathematical structure of the geometric space of non-Markovian quantum dynamical maps, the relevance of non-Markovianity in the study of the border between classical and quantum aspects of nature, and the use of non-Markovian quantum probes to detect nonlocal initial correlations in composite environments. Ultimately, with a deep understanding of and perfect control over the environment, the performance of QIP in solid-state system can be further improved.

Methods

We used a room-temperature home-built confocal microscopy, with a dry objective lens (N.A. = 0.9), to address single NV center in a type-IIa, single-crystal synthetic diamond sample (Element Six). The abundance of 13C was at the nature level of 1%. The NV centers were produced by nitrogen ions implantation and the energy of the implantation was 30 keV. The dosage was 1011/cm2 and the estimated average depth of NV was 20 nm. For NV center, the environment was made with dark spin bath 13C and 14N. In our work, the former was come from diamond lattice and was the source of slow dephasing noise. And the latter was come from nitrogen implantation, which caused the non-Markovianity of environment for NV center. The NV center, mounted on a three-axis, closed-loop piezoelectric stage for sub-micrometer-resolution scanning, was illuminated by a 532 nm diode laser. Fluorescence photons (wavelength ranging from 647 to 800 nm) were collected into a fiber and detected using the single-photon counting module, with a counting rate of 130 kHz and a signal-to-noise ratio of 200:1. We verified single photon emission from the NV center by measuring the photon correlation function. An impedance-matched gold coplanar waveguide (CPW), deposited on the bulk diamond, was used for delivery of MW to the NV center. The optical and MW pulse sequences were synchronized by a multichannel pulse generator (Spincore, PBESR-PRO-300).

Data availability

The authors declare that the main data supporting the finding of this study are available within the article.