Non-Markovianity-assisted high-fidelity Deutsch–Jozsa algorithm in diamond

The memory effects in non-Markovian quantum dynamics can induce the revival of quantum coherence, which is believed to provide important physical resources for quantum information processing (QIP). However, no real quantum algorithms have been demonstrated with the help of such memory effects. Here, we experimentally implemented a non-Markovianity-assisted high-fidelity refined Deutsch–Jozsa algorithm (RDJA) with a solid spin in diamond. The memory effects can induce pronounced non-monotonic variations in the RDJA results, which were confirmed to follow a non-Markovian quantum process by measuring the non-Markovianity of the spin system. By applying the memory effects as physical resources with the assistance of dynamical decoupling, the probability of success of RDJA was elevated above 97% in the open quantum system. This study not only demonstrates that the non-Markovianity is an important physical resource but also presents a feasible way to employ this physical resource. It will stimulate the application of the memory effects in non-Markovian quantum dynamics to improve the performance of practical QIP. Scientists have successfully applied the non-Markovianity of environment as an important quantum resource to improve the performance of quantum information processing. Quantum system unavoidably suffers from notorious decoherence, which is a primary hurdle for wide applications of quantum information techniques in realistic quantum system. Unlike to passively shield the decoherence, a team led by Fang-Wen Sun at University of Science and Technology of China actively utilized the memory effect of a non-Markovian environment, a typical quantum decoherence environment, to revive quantum coherence and correlation and to improve the fidelity of quantum Deutsch-Jozsa algorithm in a diamond nitrogen-vacancy center. This study not only demonstrates that the non-Markovianity is an important quantum resource but also presents a feasible way to employ this physical resource for quantum information techniques.


INTRODUCTION
Based on quantum phenomena, such as superposition, correlation and entanglement, quantum information processing (QIP) has provided great advantages over its classical counterpart 1-3 in efficient algorithms, 4,5 secure communication, 6,7 and highprecision 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 operation 20,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 algorithm 37 with a solid spin in a diamond nitrogen-vacancy (NV) center. The memory effects were further applied as important physical resources 28 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 method 26 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.

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 m s = +1 and m s = −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 m s = 0 ↔ m s = +1, these two spin states in the NV center could be encoded as qubit 0 j i and 1 j i, respectively. As shown in Fig. 1, 532 nm laser pulses were used for the initial spin state 0 j i ð Þ 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 0 j i and 1 j i. Here ϕ X(Y) denotes the rotation with angle ϕ around the X(Y) axis. The phase gates were realized with U ¼ ðÀπ=2Þ X ðϕÞ Y ðπ=2Þ X , where ϕ ¼ 0; 2π for constant operations (U 1 and U 2 ) and ϕ = 3π, π for balanced operations (U 3 and U 4 ) 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 0 j i and 1 j i 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 0 j i.
where ρ is the state after operations. The dark state 1 j i occurs for constant operations with the POS P 1 ¼ tr 1 j i 1 h jρ ð Þ¼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 P 0 U3 ð Þ À P 0 U1 ð Þ À Á between U 3 and U 1 is shown in Fig. 1d. Clearly, the POS of the constant (U 1 and U 2 ) operations, balanced (U 3 and U 4 ) 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 process [28][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 where σ(t, ρ 1,2 (0)) = (d/dt)D(ρ 1 (t), ρ 2 (t)) is the rate of the change of the trace distance, and D ρ 1 ; ρ 2 ð Þ¼ ρ 1 À ρ 2 k k =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 Þ , 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 nonmonotonically 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.
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 ρ 1 ; ρ 2 ð Þ¼ ða þ b cosð2πΔtÞÞe Àt 2 =T 2 , 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 14 N 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 Fig. 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 (U 3 and U 4 ) is P 0 ; whereas for constant operations (U 1 and U 2 ), it is 1 − P 0 . d The contrast between U 3 and U 1 , 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  Figs. 1d and 2b by taking P 0 U3 ð Þ À P 0 U1 ð Þ . 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 resources 28,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 method 26,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.
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 nonmonotonic dependent relationship between the POS of the RDJA and the delay time of the measurement. Therefore, a nonmonotonic behavior can be changed by polarizing the spin bath in diamond. [46][47][48] Here we adopted this strategy 46-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 roomtemperature. Since such a non-Markovian environment of NV  center is caused by coupling with the single intrinsic 14 N 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 measurement 40,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.

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, singlecrystal synthetic diamond sample (Element Six). The abundance of 13 C 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 10 11 /cm 2 and the estimated average depth of NV was 20 nm. For NV center, the environment was made with dark spin bath 13 C and 14 N. 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 Fig. 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 High-fidelity Deutsch-Jozsa algorithm in diamond Y Dong et al.
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.