Introduction

A quantum random access memory (QRAM) is an essential computational primitive for many quantum algorithms. The ability to perform a QRAM query in \(\log (N)\) time steps, where N = 2n is the number of memory cells, implies polynomial speed-ups for applications such as quantum machine learning1, matrix inversion2, quantum imaging3, and quantum searching4. Despite its clear importance to quantum information processing, a QRAM has yet to be realized experimentally. Hence, finding a suitable architecture that can be realized in the near future remains an active research subject in the theoretical and experimental domains.

In this article, we present a method to simulate large-scale entanglement accounting for various sources of noise. We are able to efficiently simulate circuits with thousands of qubits under dephasing, amplitude damping, and CNOT errors. Based on our simulation model, we present a QRAM architecture for photonic network-based QRAM based on ref. 5. The feasibility assessment is based on realistic parameters extracted from recent experiments, which we will refer to throughout the article.

A classical RAM6 consists of a binary tree leading to a final layer of memory cells, each corresponding to a unique address. The address is represented as a series of bits, with each bit corresponding to a layer of the binary tree. Each bit of an address describes how the bus signal propagates in the layer: to the right or to the left child node. Hence, the nodes of the binary tree act as switches for the address. When provided with a n-bit address, the RAM returns a bit string fk associated with the memory cell labeled k. This is called the fan-out scheme7.

A QRAM is the quantum analog of the RAM, similarly consisting of addresses, quantum switches, and memory cells in the form of qubits. In particular, with a quantum address state, over the set of address qubits a, given by \(\left\vert {\psi }_{{{{\rm{in}}}}}^{{\prime} }\right\rangle =\mathop{\sum }\nolimits_{j = 1}^{{{{\rm{n}}}}}{\alpha }_{j}{\left\vert j\right\rangle }_{a}\), one can retrieve data from a superposition of memory cells. A QRAM query is defined via the following transformation,

$$\left\vert {\psi }_{{{{\rm{in}}}}}\right\rangle =\left\vert {\psi }_{{{{\rm{in}}}}}^{{\prime} }\right\rangle {\left\vert {{\emptyset}}\right\rangle }_{b}\longrightarrow \left\vert {\psi }_{{{{\rm{out}}}}}\right\rangle =\mathop{\sum }\limits_{j=1}^{N}{\alpha }_{j}{\left\vert j\right\rangle }_{a}{\left\vert {D}_{j}\right\rangle }_{b}$$
(1)

where \(\left\vert {{\emptyset}}\right\rangle\) represents an ancillary state over the bus qubit b, which transforms into the retrieved data state after querying. In this article, we will restrict our investigations to classical data, i.e., \(\left\vert {D}_{j}\right\rangle\) are separable bits. A direct conversion of classical fan-out protocol to the quantum realm is inefficient since it requires maintaining quantum coherence over an exponential number of connections7.

Three main schemes have been investigated to date: the fan-out scheme that was already described, the bucket brigade model, and the teleportation-based scheme. Important figures of merit for the QRAM are the fidelity of the above transformation and the query time. For a detailed study and comparison of the first two schemes, please refer to ref. 8.

In the bucket brigade (BB) model7,9, the number of qubits of the device scales as O(2n), as does the number of gates. Moreover, the original protocol7 includes an additional third state in each node, called the “wait” state, in order to prevent the exponential scaling of the amount of decoherence with respect to the memory size. However, Hann et al.8 have shown that the origin of the noise resilience of the BB model is the amount of entanglement among the memory’s components and not the presence of the “wait” state, as one can devise a BB model without the “wait” state that still achieves a polynomial scaling of the decoherence with respect to the number of memory addresses n.

More recently, Chen et al. presented a photonic network-based QRAM scheme5 that makes use of quantum teleportation of addresses from a quantum computer to the QRAM binary tree. Such a scheme greatly increases the protocol’s efficiency by teleporting the registers to the layers (initially prepared in GHZ states) in parallel as opposed to in series, thereby circumventing the event of a single qubit loss collapsing the entire tree state. Additionally, the proposed QRAM maps onto quantum networks, leading to potential applications in distributed quantum computing and sensing.

However, Chen et al. left as an open challenge the simulation of the scheme on large-scale networks since the computational complexity scales exponentially with the number of qubits. In this work, we bypass this problem resorting to more efficient ways of modeling the noise in stabilizer states. Moreover, this method generalizes to other quantum networking tasks with similar constructions, such as protocols for distributed quantum computation.

This comes in line with the fact that distributing entanglement is central in quantum information processing schemes ranging from quantum computing to sensing to communications10,11,12. Simulation of distributed entanglement in a network setting, be it a long-distance network such as a possible future quantum internet13 or small-distance quantum local area network (QLAN)14, is important to assess the limitations imposed by near-term quantum technologies. The architecture of the QRAM considered in this paper, building on the photonic network-based QRAM proposed in ref. 5, involves a series of exponentially growing GHZ states, with the largest having as many qubits as there are memory cells. Each GHZ state spans across a physical layer in the QRAM architecture, and the number of nodes per layer grows exponentially with the number of memory cells 2n ≡ N to be addressed, as shown in Fig. 1.

Fig. 1: Overview of a teleportation-based QRAM architecture.
figure 1

A quantum RAM in the form of a binary tree comprises GHZ states for each physical layer. The left-most node of each layer i is entangled with an ancillary qubit in a remote quantum computer, which hosts the query address qubits (blue). Bell state measurement in the quantum computer then teleports the address state onto the access tree. The elementary operations to constructing GHZ states in a photonic integrated circuit (PIC) QRAM are identical to the ones over5.

Computer simulations of noisy quantum processes in such a system quickly become computationally intensive15,16,17 due to the density matrices growing exponentially in size with the number of qubits. Even though the entire QRAM protocol definition, i.e., the retrieval of data given an input address (see Eq. (1)), requires more than just Clifford operations, creating the routing state over the QRAM architecture only uses Clifford gates. These operations are the ones used to create the GHZ states and to teleport the address state onto the QRAM access layers. Moreover, the operations required to access the QRAM after the routing state is distributed over the routing nodes only grow with the logarithm of the number of qubits of the QRAM, in comparison to the linear amount of operations required to create the routing state. This is the reason why noise in the system mostly comes from the GHZ states before access. In particular, this set of operations to create the routing state can be classically simulated efficiently16. This approach enables an explicit and efficient description of all the intermediary states, up to local unitary corrections. In this article, we develop efficient methods to simulate large-scale noisy entanglement by characterizing the impact of noise at all intermediate steps and apply these tools to simulate a noisy QRAM.

There are several architectures for a QRAM. Here, we focus on the optically mediated quantum network-based QRAM architecture introduced in ref. 5, as it offers several key benefits: implementation in quantum networks compatible with envisioned quantum internet architecture and quantum data centers, faster query times and the possibility of executing in a non-local manner by means of teleportation. Hence, this scheme works under any network-like architecture, be it locally (e.g., on a chip) or across large distances (e.g., over a quantum internet). Without loss of generality, we characterize each node of the architecture as one of a spin-photon network that could be implemented in photonic integrated circuits (PIC).

The architecture of the QRAM is similar to previous models, such as BB and the fan-out models. The main difference concerns the execution of the protocol and the resources available at each node. In this architecture, one considers two agents: the quantum computer, which prepares the addresses, and the QRAM or quantum access tree (see Fig. 1). The quantum computer must provide an address state with \(n={\log }_{2}N\) qubits, where N is the total number of memories (for simplicity assume \(n\in {\mathbb{N}}\)). The QRAM has a binary tree architecture, with n physical layers, where the kth layer (k {1, . . . , n − 1}) has 2k−1 quantum nodes. As we describe next, in each physical layer, all the nodes share a GHZ state, which is used to teleport the address state onto the QRAM itself, allowing for an ancilla qubit to access the memories in the correct superposition.

As for the type of physical implementation chosen, and without loss of generality, we focus on a QRAM implementation involving solid-state spin qubits integrated into PICs, an approach that is promising in terms of scalability. In particular, we consider diamond nanophotonic cavities coupled with silicon-vacancy centers18,19 as each QRAM tree node. Each emitter contains an electronic spin that directly interacts with the photonic address register qubits and an accompanying nuclear spin acting as a long-lived memory. By entangling the electronic spin with the photon via cavity reflection, consecutive reflection of a photon off two neighboring nodes and subsequent heralding achieves spin-spin entanglement. This remote entangling strategy is repeatedly used to generate a GHZ state across each layer. Such operations are probabilistic (see Fig. 2): the photon has a non-zero probability of being lost to the environment before reflecting off two cavities and arriving at the detector. On the other hand, it is possible to perform close to deterministic two-qubit gates between the electronic and nuclear spin qubits, albeit with a larger error20,21. For this reason, we term this architecture teleportation-based deterministic QRAM or TD-QRAM.

Fig. 2: Probabilistic CNOT.
figure 2

Execution of a CNOT gate between two electrons, e1 and e2, mediated by a photon.

In these types of systems, the main contributors to errors are (1) spin phase errors (at rate 1/T2), (2) spin-flip errors (at rate 1/T1), and (3) errors in hyperfine gates between electron and nuclear spins (see Supplementary Table I). We leave out photon-electron interactions, as one could conceive trading off the efficiency η for arbitrarily high fidelity in the cavity-reflection-based scheme proposed in ref. 22 in the high-cooperativity and over-coupling regime.

Hence, we explore different values for T1, T2 of both electronic and nuclear spin qubits and pe and pn for the probabilities of error in electronic and nuclear spin CNOTs. For the remainder of this article, we set \({T}_{1}^{{{{\rm{n}}}}}=100\,{T}_{1}^{{{{\rm{e}}}}}\equiv 100\,{T}_{1}\) and \({T}_{2}^{{{{\rm{n}}}}}=100\,{T}_{2}^{{{{\rm{e}}}}}\equiv 100\,{T}_{2}\). Nuclear spins have a higher coherence time as they are much less coupled to the noisy spin-bath compared to electronic spins. Reported values of characteristic times go, experimentally, up to \({T}_{1}^{{{{\rm{e}}}}} \sim 1\,{{{\rm{s}}}},{T}_{2}^{{{{\rm{e}}}}} \sim 10\,{{{\rm{ms}}}}\)23, and there are theoretical predictions of being able to reach pe, pn = 10−2 ~ 10−424,25. Moreover, we detail other important physical parameters of this type of system used for the simulations in Supplementary Table I.

Results

Simulating the effects of decoherence for a TD-QRAM

To simulate the QRAM initialization protocol, we use NetSquid26 under the stabilizer formalism and extract all the parameters of the noise channels before implementing them in simulations, for instance: timing parameters for every qubit used throughout the simulation, all the noisy CNOTs with corresponding error probabilities, and to which qubits and at which step it is applied. From here, we compute the fidelity of the final QRAM state by substituting all these values into the expressions presented in the “Methods”.

We start by presenting the simulation of a 212-qubit QRAM in Fig. 3. Here, we detail individually the fidelities of the GHZ state distributed at each physical layer of the QRAM. The fidelity of the full state of the QRAM is given by:

$$\begin{array}{l}\quad F(\,{{\mbox{QRAM}}}\,)\,=\,\mathop{\prod }\limits_{i=1}^{n-1}{{{\mathcal{F}}}}\left({{{\mbox{Layer}}}}_{i},{\left\vert {{\mbox{GHZ}}}\right\rangle }_{{2}^{i-1}+1}\right),\\ {{\mbox{where}}}\,\,{\left\vert {{\mbox{GHZ}}}\right\rangle }_{q}\,=\,\frac{1}{\sqrt{2}}\left({\left\vert 0\right\rangle }^{\otimes q}+{\left\vert 1\right\rangle }^{\otimes q}\right)\end{array}$$
(2)

i.e., the fidelity of the entire tree (or the QRAM) is defined as the product of the fidelities of each physical layer (see Supplementary Methods for more details). We distinguish access fidelity from tree fidelity, where the former refers to the fidelity of the state retrieved after accessing the memory cells (\(\left\vert {\psi }_{{{{\rm{out}}}}}\right\rangle\) in Eq. (1)), and the latter refers to the multipartite state fidelity of the binary tree constituting the QRAM. Only the access fidelity depends on the address and bus qubits.

Fig. 3: TD-QRAM Simulations.
figure 3

a TD-QRAM access protocol for 12 layers, with the efficiency of generating a Bell pair swept from η = 50% to η = 90%. The noise analysis considers only dephasing and damping errors. The final fidelity is calculated according to Eq. (2), with T1 = 20 ms, T2 = 10 ms, and ϵCNOT = 0 for each layer. b Query times with varying sizes from 2 layers to 12 layers, and sweeping the efficiency of generating a Bell pair from η = 50% to η = 90%. There is an expected logarithmic scaling of the query time with the number of qubits. c TD-QRAM noise analysis with dephasing errors, T2 = 10 ms (filled lines) and T2 = 100 ms (traced lines), with fixed amplitude-damping error T1 = 2 s. We consider different QRAM sizes from 2 layers to 12 layers as well as various efficiencies of generating a Bell pair from η = 50% to η = 90%. d TD-QRAM noise analysis with noisy CNOTs, pe = pn {0, 10−5, 10−4, 10−3, 10−2}, for a QRAM with the number of layers ranging from 2 to 12. The dephasing time is fixed at T2 = 100 ms, and the amplitude-damping time is fixed at T1 = 2 s. The efficiency of generating a Bell pair is fixed at η = 90%. The final fidelity mainly depends on the number of noisy CNOTs performed throughout the protocol and has little dependence on the efficiency. All the error bars over the data correspond to the error of the average value over 100 simulations of the protocol.

One observes an exponential decrease of the fidelity with the number of the layer (notice the logarithmic scaling on the y-axis corresponding to the fidelity). This agrees with the GHZ state size increasing exponentially with the number of layers, i.e., scaling 2k. When one qubit in this multipartite state suffers an error, the entire state is affected.

One critical figure of merit that we extract from the NetSquid simulations is the query time. As demonstrated in ref. 5, the query efficiency scales logarithmically with the number of qubits. Extracting from multiple queries of the QRAM, we obtain the query times (apart from a logarithmic factor derived from making the bus qubit traverse the binary tree) in Fig. 3.

Dephasing and damping errors for TD-QRAM

Considering only the effects of dephasing and amplitude-damping errors in the spin qubits, we take T2 =  ms for amplitude-damping errors only, and then T2 = 10 ms and T2 = 100 ms with a fixed T1 = 2 s23, see Supplementary Table I. We also set the CNOT error rate to 0. We present the simulation results for the TD-QRAM scheme under memory dephasing for increasing QRAM size, as shown in Fig. 3.

Looking closely at Fig. 3c, one can observe that the effect of amplitude-damping shows an identical behavior to the one of dephasing and amplitude-damping combined, i.e., with the same type of scaling. However, it is residual compared to the effect of dephasing. This is easily explainable by the time-scales of the coherence times of the corresponding noises (T1 and T2) in the memory differ by orders of magnitude, with the first, T1, being usually much longer than the latter, T2, i.e., T1 ~ 1 s23. For this reason, its impact can be neglected relative to other sources of error.

Dephasing, damping and noisy CNOTs for TD-QRAM

The only type of error missing in the analysis is the error derived from the use of noisy CNOTs. Illustrated in Fig. 3, the dephasing and damping errors minimally contribute to infidelity. We now analyze the case for noisy CNOTs on top of fixed T1 = 2 s and T2 = 100 ms (note we now switch to linear scale in the y-axis for the fidelity due to the set of values present for the different simulations). For simplicity, we consider equal CNOT error probability, ϵCNOT, for both electronic and nuclear CNOTs, and vary ϵCNOT from 10−5 to 10−2, as shown in Fig. 3:

These simulations show that the CNOT gates dominate the overall error in the QRAM state fidelity in the TD-QRAM. For instance, to access a 128-qubit QRAM, one needs fidelities of the CNOT gates to be somewhere near 99.9% to obtain an access fidelity exceeding 90%. In this architecture, while the query times do not increase linearly with the size of the memory, the errors do. Expectedly, applying an error to a single qubit of a GHZ state contributes in the same order for the entire state.

The price to pay for performing CNOTs with such large error rates deterministically could be circumvented by near-perfect yet probabilistic CNOTs22,27 via cavity-based electron spin-photon interactions, as opposed to deterministic yet error-prone nuclear-electron spin coupling. In light of this, we explore a hybrid teleportation-based QRAM architecture in the following section.

Teleportation-based stochastic QRAM

In the TD-QRAM protocol, the entanglement generation and swap (Fig. 8) operation are still probabilistic, given the finite chance of photon loss. Hence, these probabilistic CNOTs are done in parallel throughout each physical layer to improve efficiency. After an EPR pair is created between two electron spins, however, transferring entanglement onto the nuclear spins is a deterministic procedure. Thereby, the query time grows sub-linearly. As noted before addressing the TD-QRAM scheme, this deterministic CNOT based on nuclear-electron spin interaction mainly dominates the infidelity of the GHZ state, motivating us to contemplate an alternative solution.

Since the decoherence errors from T1 and T2 contribute much less to the infidelity relative to electron-nuclear spin CNOT, replacing some of the noisy deterministic CNOTs with probabilistic CNOTs helps improve fidelity despite reducing efficiency. As we will show, this leads to higher QRAM tree state fidelities, albeit with longer query times. We call this architecture ‘teleportation-based stochastic QRAM’, or TS-QRAM.

Relying solely on probabilistic CNOTs in every step of the protocol would be very inefficient since the probability of generating a GHZ state diminishes exponentially with the number of nodes. In other words, if one entanglement attempt fails during the construction of a GHZ state, the entire state collapses. Since each linking process is heralded, there are ways to circumvent this by choosing a specified order to perform the CNOTs, similar to entanglement swapping in a repeater chain28,29. Here, the probabilistic swapping operations are equivalent to the probabilistic CNOTs, and measuring the middle node is analogous to joining smaller GHZ states to form a larger GHZ state. Abstractly, they describe the same problem, which allows us to use the solutions provided by ref. 29. Next, we present an in-depth analysis of the trade-off between fidelity and query rate as a function of error rates and physical implements.

Increasing T 1 and T 2

To decrease the number of employed deterministic CNOTs, and taking into account that these always happen when the electronic spins interact with the nuclear spins, it is natural to consider dropping the nuclear spins altogether. This is motivated by the fact that we can perform CNOTs, albeit probabilistically, between the electron spins. The downside is that electron spins suffer from having shorter coherence times than their nuclear counterparts. Still, it is advantageous to consider such schemes to avoid the use of noisier deterministic CNOTs.

To minimize the consequently increased decoherence, one could conceive schemes for increasing the T1 and T2 times for the electrons since these are the ones now causing the fidelity bottleneck, together with the required time to query the memory.

Presently, the SiV’s electronic spin’s T1 time is shown to be longer than 1 s23, thereby posing no concern over depolarization. On the other hand, its T2 coherence time is limited to tens of milliseconds23, even under dynamical decoupling. The main dephasing mechanism is attributed to the surrounding nuclear spin bath, which is weakly coupled to the electronic spin of interest via hyperfine interaction30. A potential avenue to improving the electronic spin’s T2 is therefore to “purify” its environment by materials engineering31. By producing SiV in a carbon-13 free matrix, for example, the coherence time may be further extended.

Nevertheless, our numerical analyses of the hybrid scheme show fidelities still exceeding 60% for a reasonable CNOT error rate of 10−3 and 1024 memory cells, using a T2 of 100 ms. For such a result, a probability of success of about 70% for the CNOT is required.

The teleportation-based stochastic QRAM protocol

In the TD-QRAM protocol, there are two steps occurring in parallel across each layer in the QRAM: one for generating EPR pairs across every other node and another for linking all the states into a larger GHZ state via sharing EPR pairs in-between nodes holding the previously shared EPR pairs (see Fig. 8). This could be made in parallel because the linking operations are deterministic.

In the TS-QRAM protocol, however, we must now consider an order for the linking step that depends on the node’s position, similar to the quantum repeater chain problem26,29,32. If a linking process fails, the subset of qubits that would have become entangled must be reset. The optimal strategy is then performing the linking process in a binary-tree-like approach29. This binary-tree order for the linking processes means that now a heralding signal for a successful link must be exchanged within the tree. Each parenting node will have two children, the right-child and the left-child. Each node only attempts entanglement if it receives heralding signals from both children nodes that have been successfully entangled themselves. Figure 4 illustrates this procedure and defines the order.

Fig. 4: Binary-tree-like approach of linking nodes and possible placement of deterministic CNOTs.
figure 4

a The arrows represent heralding signals for the subsequent step, and the dark nodes represent the selected nodes for attempting entanglement at each time step. b Randomly distributed deterministic nodes across the \(\log N\) distribution layers. c Intuitively distributed deterministic nodes with D deterministic distribution layers.

Moreover, as mentioned before, the advantage of the TS-QRAM protocol is that probabilistic CNOTs are used to minimize state infidelity. One might consider the optimal placements for the deterministic CNOTs to maximize the GHZ state fidelity across each physical layer. We further introduce having an additional distribution layer. This is the layer of the order binary-tree at which a linking step is attempted, as shown in Fig. 4. These abstract layers are only needed to describe the order of the linking steps and help illustrate the optimal placements for the deterministic CNOTs.

For this reason, we present two possible options to solve the placement of deterministic nodes problem: the first is randomly choosing a set of nodes to be deterministic, regardless of their distribution layer. The second option is choosing the nodes that attempt to link entanglement at the higher steps since if those attempts are unsuccessful, they take the biggest toll on the protocol requiring re-attempting every preceded step. We illustrate these two possible options in Fig. 4.

As we will verify later, we need a much smaller number of deterministic nodes if we place them in higher-level distribution layers. We first present simulation results for both cases.

Simulating the effects of decoherence for a TS-QRAM

Using the aforementioned results, we compare the TD-QRAM protocol with the TS-QRAM, which includes both probabilistic EPR pair generation and deterministic linking. For comparison purposes, we start by assuming all probabilistic CNOTs (Prob (node being deterministic) ≡ Pd = 0%) have unit efficiency in the latter scheme. If the deterministic and the probabilistic CNOTs are of the same order in gate time, then the binary-tree approach is bound to be more time-consuming, considering its greater number of entanglement attempts. However, the probabilistic CNOT based on cavity reflection is typically several orders of magnitude faster than the deterministic CNOT (101 ns vs. 105 ns). We therefore present both the QRAM’s query time and its fidelity for both schemes in Fig. 5, assuming perfect deterministic CNOTs. We also consider the case where the CNOT efficiency is less than unity for comparison.

Fig. 5: TS-QRAM simulations for protocol comparison.
figure 5

a Query times for accessing a QRAM and b Fidelity of access of a QRAM for a completely probabilistic hybrid scheme (Pd = 0%) and comparison under identical efficiencies of the distribution of Bell pairs for the TD-QRAM (two-step) scheme. T1 = 2 s, T2 = 100 ms, and ϵCNOT = 0. c Query time scaling for randomly distributed deterministic nodes under the regular binary tree ordering and d and placed at higher-level steps for the linking tree, comparing between the two deterministic CNOT placement strategies for distributing the GHZ states in the TS-QRAM scheme (see Fig. 4). Notice that for the non-random placement strategy, the ratio of deterministic nodes Pd is approximately given by \({P}_{{{{\rm{d}}}}}\approx {2}^{-({\log }_{2}(N)-D)-1}\). In both cases, the efficiency of the distribution of a Bell pair was set at η = 0.5. All the error bars over the data correspond to the error of the average value over 100 simulations of the protocol.

Before moving on to the noise simulations, we delve into the query times. It is not obvious that now the query times scale logarithmically (or even poly-logarithmically) since the efficiency of the distributed CNOTs can increase the query times depending on the order of the linking steps. In fact, Fig. 5 already shows a non-logarithmic behavior when considering a completely probabilistic protocol. If one were to choose sequential linking steps, the query times would increase exponentially with the efficiency. By choosing the scheme demonstrated in Fig. 4, we are able to reduce this to polynomial scaling26. However, depending on the noise parameters, this increase in time, compared to the initial two-step scheme, might not be wanted, as we will verify next. In Fig. 5, we present the query times for different efficiencies of the distributed CNOT, under the two possible hybrid schemes, with different numbers of deterministic CNOTs placed strategically (see Fig. 4).

We start by verifying that, for a random placement of the deterministic nodes, there is no clear dependence on the number of deterministic CNOTs. The reason is that, when choosing random placements for the deterministic nodes, the best order for the linking steps immediately changes and is no longer a binary tree. There already exist algorithms29 that use linear programming to solve an identical problem of finding the best order to attempt entanglement swapping along a chain, which is virtually identical to our problem. However, the polynomial scaling of these algorithms in terms of the number of nodes of the chain makes it unsuitable for exponentially growing chains. For the intuitive placement of the deterministic nodes, this is not the case, as choosing only the top layers of the linking tree does not change the best order to do the linking. We also consider varying the efficiency of the distribution of the Bell pairs, as shown in Supplementary Fig. 1.

Dephasing and damping errors for a TS-QRAM

We start by considering the case where there are no deterministic CNOTs and vary the dephasing and damping parameters, T2 and T1, respectively. Note that, as expected, the query times have increased by orders of magnitude (see in greater detail in Supplementary Fig. 2), hence the extent of decoherence in the memories. Moreover, to overcome the necessity of performing noisy deterministic CNOTs, the qubits used are now the electronic spin qubits, whose dephasing and damping times are much smaller than their nuclear counterparts, thereby limiting the fidelity of the QRAM tree state. For this reason, we analyzed a wide range of possible values for \({T}_{1}^{{{{\rm{e}}}}}\) and \({T}_{2}^{{{{\rm{e}}}}}\): {20 ms, 200 ms, 2 s, 20 s} and {10 ms, 100 ms, 1 s, 10 s}, respectively. In this scenario of having only probabilistic distributed CNOTs, we analyze for multiple CNOT efficiencies η and T2 values, fixing T1 = 2 s, as its contribution to the error is negligible compared to the T2. In Fig. 6, we observe infidelity values scaling exponentially with the number of qubits for a completely probabilistic execution of the hybrid protocol. Only for memory coherence times on the second timescale, i.e., T2 = 1 s, does the fidelity reach around 80% under a CNOT efficiency of η = 0.5. For other combinations of parameters, we refer to Supplementary Figs. 35.

Fig. 6: Fidelity scaling for a dephasing time T2 = 1 s and amplitude-damping time T1 = 2 s.
figure 6

The simulations are for the completely probabilistic execution of the linking step (Pd = 0%), meaning there are no deterministic CNOTs being executed to create the GHZ states within each layer of the QRAM. We present different simulations for several possible values for the efficiency of each distributed CNOT (i.e., the probability of success of each of the distributed CNOT), namely η {0.5, 0.6, 0.7, 0.8, 0.9}. All the error bars over the data correspond to the error of the average value over 100 simulations of the protocol.

Dephasing, damping and noisy CNOTs for TS-QRAM

Here, we explore adding some noisy deterministic CNOTs to counteract the effect of the decoherence for longer periods of time. As seen previously, the better location for these deterministic CNOTs are the nodes that perform the linking step at higher levels of the linking tree. In our simulations, we evaluate different values of the first deterministic layer \({\log }_{2}(N)-D\in \{2,3,4,5,6\}\). The results are presented in Fig. 7.

Fig. 7: Fidelity scaling for a dephasing time T2 = 1 s, amplitude-damping time of T1 = 2 s and a varying CNOT error.
figure 7

a ϵCNOT = 10−2. b ϵCNOT = 10−3. c ϵCNOT = 10−4. The simulations are in the hybrid regime, with 6.2% of deterministic nodes. We present different simulations for several possible values for the efficiency of each distributed CNOT (i.e., the probability of success of each of the distributed CNOT), namely η {0.5, 0.6, 0.7, 0.8, 0.9}. In dashed black lines, we also plot the values for the two-step scheme for the case with η = 0.5 and with the same T1, T2 and ϵCNOT as the hybrid scheme. All the error bars over the data correspond to the error of the average value over 100 simulations of the protocol.

Depending on the CNOT error, the TS-QRAM scheme can surpass the fidelities of access of the TD-QRAM scheme under high enough T2 times in the order of seconds. For other possible sets of parameters, we refer again to Supplementary Figs. 35.

Discussion

In this article, we introduce a method to simulate large quantum networks in an open system model. Specifically, this approach enables us to model networks comprising hundreds of stationary qubits by modeling decoherence processes as noisy channels with spin-dephasing errors, spin-flip errors, and noisy CNOT gates. When applied to the challenging but important problem of network-based QRAM, we find that the qubit depth of memory calls in the recently proposed TD-QRAM architecture becomes limited by CNOT errors. To overcome this bottleneck, we propose a modified network-enabled QRAM in which the noisy deterministic gates of ref. 20 are replaced by heralded probabilistic CNOT gates, which can sharply reduce gate errors. This scheme, TS-QRAM, trades increased query time for improved memory access fidelity and/or memory depth. The TS-QRAM protocol makes use of already demonstrated elements (see Supplementary Table I), suggesting the viability of near-term demonstrations in platforms of solid-state color centers as well as potentially other atomic memory modalities.

An outstanding problem relates to the compounding loss of photonic qubits with increasing memory depth. Since teleportation-based QRAM5 has shown that distributed quantum computers naturally map onto quantum networks, error correction schemes proposed for the former may be applied to address the issue of photon loss for the latter. Approaches include (1) photonic forward error correction using, for example, 2D photonic cluster states33,34,35,36,37,38 and (2) error-corrected cluster states39,40,41. We leave the exploration of error correction schemes in the context of QRAM for future studies.

Methods

Discrete-time-event-based simulations with NetSquid

Given the complexity of a quantum network and its formulations, a tool such as NetSquid28 is essential to simulating a QRAM. NetSquid is capable of defining intricate discrete-time-event-based protocols, with a number of steps and operations that are executed conditioned on the signaling and heralding of prior processes. Furthermore, NetSquid can simulate quantum circuits, providing methods for (1) stabilizer circuits, with simpler and faster execution, of complexity \({{{\mathcal{O}}}}\left({m}^{2}\right)\), where m is the number of qubits; (2) graph states formalism, with possibly even faster execution, in \({{{\mathcal{O}}}}\left({d}^{2}\right)\), where \(\log m\, <\, d \,<\, m\) and m is again the number of qubits; (3) density matrix formalism, which is slower in execution, in \({{{\mathcal{O}}}}\left({2}^{3m}\right)\); (4) sparse density matrix formalism that relies on sparse matrix codes to speed up the execution.

Instead of using the density matrix formalism from NetSquid, we begin by retrieving all the noise information in each step of the protocol from a noiseless discrete-time event simulation, resorting to the stabilizer formalism in polynomial time. The noise information is constituted by the time qubits spent decohering, together with the information about the channels of decoherence that would have been applied in real noisy simulations, both for waiting times and gate errors. We then incorporate the extracted information to estimate the effects of decoherence at each step a posteriori. With this information at hand, we have access to the time-evolved state of the QRAM tree at all steps of the protocol, which allows us to reconstruct the noise that would have been applied in the system in a noisy simulation. To reconstruct the density matrix, we find the analytical expressions for the density matrices of smaller parts of the system and how they evolve after the required operations under a set of noise channels. We express these as fundamental building blocks in terms of noise parameters, namely the probability of error and time of decoherence. This is what allows us to postpone the noise calculations to the end of the simulation without losing the effects of the natural stochastic behavior of the protocol. In a way, this can be understood as pre-compiling the error effect on the intermediary states of the protocol to shortcome the exponential complexity of calculating the density matrix at each time step using a quantum simulator.

In the rest of the “Methods” section, we formalize these elementary building blocks for the operations required to create these GHZ states across each physical layer in the QRAM and explain how different types of noise affect each of the intermediate steps, allowing for a reconstruction of the density matrix. We analyzed dephasing, damping and depolarizing channels, and we believe other noise models could be added in a similar manner. The result is an explicit description of the final state of the QRAM access tree state prior to the execution of the teleportation protocol. The error in the state of the access tree encompasses the majority of all the errors of accessing the QRAM, as the number of steps and operations made after creating the GHZ state grows with the total number of memory addresses logarithmically, whereas the process of generating the GHZ state requires a number of operations linear with the number of memories.

Elementary building blocks for TD-QRAM

The protocol for generating GHZ states across each layer consists of two steps (see Fig. 8):

  1. 1.

    Generating entanglement between the odd-indexed links. This entails first distributing photon-mediated heralded entanglement between the electrons, with a certain efficiency η, followed by electronic CNOTs being applied with the electron qubit acting as the control and the nuclear qubits as the target. Finally, a measurement of the electron spin in the X basis, with posterior corrections sent to the nuclear qubits.

  2. 2.

    The second step links the entangled pairs, creating a larger GHZ state distributed across each layer. This starts off by generating heralded entanglement, with the same efficiency η, between the even-indexed links, followed by applying nuclear CNOTs, where now the control is the nuclear qubit and the target is the electronic qubit. We then make consequent measurements on the Z basis on both electronic qubits, followed by appropriate Pauli corrections.

Fig. 8: Building blocks for creating the GHZ state for a chain of 6-qubits excluding the final step of entangling with the quantum computer.
figure 8

a Creating an EPR pair between two electrons, then transferring the entanglement to the nuclear spin qubits. b Linking two GHZ states through an entangled pair and a set of operations and measurements. c EPR pair creation along the odd-indexed links and transfer followed by linking of pairs by pre-sharing an EPR along the even-indexed links. Note the index of a link is with respect to the left node numbering.

After the aforementioned steps, each physical layer hosts a GHZ state shared among all the nodes. Subsequently, each physical layer extends its (2k−1)-GHZ state into a (2k−1 + 1)-GHZ state by sharing an additional entangled pair between an outermost node in the QRAM layer and the quantum computer, which holds the address state. After performing a Bell state measurement and corresponding corrections, the address state is teleported to the QRAM. Lastly, the memories can be accessed in superposition to complete the QRAM protocol.

EPR pair creation and transferring for TD-QRAM

The first step to creating a GHZ state across each layer is to share entanglement between neighboring nodes. EPR pairs are created by performing a distributed CNOT gate between these nodes’ electronic spin qubits, mediated by a photon. Despite the process being probabilistic with an efficiency dependent on the experimental implementation, it is a heralded entanglement. Hence, the presence (absence) of photon detection informs the success (failure) of the entangling attempt. After this CNOT is applied between the electronic spins, an EPR pair is created and transferred to the nuclear spins in each node via a deterministic electronic CNOT.

Given the different operations and various types of qubits involved, we introduce noise sources in the system to estimate the protocol’s fidelity. We consider amplitude damping, dephasing, and CNOT gate errors for both electronic and nuclear spin qubits.

In this step, illustrated in Fig. 8, the following takes place:

  1. 1.

    eL and eR decohere for a duration of time teL and teR, respectively;

  2. 2.

    An electronic CNOT is applied between eL and nL, with an error probability of pe,

  3. 3.

    An electronic CNOT is applied between eR and nR with an error probability of pe,

  4. 4.

    nL and nR decohere for a duration of time tnL and tnR, respectively.

Hence, these parameters, plus the parameters associated with the physical systems, namely the T1 and T2 times, govern the final form of the entangled pairs. Using the notation ϵ(σ) = 1 − eσ and \(\overline{\epsilon }(\sigma )=1-\epsilon (\sigma )={e}^{-\sigma }\) for parameters that are functions of other physical parameters, namely the elapsed times and coherence times. We will use ϵ for parameters that go to zero in the absence of noise, as is the case for ϵ() and pn. We also further assume ϵ 1. We then apply the following sequence of noise channels (check Supplementary Methods for details on the parameters):

  1. 1.

    Apply a Dephasing channel with probability \(\epsilon ({t}_{{{{\rm{eL}}}}}/{T}_{2}^{{{{\rm{e}}}}})\equiv {\epsilon }_{{{{\rm{eL}}}}}^{(2)}\) and \(\epsilon ({t}_{{{{\rm{eR}}}}}/{T}_{2}^{{{{\rm{e}}}}})\equiv {\epsilon }_{{{{\rm{eR}}}}}^{(2)}\) to electronic spin qubits eL and eR, respectively;

  2. 2.

    Apply an Amplitude-damping channel with probability \(\epsilon ({t}_{{{{\rm{eL}}}}}/{T}_{1}^{{{{\rm{e}}}}})\equiv {\epsilon }_{{{{\rm{eL}}}}}^{(1)}\) and \(\epsilon ({t}_{{{{\rm{eR}}}}}/{T}_{1}^{{{{\rm{e}}}}})\equiv {\epsilon }_{{{{\rm{eR}}}}}^{(1)}\) to electronic spin qubits eL and eR, respectively;

  3. 3.

    Apply Depolarizing channels with probability pe to all qubits after applying CNOTs (modeling a noisy CNOT);

  4. 4.

    Apply a Dephasing channel with probability \(\epsilon ({t}_{{{{\rm{nL}}}}}/{T}_{2}^{{{{\rm{n}}}}})\equiv {\epsilon }_{{{{\rm{nL}}}}}^{(2)}\) and \(\epsilon ({t}_{{{{\rm{nR}}}}}/{T}_{2}^{{{{\rm{n}}}}})\equiv {\epsilon }_{{{{\rm{nR}}}}}^{(2)}\) to nuclear spin qubits nL and nR, respectively;

  5. 5.

    Apply an Amplitude-damping channel with probability \(\epsilon ({t}_{{{{\rm{nL}}}}}/{T}_{1}^{{{{\rm{n}}}}})\equiv {\epsilon }_{{{{\rm{nL}}}}}^{(1)}\) and \(\epsilon ({t}_{{{{\rm{nR}}}}}/{T}_{1}^{{{{\rm{n}}}}})\equiv {\epsilon }_{{{{\rm{nR}}}}}^{(1)}\) to nuclear spin qubits nL and nR, respectively;

The final state for each entangled pair becomes:

$$\frac{1}{2}\left(\begin{array}{cccc}1-\mu &0&0&\nu \\ 0&\mu &0&0\\ 0&0&\mu &0\\ \nu &0&0&1-\mu \end{array}\right)$$
(3)

where

$$\mu =\frac{1-f\left({\epsilon }_{{{{\rm{eL}}}}}^{(1)},{\epsilon }_{{{{\rm{eR}}}}}^{(1)}\right){(1-{p}_{{{{\rm{e}}}}})}^{2}g\left({\epsilon }_{{{{\rm{nL}}}}}^{(1)},{\epsilon }_{{{{\rm{nR}}}}}^{(1)}\right)-{\epsilon }_{{{{\rm{nL}}}}}^{(1)}{\epsilon }_{{{{\rm{nR}}}}}^{(1)}}{2},$$
(4)
$$\nu ={\overline{\epsilon }}_{{{{\rm{eL}}}}}^{(2)}\cdot {\overline{\epsilon }}_{{{{\rm{eR}}}}}^{(2)}\cdot {\overline{\epsilon }}_{{{{\rm{nL}}}}}^{(2)}\cdot {\overline{\epsilon }}_{{{{\rm{nR}}}}}^{(2)}\cdot \sqrt{{\overline{\epsilon }}_{{{{\rm{eL}}}}}^{(1)}\cdot {\overline{\epsilon }}_{{{{\rm{eR}}}}}^{(1)}\cdot {\overline{\epsilon }}_{{{{\rm{nL}}}}}^{(1)}\cdot {\overline{\epsilon }}_{{{{\rm{nR}}}}}^{(1)}}\cdot {(1-{p}_{{{{\rm{e}}}}})}^{4}$$
(5)

and

$$\begin{array}{l}f({\epsilon }_{1},{\epsilon }_{2})\,=\,1-{\epsilon }_{1}-{\epsilon }_{2}+2{\epsilon }_{1}{\epsilon }_{2},\\ g({\epsilon }_{1},{\epsilon }_{2})\,=\,(1-{\epsilon }_{1})(1-{\epsilon }_{2})\end{array}$$
(6)

For intuition regarding the ϵ function, consider the following two limits: (1) σ → 0 in the noiseless regime where the memory coherence time goes to infinity (no decoherence) and (2) σ →  where there only exists noise and all the information is scrambled. In these limits, we retrieve: \(\mathop{\lim }\nolimits_{\sigma \to 0}\epsilon (\sigma )=0,\mathop{\lim }\nolimits_{\sigma \to \infty }\epsilon (\sigma )=1,\mathop{\lim }\nolimits_{\sigma \to 0}\overline{\epsilon }(\sigma )=1\) and \(\mathop{\lim }\nolimits_{\sigma \to \infty }\overline{\epsilon }(\sigma )=0\).

Linking of Bell pairs for TD-QRAM

The following step is crucial to extending entanglement from bipartite to GHZ states across the entire physical layer of the QRAM. It relies on using an entangled pair to combine two GHZ states of smaller sizes into a larger GHZ state, whose number of qubits equals the sum of each of the elementary GHZ states (i.e., n1-GHZ linked with a n2-GHZ becomes a (n1 + n2)-GHZ state).

In this step, we account for decoherence before applying CNOTs, therefore entering the previous expressions for the form of each pair. The decoherence to be analyzed in this step stems from:

  1. 1.

    A nuclear CNOT gate on eL and nL with probability of error pn;

  2. 2.

    A nuclear CNOT gate on eR and nR with probability of error pn;

  3. 3.

    Nuclear qubits nL and nR decohere after a CNOT for \({t}^{{\prime} }\).

Additionally, for each block, we analyze the impact of decoherence by applying the following noise channels:

  1. 1.

    Apply depolarizing channels with probability pn to all qubits (eL, eR, nL, nR) after applying CNOTs (modeling a noisy CNOT);

  2. 2.

    Apply a dephasing channel with probability \(\epsilon ({t}_{{{{\rm{nL}}}}}^{{\prime} }/{T}_{2}^{{{{\rm{n}}}}})\equiv {\epsilon }_{{{{\rm{nR}}}}}^{{\prime} (2)}\) and \(\epsilon ({t}_{{{{\rm{nR}}}}}^{{\prime} }/{T}_{2}^{{{{\rm{n}}}}})\equiv {\epsilon }_{{{{\rm{nL}}}}}^{{\prime} (2)}\) to nuclear spin qubits nL and nR, respectively;

  3. 3.

    Apply an amplitude-damping channel with probability \(\epsilon ({t}_{{{{\rm{nL}}}}}^{{\prime} }/{T}_{1}^{{{{\rm{n}}}}})\equiv {\epsilon }_{{{{\rm{nR}}}}}^{{\prime} (1)}\) and \(\epsilon ({t}_{{{{\rm{nR}}}}}^{{\prime} }/{T}_{1}^{{{{\rm{n}}}}})\equiv {\epsilon }_{{{{\rm{nL}}}}}^{{\prime} (1)}\) to nuclear spin qubits nL and nR, respectively;

Note that all the following calculations are now lower bounds for the fidelity, as the calculation of the full analytical expressions grows exponentially with the number of qubits. Because of this, we keep only the terms up to \({{{\mathcal{O}}}}\left(\epsilon \right)\). In Supplementary Methods, we detail and test the validity of our approximations.

The final GHZ state in each layer is described by a matrix with the following form:

$$\frac{1}{2}\left(\begin{array}{ccccc}{\rho }_{00}&0&\ldots \,&0&{\rho }_{01}\\ 0&\epsilon &\ldots \,&0&0\\ \vdots &0&\ddots &0&\vdots \\ 0&0&\ldots \,&\epsilon &0\\ {\rho }_{10}&0&\ldots \,&0&{\rho }_{11}\end{array}\right)$$
(7)

where all ϵ terms are of at least order \({{{\mathcal{O}}}}(\epsilon )\) and do not contribute to infidelity, as they are orthogonal to the GHZ state.

The diagonal elements that we consider are only the first and the last, as the remaining ones have at least \({{{\mathcal{O}}}}\left(\epsilon \right)\) and, when expanding to a larger GHZ state, contribute in \({{{\mathcal{O}}}}\left({\epsilon }^{2}\right)\) or higher orders, hence negligibly affecting the fidelity.

Let us first consider the form of the state after executing the linking protocol in a noiseless manner, with previously noisy states, as the ones that result from the entangling step given by Eq. (3). Starting with the simple case of a 4-qubit GHZ state built from three states of the form of Eq. (3), with parameters (μj, νj), j = 1, 2, 3 respectively, the final matrix is:

$$\frac{1}{2}\left(\begin{array}{ccccc}{\overline{\mu }}_{1}{\overline{\mu }}_{2}{\overline{\mu }}_{3}&0&\ldots \,&0&{\nu }_{1}{\nu }_{2}{\nu }_{3}\\ 0&{\overline{\mu }}_{1}{\mu }_{2}{\overline{\mu }}_{3}&\ldots \,&0&0\\ \vdots &0&\ddots &0&\vdots \\ 0&0&\ldots \,&{\overline{\mu }}_{1}{\mu }_{2}{\overline{\mu }}_{3}&0\\ {\nu }_{1}{\nu }_{2}{\nu }_{3}&0&\ldots \,&0&{\overline{\mu }}_{1}{\overline{\mu }}_{2}{\overline{\mu }}_{3}\end{array}\right)$$
(8)

where we, again, denote a bar over a variable as 1 minus itself, \({\overline{\mu }}_{i}\equiv 1-{\mu }_{i}\). Note that each of the μi comes from one of the pairs used to create the GHZ state, as these pairs are solely described by two numbers (μi, νi) (see Eq. (3)). There exists a rule for each entry in the diagonal, which we detail in Supplementary Methods, and the same rule holds for any number of qubits of the final state. The GHZ diagonal entries then become:

$${\rho }_{00}={\rho }_{11}={\overline{\mu }}_{1}{\overline{\mu }}_{2}{\overline{\mu }}_{3}$$
(9)

Now, adding the effect of the noisy CNOTs on the state, we calculate the diagonal terms that are shown to be identical, given by:

$$\begin{array}{lll}{\rho }_{00}^{{\prime} }\,=\,{\rho }_{11}^{{\prime} }={\left(1-\frac{{p}_{{{{\rm{n}}}}}}{2}\right)}^{2}(1-{\mu }_{1})(1-{\mu }_{2})(1-{\mu }_{3})\\ \qquad\quad-\,{p}_{{{{\rm{n}}}}}\left(1-\frac{{p}_{{{{\rm{n}}}}}}{2}\right)(1-{\mu }_{1}-\frac{{p}_{{{{\rm{n}}}}}}{2})(1-{\mu }_{2}-\frac{{p}_{{{{\rm{n}}}}}}{2})(1-2{\mu }_{3})\\ \qquad\quad+\,{{{\mathcal{O}}}}\left({\epsilon }^{3}\right)\\ \qquad=\,\left[{\left(1-\frac{{p}_{{{{\rm{n}}}}}}{2}\right)}^{2}-{p}_{{{{\rm{n}}}}}\left(1-\frac{{p}_{{{{\rm{n}}}}}}{2}\right)\right](1-{\mu }_{1})(1-{\mu }_{2})(1-{\mu }_{3})\\ \qquad\quad+\,{{{\mathcal{O}}}}\left({\epsilon }^{2}\right)\\ \qquad\equiv \,h({p}_{{{{\rm{n}}}}})(1-{\mu }_{1})(1-{\mu }_{2})(1-{\mu }_{3})+{{{\mathcal{O}}}}\left({\epsilon }^{2}\right)\end{array}$$
(10)

where we recall that every term with pn, μi 1 converges to zero in the noiseless limit. For the other diagonal entries, we multiply them by h(pn).

Finally, incorporating memory decoherence after CNOTs, we perform another approximation. For the diagonal terms, only the damping channel plays a role. The first and last entries of the diagonal become:

$$\begin{array}{ll}{\rho }_{00}^{{\prime\prime} }\,=\,h({p}_{{{{\rm{n}}}}})\left({\overline{\mu }}_{1}{\overline{\mu }}_{2}{\overline{\mu }}_{3}+{\epsilon }_{{{{\rm{nL}}}}}^{{\prime} (1)}{\mu }_{1}{\mu }_{2}{\overline{\mu }}_{3}+{\epsilon }_{{{{\rm{nR}}}}}^{{\prime} (1)}{\overline{\mu }}_{1}{\mu }_{2}{\mu }_{3}\right)+{{{\mathcal{O}}}}\left({\epsilon }^{4}\right)\\ {\rho }_{11}^{{\prime\prime} }\,=\,{\rho }_{11}\left(1-{\epsilon }_{{{{\rm{nL}}}}}^{{\prime} (1)}\right)\left(1-{\epsilon }_{{{{\rm{nR}}}}}^{{\prime} (1)}\right)\end{array}$$
(11)

In this approximation, the extra terms that appear for the first entry are already of order \({{{\mathcal{O}}}}\left({\epsilon }^{3}\right)\) and could be neglected.

Lastly, we compute the off-diagonal terms by multiplying every contribution from each noise channel applied in the correct manner. The expression is given by:

$${\rho }_{01}^{{\prime\prime} }={\rho }_{10}^{{\prime\prime} }={\nu }_{1}{\nu }_{2}{\nu }_{3}\cdot {\overline{\epsilon }}_{{{{\rm{nL}}}}}^{{\prime} (2)}{\overline{\epsilon }}_{{{{\rm{nR}}}}}^{{\prime} (2)}\sqrt{{\overline{\epsilon }}_{{{{\rm{nL}}}}}^{{\prime} (2)}{\overline{\epsilon }}_{{{{\rm{nR}}}}}^{{\prime} (2)}}\cdot {(1-{p}_{{{{\rm{n}}}}})}^{2}f({p}_{{{{\rm{n}}}}},{p}_{{{{\rm{n}}}}})$$
(12)

When extending the linking protocol to a larger number of qubits, the expressions maintain their form. We only need to add all the terms in a similar manner as in the case of the 4-GHZ state. The complete analysis is detailed in Supplementary Methods.

Thus far, we show how three types of noise (one for the two-qubit operations and two for individual memories) influence the final state of the GHZ states generated across each physical layer of the QRAM access tree. Note that we always present the full expressions accounting for all the noise channels. In fact, if we include a specific noise channel or a subset of what we have considered, we may simply set the parameters corresponding to other noises to zero. For example, it is straightforward to verify that setting pe and pn to zero and T1 to infinity recovers the case for only having dephasing, thus affecting only the off-diagonal terms. The same is valid for all the other noises.

Modified protocol and building blocks for TS-QRAM

We now consider an alternative architecture that enables different subsets of each layer to create GHZ states independently. As illustrated in Fig. 9, this architecture assumes two electron spins and one nuclear spin (instead of each node of the QRAM having an electronic spin and a nuclear spin assumed for the TD-QRAM). As we will show, this architecture still retains similar building blocks as the aforementioned TD-QRAM protocol.

Fig. 9: Possible protocols for linking smaller GHZ states into a larger GHZ state both probabilistically and deterministically.
figure 9

a Probabilistic CNOT Protocol mediated by a photon. b Deterministic CNOT Protocol, consisting of a nuclear CNOT between the nuclear spin ancilla and the left electronic spin qubit.

EPR creation for TS-QRAM

As in the non-hybrid version of the protocol, the first step to creating an EPR pair between two physically separated electronic spins is sending a photon that interacts with them sequentially. A subsequent measurement heralds the successful production of a spin-spin EPR pair. Notably, there are no deterministic CNOTs applied to transfer the qubit states onto the nuclear spins, as we only work with the electron spins at this stage.

The final state shared between the electronic spins is the one of Eq. (3) in the limit of the absence of electronic CNOT error (pe → 0) and altering the memory decoherence noise from nuclear to electronic (\({\epsilon }_{{{{\rm{nL}}}}}\to {\epsilon}_{\rm{eL}} ^{\prime}\) and \({\epsilon }_{{{{\rm{nR}}}}}\to {\epsilon}_{{\rm{eR}}} ^{\prime}\)):

$$\frac{1}{2}\left(\begin{array}{cccc}1-\mu &0&0&\nu \\ 0&\mu &0&0\\ 0&0&\mu &0\\ \nu &0&0&1-\mu \end{array}\right)$$
(13)

where

$$\mu =\frac{1-f\left({\epsilon }_{{{{\rm{eL}}}}}^{(1)},{\epsilon }_{{{{\rm{eR}}}}}^{(1)}\right)g\left({\epsilon }_{{{{\rm{eL}}}}}^{{\prime} (1)},{\epsilon }_{{{{\rm{eR}}}}}^{{\prime} (1)}\right)+{\epsilon }_{{{{\rm{eL}}}}}^{{\prime} (1)}{\epsilon }_{{{{\rm{eR}}}}}^{{\prime} (1)}}{2},$$
(14)
$$\nu ={\overline{\epsilon }}_{{{{\rm{eL}}}}}^{(2)}\cdot {\overline{\epsilon }}_{{{{\rm{eR}}}}}^{(2)}\cdot {\overline{\epsilon }}_{{{{\rm{eL}}}}}^{{\prime} (2)}\cdot {\overline{\epsilon }}_{{{{\rm{eR}}}}}^{{\prime} (2)}\cdot \sqrt{{\overline{\epsilon }}_{{{{\rm{eL}}}}}^{(1)}\cdot {\overline{\epsilon }}_{{{{\rm{eR}}}}}^{(1)}\cdot {\overline{\epsilon }}_{{{{\rm{eL}}}}}^{{\prime} (1)}\cdot {\overline{\epsilon }}_{{{{\rm{eR}}}}}^{{\prime} (1)}}$$
(15)

and again,

$$\begin{array}{ll}f({\epsilon }_{1},{\epsilon }_{2})\,=\,1-{\epsilon }_{1}-{\epsilon }_{2}+2{\epsilon }_{1}{\epsilon }_{2},\\ g({\epsilon }_{1},{\epsilon }_{2})\,=\,(1-{\epsilon }_{1})(1-{\epsilon }_{2})\end{array},$$
(16)

where we use the same abbreviation \(\overline{\epsilon }(\sigma )=1-\epsilon (\sigma )={e}^{-\sigma }\).

Linking pairs in the probabilistic scenario for a TS-QRAM

TS-QRAM differs from TD-QRAM in that the operation of linking pairs has a non-unity probability of succeeding—let us call this probability pCNOT. Moreover, it is executed in a similar way as that of creating an EPR pair:

  1. 1.

    Interact photon γ with the left electronic spin qubit eL, executing a local CNOT,

  2. 2.

    Send the single photon γ to the right cavity,

  3. 3.

    Interact the photon γ with the right electronic spin qubit eR, executing a local CNOT,

  4. 4.

    Measure the photon γ,

  5. 5.

    Measure the right (or left) electronic spin in X.

Importantly, both cavities belong to the same node in this step. This results in a controlled gate applied between the right and left electronic spin qubits. Unlike before, it is still necessary to measure one of the nodes’ electronic spin qubits, as the state has twice the number of qubits as the final state (we chose to measure the right electron, but one could choose to keep the right and measure the left instead; the choice is arbitrary and translates to the same practical outcome). This measurement should be on the X basis in order to not destroy the entanglement shared among all the qubits and rendering the state useless. Moreover, a correction must be made depending on the outcome of the measurement of the electronic spin qubit and the photonic qubit.

Afterward, the GHZ states shared between the left and right nodes are linked into a larger GHZ state via an intermediary node. Inside this intermediary node, its left electronic spin merges into the larger GHZ state. We again take into account the previous calculations for detailing the density matrix of the final state. The decoherence sources are now only provenient from the memories of where each qubit is being held (which we chose to be the left cavity of the node). As we used near-perfect probabilistic CNOTs mediated by a photon, only its memory affects the state fidelity. Thus, for the remainder of the protocol, we:

  1. 1.

    Apply a dephasing channel with probability \(\epsilon ({t}_{{{{\rm{eL}}}}}^{{\prime\prime} }/{T}_{2}^{{{{\rm{e}}}}})\equiv {\epsilon }_{{{{\rm{eL}}}}}^{{\prime\prime} (2)}\) to electronic spin qubit eL;

  2. 2.

    Apply an amplitude-damping channel with probability \(\epsilon ({t}_{{{{\rm{eL}}}}}^{{\prime\prime} }/{T}_{1}^{{{{\rm{e}}}}})\equiv {\epsilon }_{{{{\rm{eL}}}}}^{{\prime\prime} (1)}\) to electronic spin qubit eL.

Importantly, the following calculations are again lower-bound approximations for fidelity. Performing the calculations for a simple link of two entangled pairs described by Eq. (13), with parameters (μj, νj), j = 1, 2, the final density matrix of the 3-GHZ state, prior to any memory decoherence, is:

$$\frac{1}{2}\left(\begin{array}{ccccc}{\overline{\mu }}_{1}{\overline{\mu }}_{2}&0&\ldots \,&0&{\nu }_{1}{\nu }_{2}\\ 0&{\overline{\mu }}_{1}{\mu }_{2}&\ldots \,&0&0\\ \vdots &0&\ddots &0&\vdots \\ 0&0&\ldots \,&{\overline{\mu }}_{1}{\mu }_{2}&0\\ {\nu }_{1}{\nu }_{2}&0&\ldots \,&0&{\overline{\mu }}_{1}{\overline{\mu }}_{2}\end{array}\right)$$
(17)

Adding the memory decoherence accounting for both dephasing and amplitude-damping leads to a matrix similar in form to one shown in Eq. (7), except with entries changing to:

$$\begin{array}{ll}{\rho }_{00}^{{\prime} }\,=\,{\overline{\mu }}_{1}{\overline{\mu }}_{2}+{\epsilon }_{{{{\rm{eL}}}}}^{{\prime\prime} (1)}{\mu }_{1}{\mu }_{2}+{{{\mathcal{O}}}}\left({\epsilon }^{4}\right)\\ {\rho }_{11}^{{\prime} }\,=\,{\overline{\mu }}_{1}{\overline{\mu }}_{2}\left(1-{\epsilon }_{{{{\rm{eL}}}}}^{{\prime\prime} (1)}\right)\\ {\rho }_{10}^{{\prime} }\,=\,{\rho }_{01}^{{\prime} }={\nu }_{1}{\nu }_{2}{\overline{\epsilon }}_{{{{\rm{eL}}}}}^{{\prime\prime} (2)}\sqrt{1-{\epsilon }_{{{{\rm{eL}}}}}^{{\prime\prime} (1)}}\end{array}$$
(18)

Linking pairs in the deterministic scenario for TS-QRAM

We next describe a scheme for deterministic CNOT gates. Since the composition of each node is now different, the operations one needs to execute to deterministically link smaller GHZ states into larger GHZ states changes as well:

  1. 1.

    Apply a deterministic electronic CNOT controlled by the left electronic spin qubit eL and targeted at the nuclear spin qubit n,

  2. 2.

    Measure the left electronic spin qubit eL in X,

  3. 3.

    Apply a deterministic nuclear CNOT controlled by the nuclear spin qubit n and targeted at the right electronic spin qubit eR,

  4. 4.

    Measure the right electronic spin qubit eR in Z.

Measurement-conditioned corrections result in a GHZ state consisting of the nuclear spin and the remaining electronic spin qubits. Notice that by not involving the photon-mediated CNOT, this has been done in a deterministic fashion. In this case, we must consider additional errors, namely those that arise from using deterministic electronic and nuclear CNOTs. The sequence of noise channels becomes:

  1. 1.

    Apply depolarizing channels with probability pe to the electronic spin qubit eL and to the nuclear spin qubit n,

  2. 2.

    Apply depolarizing channels with probability pn to the nuclear spin qubit n and to the electronic spin qubit eR,

  3. 3.

    Apply a dephasing channel with probability \(\epsilon ({t}_{n}^{{\prime} }/{T}_{2}^{{{{\rm{n}}}}})\equiv {\epsilon }_{n}^{{\prime} (2)}\) to nuclear spin qubit n,

  4. 4.

    Apply an amplitude-damping channel with probability \(\epsilon ({t}_{n}^{{\prime} }/{T}_{1}^{{{{\rm{n}}}}})\equiv {\epsilon }_{n}^{{\prime} (1)}\) to nuclear spin qubit n.

From here, we calculate the final state’s density matrix. Performing the calculations for the same simple link of two entangled pairs described by Eq. (13), with parameters (μj, νj), j = 1, 2, the final density matrix of the 3-GHZ state, prior to any memory decoherence and without any CNOT errors is the same as Eq. (17). Adding the effect of the CNOTs leads to:

$$\begin{array}{l}{\rho }_{00}^{{\prime} }\,=\,{\rho }_{11}^{{\prime} }={(1-p)}^{2}{\overline{\mu }}_{1}{\overline{\mu }}_{2}+\frac{p}{2}\left(1-\frac{p}{2}\right)\\ {\rho }_{10}^{{\prime} }\,=\,{\rho }_{01}^{{\prime} }={\nu }_{1}{\nu }_{2}{(1-p)}^{3}\left(1-\frac{p}{2}\right)\end{array}$$
(19)

where we set pe = pn ≡ p. In fact, all diagonal entries can be decomposed into terms of the form \({(1-p)}^{2}\,{{\mbox{diag}}}\,(\rho )+{\mathbb{1}}p/2(1-p/2)\). Using this fact, we incorporate the posterior amplitude-damping noise channels:

$$\begin{array}{lll}{\rho }_{00}^{{\prime\prime} }\,=\,\tilde{h}(p)\cdot \left({\overline{\mu }}_{1}{\overline{\mu }}_{2}+{\epsilon }_{{{{\rm{eL}}}}}^{{\prime} (1)}{\mu }_{1}{\mu }_{2}\right)+{{{\mathcal{O}}}}\left({\epsilon }^{3}\right)\\ {\rho }_{11}^{{\prime\prime} }\,=\,\tilde{h}(p)\cdot {\overline{\mu }}_{1}{\overline{\mu }}_{2}\left(1-{\epsilon }_{{{{\rm{eL}}}}}^{{\prime} (1)}\right)+{{{\mathcal{O}}}}\left({\epsilon }^{3}\right)\\ {\rho }_{10}^{{\prime\prime} }\,=\,{\rho }_{01}^{{\prime\prime} }={\nu }_{1}{\nu }_{2}{(1-p)}^{3}\left(1-\frac{p}{2}\right)\sqrt{1-{\epsilon }_{{{{\rm{eL}}}}}^{{\prime} (1)}}\end{array}$$
(20)

where \(\tilde{h}(p)={(1-p)}^{2}+p/2(1-p/2)\). In the Supplementary Methods, we present the derivation for a chain of an arbitrary number of channels, as well as proof of the validity of our approximations.

Validity of the results

In this section, we discuss our methods and provide empirical proof for our noise analysis robustness. In our work, we have considered an analysis of a discrete protocol, where each gate takes a fixed amount of time, and qubits stay in memory waiting for instructions from the protocol. Given the discreteness of the problem, solving the master equations in each of the specific time periods where the noise actually happens is equivalent to applying the corresponding noise channels.

To support our claims and demonstrate the equivalence of using the full density matrix and our methods of postponing the noise analysis to the end of the protocol simulation, we present one additional figure. This figure shows the comparison of the fidelity of the GHZ states distributed at each of the layers of the QRAM for a small QRAM (5 layers, ~36 qubits) obtained from our simulation methods and those derived using the density matrix formalism. We present the comparison for simulations for the TD-QRAM, as for TS-QRAM, we use the same methods, just under different assumptions over which noise channels are applied. Let FDM be the fidelity calculated using the full density matrix and FS be the one from our simulation methods. The figure showcases how the difference of the fidelities calculated using the density matrix and our methods evolve for different layers (with increasing amounts of qubits), weighted by the overall error (or infidelity of the state), i.e., FDM − FS/(1 − FDM).

One can observe in Fig. 10 that the error is always less than 1%, showing a trend of either maintaining or decreasing as the size of the system increases. This provides empirical proof of the power of our methods across the different scenarios.

Fig. 10: Comparison between the infidelity calculated using a full density matrix simulation and our methods.
figure 10

Simulations made under a TD-QRAM protocol execution up to 5 layers for different combinations of error parameters. All the error bars over the data correspond to the error of the average value over 100 simulations of the protocol.