Precise control of entanglement in multinuclear spin registers coupled to defects

Quantum networks play an indispensable role in quantum information tasks such as secure communications, enhanced quantum sensing, and distributed computing. Among the most mature and promising platforms for quantum networking are nitrogen-vacancy centers in diamond and other color centers in solids. One of the challenges in using these systems for networking applications is to controllably manipulate entanglement between the electron and the nuclear spin register despite the always-on nature of the hyperfine interactions, which makes this an inherently many-body quantum system. Here, we develop a general formalism to quantify and control the generation of entanglement in an arbitrarily large nuclear spin register coupled to a color center electronic spin. We provide a reliable measure of nuclear spin selectivity, by exactly incorporating into our treatment the dynamics with unwanted nuclei. We also show how to realize direct multipartite gates through the use of dynamical decoupling sequences, drastically reducing the total gate time compared to protocols based on sequential entanglement with individual nuclear spins. We quantify the performance of such gate operations in the presence of unwanted residual entanglement links, capturing the dynamics of the entire nuclear spin register. Finally, using experimental parameters of a well-characterized 27 nuclear spin register device, we show how to prepare with high fidelity entangled states for quantum error correction.


I. INTRODUCTION
Controlling on-demand quantum nodes with high precision and scaling up to build large-scale quantum architectures is the ultimate goal of quantum information processing.Quantum networks are clusters of nodes interconnected via communication channels, which transfer information or distribute entanglement using photons [1].Long-distance connections are established by breaking the transmission distance into smaller segments and creating intermediate entanglement links through quantum repeaters [2].Quantum networks will enable secure communication [3][4][5][6] between qubit devices and enhance quantum computing or sensing capabilities [7][8][9] by using entanglement as a resource.Few-node quantum networks in spin-based solid-state platforms have already been realized using NV centers in diamond [10][11][12], SiV centers in diamond [13,14], or quantum dots [15].Proposals for hybrid architectures complemented by transducers [16] or modular designs [17,18] have also been put forward.In defect platforms, the electronic spin serves as the communication qubit, because it features a spin-photon interface, while nearby nuclear spins can serve as long-lived quantum memories.
A challenge with exploiting the long coherence times of the nuclear spins is twofold: (i) the interactions between the nuclear spins and the electronic defect are always on (not switchable) and (ii) the majority of the nuclear spins are located at distant lattice sites, which leads to interactions that are weak compared to the dephasing rate of the defect spin.Fortunately, both these issues can be addressed simultaneously through the use of dynamical decoupling (DD) pulse sequences [19].The parameters associated with these DD sequences (specifically, the interpulse spacing) are selected such that, ideally, all nuclear spins except for one are decoupled from the defect.This effectively creates a knob to select a target nuclear spin.By varying the pulse spacing, different nuclear spins can be selected across the register.This approach has led to bold first steps toward distributing entanglement across a network of a few quantum nodes [11,20], realizing error-correction schemes [21][22][23], performing entanglement distillation [12], or implementing quantum repeater protocols [24].
Despite these seminal experimental demonstrations, critical challenges remain in exploiting nuclear spins as quantum memory registers for networks.A key issue is that, due to the many-body nature of this alwayscoupled system, the electron is never fully decoupled from the remaining nuclear spins, leading to residual electronnuclear entanglement.This lowers the fidelity of the gates, and can be detrimental in the operation of the network.An additional consideration is that in these DD control protocols, the gates between the defect and each nuclear spin are implemented sequentially, which can lead to impractically long operations in the encoding and decoding steps of quantum error correction.While these issues can be in part addressed by adding controls to the system, e.g., by directly driving the nuclear spins through nuclear magnetic resonance [25], this complicates the experiment significantly, leading to a potentially impractical overhead that could limit scalability.
In this paper, we address these challenges by developing a formalism that allows us to capture the dynamics of the full system.This in turn enables us to both characterize the quality of the electron-nuclear gates and to design DD sequences that can directly create multipartite entangling gates within the defect-nuclear spin register.A key insight in our approach is that the form of the Hamiltonian allows an exact analysis of the whole system in terms of only bipartite dynamics.We use the notion of one-tangles, an entanglement measure that captures quantum correlations between a single spin and a spin ensemble.We present closed-form expressions for the one-tangles of individual nuclear spins in the register and of the defect electronic spin.Remarkably, these onetangles depend only on two-qubit Makhlin invariants (parameters that quantify and classify the entangling power of two-qubit gates).This critical simplification allows us to systematically determine the DD sequences that maximize or minimize the one-tangles as desired for nuclear spin registers containing up to hundreds of nuclei.We use this approach to find sequences that create entanglement between the electron and a target subset of nuclei while simultaneously decoupling unwanted nuclei.We show that it is possible to perform controlled entangling operations involving three nuclear spins more than four times faster than sequential gate approaches while achieving significantly higher gate fidelities, which capture errors due to the presence of the entire nuclear register.We further reformulate the three-qubit bit-flip code in terms of the multi-spin gates and, using parameters from the well-characterized 27-qubit device by the Delft group, we show that the electron's state can be retrieved with probability > 99%.Our approach provides a practical and scalable means for selecting nuclear spins as quantum memory qubits and for designing gates among them that can prepare entangled multipartite states for efficient encoding and decoding steps in quantum error correction protocols.
The paper is organized as follows.In Sec.II, we review and generalize existing results on π-pulse sequences used for controlling single nuclear spins.In Sec.III, we quantify entanglement in the case of a single nuclear spin coupled to the electron, and we present our formalism for the entanglement distribution in the entire nuclear spin register.Finally, in Sec.IV, we show how to perform multi-spin gates, quantify their gate fidelity in the presence of spectator nuclei, and show how to use these gates for quantum error correction codes.

II. CONTROLLING A SINGLE NUCLEAR SPIN
The application of periodic trains of pulses on the electron interleaved by free-evolution periods can generate either single-qubit gates on a nuclear spin or entangle it with the electronic spin.This is because dynamical decoupling sequences can modify the effective electronnuclear hyperfine interaction, allowing one to couple a specific nucleus to the electron while decoupling others.Well-known examples of dynamical decoupling sequences that have been under investigation for many decades include the Carr-Purcell-Meiboom-Gill (CPMG) [26][27][28][29] and Uhrig (UDD) [30,31] sequences.In this section, we review and generalize existing results for single nuclear spin control via electronic spin driving.In subsequent sections, we treat the problem of controlling multiple nuclear spins at the same time.

A. Creating electron-nuclear spin entanglement
We begin with the task of creating electron-nuclear spin entanglement.It was shown in Ref. [19] that by choosing the pulse spacing to satisfy a certain resonance condition that depends on the hyperfine couplings, it is possible to rotate a target nuclear spin in a way that depends on the electronic spin state.This is done using pulse sequences that are obtained by concatenating a basic "unit" multiple times.For example, the CPMG sequence can be expressed in terms of N units as (t/4 − π − t/2 − π − t/4) N , where t is the duration of the unit, and π represents a π-pulse.The pulses are implemented experimentally via a microwave (MW) drive to directly induce transitions between electronic spin states.The idealized instantaneous π-pulses, in reality, have finite amplitude and duration; they could be generated using a vector source [32], whose characteristics (e.g.frequency, duration, amplitude) are pre-defined by an arbitrary waveform generator, and their shapes could, for example, be Hermite envelopes [25,33].
The Hamiltonian for a single nuclear spin (I = 1/2) is given by [34]: where σ j are the Pauli matrices, ω L is the Larmor frequency of the nuclear spin, and A and B are the parallel and perpendicular components of the hyperfine interaction respectively.The electron spin operator Z e is defined as Z e = s 0 |0 0| + s 1 |1 1|, where |0 and |1 are the two levels of the electron spin multiplet used to define the qubit, and s j are the corresponding spin projection quantum numbers.Further, we define H j as H j = 1/2[(ω L +s j A)σ z +s j Bσ x ].From the above Hamiltonian, it follows that the electron-nuclear spin evolution operator after one unit of the pulse sequence is given by where σ jj ≡ |j j| are projectors onto two of the levels in the electron spin multiplet, and R nj (φ j ) = e −iφj /2(σ•nj ) denotes two different conditional nuclear spin evolution operators specified by rotation axes n j and angles φ j .
Both n j and φ j in general depend on the electron's spin state and on the pulse sequence.The explicit form of R nj (φ j ) in the case of CPMG is found in Appendix A 1.
To create entanglement, we need the two rotation operators, R nj (φ j ), to differ.It is in fact possible to choose the pulse time t such that the nuclear spin axes are antiparallel, i.e., n 0 • n 1 = −1.At the same time, the coherence function P x , which is the probability for an electron prepared in state |+ to return to this state at time t, reaches a minimum.The coherence function can be expressed as P x = 1/2(1 + M ), where M = 1  2 Tr[R n0 (φ 0 )R † n1 (φ 1 )] [see also Ref. [19] and Appendix B].As has been shown in Ref. [19], for φ 0 = φ 1 ≡ φ (which holds for CPMG), M is given by M = 1 − sin 2 (φ/2)(1 − n 0 • n 1 ).By calculating M analytically using the explicit expressions for the conditional evolution operators R nj (φ j ), and by setting n 0 •n 1 = −1, the resonance times can be obtained.For the CPMG, UDD 3 and UDD 4 sequences, we find that these resonances occur at times where ω = ω 0 + ω 1 , ω j = (ω L + s j A) 2 + (s j B) 2 , and k is the order of the resonance.This expression for t k , which is valid for ω L A, B, combines and generalizes known results.For example, the resonance times of Eq. ( 3) have been shown in Ref. [19,35] for s 0 = 0, s 1 = −1, while in Ref. [13] for s 0 = −s 1 = 1/2.For the UDD 4 sequence we find that there are additional resonances at times t k = 8π(2k − 1)/ω, which was also reported in Ref. [35].All resonance times are valid for any electronic spin projection and any type of nuclear spin with I = 1/2 (e.g. 13 C in diamond/SiC or 29 Si in SiC).
An entangling gate is achieved by iterating the sequence an appropriate number N to accumulate a desired rotation angle on the nuclear spin.We present the rotation angles for the three pulse sequences in Appendix C. Sequences with an odd number of pulses in the basic unit need to be repeated twice to ensure the electron returns to its initial state.For CPMG and UDD 3 , we find that the rotation angles per iteration are equal, i.e., φ 0 = φ 1 .One way to generate an entangling gate is to set the unit time equal to a resonance time and repeat the sequence such that it leads to a total angle of π/2, and hence, implements a CR x (π/2) gate [19,21].This is possible since the evolution operator after N repetitions of the basic unit retains the form of Eq. ( 2) with φ j replaced by the total rotation angle, φ j (N ), whereas the dot product n 0 • n 1 is independent of N at resonance.However, this latter feature does not hold for any sequence.In principle, one can realize entangling operations beyond CR x (π/2), which we will explore later on in Sec.IV.
The UDD 4 sequence yields a more complicated evolution of the nuclear spin since it rotates by a different amount, depending on the electron's state (i.e., φ 0 = φ 1 ).This condition leads to a non-trivial feature based on which the dot product of its rotation axes depends on N .Thus, even if one fixes a resonance time for the basic UDD 4 unit, the nuclear rotation axes can switch from antiparallel to parallel for some N .This feature is shown in Figs.tional rotation, and no entanglement is generated.
The jumps in n 0 • n 1 in the case of UDD 4 appear because we restrict the value of the rotation angles in [0, π]; if the angles are in [−π, 0], we make them positive, and reverse the corresponding signs of the rotation axes n j for consistency.Alternatively, if the rotation angles are not restricted in this way, the dot product remains fixed at n 0 • n 1 = −1 for all N .However, for some N , it could happen that φ 0 = −φ 1 (modulo 2π), which means that such N cannot produce an entangling gate.It would then be misleading to claim there is a resonance whenever n 0 • n 1 = −1 for UDD 4 .Thus, we fix the convention φ j ∈ [0, π] to ensure that we find the right N to produce conditional rotations on the nuclear spins.This convention is not necessary for CPMG and UDD 3 , as it always holds that φ 0 = φ 1 , and we can reliably identify N to create entangling gates.No matter which convention is used for the rotation angles of CPMG or UDD 3 , the dot product shows no dependence on N [Figs.1(a), (b)].
It is important to note that, in addition to implementing gates, π-pulse sequences can also average out the interactions of the electron with unwanted spins, ensuring some degree of selectivity with a target spin.Higherorder resonances were proven to be more effective in targeting a desired nuclear spin [35,36].In turn, this implies that long sequences are required to achieve enhanced selectivity.In some cases, the sequences average out even the interaction with a target nucleus, rendering such spins uncontrollable, or introducing the need for more sophisticated approaches, such as decoherence protected subspaces [37] (which also require direct driving of nuclear registers).These issues will also be discussed further later on when we talk about simultaneous control of multiple nuclei.

B. Implementing single-qubit gates on a nuclear spin
We can use similar ideas to determine how to implement single-qubit gates on a nuclear spin without entangling it with the electron.Let us illustrate this in the case of CPMG.The CPMG sequence yields a rather simple equation for the rotation axes dot product of a single nuclear spin, which reads: where cos θ j = (ω L + s j A)/ω j .This expression is exact for s j B << ω j , or fairly in the limit cos θ j → 1. Eq. ( 4) is a generalization of the inner product of Ref. [19], with the difference that it was presented there for an electron spin S = 1 (with the choice s 0 = 0 and s 1 = −1).The nuclear spin evolves independently of the electron when n 0 • n 1 = 1 and φ 0 = φ 1 .For the CPMG sequence, it always holds that φ 0 = φ 1 .Thus, using Eq. ( 4), and by requiring that n 0 • n 1 = 1, we find two conditions for the decoupled evolution: which are the equations of a circle with center C = (−ω L /s j , 0) and radius R = 8κπ/s j t [with κ ∈ Z and t being the time of one CPMG unit].Note that for a S = 1 defect electron spin, and if s j = 0, the decoupled evolution happens at times t = 8κπ/ω L for all nuclei.Using Eq. ( 5), one can identify nuclei that do not affect the gate fidelity of target nuclear spins, as the former show no correlations with the electron.Notice that these conditions are independent of the number of repetitions of the sequence, as the dot product itself does not depend on N .In addition, since the evolution operator of the system is defined by the rotation each spin undergoes, this feature continues to hold in the total system.We will use the condition for decoupled evolution in Sec.IV B to show that such spins have no effect on the gate operations with target nuclei.For now we stress that Eq. ( 5) is valid for (8κπ/s j t) 2 > (A + ω L /s j ) 2 , while we also constrain the κ/t range such that A, B ≤ 2π • 300 kHz i.e., such that the nuclei are weakly coupled with the electron.Some examples for an electron-spin are shown in Fig. 2(a) and Fig. 2(b) respectively.One notices that the times t of the basic sequence exceed a few µs.In turn, this implies that the condition of the trivial evolution is strictly satisfied for k ≥ 2 CPMG resonances of the spins with HF parameters shown in Fig. 2. In Appendix E we further show that trivial evolution can occur for shorter times of the basic unit, although the triviality is only approximate in this case.

III. QUANTIFYING ENTANGLEMENT IN THE ELECTRON-NUCLEAR SPIN SYSTEM
Controlling multiple nuclear spins is usually done by applying additional radio-frequency pulses that drive the nuclear spins directly to facilitate entangling gates, either in terms of speed or precision, or even to reduce cross-talk [25].It is also possible to control multiple nuclear spins by driving only the defect electronic spin.The most straightforward way to do this is by implementing entangling gates sequentially using the techniques for addressing individual nuclear spins described in the previous section.However, the slowness of this approach can result in low entanglement and gate fidelities due to the electron's dephasing, as errors on the electron spread to the nuclei.This issue can in principle be addressed by applying dynamical decoupling on the electron or nuclei while new entanglement links are generated [11]; reaching long coherence times, however, requires a large number of pulses (e.g. for coherence > 1s for an NV electronic spin, 10240 pulses are required [38]).Hence, as the number of target nuclear spins grows, the experimental overhead increases significantly.
In what follows, we show that these challenges can be largely sidestepped by creating multi-nuclear entanglement simultaneously rather than sequentially.To see how this works, we first discuss how to quantify multi-spin entanglement in these types of defect spin systems.We first consider measures of entangling power for a single nuclear spin coupled to the electron and then generalize this to multiple spins using the concept of one-tangles.In subsequent sections, we then show how to employ these measures to guide the design of multi-nuclear spin entangling gates.

A. Disjoined picture
The joint evolution of the electron and a single nuclear spin can be described via the Makhlin (or local) invariants [39], typically denoted as G 1 and G 2 .These invariants classify all two-qubit operations into distinct entangling classes, such that gates sharing the same local invariants belong to the same entangling class.This property stems from the fact that local operations do not change the amount of entanglement between two parties.Entangling gates that give rise to maximum correlations are known as perfect entanglers; examples include the CNOT and CZ gates, which are locally equivalent.Makhlin invariants are suitable for classifying two-qubit gates; a more general metric that omits details of the gate structure and focuses instead on the entanglement it can generate is the entangling power [40].
For any arbitrary π-pulse sequence, the electronnuclear evolution operator after N repetitions of the sequence retains the form of Eq. ( 2), with φ j replaced by the total rotation angle, φ j (N ).This special form of the evolution operator allows us to find the analytical forms of G 1 and G 2 as a function of N : where n 01 ≡ n 0 • n 1 , and with Based on these ranges, one notices that π-pulse sequences can only generate perfect entangling gates in the CNOTequivalent class, for which it holds that (G 1 , G 2 ) = (0, 1).Under the resonance condition (n 01 = −1), the first Makhlin invariant simplifies to G 1 = cos 2 φ0(N )+φ1(N ) 2 , and requiring G 1 = 0 gives the number of sequence iterations needed to obtain a controlled gate.To estimate the number of repetitions N , we only need to know the rotation angles in one iteration.The minima of G 1 are located at N = (2κ + 1)π/(φ 0 + φ 1 ).In general, G 1 can be zero for other N as well, as long as n 0 • n 1 ≤ 0. We provide the analytical expressions for N for this general case in Appendix F and use these conditions to identify nuclear spin candidates to realize simultaneous controlled gates in Sec.IV.It has been shown that the entangling power of a twoqubit operator can be expressed in terms of G 1 as [41]: It is clear that for G 1 = 0 the entangling power is maximized and saturates to 2/9 for the two-qubit case.In Fig. 3, we show the entangling power (scaled by 2/9) and Makhlin invariants for the CPMG, UDD 3 , and UDD 4 sequences.The vertical lines correspond to the minima of G 1 .We notice that the period of oscillations is larger for CPMG since the angle per iteration is greater compared to the UDD n sequences (see Appendix G and Ref. [35]).

B. Assessing multi-spin entanglement via one-tangles
To understand the entanglement distribution in the total system (consisting of the electron and multiple nuclei), we need to extend the notion of the two-qubit entangling power.To this end, we employ the onetangles [42,43], which measure the total amount of en-tanglement in a state by considering all possible bipartitions of the system.That is, by fictitiously dividing the total system into subsystems, one can quantify the degree of correlations between the subsystems (also known as the bipartition entanglement).We choose to use the one-tangle as the entanglement metric, which means for each bipartition, we separate only one qubit (electron or nuclear spin) from the rest of the system.
One-tangles carry only the information of the entanglement capacity in the system and cannot distinguish states that belong to different families (e.g., W states versus GHZ states for the tripartite case) [44].Such a metric is convenient since we are interested in the general evolution of the system rather than generating particular entangled states.
Similar to the two-qubit entangling power, the onetangles are defined through the linear entropy.For a pure state |ψ , the one-tangle reads: where g|g denotes a bipartition of the system.Some authors include an overall multiplicative factor of 2 for the linear entropy; we choose not to follow this convention as it simply redefines the bounds of the linear entropy and does not affect our following analysis.Eq. ( 9) in its current form is not particularly useful for quantifying the entanglement of multi-nuclear operations since it depends on the initial state.We must therefore average over initial states.In particular, we will use the bipartition entangling power, which is defined as the average of the one-tangle over all initial product states.This average can be computed by averaging over single-qubit unitaries applied to an arbitrary initial product state, i.e., g|g (U ) := τ g|g [U (U ⊗i i |ψ 0 )] Ui .In Ref. [44], it was shown that the entangling power (with one-tangles as the measure) for a bipartition p|q of the system is given by where d i = 2 is the dimension of each qubit subsystem.The state |U is defined in the context of the Choi-Jamiolkowski isomorphism [45,46], which maps any projector living in a d-dimensional Hilbert space (H d ) into a state vector in an extended space (H d 2 ≡ H ⊗ H ), i.e. |i j | → |ij .In our case, d = 2 n where n is the number of qubits, including the electron and the nuclei.x |y denotes a bipartition in the secondary system of the total extended space.The summation is performed over all 2 n bipartitions in H .For example, for the tripartite case we have where '•' is the empty bipartition.Eq. ( 10) is applicable for multipartite unitary gates, with q referring to a single qubit partitioned from the d-dimensional Hilbert space, H d , and p referring to the remaining (d − 1)-dimensional subsystem.As an example, for 4 qubits in total, p|q can take the values p|q ∈ {123|4, 124|3, 134|2, 234|1}.
In the case of π-pulse sequences, the evolution operator has a special form given by: where L is the total number of nuclear spins, and for conciseness we refer to φ (l) j (N ) as simply φ (l) j .The evolution operator is therefore defined by the evolution of each nuclear spin in the disjoined picture (see Appendix A 1 for a proof).This feature allows us to obtain analytical expressions for the average of the one-tangles for any number of nuclear spins.However, we need to distinguish the case when either a single nuclear spin or the electron is partitioned from the rest of the system.For brevity, we will refer to these types of average one-tangles as the one-tangle of a nuclear spin and the one-tangle of the electron, respectively.
Starting with the one-tangle of a single nuclear spin, we find that it is given by (see Appendix H) which holds for n ≥ 3 qubits.For n = 2, the average of the one-tangle is the two-qubit entangling power of Eq. ( 8).G 1 is given by Eq. ( 6).Note that as is expected, the one-tangle of a nuclear spin does not depend on other quantities besides those that determine its evolution (due to the tensor product form of the total evolution operator U ).In the case when the electron is partitioned from the system the one-tangle reads (see Appendix H) where 01 ) contains the information of the evolution of the j-th nuclear spin.The one-tangle of the electron now includes contributions from the evolutions of each nuclear spin; due to the always-on nature of the HF interaction, the electron can be correlated with all nuclei.On the other hand, we see from Eq. ( 12) that a single nuclear spin can only have explicit correlations with the electron and evolves independently of all other nuclei (assuming no inter-nuclear spin interactions).
Remarkably, the expressions for the one-tangles, Eq. ( 12) and Eq. ( 13), allow us to study the entanglement distribution in an arbitrarily large nuclear spin register.Together with the knowledge of the evolution of each nuclear spin in the disjoined picture, we can simulate efficiently a large number of nuclei and obtain complete information about the dynamics of the system.The simplicity of Eqs.(12) and ( 13) is what allows us to obtain a detailed understanding of how entanglement gets distributed throughout the system for various pulse sequences, as we discuss in the remainder of the paper.
One thing we can immediately see from Eq. ( 12) is that the one-tangle of a nuclear spin is minimized when the (c) Maximum one-tangles as a function of the number of qubits for the case when the electron (blue) or a single nuclear spin (red) is partitioned from the rest of the system.The yellow line is the theoretical maximum bound for a perfect U (n) entangler, while the purple line is the numerical bound we found for randomly generated U (n), obtained by retaining the maximal value over 100 random unitaries for n = 4, 5 and 5 random unitaries for n = 6.For n = 3, we construct a U (n) from an absolutely maximally entangling (AME) state.Such U (n) saturates the bound, if the AME(2n, d) state exists (in this case d = 2).function G 1 is maximized.This can happen when the nuclear spin undergoes a trivial evolution, namely when n 0 • n 1 = 1 (n 0 • n 1 = −1) and φ 0 = φ 1 (φ 0 = −φ 1 ).The range of the function G 1 is shown in Fig. 4(a) and Fig. 4(b) for the cases of n 0 •n 1 = ±1 respectively.Whenever G 1 = 0, the one-tangle of a nuclear spin is maximal, whereas when G 1 = 1, the nuclear spin decouples from the system.In Fig. 4(c), we show the maximum onetangle when a single nuclear spin (red) or the electron (blue) is separated from the rest of the spins.As expected, the maximum nuclear one-tangle is independent of the number of total qubits in the system and saturates to the value 2/9, which also holds for two-qubit operations.On the other hand, the electron's one-tangle shows an increase with the number of qubits until it becomes independent of n and saturates close to 1/3.
In light of these results, it is interesting to ask whether it is possible to achieve maximal entangling power by applying π-pulses to this central spin system.In Fig. 4(c), we also show the bound of the bipartition entanglement for an arbitary n-qubit gate U (n) (yellow), which is calculated according to [44]: where d px and d qy are the dimensions of the subsystems px and qy .Interestingly, this bound is never reached by π-pulse sequences.However, this upper bound is not always tight.A necessary requirement for the bound to be tight is that the CP-maps associated with U (n) are unital [40], which means that they map maximally mixed states onto maximally mixed states.This condition alone is not sufficient, since as was shown in Ref. [40], for the two-qubit case, the bound given by the linear entropy (which is 1/3) is never saturated, and the well-known perfect entanglers, such as CNOT, can only reach the value of 2/9.The saturation of the bound occurs when the matrix elements of U (n) can be obtained from socalled absolutely maximally entangling states, known as AME(2n, d), if these exist [44].For d = 2 (i.e., qubit subsystems), AME(n, d) states exist only for n = 3, 5, 6 [47].
In Fig. 4(c), we show that the bound is indeed saturated for n = 3 [for which AME(2n, d) exists], if we construct such U (n) based on Ref. [44], for an AME(2n, d) state found in Ref. [48].For n = 4, 5, 6, we generated random n-qubit unitaries U (n) and calculated the maximum value of one-tangles; the results are depicted with a purple line.Although we have not sampled a large number of U (n), we see that the maximum bipartition entanglement of random unitaries exceeds the bound of the one-tangles corresponding to π-pulse sequences.Therefore, the multipartite controlled gates generated by π-pulse sequences applied to this central spin system do not saturate the one-tangle bound for n ≥ 3, and hence the amount of entanglement they can create is limited.We now illustrate the utility of Eqs. ( 12) and ( 13) by using them to design electron-nuclear entangling gates that avoid unwanted nuclei.We first consider the simplest example of two nuclei under the CPMG sequence, for an electron spin S = 1/2.We fix the HF parameters of the target spin to be (A, B) = 2π • (60, 30) kHz, and allow the HF parameters of the second spin to vary in the range 2π • [10,200] kHz.The nuclear spin Larmor frequency is set to be ω L = 2π • 314 kHz; for 13 C atoms this corresponds to a magnetic field of B ≈ 293.46 G. Depending on the defect electronic spin, the B-field should be chosen such that it ensures the MW qubit transitions are far from anti-crossings and hence, leakage outside of the electronic qubit subspace is suppressed [32].
In Fig. 5(a), we select the first resonance of the target spin and N = 25 sequence iterations, which maximize its one-tangle, and show the one-tangle of the unwanted spin (scaled by the maximum value of 2/9).In the ranges where the one-tangle of the unwanted spin is minimal, we successfully decouple it from the rest of the spins.We have verified that these ranges correspond to nuclear spins whose HF parameters approximately satisfy the condition for trivial evolution; we further depict this behavior for an S = 1 electron system in Appendix E.
Based on Fig. 5(a), we would conclude that certain unwanted nuclei cannot be decoupled, as they show nonzero entanglement with the rest of the system.If one wishes to target a specific spin with high selectivity then, different resonance times and sequence iterations need to be considered.Note that this effect would be com- pletely missed in prior formulations of this problem, and the issue of insufficient decoupling would only appear in numerics, where the simulations would have to be repeated for all the different physically relevant hyperfine couplings.In Fig. 5(b), we show the minimal value of the unwanted spin's one-tangle (excluding the case of same HF parameters for the unwanted and target nuclei), which is optimized over the first five resonances of the target spin and up to 300 repetitions of the sequence.We search only over iterations that generate maximal entanglement between the target nucleus and electron, which we obtain from the minima of G 1 .The optimal iterations and resonances are shown in Fig. 5(c) and Fig. 5(d), respectively.The optimization yields minimum one-tangles on the order of ∼ 10 −3 for the unwanted spin, providing isolation for the electron-target nuclear spin system.We conclude that using the analytical expressions of the onetangles to minimize unwanted one-tangles via optimization of the parameters of the π-pulse sequence provides a faithful metric of selectivity with a single target spin.
Lastly, it is interesting to note that Fig. 5(a) reveals that the unwanted spin's one-tangle can be maximal (depending on its HF parameters) at the same time, t, and repetitions N we chose for the target spin.This feature is further studied in Sec.IV and paves the path to identifying nuclei that synchronously undergo controlled gates.

IV. SYNCHRONOUS CONTROLLED GATES ON MULTIPLE NUCLEI A. Maximization of multiple one-tangles
As we saw in Sec.III B, one-tangles corresponding to different nuclei can be maximized/minimized simultaneously and for the same number of repetitions of the sequence unit.This suggests that instead of generating entanglement with single spins sequentially, one can simultaneously entangle multiple nuclei with the electron.In this section, we confirm that this is indeed the case.
To see how such direct generation of multi-spin entanglement is possible, we devise a simple strategy of identifying nuclei whose one-tangles become simultaneously maximal.To demonstrate our method, we select nuclei randomly from the HF range 2π • [10,200] kHz.There are two relevant parameters we need to decide how to fix; the time, t, of one unit of the sequence, and the repetitions, N .We fix t by setting it equal to a chosen resonance of the first randomly selected nucleus.For this nucleus, we find the iterations that maximize its one-tangle, based on the minima of G 1 , and store these into the set Ñ (1) .Since the time we choose does not in principle coincide with a resonance of other randomly selected nuclei (as the HF parameters differ), it will in general hold that n 0 • n 1 = −1 for these nuclei, meaning that we need a reliable way of estimating iterations that maximize their one-tangles.As long as n 0 • n 1 ≤ 0 for a single nuclear spin, the one-tangle can be maximal for some N .We explain how we find the maxima [analytically for CPMG and UDD 3 ; numerically for UDD 4 ] in Appendix F. Based on the maxima, we assign to each nucleus a set Ñ (j) , similar to what we did for the first nucleus.Then, we search for a common intersection i.e., one number of iterations of the sequence that belongs to multiple sets [ The first set we fix is that of the first randomly chosen spin, and then we test its intersection with the remaining sets.Nuclear spins whose sets have zero intersection with this initial fixed set are removed.In the end, we obtain a particular value of iterations (N * ) and nuclear spin candidates that can participate in a multipartite gate.
In the simulations that follow, we assume an electron spin S = 1/2, that could correspond to SiV − or SnV − defect in diamond [55][56][57][58].We further set the nuclear Larmor frequencies to be ω L = 2π • 314 kHz.The HF range 2π • [10,200] kHz we choose for the nuclei would for instance correspond to the median of the HF distribution for an isotopic concentration of ∼ 10 −3 in SiC [36].Such nuclei are weakly coupled since the HF parameters are smaller than 1/T * 2 , which is typically a few MHz [59,60] for NV centers, or in general for A, B 1 MHz [61] (∼1 MHz is also the electron linewidth for the neutral divacancy in SiC [36]).For HF strengths > 2π•6 kHz, the nuclei are within a distance of R < 15 Å from the vacancy site, while for strengths on the order of 2π•1 kHz, they are vacancy site ( Å) 100-200 [49] 1.61 13 C (1st neighbor) (NV diamond) ∼ 10-20 [49] 3.86 13 C (19.4, 13.9) [50] (3rd neighbor) (NV diamond, Cg [50]) vacancy site ( Å) 60-120 [53] 6.8 13 C (NV diamond) 20-50 [53] 8-9 13 C (NV diamond) 2-20 [53] 11.5 Considering the first resonance (k = 1 of one of the target spins) and using the CPMG sequence, we show ten nuclear spin one-tangles [Fig.6(a)] that are maximized for a unit time t = 3.1874 µs.In Fig. 6(b) we show the dot product of the rotation axes of each of the ten nuclei.It is apparent that the axes of each spin are nearly antiparallel since, for k = 1, the individual resonance times have only a small deviation from t = 3.1874 µs.Consequently, the only way for the one-tangles to be maximized is that the nuclei rotate with φ 0 (N * ) = φ 1 (N * ) ≈ π/2 [see Eq. ( 6)] and hence, the realized gate is close to a multipartite CR x (π/2).It is interesting to notice that, based on Table II, nuclear spins 6 and 7, 2 and 5, 4 and 8, as well as spins 1 and 9, have similar A values.In Ref. [21] it was reported that two weakly coupled nuclear spins (one of them was a spectator unwanted nucleus) showed similar A values, and thus the controlled gate on one of them also rotated the other one (potentially leading to unwanted residual entanglement), but this effect was not quantified in their quantum error-correction scheme.
In Figs.6(c),(d) we again show nuclear spin one-tangles and rotation axis dot products, but now for the k = 2 resonance.As the order of the resonance increases, the individual resonance times show a larger dispersion, leading to nuclear rotation axes that deviate from being an-tiparallel.For multiple nuclei to be (close to) maximally entangled with the electron, they would then have to compensate for this feature by rotating by an angle φ 0 that differs from π/2 [Fig.6(c)].
We can perform a similar analysis for the UDD 3 sequence for which again, the rotation angle of each nucleus is independent of the electron's state, i.e., φ 0 = φ 1 .The basic UDD 3 unit now contains an odd number of pulses and thus, needs to be repeated twice.For this reason, the UDD 3 angle per iteration is smaller than those of CPMG or UDD 4 (see Appendix G and Ref. [35]), implying higher precision on the accumulated angle, but slower multipartite gates.This behavior is verified in Fig. 6(e), where we plot the one-tangles of eleven nuclear spins versus their accumulated rotation angle, which is very close to π/2.As the first resonance is very sharp [see Fig. 6(f)], the nuclear rotation axes are very close to antiparallel.This gives rise to very high entanglement but a long sequence with N * = 487 repetitions.However, one can impose restrictions on the total time and still find very high onetangles for the k = 1 UDD 3 resonance.
On the other hand, for k = 3 [Fig.6(h)], the resonance is broader, and hence, the rotation angles of the target nuclei deviate in general from π/2 [Fig.6(g)], similar to what we observed for CPMG.The k = 1 UDD 3 resonance leads to higher entanglement since the unit time is smaller than for k = 3, implying greater precision in the accumulated rotation angle per iteration.Of course, one reason for the difference between the two resonances is the random selection of HF values, which is distinct in the two cases.In addition, the chosen number of sequence repetitions might not be optimal for k = 3.It is not surprising that particular resonances and iterations can lead to better nuclear spin control, as the rotation angle depends both on the sequence time and N .Since N takes discrete values, this implies that features of overor under-rotation result in imperfect entanglement.
Lastly, we consider the UDD 4 sequence.In this case, the rotation angle of each spin depends on the electron's state, and we cannot estimate analytically the maxima of one-tangles; instead, we identify them via numerical search.In Fig. 6(i) we show the one-tangles versus the rotation angles (φ j ) for nine nuclei selected from the randomly distributed ensemble, for k = 1 [lines with circles (diamonds) show φ 0 (φ 1 )].The dot product of the nuclear axes is shown in Fig. 6(j).Even though the dot product shows nontrivial jumps (due to φ 0 = φ 1 ), one can still obtain appreciable entanglement with multiple nuclei.The one-tangles in Fig. 6(k) and the dot products in Fig. 6(l) correspond to the k = 2 resonance.The entangling operations for UDD 4 are in general faster than for UDD 3 , since the former induces a larger nuclear spin rotation.An interesting feature that emerges from φ 0 = φ 1 is that the nuclei undergo a more complicated evolution, and entanglement generation can occur for multiple sets of rotation angles and axes.For example, we see that both in Fig. 6(i) and Fig. 6(k) it can happen that (φ 0 (N * ), φ 1 (N * )) ≈ (0, π) (or vice-versa) realizing a CR(π) operation with that particular nuclear spin [see Table IV in Appendix I 1].This is not surprising, since based on Eq. ( 6) for n 0 • n 1 = 0 [see spin "7" in Fig. 6(l)], G 1 = 0 if either φ 0 (N ) or φ 1 (N ) is (2κ + 1)π.

B. Effect of unwanted spins on gate-fidelity
Using the language of one-tangles, we showed that it is possible to realize direct multipartite gates, providing a speed-up compared to sequential entanglementgeneration schemes.However, the gate fidelity could still be affected by unwanted nuclei, especially if these become entangled with the electron.We now examine this issue.
To keep the discussion general, let us consider L nuclear spins in total, with K of them corresponding to the target nuclei that show maximal one-tangles.The L − K unwanted nuclei affect the target gate since in general, they have a non-zero degree of entanglement with the electron.This means that projecting the evolution operator onto the target subspace would result in a nonunitary gate.In Appendix A 2 we show how this can be avoided by using the Kraus operator representation of the partial trace channel, based on which we can work directly with the total evolution operator and do not need to specify an initial state for the system.The operatorsum representation [63] allows us to derive an analytical expression for the gate fidelity of the target subspace.As a target gate U 0 we consider the evolution operator of the K target spins in the absence of the unwanted spins, i.e., Using the analytical expressions for the Kraus operators, we find that the target subspace gate fidelity reads: (i) j and p (i) j are given in Appendix A 2. The summation is performed over the 2 L−K Kraus operators of the unwanted subspace.The expression of the gate fidelity depends solely on the parameters describing the unwanted spins' evolution since we assumed that U 0 is the evolution that would occur in the absence of any unwanted spins.The gate fidelity is clearly maximized when 2 .This happens when the unwanted spins evolve trivially (i.e., independently of the electron's spin state), which is an immediate consequence of the minimization of unwanted nuclear spin one-tangles.
To understand the impact of an unwanted spin bath on the target evolution we consider as our target nuclear spins three different groups from Sec. IV A: i) those we identified at the k = 2 CPMG resonance, ii) those at the The labels in all graphs show up to how many spins were "traced-out" from the total system.The unwanted spins have one-tangles in the range [0,0.76].The error-bars of the blue points show the intervals of one-tangles to which we assign unwanted spins and are the same for all differently colored lines.In the ranges where we cannot find up to 6 unwanted spins, we depict a smaller number of them.In (b) we have used the condition for the trivial evolution to identify unwanted nuclei which do not introduce any gate error.The dashed lines in the plots serve as a guide to the eye.k = 3 UDD 3 resonance and iii) those at the k = 2 UDD 4 resonance.For each case, we construct an ensemble of unwanted nuclear spins with randomly distributed HF parameters and identify those with one-tangles in the range [0, 0.76].As the target gate operation, we consider the evolution of the target spins of Eq. ( 15), isolated from unwanted nuclei.The gate error arises once we introduce unwanted nuclei, let them interact with the electron, and then trace them out to obtain the effective evolution in the target subspace.In reality, we never assume an initial state or trace out nuclei since we can use Eq. ( 16) to find the gate error by using only the information of the unwanted spins' evolution.
As an example, we gradually build up a bath of six unwanted, spectator nuclei by adding one of them at a time, in each case examining the impact on the gate error.To do this, we start with an ensemble of 3×10 5 nuclear spins with randomly distributed HF parameters (with a tolerance of at least 3 kHz difference for at least one of the HF components to ensure we have sufficiently distinct nuclei) such that their one-tangles span the range [0, 0.76].Since each unwanted spin has a different one-tangle, we divide the range [0, 0.76] into smaller intervals and assign the nuclear spin one-tangles into these intervals.In Fig. 7(a), we depict the infidelity 1 − F corresponding to the CPMG sequence as a function of the one-tangle interval.For each interval, we gradually increase the number of unwanted nuclei that contribute to the infidelity, starting from 1 and increasing up to 6. Due to the random distribution of HF parameters, it might be the case that there are fewer than six spins in some of these intervals (especially for low values of the one-tangle), in which case we show the gate error as we "trace out" a smaller number of spins.As expected, the gate error grows as we increase the size of the nuclear spin environment or as its entanglement with the target subsystem becomes substantial (as indicated by the magnitude of the onetangle).However, some nuclei can evolve trivially under the CPMG sequence, in particular those whose HF parameters obey the conditions for trivial evolution shown in Sec.II B. In Fig. 7(b), we show the gate error versus the one-tangles of unwanted spins that satisfy the condition for trivial evolution.All one-tangles are trivially zero, leading to a vanishing gate error.
In Fig. 7(c) and in Fig. 7(d) we show the infidelity of the multipartite gate under the UDD 3 or UDD 4 evolution.We notice that for UDD 4 , the one-tangles are distributed at higher values.This is a direct consequence of the more complicated dynamics that the nuclei undergo for this sequence.Recall that multiple conditions allow nuclei to entangle with the electron due to the fact that their individual rotation angles φ 0 and φ 1 are different.
It is interesting to note that for some values of onetangles, the gate error shows jumps and becomes very large.It is not surprising that this is possible even at relatively small values of one-tangles (∼ 10 −2 ) [see Fig. 7(c)].The reason for this behavior is that the unwanted spins could cause the evolution to deviate from the ideal isolated evolution of Eq. ( 15).However, the resulting gate may have a larger overlap with other target gates.Here we choose not to optimize over the resulting gate, as we want to show the overall tendency of the target subspace gate error as the entanglement of unwanted spins with the remaining system increases.In Appendix A 2, we provide a modified gate fidelity formula if one wishes to optimize over single-qubit gates acting on the target nuclei.
Although we have not optimized over the sequence parameters and target spin HF parameters, we see that a CPMG sequence with only N * = 8 repetitions and a total time of T ≈ 74.5 µs is still capable of entangling eight different nuclear spins with the electron and preserving the multipartite gate operation in general on par with UDD 4 .However, both UDD sequences are longer in this scenario and require a larger number of sequence iterations than CPMG (T = 1.48 ms and N * = 93 for UDD 3 , while T ≈ 0.38 ms and N * = 41 for UDD 4 ).Even though we do not compare directly the sequences (as their parameters differ), we see that resorting to long sequences does not necessarily imply enhanced protection of the target evolution.Moreover, in an experimental setup, it is preferable to use a smaller number of sequence iterations to limit potential pulse errors.Experimentally and numerically, it has been shown that CPMG outperforms UDD 6 [28] in decoupling capabilities, which is in agreement with a soft cut-off Lorentzian noise spectrum.Further comparison of the gate performance for CPMG, UDD 3 , and UDD 4 can be found in Appendix I 2, where we average over eight different ensembles of randomly generated unwanted nuclei for each sequence.

C. Multipartite gates in a 27 nuclear spin register
Up to this point, we have studied the qualitative behavior of multipartite gates for randomly distributed nuclear spins.In this section we consider an ensemble of 27 13 C atoms in an NV center (S = 1) in diamond, using HF parameters experimentally determined via 3D spectroscopy by the Delft group [32,64].To showcase the performance of multipartite gates, we will consider the CPMG sequence.We set the magnetic field to B = 403 G [32], which translates into a Larmor frequency of ω L ≈ 2π • 432 kHz for the 13 C nuclei.We further select the electron's spin projections to be s 0 = 0 and s 1 = −1.
To identify target nuclear spins, we could use our analytical expressions to find the number of iterations that maximize multiple one-tangles.Instead, to perform a more rigorous search, we optimize both the time of the CPMG unit and the number of iterations.We explore 135 different realizations (27 cases for each k ∈ [1,5]); in each case, we choose a resonance time of one of the 27 nuclei and vary it within ±0.25 µs.We further perform a search on the number of iterations by constraining the total time of the gate to be ≤ 1.5 ms.In this way, we restrict the gate time within T * 2 of the nuclei, which ranges from 3 to 17 ms [32].For each realization, we select the time and number of iterations that ensure: i) one-tangles of target nuclei > 0.8, ii) one-tangles of unwanted nuclei < 0.14, iii) mean value of unwanted one-tangles < 0.1.After we find the potential sets of (t, N * ) which fulfill all the above requirements, we choose a set that can simultaneously entangle two or more nuclear spins with the electron.If no such set exists, we ignore that case.In the end, we calculate the gate fidelity of the target subspace for each of the groups of (t, N * ) in the presence of the remaining unwanted spectator nuclei.
The computation of nuclear spin one-tangles requires only the information of the independent evolution of each nucleus.Hence, this allows us to simulate many nuclear spins without computational difficulty.The gate fidelity, on the other hand, involves 2 L−K Kraus operators (L = 27 and K is the number of target nuclei), which translates into 2 × 2 L−K additions [see Eq. ( 16)].As an example, a single run for K = 7 target spins and thus, 20 unwanted spins (∼ 2 × 10 6 additions) calculates the gate fidelity within ∼ 8 seconds, but for K = 2 (∼ 67 × 10 6 additions) it takes ∼ 4.5 mins (computational times are w/o parallel computing).However, it is still advantageous that we can do such computations without explicitly defining the Kraus operators.
We display our results in Fig. 8.In Fig. 8(a) we show the mean of target one-tangles, while in Fig. 8(b) we show the mean of the unwanted one-tangles for 27 different realizations, and resonances k ∈ [1,5].As expected, higher-order resonances in principle give rise to lower residual entanglement with unwanted spins [35].In Fig. 8(c) we show the number of target nuclei, whose onetangle mean is the one in Fig. 8(a).In general, as the order of the resonance k increases, nuclei tend to decouple more efficiently since the resonant times show larger dispersion, and hence, the number of target nuclei decreases.In Fig. 8(d) and Fig. 8(e), we show the number of iterations and total gate time.Higher-order resonances require fewer sequence repetitions since the accumulated nuclear rotation angle per iteration is larger.Finally, in Fig. 8(f), we show the gate error of the entangling operation.The first resonance yields the highest error since the spectator nuclei have larger residual entanglement with the target spins.The optimization tries to balance the trade-off between maximum achievable entanglement (i.e., target one-tangles > 0.8) and minimum gate error.Requiring lower values of individual unwanted one-tangles could reduce the gate error more.
We should further comment that the HF parameters of the 27 nuclear spins are smaller than the randomly generated ones in Sec.IV A (see Appendix I 1 and Appendix I 3).It is then a natural consequence that the gate times for the multipartite gates presented in this section are longer.Experimentally, one could identify better candidates for target nuclei to maximize the entanglement in the nuclear spin register while satisfying time constraints.Using target nuclear spins with a bit larger HF parameters could reduce the total gate time.
In addition, over-or under-rotation errors that cause the one-tangles of the target nuclei to deviate from their maximum values could potentially be remedied by direct driving of a few nuclear spins or by using hybrid sequence protocols as in Ref. [35].However, our results indicate that multipartite entangling operations can be reliably implemented with gate fidelities above 0.95 for k > 1 even without such measures.
D. Speed-up of controlled-gates for QEC Practical applications, such as quantum error correction (QEC), require gate durations to be much smaller than T * 2 of the spins which participate in the protocol to ensure reliable performance.Many QEC schemes require repeating a sequence of operations and/or measurements multiple times, and thus it is crucial to perform the gate operations fast; for example, one QEC cycle of Ref. [22] lasted for ∼ 2.99 ms.More specifically, for the three nuclei that participated in this QEC scheme [22], the durations of each sequential electron-nuclear entangling gate were 980 µs, 400 µs, and 1086 µs, respectively.The accumulation of errors due to decoherence during long gates could be partially alleviated by applying refocusing pulses to extend coherence times [25].However, such techniques add to the experimental overhead, making it desirable to use them only sparingly or not at all if possible; such methods can be avoided if we can accelerate the entangling gates by involving multiple nuclei in the operation simultaneously.
To demonstrate the advantages offered by the synchronous controlled gates, we select as an example case against sequential entanglement protocols, we perform another simulation where we entangle each Cj nucleus [j ∈ {4, 5, 15}] one at a time with the electron starting with C4.The constraints we impose on the sequential entangling gates are similar to those in the multi-spin case, such that the comparison of the two methods is fair.More details about the constraints and the optimal sequential gates can be found in Appendix I 4. For now, we stress that we restrict the duration of each entangling gate to be within 1.5 ms (the total gate time of all three gates can exceed 1.5 ms), to allow for potentially enhanced selectivity for each nucleus and a more direct gate fidelity comparison with the multi-spin entanglement protocol.
For each Cj nucleus, we search over the first ten resonances (k ∈ [1,10]) and number of CPMG iterations that satisfy our constraints and choose the optimal CR x (π/2) gates [see Table X of Appendix I 4].For C4, we find that the optimal gate time is T ≈ 0.93 ms with an error due to residual entanglement of 1 − F = 0.1133.By performing only this single entangling gate, we already exceed the gate time of ∼ 0.58 ms of the multipartite operation.For C5, we find that a CR x (π/2) gate can be performed at the shortest gate time of ∼ 68 µs, which leads to a gate error of 1 − F = 0.1045.The results for C15 are rather surprising; although we search over ten difference resonances, the best CR x (π/2) gate we can achieve is long (∼ 1.344 ms), and the error (1 − F = 0.1421) is larger than the other two entangling gates.
Overall, we see that the sequential gates for the {C4, C5, C15} set lead to significant gate error since these fail to decouple each nucleus from the remaining spin bath effectively.The total gate time of the sequential entangling operations is ∼ 2.342 ms, already four times larger than the gate time of the multipartite gate on {C4, C5, C15}.Further, the sets we identified as target spins for the multi-spin gates in Sec.IV C contain nuclei, which when attempted to be addressed individually, lead to electron-nuclear entangling gates that suffer from cross-talk arising from the other nuclear spins of the set.Indeed, this is verified by the gate error sources we identified [see Table VIII of Appendix I 3]; for example, the infidelity of the C4 entangling gate is due to nonzero residual entanglement of the electron with the C15 nucleus.Similar observations hold for the errors of the other two sequential gates.Thus, our formalism not only provides a faithful metric of nuclear spin selectivity but identifies cross-talk issues and optimal nuclear spin candidates for performing entangling gates within time constraints.
In Fig. 9 we compare the multi-spin protocol with the sequential entanglement generation scheme.In the latter case, the gates are very close to CR x (±π/2) [see Figs.9(f), (g), (h) and Table XI

E. Three-qubit bit-flip code
Let us now consider a three-qubit measurement-free QEC protocol that does not require stabilizer measurements or ancillary qubits, and can correct a single bitor phase-flip error [65].Our goal is to protect the initial state of the electron.Using two nuclei which we assume have been initialized into the |1 state, we will show how to use the CR xz multi-spin operations to recover the electron's state from a single bit-flip error.We will also compare the performance of this approach with the sequential entangling gate protocol.
The QEC protocol consists of three parts: i) the encoding of the electron's physical state into a logical state, ii) the decoding, and iii) the correction.The latter is performed by decomposing the three-qubit Toffoli gate (controlled on the nuclei) using single-and two-qubit gates [65].The entire QEC circuit of the sequential protocol can be found in Appendix I 5 and Ref. [65].Such a measurement-free QEC protocol has been realized experimentally in Ref. [21], where very high theoretical fidelities (in excess of 99%) of electron-nuclear entangling gates were reported.However, in Ref. [21] it was mentioned that these estimates did not account for the presence of unwanted nuclei, which leads to extra loss of electron coherence.Here we show explicitly that the presence of the unwanted spin bath can have a significant impact on the implementation of target operations, especially when it undergoes substantial entanglement with the electron.
In the following analysis, we consider that only the electron and the two nuclei that are part of the protocol are present since we cannot simulate the full density matrix of 28 qubits.Although we ignore the presence of the remaining nuclei, our analysis is complete as will provide the gate errors that capture residual entanglement links with nuclei from the entire register.
To explain the principles of the multi-spin three-qubit QEC protocol, suppose that we wish to recover an arbitrary state of the electron from an X-error that happens after the encoding.We implement the encoding and decoding using the CR xz gate.In the absence of errors, the encoding and decoding gates need to combine to flip the initial |11 state of the nuclei into |00 , such that the subsequent Toffoli gate is not activated.Due to the more complicated dynamics induced by the multispin gates, this requirement is not satisfied by the encoding/decoding CR xz gates alone.We resolve this issue by introducing unconditional R y (−π) gates on the nuclei in between the two encoding/decoding CR xz gates; this ensures that the encoding/decoding and R y (−π) gates compose together so as to flip the nuclei, and deactivate the subsequent Toffoli gate [see Appendix I 5 for a proof].
The correction circuit is composed of unconditional nuclear and electron rotations, as well as CR x (π/2) gates.For simplicity, we will treat the additional R y (−π) rotations that we require as part of the encoding and the gates of the correction circuit as ideal.We do not find the optimal parameters to perform the correction gates, since we would numerically optimize and implement them in the same way for both the sequential and the multi-spin schemes.The R y (−π) rotations can be implemented by direct driving of the nuclei or composed through unconditional R x and R z gates obtained via dynamical decoupling sequences [65], through appropriate tuning of the interpulse spacing of the sequence.
A bit-flip on the electron makes the rotation that each nucleus undergoes during the encoding differ from the one it undergoes during the decoding.The success of our protocol lies in the fact that now the CR xz and R y (−π) gates combine to rotate the nuclei approximately about the z-axis.This means that the nuclei return close to the |11 state, activating the subsequent Toffoli gate.The evolution of the nuclei up to the decoding involves also a non-vanishing x-axis rotation.Consequently, at the end of the decoding, the nuclei are not fully disentangled from the electron.However, the x-rotation is quadratically suppressed by the nuclear Larmor frequency [see Appendix I 5], meaning that the recovery operation brings the electron close to its initial state, but as we will quantify shortly, the electron's final state is slightly mixed.
To illustrate the performance of the multi-spin QEC scheme, we start with the recovery of the electron state |y from a bit-flip error.We consider case #22 and k = 4 of the multi-spin gates of Fig. 8, for which we entangle the electron with nuclei C10 and C12.The gate error due to residual entanglement with unwanted spins is 1 − F ≈ 0.04, and the gate time is T ≈ 645.6 µs.In Fig. 10(a), we show the coefficients of the three-qubit state at each step of the circuit, prior to the encoding and up to the correction step.We find that the probability of recovering the electron's state is 99.63%.The electron's reduced density matrix [Fig.10(b)] after tracing out the two nuclei verifies that it is close to the desired |y y| state; the purity is found to be 99.26%.In Fig. 10(c) we show the error probability, defined as 1 − | ψ el,0 |ψ final | 2 (|ψ el,0 is the electron's initial state and |ψ final the final three-qubit state) for arbitrary initial states |ψ el,0 = cos(γ/2)|0 + e iδ sin(γ/2)|1 .We find that in all cases, we recover the electron's state with an error on the order of ∼ 10 −3 .
We perform a similar analysis for the recovery of the |π/3 = cos(π/6)|0 + sin(π/6)|1 state, now for case #13 and k = 4 of Fig. 8.For this realization, we again entangle the electron with nuclei C10 and C12; the gate duration is T ≈ 827 µs, and the gate error due to residual entanglement is 1 − F ≈ 0.0152.In Fig. 10(d), we show the coefficients of the three-qubit state, and in Fig. 10(e) the electron's reduced density matrix, whose purity is 99%.We find that the recovery probability is 99.5%.In Fig. 10(f), we show the error probability for arbitrary initial states of the electron.In Fig. 10 We now compare our direct multi-spin protocol with the sequential three-qubit QEC code.For a fair comparison, we impose constraints on the sequential entangling gates that are similar to those of the multi-spin operation.By searching over the first ten resonances of C12 or C10 we find a list of acceptable CR x (π/2) gates [see Table XII of Appendix I 6].For C12, the CR x (π/2) gate can be implemented with error 1 − F = 0.0238 due to unwanted residual entanglement and duration of 449.4277 µs.This gate is faster than the two cases of multi-spin operations mentioned previously [although faster multi-spin gates were found in Fig. 8], with an error lower than case #22 and k = 4, but higher than case #13 and k = 4.Note that in Fig. 8, the multi-spin gates were restricted to k ≤ 5, but to implement the CR x (π/2) gate reliably, we expanded the search over k ≥ 5, as higher-order resonances are needed for improved selectivity for the sequential scheme.Addressing the C10 nucleus is much more challenging than addressing C12.In the time constraint of 1.5 ms, the lowest infidelity is ∼ 0.384; imposing a new constraint of 5 ms, we find that the CR x (π/2) gate can be implemented for a duration of ∼ 3 ms with an infidelity of ∼ 0.106.
The sequential scheme can, in principle, succeed with a recovery probability of 100%, assuming all gates are error-free, since the disentanglement in the decoding step can be perfect [see Appendix I 5].Nevertheless, errors due to unresolved residual entanglement reduce the probability of recovering the electron's initial state.That is, tracing out unwanted spins and the nuclei of the protocol yields in general a mixed density matrix for the electron.Thus, in cases when cross-talk errors cannot be resolved by the sequential scheme, the recovery probability is expected to be smaller for the sequential protocol compared to the multi-spin scheme, and the electron's reduced density matrix more mixed at the end of the correction.
For both protocols, it is necessary to implement the correction CR x (π/2) gates reliably.The advantage of the multi-spin QEC scheme lies in the fact that it can reduce the encoding and decoding durations by utilizing the CR xz operations, while to ensure reliable CR x (π/2) correction gates, we can allow more relaxed time constraints for the Toffoli implementation.In this way, we save time during the first two parts of the QEC scheme.On the other hand, the entire sequential QEC scheme relies on the successful performance of the CR x (π/2) gates, which are implemented using the same optimal sequence parameters for all parts of the circuit.Thus, in the sequential QEC scheme, one might have to trade off gate fidelity with speed of operations, and the total duration of the gates can quickly exceed the coherence times.
Interestingly, both protocols can be combined to provide optimal performance of the QEC codes.For example, reliable and fast CR x (π/2) encoding/decoding gates could be combined with CR xz encoding/decoding gates to address subsets of nuclei that cannot be resolved individually within given time constraints.Considering that the number of spinful nuclei in experimental conditions could be hundreds, it is highly likely that particular CR x (π/2) gates will fail to provide both speed of operation and selectivity of a single spin.This was verified, for example, in Ref. [25], wherein certain electronnuclear Bell-state fidelities were as low as 63% due to unresolved cross-talk arising from nearby nuclei, combined with loss of coherence due to long two-qubit operations.Inability to address nuclei individually means that they would have to be excluded from any protocol (i.e., decoupled such that they don't induce errors) but could become a valuable resource using the multi-spin gates.The CR xz encoding/decoding gates would be accompanied by R y (−π) unconditional rotations on these nuclear spin subsets, which, as we mentioned previously, are required for the multi-spin QEC scheme.
Our analysis shows that the multi-spin entangling gates can drastically reduce the entanglement generation time and mitigate dephasing issues.In a measurementfree QEC scheme, the entanglement generation speed-up could be crucial for protecting the logical state; leaving it unprotected for a shorter duration reduces the probability of errors occurring during the decoding step.Additionally, the synchronous controlled gates can outperform the sequential entanglement schemes, especially when we cannot resolve cross-talk issues.An interesting future direction would be to examine further the utility of CR xz gates for QEC protocols, and potentially adjust the correction circuit to account for the imperfect disentanglement at the end of the decoding.

V. CONCLUSIONS
Nuclear spins are an essential component of spin-based solid-state platforms for quantum networks.Harnessing their full potential to create large-scale quantum networks requires a detailed understanding of and precise control over the entanglement distribution in the system.We showed how to quantify the entanglement in a multi-nuclear spin register coupled to a single electron qubit and presented a faithful metric for nuclear spin selectivity.We studied the properties of CPMG, UDD 3 , and UDD 4 sequences and extended their resonance conditions to arbitrary electron systems for applicability to any defect qubit in diamond or SiC.We further showed how to implement synchronous controlled gates on multiple nuclei by driving the electron appropriately.Such multipartite gates provide a speed-up over the conventional way of generating sequential entanglement links, especially for large nuclear spin registers, where the total sequence time can exceed the dephasing time.We quantify the performance of multipartite gates implemented by CPMG, UDD 3 , or UDD 4 sequences in the presence of unwanted nuclear spins, revealing that the gate fidelity tends to decrease as the residual entanglement with the unwanted bath becomes significant.Using experimental parameters for 27 13 C atoms in close proximity to an NV center in diamond, we have further verified that such multipartite gates can be performed reliably and with high fidelity, and can facilitate implementations of quantum error correction codes.
Appendix A: Mathematical description of multi-spin nuclear register

Evolution operator of multiple spins
We mentioned in the main text that π-pulse sequences generate an evolution operator which is a sum of terms, each of which includes an electron spin projector tensored with a product of single-qubit gates acting on the nuclei.Here, we show this explicitly.Let us consider for simplicity two nuclear spins, with HF parameters A l and B l [l ∈ {1, 2}].Neglecting inter-nuclear spin interactions, the secular Hamiltonian is given by: where we have defined H x and σ (l) z being the Pauli matrices which act on the l-th spin (and the identity acts on the other spin).As a concrete example, let us focus on the CPMG sequence (t/4 − π − t/2 − π − t/4).Its evolution operator over one unit of the sequence (which consists of two pulses) has the form: j ] = 0, and thus we can write down the total evolution operator as where R 1 ) = e −iH (1) 1 t/4 e −iH (1) 0 t/2 e −iH (1) 1 t/4 ), and similarly for R (2) nj (φ (2) j ).Therefore, if more nuclear spins are considered, their Hamiltonians commute and thus, one obtains a tensor product of single-qubit rotations acting on the nuclei.

Kraus operators and gate fidelity
In the main text, we mentioned that the unwanted nuclei affect the gate fidelity of target nuclei when the former have non-zero entanglement with the target subspace.Here we provide the steps to obtain the formula for the gate fidelity of the target subspace.
One way to describe the evolution of the target subspace in the presence of unwanted spins is by tracing out the latter.This procedure can be performed on the density matrix level, but this requires that we specify an initial state for the system.To avoid this limitation, we can instead describe the same partial-trace channel using the operator-sum representation [63].The elements of the partial-trace channel are Kraus operators, defined via a chosen complete basis for the environment (i.e., the unwanted spins).Since one can choose any complete basis, the Kraus operators are not unique.Using the operator-sum representation then, one can naturally extend the fidelity of a general quantum operation into the form [66]: where m = 2 K+1 is the dimension of the target subspace (consisting of the electron and K target spins), whereas E k are the Kraus operators of the quantum channel described by E(ρ) = k E k ρE † k , and they satisfy the completeness relation k E † k E k = 1.We assume L nuclear spins in total, with K target ones and hence, L − K unwanted.The environment is thus spanned by 2 L−K basis states.We further assume that we have permuted the total evolution operator U such that the target spins appear first in the tensor product with the electron's projector and the unwanted spins appear in the last positions, i.e.: ).
(A6) Without loss of generality, we consider the initial state of the environment to be |e 0 ≡ |0 ⊗(L−K) , which when extended to the total space becomes |e 0 = 1 K+1×K+1 ⊗ |0 ⊗(L−K) .Here 1 K+1×K+1 is the identity gate acting on the space of target spins and the electron.We further define the complete computational basis {|e , where all |e i states correspond to all possible bit-strings of zeros and ones.The states |e i are again extended into the total space as |ẽ i = 1 K+1×K+1 ⊗ |e i .With these definitions we are now ready to introduce the expression for the i-th Kraus operator of the partial-trace quantum channel: If for the state |e i the m-th nuclear spin of the environment is in state |0 then we have: and whenever the m-th ket is |1 we have: x,j + in Suppose that out of the L − K spins in the environment M of them are in |0 and the other L−K −M are in state |1 .Substituting Eq. (A8) and Eq.(A9) into Eq.(A7) we obtain the final form of the i-th Kraus operator: 2 ) , while {n x , n y , n z } correspond to the rotation axis components of each nuclear spin.In the case when M = L − K (i.e., |e i = |0 ⊗(L−K) ) it holds that p (i) j = 1, and in the case when M = 0 (i.e.|e i = |1 ⊗(L−K) ) it holds that c The last element we need to evaluate the expression of the gate fidelity for the target subspace is the target gate operation U 0 .We take as our target gate the evolution operator of the K target spins in the absence of the unwanted spins, i.e., By substituting Eq. (A11) and Eq.(A10) into Eq.(A5), we find that the expression of the gate fidelity reads: (A12) where we have used the fact that U 0 is a 2 K+1 × 2 K+1 target gate, the Kraus operators, E k , are projectors with dimension 2 K+1 × 2 K+1 , as well as the trace property of the Kronecker product tr In Sec.IV B, we mentioned that one can optimize the gate fidelity over the target gate.For a generic target gate, it is difficult to find a closed form expression of the gate fidelity.For this reason, we assume a target gate of the form: where now one would have to optimize over the single qubit rotations that act on the target nuclear spins.Again, the first step is to calculate U † 0 E i which gives: Evaluating the trace gives: where we have have defined . Finally, the fidelity expression reads: Clearly, for φ and n j , f j = 1 and we recover Eq. (A12).To find if there is a higher overlap with the target gate of Eq. (A13), one would have to optimize over the set {φ j }, which corresponds to the parameters of the single qubit rotations that act on the target subspace.Such a computation could be potentially performed via gradient-based optimization methods, supplemented by the Jacobian.If a target gate with better overlap is found, then the one-tangles be reevaluated using the optimized set {φ j } to obtain the entanglement distribution of the target subsystem.

Appendix B: Resonance times
For completeness, we present the formula for the coherence function P x ; this function is used to derive the resonance times.The expressions we present below can also be found in Ref. [19].In DD protocols, the electron is initialized in the |+ state; assuming a single nuclear spin, the initial density matrix is given by: where the tensor product is implied between kets and bras.The probability to find the electron in the |+ state after some time t is P x = +|ρ(t)|+ , where ρ(t) = U ρ 0 U † is the time-evolved density matrix of the system.Further, Evaluating +|U ρ 0 U † |+ we obtain: The probability to find the electron in the |+ state (irrespective of the nuclear spin state) is the trace of Eq. (B3) with respect to the nuclear spin state: and therefore, M = 1 2 Tr(U † 0 U 1 ) = 1 2 Tr(U 0 U † 1 ).Finally, by setting U j = R nj (φ j ), M becomes: In the case of φ 0 = φ 1 ≡ φ, M can be re-written as: Using the explicit expression for U j , one can derive the resonance condition by setting n 0 • n 1 = −1 in Eq. (B7) for sequences that produce the same nuclear spin rotation angle.For sequences that produce different nuclear spin rotation angles (e.g.UDD 4 ) one would have to use Eq.(B6).

Appendix C: Nuclear spin rotation angles
Here we provide the expressions for the nuclear spin rotation angles corresponding to 2-π, 3-π, and 4-π sequences (meaning two, three, or four π pulses in a single and Larmor frequency ω L = 2π • 314 kHz as in Sec.III B. However, in this case, we assume a defect electron system S = 1, and we define the qubit using the spin projections s 0 = 0 and s 1 = −1.As in Sec.III B, we choose the CPMG sequence.First, we consider the k = 1 resonance of the target spin i.e, we set the basic unit time to be t = 3.5102 µs and set the number of iterations to be N = 20, which gives rise to maximum one-tangle of the target spin.In Fig. 12(a), we plot the one-tangle of an unwanted nuclear spin whose HF parameters could lie in the range ∈ 2π • [10,200] kHz.We further indicate with circles the HF parameters of an unwanted spin, which satisfies approximately the condition for trivial evolution, in Sec.II B. To display these points, we set a bound for the unwanted one-tangle to be 12|3 < 0.02 and a tolerance for satisfying the trivial evolution of 1.3 × 10 −2 .We see that indeed the minimal one-tangles correspond to nuclei that approximately evolve trivially.
In Fig. 12(b), we minimize the unwanted one-tangle by searching over the first five resonances of the target spin and iterations of the basic unit that preserve maximum entanglement between the target register and the electron.The optimal repetitions of the basic CPMG unit, as well as the optimal resonances, are shown in Fig. 12(c) and Fig. 12(d) respectively.
To understand geometrically the rotation angle induced by each sequence we use the Rodrigues formula [67] for the composition of rotations.Two rotations of the form R l (α)R m (β) give rise to the total rotation R n (γ) for which the rotation angle is given by: while the rotation axis is given by: (G2) We apply this composition law repeatedly to find the induced nuclear spin rotation after each free-evolution period of the sequence has passed.For the CPMG sequence, there are two compositions and three free-evolution periods, UDD 4 has four compositions and five free-evolution periods, and UDD 3 has six compositions and seven freeevolution periods.UDD 3 has more free-evolution periods than UDD 4 because we repeat the basic unit twice to yield a new sequence unit.In this way, we ensure that the electron returns to its initial state since the new basic block of the sequence has an even number of π-pulses.
Without loss of generality, we consider an electron spin S = 1, with s 0 = 0 and s 1 = −1, and assume that the electron starts from the |0 state (similar analysis holds when the electron starts in |1 ) and is flipped repeatedly according to the number of π-pulses in the CPMG or UDD units.(c) rotation angles.We compose the rotations of the freeevolution periods for one unit of the sequence using the Rodrigues formula.The last composition gives rise to the black spherical triangles.In (a) we show CDB which gives the total rotation angle γ.We find that geometrically the rotation angle of CPMG is larger.
In Fig. 13 we show the rotation axes of a single nuclear spin [(ω L , A, B) = 2π • (314, 120, 90) kHz and t = 3.7889 µs] after each composition.In each free-evolution period the nuclear spin rotates alternately about axis 'A' and 'B'.For example, in Fig. 13 and so one would conclude that γ CPMG < γ UDD4 < γ UDD3 .However, these rotation angles are close to 2π and hence we need to consider as actual rotation γ = 2π−γ.Therefore, we find that it holds: γCPMG > γUDD4 > γUDD3 . (G3) Thus, UDD 3 produces the finest rotation angle of all three sequences, which can offer greater precision, but CPMG is the fastest of all.
Appendix H: Derivation of one-tangles for the electron and a nuclear spin In this section we prove that the nuclear spin onetangle essentially reduces to the two-qubit entangling power.We start from the general expression for an arbitrary number n of qubits (with n − 1 nuclear spins): where Θ(n − 3) is the step function.Clearly for n = 3 the last term vanishes and we recover 2/9(1 − G 1 ).For n > 3 we have: (1−G 1 ), (H2) which concludes our proof.
For the electron, we start from the expression: Appendix I: Parameters of the multipartite gates

Random generation of nuclei
In Tables II, III, IV we list the HF parameters of the randomly generate nuclei (labeled by #) we used in Sec.IV A. We present their one-tangles, rotation angles, dot product of rotation axes, and positions compared to the vacancy site.To estimate the distances and polar angles of nuclei, we use the approach found in the supplemental of Ref. [36,68] and in Ref. [53].Since we are studying weakly coupled spins far away from the electron, the interaction is well approximated by the dipole-dipole interaction, and the Fermi contact interaction is negligible.The hyperfine vector can be broken into parallel and perpendicular components which are related to the polar angle θ and the distance R by: B = 3A 0 cos θ sin θ, (I1) with A 0 = µ 0 γ n γ e /(4πR 3 ).We solve these equations for R and θ, assuming 13 C atoms and present the values in the tables.

Gate error comparison for the three sequences
Here we provide a more thorough calculation of the gate error of multipartite gates under the CPMG, UDD 3 , or UDD 4 evolution.Following a similar approach as in Sec.IV B, we generate ensembles of 5 × 10 5 unwanted nuclear spins with randomly distributed HF parameters and identify those with one-tangles in the range [0.1, 0.7].We keep the same number of repetitions and gate time we considered for each sequence in Sec.IV B. However, in this case, we repeat the random generation 8 times to produce 8 different ensembles of 5 × 10 5 unwanted nuclei.For each of these 8 different ensembles we repeat the same procedure as in Sec.IV B; we gradually increase the size of the unwanted spin bath (which contains up to 6 spins) and calculate the gate error it induces on the target subspace.At the end, we take the average of the error (over the 8 ensembles) for each case of unwanted spin bath size (from 1 up to 6 spins).Notice that the 8 ensembles are distinct for each sequence.
In Fig. 14 we show the gate error averaged over the 8 different realizations of unwanted spin ensembles for CPMG (a), UDD 3 (b) and UDD 4 (c).We notice that CPMG performs in general on par with UDD 4 , while UDD 3 fails to protect the target subspace as effectively as the other two sequences.Although in this scenario UDD 3 has the longest total gate time of all three sequences (as we mentioned in the main text), we see that choosing a longer sequence does not always ensure improved performance.To provide a comparison of the gate error we further evaluate the average gate error in each range of one-tangles.That is, we average the gate error for each fixed interval of one-tangles as The results are shown in Fig. 14(d) where we see that UDD 3 underperforms the other two sequences.

Parameters for 27 nuclear spins
The HF parameters for the 27 nuclear spins [32] we considered in Sec.IV C are listed in Table V.In addition, in Tables VI, VII, VIII, IX we list the target spins of Fig. 8 for each of the 27 different realizations of each resonance k, their one-tangles and the gate error., 3), 1 − F = 0.1133 and T * ≈ 0.9337 ms.There is no other optimal case for C4 within the time constraint of 1.5 ms and unwanted one-tangles below 0.2.The optimal parameters for C5 are: (N * , k * ) = (6, 3), T * ≈ 68.24 µs, and 1−F = 0.1045; there are other cases that satisfy the time constraint and tolerance of unwanted one-tangles of 0.14, but we selected the fastest option.The optimal parameters for C15 are (N * , k * ) = (118, 3), T * ≈ 1.3439 ms, and 1 − F = 0.1421; the tolerance for unwanted one-tangles for C15 was 0.31.For the time constraint of 1.5 ms, we found no other optimal case to address only C15.
Here we provide the parameters we considered in Sec.IV D. To obtain the optimal sequential CR x (π/2) gates with C4, C5 and C15, we set the time constraint of 1.5 ms for each sequential gate.We further require that the unwanted one-tangles of the remaining 26 unwanted spins are below 0.14-0.4(we cannot satisfy the unwanted one-tangle bound of 0.14 for all cases of addressing each Cj nucleus).The unwanted one-tangles for the optimal choices we found are listed in Table X.The rotation angles and axes for the sequential and multi-spin gates of Fig. 9

QEC with CRxz multi-spin gates
In this section, we provide the details of how we implement the three-qubit bit-flip code using the CR xz gates.First, we will explain the three-qubit bit-flip code that utilizes the sequential CR ±x (π/2) gates.The circuit to implement the QEC code using the latter scheme is shown in Fig. 15(a); the CNOT gates used in the usual QEC code have been expressed in terms of the CR ±x (π/2) gates as well as initialization of the nuclei into the |1 state, while the Toffoli gate has been decomposed into single-qubit gates and CR ±x (π/2) gates.The CR ±x (π/2) shown in Fig. 15 are given by: where we define R x (φ) = e −i(φ/2)σx .The half-white, half-black control implies that when the electron is in the |0 state, the nuclear spin still undergoes a rotation, but it differs from the one it undergoes when the electron is in the |1 state.The electron rotation angles θ j have to satisfy particular relations to ensure recovery of the electron's state.If no error occurs, then the final state is: α cos( Θ 2 ) + iβ sin( Θ 2 ) −α cos( Θ 2 ) − iβ sin( Θ 2 ) −α cos( Θ 2 ) − iβ sin( Θ 2 ) α cos( Θ 2 ) + iβ sin( Θ 2 ) β cos( Θ 2 ) + iα sin( Θ 2 ) −β cos( Θ 2 ) − iα sin( Θ 2 ) −β cos( Θ 2 ) − iα sin( Θ 2 ) β cos( Θ 2 ) + iα sin( Θ 2 ), where we have defined Θ = θ 1 + θ 2 − θ 3 − θ 4 .Clearly in order to preserve the initial state of the electron it has to hold that Θ = 2κπ.In this case, the final state is (α|0 + β|1 )|x |x , where |x = (|0 − |1 )/ √ 2. Based on the above observations we find that we can satisfy both conditions for Θ and Θ if we chose the θ j to satisfy: It is clear that in the sequential protocol if no error occurs on the electron's state, the CR ±x (π/2) gates of the encoding add up with those of the decoding step to produce CR ±x (π) gates which flip both nuclear spins into the |00 state and hence the subsequent Toffoli gate is not activated.We should further mention, that in the case where a single bit-flip happens on either the first or second nuclear spin, and we are interested in preserving the initial state of the electron, then the θ j need to be constrained further.That is, we have two more conditions, namely if the bit-flip happens on the first nucleus, then the angles need to satisfy θ 1 + θ 2 + θ 3 + θ 4 = 2π, whereas if the bit-flip happens on the second nucleus, the angles need to satisfy θ 1 − θ 2 + θ 3 − θ 4 = 2π.Combining these constraints with the θ j constraints when a bit-flip or no bit-flip happens on the electron, we find that θ j need to satisfy Let us return to the CR xz QEC protocol and consider first the case where no error happens on the electron.Now, the CR xz gates of the encoding and decoding would again add up, but in general, the total gate would not be equivalent to a bit-flip operation that brings the state |11 of the nuclei into the |00 state.However, if we put R y (−π) gates on the nuclei at the encoding step and right after the CR xz gate, we would then have the total gate CR xz [1 2×2 ⊗ R y (−π) ⊗ R y (−π)]CR xz .If we consider the case when the electron is in the |0 state and consider the part of the gate acting on the first nuclear spin, we find that the total gate is: where in the last line we have used the fact that timesymmetric π-sequences do not produce an n y rotation component and thus, n 2 x +n 2 z = 1.(Note that we consider here a π-pulse sequence that produces the same rotation angles irrespective of the electron's state i.e., φ 0 = φ 1 ≡ φ.)The same analysis follows for the second nuclear spin, and for the case when the electron is in state |1 and thus, CR xz [1 2×2 ⊗ R y (−π) ⊗ R y (−π)]CR xz is equivalent to i 2 1 2×2 ⊗ σ y ⊗ σ y if no error occurs on the electron.Thus, we see that the CR xz [1 2×2 ⊗ R y (−π) ⊗ R y (−π)]CR xz gate leads to the desired bit-flip operation of the nuclei, deactivating the subsequent Toffoli-gate.This is verified schematically in Figs.16(a) and (b), where we show the Bloch sphere evolution of nuclear spins C10 and C12 [that we considered in Sec.IV D] respectively, up to the decoding, assuming no error has occurred on the electron.Now, let us assume that a bit-flip error happens on the electron.At the encoding step, which includes the R y (−π) rotations, the encoded state becomes: (1)  n0 |1 ⊗ R y (−π)R (2)  n0 |1 + β|1 ⊗ R y (−π)R (1)  n1 |1 ⊗ R y (−π)R (2)  n1 |1 .

(I9)
After the bit-flip and the decoding step the state becomes: n1 R y (−π)R (1)  n0 |1 ⊗ R (2)  n1 R y (−π)R (2)  n0 |1 + β|0 ⊗ R (1)  n0 R y (−π)R (1)  n1 |1 ⊗ R (2)  n0 R y (−π)R (2)  n1 |1 .at the state |11 such that we activate the Toffoli-gate, recovering the electron's state with high probability.To see this, let us consider R where G (j) 1 = cos 2 φ (j) 2 +sin 2 φ (j) 2 (n 0 •n 1 ) (j) .Since for the multi-spin gates we choose the number of iterations N such that G (j) 1 is minimized for all j-nuclear spins (i.e., G (j) 1 ≈ 0, ∀j), then the y-component of the composite rotation vanishes.Further, for the CR xz gates, and considering the CPMG sequence, it holds that n x,0 •n x,1 < 0, and that n z,0 ≈ n z,1 +δ, where δ is small, as we will show shortly [for brevity, we drop superscripts j which refer to the j-th spin].Let us further consider the action of the CR xz gate on a single nuclear spin (similar analysis holds for more nuclei).As we mentioned in Appendix A 1, the evolution of a nuclear spin over one unit of the CPMG sequence is defined by the Hamiltonians H j = 1 2 [(ω L + s j A)Z + (s j B)X], where the nuclear rotations over one unit of the sequence are: R n0 = e −iH0t/4 e −iH1t/2 e −iH0t/4 and R n1 = e −iH1t/4 e −iH0t/2 e −iH1t/4 .Letting cos θ j = (ω L + s j A)/ω j [where ω j = (ω L + s j A) 2 + (s j B) 2 ] and sin θ j = s j B/ω j , we find the SU(2) decomposition of Eq. (I11), and focusing on the z-components we find that it holds: Thus, in Eq. (I11), we will have suppressed x-component of rotation, meaning that each nucleus will rotate approximately around the z-axis irrespective of the electron's state.Since each nucleus is initialized in the |1 state, an R z rotation will only approximately lead to a global phase.The non-zero difference of the z-axis components is what makes our CR xz QEC protocol probabilistic, since the disentanglement at the decoding step is imperfect, but it succeeds with high probability because the difference in the z-components is, in general, small (the external B-field is typically chosen such that ω L A, B).
6. Parameters for three-qubit QEC with CRx(π/2) In Table XII, we provide a list of the optimal CR x (π/2) gates for nuclear spins C10 and C12 using the sequential entanglement scheme, we considered in Sec.IV D. ) and resonances (k * ) to perform CRx(π/2) between the electron and C12 or C10.We provide a list of optimal cases for T ≤ 1.5 ms for C12.For C10 we could not satisfy the bound of unwanted one-tangles for this time constraint, so we further list cases for T up to 5 ms.

FIG. 2 .
FIG. 2. Hyperfine parameters of nuclear spins that undergo a trivial evolution under the CPMG sequence.Each circle corresponds to a constant time of one CPMG unit and different value of κ [see main text].In (a) we have selected the electron's spin projections s0 = −s1 = 1/2 and in (b) s0 = 3/2, s1 = −1/2.The Larmor frequency was considered to be ωL = 2π • 314 kHz.For illustration purposes, we have shown mainly times t ∈ Z + , but t could also take any positive non-integer values.

FIG. 4 .
FIG. 4. Function G1 versus the rotation angles φj for the case of n0 • n1 = 1 (a) and n0 • n1 = −1 (b).(c)Maximum one-tangles as a function of the number of qubits for the case when the electron (blue) or a single nuclear spin (red) is partitioned from the rest of the system.The yellow line is the theoretical maximum bound for a perfect U (n) entangler, while the purple line is the numerical bound we found for randomly generated U (n), obtained by retaining the maximal value over 100 random unitaries for n = 4, 5 and 5 random unitaries for n = 6.For n = 3, we construct a U (n) from an absolutely maximally entangling (AME) state.Such U (n) saturates the bound, if the AME(2n, d) state exists (in this case d = 2).

FIG. 5 .
FIG. 5. Controlling a target nuclear spin with parameters (A, B, ωL) = 2π • (60, 30, 314) kHz, in the presence of an unwanted spin with HF parameters ∈ 2π•[10, 200] kHz.(a) Onetangle of the unwanted spin scaled by the maximum bound of 2/9.The time of one sequence unit is the first resonance of the target spin, and the number of iterations is N = 25, which maximize its one-tangle.(b) Minimization of the unwanted spin's one-tangle using the first five (k = 1, . .., 5) resonances of the target spin, and up to 300 pulses on the electron.Optimal sequence iterations (c) and optimal resonance (d) to minimize the unwanted spin's one-tangle, while keeping the one-tangle for the target spin maximal.In all plots, we considered an electron spin S = 1/2, and the CPMG sequence.

FIG. 7 .
FIG. 7. Gate error 1 − F as a function of one-tangles of unwanted nuclear spins for (a),(b) the CPMG, (c) the UDD3, and (d) the UDD4 sequences.The labels in all graphs show up to how many spins were "traced-out" from the total system.The unwanted spins have one-tangles in the range [0,0.76].The error-bars of the blue points show the intervals of one-tangles to which we assign unwanted spins and are the same for all differently colored lines.In the ranges where we cannot find up to 6 unwanted spins, we depict a smaller number of them.In (b) we have used the condition for the trivial evolution to identify unwanted nuclei which do not introduce any gate error.The dashed lines in the plots serve as a guide to the eye.

FIG. 8 .
FIG. 8. Multipartite gates in a 27 nuclear spin register using the CPMG sequence.Each case # corresponds to a different set of CPMG unit time and number of iterations.(a) Mean value of target nuclei one-tangles for each of the 27 cases.(b) Mean value of unwanted nuclei one-tangles.(c) Number of target spins to realize the multipartite gates.(d) Number of iterations and (e) gate time of the multipartite gate.(f) Gate error due to residual entanglement with unwanted nuclear spins.For each of the 27 different realizations, the CPMG unit time is optimized close to the resonance time of each of the 27 nuclei.k indicates the number of resonances.

FIG. 9 .
FIG. 9. Comparison of synchronous multi-spin gate scheme with the sequential entanglement protocol.Circuit diagram for (a) multi-spin entangling gate operation and for (e) sequential entangling protocol.The x-axis components (b), (f) and the z-axis components (c), (g) of the 13 C nuclear spin rotations are shown.The subscripts "0" and "1" on the axis components refer to the nuclear rotations Rn j .(d), (h) The rotation angle of each nucleus.(b), (c) and (d) correspond to the multi-spin operation, while (f), (g), and (h) correspond to the sequential entangling protocol.The exact parameters of the rotation axes and rotation angles are given in Table XI of Appendix I 4. Lighter shading in (a) and (e) indicates shorter gate durations.

FIG. 10 .
FIG. 10.Three-qubit bit-flip code using the CRxz multi-spin operations.The electron's state is encoded into three physical qubits, two of which correspond to the 13 C atoms C10 and C12.(a) Recovery of the electron state |y [case #22, k = 4 of Fig. 8].(d) Recovery of the electron state |π/3 = cos(π/6)|0 + sin(π/6)|1 [case #13, k = 4 of Fig. 8].From top to bottom the panels in (a), (d) show the coefficients of: initial, encoded, error, decoded, and corrected state.Blue (red) bars are the real (imaginary) parts of the coefficients.The probability to measure the electron in |y in (a) is 99.63% while to measure it in |π/3 in (d) is 99.5%.Real and imaginary components (b), (e) of the final reduced density matrix of the electron verify the recovery of the initial state.Error probability 1 − | ψ el,0 |ψ final | 2 of measuring incorrect state of the electron at the end of the QEC code for case #22 and k = 4 (c) and for case #13 and k = 4 (f).|ψ el,0 is defined as cos(γ/2)|0 + e iδ sin(γ/2)|1 .Evolution of13 C atoms C10 (g) and C12 (h) up to the decoding step, when the electron undergoes a bit-flip.The initial state is |1 for each nucleus (blue arrow).The nuclei follow the green curve evolution if the electron is initially in |0 or the red curve evolution if it is initially in |1 .After an error happens on the electron and we perform the decoding, the nuclei approximately return to |11 such that the subsequent Toffoli gate corrects the bit-flip error.
(g) and (h), we show the evolution of each nuclear spin up to the decoding step.The blue arrows indicate the initial state of the nuclei, which is the |1 state.The green (red) curves show the path each nucleus traces on the Bloch sphere if the electron starts from the |0 (|1 ) state and undergoes a bit-flip.The final green/red arrows indicate that the nuclei return approximately to the |11 state, such that the Toffoli gate then corrects the electron's bit-flip.In the case when no bit-flip occurs, both nuclei traverse a great arc on the Bloch sphere and end up exactly in the |0 state at the end of the decoding [see AppendixI 5].

FIG. 12 .
FIG. 12. Controlling a target spin with parameters (A, B, ωL) = 2π • (60, 30, 314) kHz in the presence of an unwanted spin with varying HF parameters ∈ 2π • [10, 200] kHz.(a) One-tangle of the unwanted spin, scaled by the maximum bound of 2/9.The time of the unit is the first resonance time of the target spin and the number of iterations is N = 20, which maximize its one-tangle.(b) Minimization of the onetangle of the unwanted spin using the first five (k = 1, . . ., 5) resonances of the target spin, and up to 300 pulses on the electron.Optimal number of repetitions (c) and optimal resonance (d) to minimize the unwanted spin's one-tangle, while keeping the one-tangle of the target spin maximal.In all plots, we considered the CPMG sequence, and an electron spin S = 1 (s0 = 0 and s1 = −1).

FIG. 13 .
FIG.13.Comparison of CPMG (a) with UDD4 (b) and UDD3 (c) rotation angles.We compose the rotations of the freeevolution periods for one unit of the sequence using the Rodrigues formula.The last composition gives rise to the black spherical triangles.In (a) we show CDB which gives the total rotation angle γ.We find that geometrically the rotation angle of CPMG is larger.

2 CPMG > π − γ 2 UDD4 > π − γ 2 UDD3
(a) the nuclear spin first rotates about 'A', then about 'B' and again about 'A'.The composition of 'A' and 'B' gives rise to the new axis 'C', and the composition of 'C' with 'A' leads to the final axis 'D'.The angle enclosed by the arcs CD and BD, gives the total rotation angle γ in one CPMG unit.Similar analysis holds for Fig. 13(b) and Fig. 13(c) where rotations follow the composition [A][B][A][B][A] and [A][B][A][B][A][B][A] respectively.We notice that it holds π − γ

FIG. 14 .
FIG. 14. Gate error 1 − F as a function of one-tangles of unwanted nuclei for (a) CPMG, (b) UDD3 and (c) UDD4.The labels in all graphs show up to how many spins were "traced-out" from the total system.The unwanted spins have one-tangles in the range [0.1, 0.7].The error-bars of the blue points show the intervals where we assign unwanted spins, and are the same for all differently colored lines.The gate error shown in (a), (b), (c) is the average over eight different ensembles of unwanted nuclei for each bath size.In (d) we take the gate error from plots (a), (b) and (c) respectively and further average over the six different unwanted spin baths for each one-tangle range [see text].

FIG. 15 .
FIG.15. Circuit diagrams to correct a bit-flip on the electron for (a) the sequential approach that utilizes the CRx(π/2) gates and (b) the multi-spin operation protocol.E denotes the bit-flip error, which can happen either on the electron or on one of the nuclei.In (b), we further require the R−y(π) unconditional rotations on the nuclear spins for the encoding step.These rotations can be either performed at the encoding step after the CRxz gate or the decoding step before the CRxz gate.The half-white, half-black circles of the control of the CR±x(π/2) gates indicate that depending on the electron's state, the nuclear spin rotates by Rx(π/2) or Rx(−π/2).For the CRxz gates, the half-white, half-black notation means that depending on the elctron's state, the nuclear spin rotates by Rn 0 or Rn 1 .

4 FIG. 16 .
FIG. 16.Evolution of nuclear spins C10 (a) and C12 (b) up to the decoding, if no error occurs on the electron during the QEC protocol.Initially, both nuclei are in the |1 state (blue arrow).If the electron starts in the |0 (|1 ) state, the nuclear spins follow the green (red) trajectory.The final state of each spin is indicated with the red arrow pointing to the north pole of the Bloch sphere (the final green and red arrows coincide).

TABLE I .
Range of hyperfine parameters and corresponding distances from the vacancy site for13C atoms and29Si atoms in diamond or SiC.Explicit values (A, B) are shown in parentheses, otherwise we provide approximate ranges.
[62]in R ∼ 25 Å[62].More precise ranges of HF values and distances from the vacancy are shown in TableI.The HF values for our following simulations, and estimations of the nuclear positions relative to the vacancy, are listed in Appendix I 1.To ensure that the spins selected via random generation are distinct, we give a bound on how different the HF values should be, e.g. for CPMG, we require that at least one of the HF values differs by at least 2π • 25 kHz from the rest.This bound is set to a reasonable value so that we generate enough nuclei within the HF range, but with distinct enough HF values.In the following, we study two different resonances for CPMG, UDD 3 , or UDD 4 , and for each resonance, we perform a distinct random generation of nuclei.
of Appendix I 4].The gates acting on the nuclei in the multipartite case, in principle, have both nonzero x-and z-axis components [see Figs.9(b), (c), (d) and Table XI of Appendix I 4].Although the gates of the two approaches are different, they are equivalent up to local rotations.

TABLE V .
Hyperfine parameters of the 13 C atoms we considered in Sec.IV C.