Netsquid, A Network Simulator For Quantum Information Using Discrete Events
Netsquid, A Network Simulator For Quantum Information Using Discrete Events
Netsquid, A Network Simulator For Quantum Information Using Discrete Events
In order to bring quantum networks into the real world, we would like to determine the require-
arXiv:2010.12535v3 [quant-ph] 26 Jul 2021
ments of quantum network protocols including the underlying quantum hardware. Because detailed
architecture proposals are generally too complex for mathematical analysis, it is natural to employ
numerical simulation. Here we introduce NetSquid, the NETwork Simulator for QUantum Informa-
tion using Discrete events, a discrete-event based platform for simulating all aspects of quantum
networks and modular quantum computing systems, ranging from the physical layer and its control
plane up to the application level. We study several use cases to showcase NetSquid’s power, including
detailed physical layer simulations of repeater chains based on nitrogen vacancy centres in diamond
as well as atomic ensembles. We also study the control plane of a quantum switch beyond its ana-
lytically known regime, and showcase NetSquid’s ability to investigate large networks by simulating
entanglement distribution over a chain of up to one thousand nodes.
2
Fidelity of entanglement (F)
a) d) < 50% 100% e)
Node A QUBITS DECOHERE
b)
ENTANGLEMENT 1 1 1
WITH TIME
GENERATED
Connection
1 71 1 1 1 7 7
Quantum
Source equal →
StateSampler DISTILLATION unequal→
SUCCEEDS
Classical 2 2 2
Quantum Channel
Channel 8 8
FibreLossModel
FibreDelayModel
Node R
2 82 2 2 ENTANGLEMENT
3 9 SWAP
3 5 3 9 11 9 Repeat for N runs
c) DISTILLATION DISTILLATION
f) 1
FAILS SUCCEEDS
10-1
QuantumProcessor
Physical
X, Y, Z F1 = 0.5
probability
cumulative
H
Instructions
1
RX
Measure 0
CNOT F4 = 1
SWAP
2 Node B
4 10
3 4 6 4 10 12 10 10 F7 = 0.9
MemoryPosition
F9 = 0
Time progresses by stepping from event to event 10-6
0 100
timeline time [ms]
...
Figure 1: Illustrative example of a NetSquid use case. Each sub-figure explains part of the modelling
and simulation process. For greater clarity the figures are not based on real simulation data. The scenario
shown is a quantum repeater utilising entanglement distillation (see main text). a) The setup of a
quantum network using node and connection components. b) A zoom in showing the subcomponents of
the entangling connection component. The quantum channels are characterised using fibre delay and loss
models. The quantum source samples from an entangled bipartite state sampler when externally triggered
by the classical channel. c) A zoom in of the quantum memory positions within a quantum processor
illustrating their physical gate topology. The physical single-qubit instructions possible on each memory in
this example are the Pauli (X, Y , Z), Hadamard (H), and X-rotation (RX ) gates, and measurement. The
blue-dashed arrows show the positions and control direction (where applicable) for which the two-qubit
instructions controlled-X (CNOT) and swap are possible. Noise and error models for the memories and
gates are also assigned. d) Illustration of a single simulation run. Time progresses by discretely stepping
from event to event, with new events generated as the simulation proceeds. Qubits are represented by
circles, which are numbered according to the order they were generated. A star shows the moment of
generation. The curved lines between qubits denote their entanglement with the colour indicating fidelity.
The state of each qubit is updated as it is accessed during the simulation, for instance to apply
time-dependent noise from waiting in memory. e) A zoom in of the distillation protocol. The shared
quantum states of the qubits are combined in an entangling step, which then shrinks as two of the qubits
are measured. The output is randomly sampled, causing the simulation to choose one of two paths by
announcing success or failure. f ) A plot illustrating the stochastic paths followed by multiple independent
simulation runs over time, labeled by their final end-to-end fidelity Fi . The blue dashed line corresponds to
the run shown in panel (d). The runs are typically executed in parallel. Their results are statistically
analysed to produce performance metrics such as the average outcome fidelity and run duration.
are ready, the intermediate node swaps the entan- lection of physical models is used to describe the
glement to achieve end-to-end entanglement. We re- loss and delay of the fibre optic channels, the deco-
mark that already this simple protocol is rather in- herence of the quantum memories, and the errors of
volved to analyse. quantum gates.
We begin by modelling the network. The basic ele- Quantum information in NetSquid is represented at
ment of NetSquid’s modular framework is the “com- the level of qubits, which are treated as objects that
ponent”. It is capable of describing the physical dynamically share their quantum states. These in-
model composition, quantum and classical commu- ternally shared states will automatically merge or
nication ports, and, recursively, any subcomponents. “split” – a term we use to mean the separation of
All hardware elements, including the network itself, a tensor product state into two separately shared
are represented by components. For this example we sub-states – as qubits entangle or are measured, as
require three remote nodes linked by two quantum illustrated by the distillation protocol in Figure 1(e).
and two classical connections, the setup of which is The states are tracked internally, i.e. hidden from
shown in Figure 1(a). In Figure 1(b,c) the nested users, for two reasons: to encourage a node-centric
structure of these components is highlighted. A se- approach to programming network protocols, and to
3
Alice
allow a seamless switching between different quan- Z
entanglement
source 0,1
Charlie Z X
tum state representations. The representations of- Z
quantum
qubit
fered by NetSquid are ket vectors, density matri- arrives Bob memory
start ........
ces, stabiliser tableaus and graph states with local
Cliffords, each with trade-offs in modelling versatil- Pongqubit
arrives
message
arrives
Pong
Pong
ity, computation speed and network (memory) scal-
ability (see the subsection Fast and scalable quan- handle
schedule
event
event
timeline
event
tum network simulation below and Supplementary
Note 1). Generate
entanglement
Measure & send Store & wait Apply corrections
BSM
0,1 X
4
In the following, we recover via simulation a selec-
B = 2 qubits C
tion of the results from Vardoyan et al. [56], who per leaf node
studied the switch as the central node in a star net- B
work, and extend them in two directions. First, we LC
increase the range of parameters for which we can D
estimate entanglement rates using the same model 3 LB
LD
as used in the work of Vardoyan et al. Second, sim- 2
B
SWITCH B
ulation enables us to investigate more sophisticated NODE
models than the exponentially distributed erasure 4
C
GHZ C
Measurement
process from their work, in particular we analyse 1
5
State size Analytical
NetSquid
on leaf nodes (Vardoyan et al.)
2
4 (upper bound)
2 (for buffer< )
10
(×106 #produced states/second)
1.0
8 0.9
Capacity
0.8
Fidelity
6
0.7
4 0.6
0.5
2
1 2 3 4 5 0 2 4 6 8 10
Buffer size Memory coherence time T2 [ s]
(a) (b)
Figure 4: Performance analysis of the quantum switch with 9 users using NetSquid. (a)
Capacity as a function of the buffer size (number of quantum memories that the switch has available per
user) for either 2− or 4−qubit Greenberger-Horne-Zeilinger (GHZ)-states. For each scenario, the generation
rate µ of pairs varies per user. For the blue scenario (2-partite entanglement, µ = [1.9, 1.9, 1.9, 1, 1, 1, 1, 1, 1]
MHz), the capacity was determined analytically by Vardoyan et al. using Markov Chain methods [56,
Figure 8]. Here we extend this to 4-partite entanglement (orange scenario, same µs), for which Vardoyan et
al. have found an upper bound (by assuming unbounded buffer and each µ = maximum of original rates
= 1.9 MHz) but no exact analytical expression. The green scenario (µ = [15, 1.9, 1.9, 1, 1, 1, 1, 1, 1] MHz)
does not satisfy the stability condition for the Markov chain for unbounded buffer size (each leaf’s rate <
half of sum of all rates) so in that case steady-state capacity is not well-defined. We note that regardless of
buffer size, the switch has a single link to each user, which is the reason why the capacity does not scale
linearly with buffer size. (b) Average fidelity of the produced entanglement on the user nodes (no
analytical results known) with unbounded buffer size. The fact that the green curve has lower fidelity than
the blue one, while the former has higher rates, can be explained from the fact that the protocol prioritises
entanglement which has the longest storage time (see Supplementary Note 3). Each data point represents
the average of 40 runs (each 0.1 ms in simulation). Standard deviation is smaller than dot size.
ing simulators. Together with the node model, we consider two pro-
tocols: swap-asap and nested-with-distill. In
The NV-based quantum processor includes the fol- swap-asap, as soon as adjacent links are gener-
lowing three features. First, the nodes have a sin- ated the entanglement is swapped. nested-with-
gle communication qubit, i.e. a qubit acting as the distill is a nested protocol [9] with entanglement
optical interface that can be entangled with a re- distillation at every nesting level. For a descrip-
mote qubit via photon interference. This seemingly tion of the simulation, including the node model
small restriction has important consequences for the and protocols, see Methods, section Implementing
communications protocol. In particular, entangle- a processing-node repeater chain in NetSquid.
ment can not proceed in parallel with both adja-
cent nodes. As a consequence, operations need to The first question that we investigate is the distance
be scheduled in sequence and the state of the com- that can be covered by a repeater chain. For this we
munication qubit transferred onto a storage qubit. choose two sets of hardware parameters that we dub
Second, the qubits in a node are connected with near-term and 10× improved (see Supplementary
a star topology with the communication qubit lo- Note 4) and choose two configurations: one without
cated in the centre. Two-qubit gates are only pos- intermediate repeaters and one with three of them.
sible between the communication qubit and a stor- We observe, see Figure 5(a), that the repeater chain
age qubit. Third, communication and storage qubits performs worse in fidelity than the repeaterless con-
have unequal coherence times. Furthermore, the figuration with near-term hardware. For improved
storage qubits suffer additional decoherence when hardware, we see two regimes, for short distances
the node attempts to generate entanglement. Previ- the use of repeaters increases rate but lowers fidelity
ous repeater-chain analyses, e.g. [22, 23, 43], did not while from 750 km until 1500 km the repeater chain
take all three into account simultaneously. outperforms the no-repeater setup.
6
The second question that we address is which pro- D. Performance comparison between two
tocol performs best for a given distance. We con- atomic-ensemble memory types through
sider seven protocols: no repeater, and repeater NetSquid’s modular design
chains implementing swap-asap or nested-with-
distill over 1, 3 or 7 repeaters. The latter is Finally, we showcase that NetSquid’s modular de-
motivated by the fact that the nested-with- sign greatly reduces the effort of assessing possible
distill protocol is defined for 2n − 1 repeaters hardware development scenarios. We demonstrate
(n ≥ 1), and thus 1, 3, and 7 are the first three pos- the power of this modularity by simulating point-to-
sible configurations. In Figure 5(b), we sweep over point remote-entanglement generation based on ei-
the hardware parameter space for two distances, ther of two types of atomic-ensemble based quantum
where we improve all hardware parameters simul- memories: atomic frequency combs (AFC) [72] and
taneously and the improvement is quantified by a electronically induced transparency (EIT) [73, 74]
number we refer to as "improvement factor" (see sec- memories. Both simulations are identical except for
tion How we choose improved hardware parameters the choice of a different quantum memory compo-
of the Methods). For 500 km, we observe that the nent.
no-repeater configuration achieves larger or equal The two types of memories are a promising build-
fidelity for the entire range studied. However, re- ing block for high-rate remote entanglement gener-
peater schemes boost the rate for all parameter val- ation through quantum repeaters because of their
ues. If we increase the distance to 800 km, then we high efficiency (EIT) or their ability for multiplex-
see that the use of repeaters increases both rate ing (AFC), i.e. to perform many attempts at en-
and fidelity for the same range of parameters. If tanglement generation simultaneously without net-
we focus on the repeater scheme, we observe for work components having to wait for the arrival of
both distances that for high hardware quality, the classical messages that herald successful generation.
nested-with-distill scheme, which includes dis- The first type of memories, AFCs, are based on a
tillation, is optimal. In contrast, for lower hardware photon-echo process, where an absorbed photon is
quality, the best-performing scheme that achieves re-emitted after an engineered duration. In contrast,
fidelities larger than the classical bound 0.5 is the the second type, EITs, emit the photon after an on-
swap-asap protocol. demand interval, due to optical control. In principle
We note that beyond 700 km the entanglement rate the AFC protocol can be extended to offer such on-
decreases when the hardware is improved. This is demand retrieval as well. At this point both tech-
due to the presence of dark counts, i.e. false sig- nologies are promising candidates and it is not yet
nals that a photon has been detected. At large dis- clear which outperforms the other and under what
tances most photons dissipate in the fibre, whereby circumstances.
the majority of detector clicks are dark counts. Be- Atomic-ensemble based repeaters have been analyt-
cause a dark count is mistakenly counted as a suc- ically and numerically studied before with stream-
cessful entanglement generation attempt, improving lined physical models [19, 75]. NetSquid’s discrete-
(i.e. decreasing) the dark count rate in fact results event based paradigm allows us to go beyond that
in a lower number of observed detector clicks, from by concurrently introducing several non-ideal char-
which the (perceived) entanglement rate plotted in acteristics. In particular, we include the emission of
Figure 5(a) is calculated. more than one photon pair, photon distinguisha-
Lastly, in Figure 6, we investigate the sensitivity bility and time-dependent memory efficiency. Effi-
of the entanglement fidelity for the different hard- ciency in this context is the probability that the
ware parameters. We take as the figure of merit the absorbed photon will be re-emitted. All these char-
best fidelity achieved with a swap-asap protocol. acteristics have a significant impact on the perfor-
The uniform improvement factor is set to 3, while mance of the repeater protocol.
the following four hardware parameters are varied: In order to compare the two memory types, we sim-
a two-qubit gate noise parameter, photon detection ulate many rounds of the BB84 quantum key dis-
probability (excluding transmission), induced stor- tribution protocol [76] between two remote nodes,
age qubit noise and visibility. We observe that im- using a single repeater positioned precisely in be-
proving the detection probability yields the largest tween them. Entanglement generation is attempted
fidelity increase from 2× to 50× improvement, while in synchronised rounds over both segments in par-
this increase is smallest for visibility. We also see allel. At the end of each round, the two end nodes
that improving two-qubit gate noise or induced stor- measure in the X- or Z-basis, chosen uniformly at
age qubit noise on top of an increase in detection random, and the repeater performs a probabilistic
probability yields only a small additional fidelity linear-optical Bell-state measurement. Upon a suc-
improvement, which however boosts fidelity beyond cessful outcome, we expect correlation between the
the classical threshold of 0.5. These observations in- measurement outcomes if they were performed in
dicate that detection probability is the most impor- the same basis. As a figure of merit we choose the
tant parameter for realising remote-entanglement asymptotic BB84 secret-key rate.
generation with the swap-asap scheme, followed The results of our simulations are shown in Figure 7,
by two-qubit gate noise and induced storage qubit where the rate at which secret key between the two
noise. nodes can be generated is obtained as a function
7
1 / 3 / 7 repeaters:
Hardware quality: / /
no repeater SWAP-ASAP
near-term no repeater
/ / WITH-DISTILL
10x 3 repeaters
1.0 1.00
500 km 800 km
Fidelity
0.75
Fidelity
0.5 0.50 (b)
0.25
0.0
0.00
Rate [Hz]
101 101
Rate [Hz]
10 1 10 1
10 3 (c)
10 3
10 5
10 5
20 250 500 750 1000 1250 1500
Distance between end nodes [km] 10 7
1 5 10 15 20 25 1 5 10 15 20 25 30
(a) Uniform hardware improvement
8
(A) two-qubit gate noise
ison of the STAB and GSLC formalisms see Supple-
5
0.5 mentary Note 1.
fi de
(A) & (D) (A) & (B)
0.5
0 The repetitive nature of simulation runs due to the
lity
0.4
5 collection of statistics via random sampling allows
NetSquid to take advantage of “memoization” for
expensive quantum operations, which is a form of
(B) detection
(D) 0.3
5
probability caching that stores the outcome of expensive oper-
visibility
0.3
0 (excluding ations and returns them when the same input com-
transmission)
binations reoccur to save computation time. Specifi-
cally, the action of a quantum operator onto a quan-
single/two- tum state for a specific set of qubit indices and other
parameter discrete parameters can be efficiently stored, for in-
improvement:
(C) & (D) (B)
2x
stance as a sparse matrix. Future matching operator
& (C)
3x actions can then be reduced to a fast lookup and ap-
(C) induced storage qubit noise 10x plication, avoiding several expensive computational
50x
steps – see the Methods, section Qubits and quan-
tum computation for more details.
Figure 6: Sensitivity of fidelity in various In the following we benchmark the performance of
hardware parameters for nitrogen-vacancy the available quantum state formalisms. For this, we
(NV) repeater chains. The NV hardware model first consider the generation of an n qubit entangled
consists of ~15 parameters and from those we focus GHZ state followed by a measurement of each qubit
on four parameters in this figure: (A) two-qubit (see section Benchmarking of the Methods). For a
gate fidelity, (B) detection probability, (C) induced baseline comparison with classical quantum com-
storage qubit noise and (D) visibility. We start by puting simulators we also include the ProjectQ [79]
improving all ~15 parameters, including the four package for Python, which uses a quantum state rep-
designated ones, using an improvement factor of 3 resentation equivalent to our ket vector. We show
(Methods, section How we choose improved the average computation time for a single run ver-
hardware parameters). Then, for each of the four sus the number of qubits for the different quantum
parameters only, we individually decrease their computation libraries in Figure 8(a). The exponen-
improvement factor to 2, or increase it to 10 or 50. tial scaling of the universal formalisms in contrast
The figure shows the resulting fidelity (horizontal to the stabiliser formalisms is clearly visible, with
and vertical grid lines; dashed line indicates the density matrix formalism performing noticeably
maximal fidelity which can be attained classically). worse. For the ket formalism we also show the effect
Note that at an improvement factor of 3 (orange of memoization, which gives a speed-up roughly be-
line), all ~15 parameters are improved by 3 times, tween two and five.
resulting in a fidelity of 0.39. In addition, we vary Let us next consider a more involved benchmarking
the improvement factor for combinations of two of use case: the quantum computation involved in sim-
the four parameters (diagonal lines). The 3× ulating a repeater chain i.e. only the manipulation
improved parameter values can be found in of qubits, postponing all other simulation aspects,
Supplementary Table II. The other values (at such as event processing and component modelling,
2/10/50×) are approximately: two-qubit gate to the next section. This benchmark involves the
fidelity FEC (0.985/0.997/0.9994), detection following steps: first the N − 1 pairs of qubits along
probability pnofibre
det (6.8%/58%/90%), induced an N node repeater chain are entangled, then each
storage qubit noise N1/e (2800/14000/70000), qubit experiences depolarising noise, and finally ad-
visibility V (95%/99%/99.8%). The fidelities jacent qubits on all but the end-nodes do an entan-
shown are obtained by simulation of the glement swap via a Bell state measurement (BSM).
swap-asap protocol (3 repeaters) with a total If the measured qubits are split from their shared
spanned distance of 500 km. Each data point quantum states after the BSM, then the size of any
represents the average of 1000 runs (standard state is limited to four qubits.
deviation on fidelity < 0.002).
The average computation time for a single run ver-
sus the number of qubits in the chain are shown for
the different quantum computation libraries in Fig-
“graph states with local Cliffords” (GSLC) [77, 78] ure 8(b), where we have again included ProjectQ.
that the user can select. Stabiliser states are a sub- We observe that for the NetSquid formalisms (but
set of quantum states that are closed under the ap- not for ProjectQ) keeping qubits “in-place” after
plication of Clifford unitaries and single-qubit mea- each measurement is more performant than “split-
surement in the computational basis. In the con- ting” them below a certain threshold due to the
text of simulations for quantum networks stabiliser extra overhead of doing the latter. The ket vector
states are particularly interesting because many net- formalism is seen to be the most efficient for this
work protocols consist of only Clifford operations benchmarking use case if states are split after mea-
and noise can be well approximated by stochastic surement. When the measurement operations are
application of Pauli gates. For a theoretical compar- performed in-place the GSLC formalism performs
9
1
10 0.20
Number of attempts/success
Secret Key Rate [bits/att.]
EIT EIT
10 2 AFC AFC
0.15
102
10 3 EIT X basis
QBER
EIT Z basis
0.10
10 4 AFC X basis
AFC Z basis
5
10 0.05 101
6
10
0 0.00
0 20 40 60 80 100 0 20 40 60 80 100 0 20 40 60 80 100
Total Distance [km] Total Distance [km] Total Distance [km]
Figure 7: Performance comparison of a single quantum repeater with atomic frequency comb
(AFC) or electronically induced transparency (EIT) quantum memories. Shown are: (a) the
secret key rate in secret bits per entanglement generation attempt, (b) the quantum bit error rate
(QBER) in the X and Z bases (c) the average number of attempts necessary for one successful end-to-end
entanglement generation. Each data point is obtained using 10.000 (EIT) or 30.000 (AFC) successful
attempts at generating entanglement between the end nodes. Solid lines are fits. Note that for the secret
key plot we use logarithmic scale with added 0 at the origin of the axes. Error bars denote standard
deviation and are symmetrical.
(a) (b)
10
engine PyDynAA [80] (see section Discrete event Runtime profile of a repeater chain
2.00
simulation of the Methods). NetSquid aims to sched- nodes
ule events as economically as possible, for instance 1.75 protocols 0.02
Runtime [s]
1.25
To benchmark the performance of an event-driven qubits
11
scalability to simulation of networks of up to 1000 distributed quantum computers or more generally
nodes. to simulate different components in modular archi-
tectures.
G. Conclusions
III. METHODS
In this work we have presented our design of a modu-
lar software framework for simulating scalable quan- A. Design and functionality of NetSquid
tum networks and accurately modelling the non-
idealities of real world physical hardware, providing The NetSquid simulator is available as a software
us with a design tool for future quantum networks. package for the Python 3 programming language.
We have showcased its power and also its limitations It consists of the sub-packages “qubits”, “compo-
via example use cases. Let us recap NetSquid’s main nents”, “models”, “nodes”, “protocols” and “util”,
features. which are shown stacked in Figure 10. NetSquid de-
First, NetSquid allows the modelling of any physical pends on the PyDynAA software library to provide
device in the network that can be mapped to qubits. its discrete-event simulation engine [80]. Under the
To demonstrate this we studied two use cases involv- hood speed critical routines and classes are written
ing nitrogen-vacancy centres in diamond as well as in Cython [89] to give C-like performance, includ-
atomic-ensemble based memories. ing its interfaces to both PyDynAA and the scien-
Second, NetSquid is entirely modular, allowing users tific computation packages NumPy and SciPy. In
to set up large scale simulations of complicated net- the following subsections we highlight some of the
works and to explore variations in the network de- main design features and functionality of NetSquid;
sign; for example, by comparing how different hard- for a more detailed presentation see Supplementary
ware platforms perform in an otherwise identical Note 1.
network layout. Moreover, this modularity makes it
possible to explore different control plane protocols
netsquid package v0.10
for quantum networks in a way that is essentially protocols util
identical to how such protocols would be executed ServiceProtocol NodeProtocol Protocol
Data-
in the real world. Control programs can be run on nodes
Collector
Component
protocols and the physical devices dictating the per- Model simtools
tum computation library used by NetSquid has been Not all classes and modules are shown
designed to manage the dynamic lifetimes of many
qubits across a network. It offers a seamless choice of Figure 10: Overview of NetSquid’s software
quantum state representations to support different architecture. The sub-packages that make up the
modelling use cases, allowing both a fully detailed NetSquid package are shown stacked in relation to
simulation in terms of wave functions or density ma- each other and the PyDynAA package dependency.
trices, or simplified ones using certain stabiliser for- The main classes in each (sub-)package are
malisms. As an example use case, we explored the highlighted, and their relationships in terms of
simulation run-time of a repeater chain with up to inheritance, composition and aggregation are
one thousand nodes. shown. Also shown are the key modules users
In light of the results we have presented, we see a interact with, which are described in the main text.
clear application for NetSquid in the broad context In this paper NetSquid version 0.10 is described.
of communication networks. It can be used to pre-
dict performance with accurate models, to study the
stability of large networks, to validate protocol de-
signs, to guide experiment, etc. While we have only
touched upon it in our discussion of performance 1. Discrete event simulation
benchmarks, NetSquid would also lend itself well to
the study of modular quantum computing architec- The PyDynAA package provides a fast, powerful,
tures, where the timing of control plays a crucial and lightweight discrete-event simulation engine. It
role in studying their scalability. For instance, it is a C++ port of the core engine layer from the
might be used to validate the microarchitecture of DynAA simulation framework [80], with bindings
12
added for the Python and Cython languages. Dy- putational cost of applying a quantum operator can
nAA defines a concise set of classes and concepts then be reduced to just sparse matrix multiplication
for modelling event-driven simulations. The simula- onto a dense vector or matrix. Memoization is sim-
tion engine manages a timeline of “events”, which ilarly applicable to general Clifford operators in the
can only be manipulated by objects that are sub- stabiliser tableau formalism. To use memoization on
classes of the “entity” base class. Simulation entities operators that depend on a continuous parameter,
can dynamically schedule events on the timeline and such as arbitrary rotations, the parameter can be
react to events by registering an “event handler” ob- discretised i.e. rounded to some limited precision.
ject to wait for event(s) with a specified type, source
entity, or identifier to be triggered.
To deal with the timing complexities encountered 3. Physical modelling of network components
in NetSquid simulations, an “event expression” class
was introduced to PyDynAA to allow entities to All physical devices in a quantum network are mod-
also wait on logical combinations of events to oc- elled by a “component” object, and are thereby also
cur. Atomic event expressions, which describe regu- all simulation entities, as shown in Figure 10. Com-
lar wait conditions for standard events, can be com- ponents can be composed of subcomponents, which
bined to form composite expressions using logical makes setting up networks in NetSquid modular.
“and” and “or” operators to any depth. This feature The network itself, for instance, can be modelled as
has been used extensively in NetSquid to model both a composite component containing “node” and “con-
the internal behaviour of hardware components, as nection” components; these composite components
well as for programming network protocols. can in turn contain components such as quantum
memories, quantum and classical channels, quan-
tum sources, etc., as illustrated in Figure 1. The
2. Qubits and quantum computation physical behaviour of a component is described by
composing it of “models”, which can specify physical
The qubits sub-package of NetSquid defines the characteristics such as transmission delays or noise
“qubit” object that is used to track the flow of quan- such as photon loss or decoherence. Communication
tum information. Qubits internally share quantum between components is facilitated by their “ports”,
state (“QState”) objects, which grow and shrink in which can be connected together to automatically
size as qubits interact or are measured. The “QS- pass on messages.
tate” class is an interface that is implemented by NetSquid also allows precise modelling of quantum
a range of different formalisms, as presented in computation capable devices. For this it provides
section Benchmarking of quantum computation of the “quantum processor” component, a subclass of
the Results and Discussion. Via the qubit-centric the quantum memory. This component is capable of
API, which provides functions to directly manipu- executing “quantum programs” i.e. sequences of “in-
late qubits without knowledge of their shared quan- structions” that describe operations such as quan-
tum states, users can program simulations in a for- tum gates and measurements or physical processes
malism agnostic way. Functionality is also provided such as photon emission. Quantum programs fully
to automatically convert between quantum states support conditional and iterative statements, as well
that use different formalisms, and to sample from a as parallelisation if the modelled device supports
distribution of states, which is useful for instance for it. When a program is executed its instructions are
pure state formalisms. mapped to the physical instructions on the proces-
The ket and density matrix formalisms use dense ar- sor, which model the physical duration and errors
rays (vectors or matrices, respectively) to represent associated to carrying out the operation. A physical
quantum states. Applying a k qubit operator to an n instruction can be assigned to all memory positions
qubit ket vector state generally involves the compu- or only to a specific position, as well as direction-
tationally expensive task of performing 2n−k matrix ally between specific memory positions in the case
multiplications on 2k temporary sub-vectors and ag- of multi-qubit instructions.
gregating the result (only in special cases can this be
done in-place) [90, 91]. The analogous application of
an operator to a density matrix is more expensive 4. Asynchronous framework for programming
due to the extra dimension involved. However, as protocols
discussed in section Fast and scalable quantum net-
work simulation of the Results and Discussion, the NetSquid provides a “protocol” class to describe the
repetitive nature of NetSquid simulations allows us network protocols and classical control plane logic
to take advantage of operators frequently being ap- running on a quantum network. Similarly to the
plied to the same qubit indices for states of a given component class, a protocol is a simulation entity
size. For these operators, we compute a 2n × 2n and can thereby directly interact with the event
dimensional sparse matrix representation of the k timeline. Protocols can be nested inside other pro-
qubit operator via tensor products with the identity tocols and may describe both local or remote be-
and memoize this result for the specific indices and haviour across a network. The “node protocol” sub-
size. When the memoization is applicable the com- class is specifically restricted to only operating lo-
13
cally on a single node. Inter-protocol communica- B. Implementing a processing-node repeater
tion is possible via a signalling mechanism and a re- chain in NetSquid
quest and response interface defined by the “service
protocol” class. Protocols can be programmed using Here, we explain the details of the most complex of
both the standard callback functionality of PyDy- our three use cases, namely the repeater chain of
nAA and a tailored asynchronous framework that Nitrogen-Vacancy-based processing nodes from sec-
allows the suspension of a routine conditioned on tion Sensitivity analysis for the physical modelling
an “event expression”; for example, to wait for input of a long range repeater chain of the Results and Dis-
to arrive on a port, a quantum program to finish, or cussion (see Supplementary Notes 3 and 7 for details
to pause for a fixed duration. on the other two use cases). We first describe how
The “util” sub-package shown in Figure 10 provides we modelled the NV hardware, followed by the re-
a range of utilities for running, recording and in- peater protocols used. With regard to the physical
teracting with simulations. Functions to control the modelling, let us emphasise that this is well estab-
simulation are defined in the “simtools” module, lished (see e.g. [92]); the main goal here is to explain
including functions for inspecting and diagnosing how we used this model in a NetSquid implementa-
the timeline. A “data collector” class supports the tion.
event-driven collection of data during a simulation, In our simulations the following NetSquid compo-
which has priority over other event handlers to re- nents model the physical repeater chain: “nodes”,
act to events. The “simstats” module is responsible each holding a single “quantum processor” modelling
for collecting a range of statistics during a simu- the NV centre, and “classical channels” that connect
lation run, such as the number of events and call- adjacent nodes and are modelled as fibres with a
backs processed, the maximum and average size of constant transmission time. We choose equal spac-
manipulated quantum states, and a count of all the ing between the nodes. If we were to simulate in-
quantum operations performed. Finally, the “simlog” dividual attempts at entanglement generation, we
module allows fine grained logging of the various would also need components for transmitting and
modules for debugging purposes. detecting qubits such as was used in previous Net-
Squid simulations of NV centres [39]. However, in
order to speed up simulations we insert the entan-
gled state between remote NVs using a model. We
designed two types of protocols to run on each node
of this network that differ in whether they imple-
5. Benchmarking ment a scheme with or without distillation.
In the remainder of this section, we describe the
components modelling. More detailed descriptions
To perform the benchmarking described in sec- of the hardware parameters and their values used
tion Fast and scalable quantum network simulation in our simulation can be found in Supplementary
of the Results and Discussion we used computing Note 4.
nodes with two 2.6 GHz Intel Xeon E5-2690 v3
(Haswell) 12 core processors and 64 GB of mem-
ory. Because each process only requires a single core,
1. Modelling a nitrogen-vacancy centre in diamond
care was taken to ensure sufficient cores and mem-
ory were available when running jobs in parallel. The
computation time of a process is the arithmetic av- In NetSquid, the NV centre is modelled by a quan-
erage of a number of successive iterations; to avoid tum processor component, which holds a single com-
fluctuations due to interfering CPU processes the munication qubit (electronic spin-1 system) and
reported time is a minimum of five such repeated multiple storage qubits (13 C nuclear spins). The de-
averages. To perform the simulation profiling the cay of the state held by a communication qubit or
Cython extension modules of both NetSquid and storage qubit is implemented using a noise model,
PyDynAA were compiled with profiling on, which which is based on the relaxation time T1 and the
adds some runtime overhead. Version 0.10.0 and dephasing time T2 . If a spin is acted upon after hav-
0.3.5 of NetSquid and PyDynAA were benchmarked. ing been idle for time ∆t, then to its state ρ we first
We benchmarked against ProjectQ version 0.4.2 us- apply a quantum channel
ing its “MainEngine” backend. See Supplementary
Note 2 for further details. ρ 7→ E0 ρE0† + E1 ρE1†
14
where Z = |0ih0| − |1ih1| and the dephasing proba- scheme, which includes the emission of a single pho-
bility equals ton by each NV, the transmission of the photons to
the midpoint through a noisy and lossy channel, the
1
application of imperfect measurement operators at
p= 1 − e−∆t/T2 · e∆t/(2T1 ) .
2 the midpoint, and the transmission of the measure-
ment outcome back to the two involved nodes [39].
The electron and nuclear spins have different T1 and
For larger internode distances, simulating each at-
T2 times.
tempt requires unfeasibly long simulation times due
We allow the quantum processor to perform the fol-
to the exponential decrease in attempt success rate.
lowing operations on the electron spin: initialisation
To speed up our simulations in the examples stud-
(setting the state to |0i), readout (measurement in
ied here, we generate the produced state between
the {|0i , |1i} basis) and arbitrary single-qubit ro-
adjacent nodes from a model which has shown good
tation. In particular, the latter includes Pauli rota-
agreement with experimental results [93]. This pro-
tions
cedure includes a random duration and noise in-
duced on the storage qubits, as we describe below.
RP (θ) = cos(θ/2)112 − i sin(θ/2)P (2)
Let us define
where θ is the rotation angle, P ∈ {X, Y, Z} p00 = α2 [2pdet (1 − pdet )(1 − pdc )
and 112 = |0ih0| + |1ih1|, X = |0ih1| + |1ih0|,
Y = −i|0ih1| + i|1ih0| and Z = |0ih0| − |1ih1| +2pdc (1 − pdc )(1 − pdet )2
are the single-qubit Pauli operators. 1
+p2det (1 − pdc ) · (1 + V )]
For the nuclear spin, we have only initialisation and 2
rotations RZ (θ) for arbitrary rotation angle θ. In p10 = α(1 − α) · [(1 − pdc ) · pdet
addition, we allow the two-qubit controlled-RX (±θ) +2pdc (1 − pdc )(1 − pdet )]
gate between an electron (e) and a nuclear (n) spin:
p01 = p01
|0ih0|e ⊗ RX (θ)n + |1ih1|e ⊗ RX (−θ)n . p11 = (1 − α)2 · pdc
We model each noisy operation Onoisy as the perfect where pdet is the detection probability, pdc the dark
operation Operfect followed by a noise channel N : count probability, V denotes photon indistinguisha-
bility and α is the bright-state parameter (see Sup-
Onoisy = N ◦ Operfect . plementary Note 4 for parameter descriptions). We
follow the model of the produced entangled state
If O is a single-qubit rotation, then N is the depo- from the experimental work of [93], whose setup
larising channel: consists of a beam splitter with two detectors lo-
cated between the two adjacent nodes. In their
model, the unnormalised state is given by
depol 3p p
Np : ρ 7→ 1 − ρ+ (XρX + Y ρY + ZρZ)
4 4
p00 0 √ 0 0
(3)
with parameter p = 4(1 − F )/3 with F the fidelity 0 √ p01 ± V p01 p10 0
ρ=
of the operation. 0 ± V p01 p10 p10 0
If O is single-qubit initialisation, N = Npdepol 0 0 0 p11
with parameter p = 2(1 − F ). The noise map of
where ± denotes which of the two detectors detected
the controlled-RX gate is an identical single-qubit
a photon (each occurring with probability 12 ). We
depolarising channel on both involved qubits, i.e.
also follow the model of [93] for double-excitation
N = Npdepol ⊗ Npdepol .
noise and optical phase uncertainty, by applying a
Finally, we model electron spin readout by a POVM
dephasing channel to both qubits with parameter
measurement with the Kraus operators
p = pdexc /2, followed by a dephasing channel of one
√ √ of the qubits, respectively.
f0 √ 0 1 − f0 √0
M0 = , M1 = The success probability of a single attempt is
0 1 − f1 0 f1
(4) psucc = p00 + p01 + p10 + p11 .
where 1 − f0 (1 − f1 ) is the probability that a mea-
surement outcome 0 (1) is flipped to 1 (0). The time elapsed until the fresh state is put
on the electron spins is (k − 1) · ∆t with
∆t := (temission + L/c), where temission is the delay
2. Simulation speedup via state insertion until the NV centre emits a photon, L the internode
distance and c the speed of light in fibre. Here, k
For generating entanglement between the electron is the number of attempts up to and including suc-
spins of two remote NVs, we simulate a scheme based cessful entanglement generation and is computed by
on single-photon detection, following its experimen- drawing a random sample from the geometric distri-
tal implementation in [93]. NetSquid was used pre- bution Pr(k) = psucc · (1 − psucc )k−1 . After the suc-
viously to simulate each generation attempt of this cessful generation, we wait for another time ∆t to
15
mimic the photon travel delay and midpoint herald- the two electron spins. It consists of local opera-
ing message delay. tions followed by classical communication to deter-
Every entanglement generation attempt induces de- mine whether distillation succeeded. The entangle-
phasing noise on the storage qubits in the same NV ment swap (swap) converts two short-distance en-
system. We apply the dephasing channel (eq. (1)) at tangled qubit pairs A − M and M − B into a sin-
the end of the successful entanglement generation, gle long-distance one A − B, where A, B and M are
where the accumulated dephasing probability is nodes. It consists of local operations at M , including
spin readout, and communicating the measurement
1 − (1 − 2psingle )k outcomes to A and B, followed by A and B updat-
(5) ing their knowledge of the precise state A − B they
2
hold in the perfect case. We opt for such tracking as
where psingle is the single-attempt dephasing proba- opposed to applying a correction operator to bring
bility (see eq. (46) in Supplementary Note 4). A − B back to a canonical state since the correc-
tion operator generally cannot be applied to the nu-
clear spins directly. Details of the tracking are given
3. How we choose improved hardware parameters in Supplementary Note 6. The circuit implementa-
tions for the building blocks, “quantum programs"
in NetSquid, are given in Supplementary Note 5.
Here, we explain how we choose ‘improved’ hard- Let us explain the swap-asap and nested-with-
ware parameters. Let us emphasise that this choice distill protocols in spirit; the exact protocols run
is independent of the setup of our NetSquid simu- asynchronously on each node and can be found in
lations and only serves the purpose of showcasing Supplementary Note 5. In the swap-asap proto-
that NetSquid can assess the performance of hard- col, a repeater node performs entgen with both its
ware with a given quality. neighbours, followed by swap as soon as it holds the
By ‘near-term’ hardware, we mean values for the two entangled pairs. Next, nested-with-distill is
above defined parameters as expected to be achieved a nested protocol on 2n + 1 nodes (integer n ≥ 0)
in the near future by NV hardware. If we say that with distillation at each nesting level which is based
an error probability is improved by an improvement on the BDCZ protocol [9]. For nesting level n = 0,
factor k, we mean that its corresponding no-error there are no repeaters and the two nodes only per-
√
probability equals k pne , where pne is the no-error form entgen once. For nesting level n > 0, the
probability of the near-term√hardware. For example, chain is divided into a left part and a right part
visibility V is improved as V while the probability
k
16
ACKNOWLEDGEMENTS O’Brien, K. Nemoto, and L. C. Hollenberg, “De-
terministic optical quantum computer using pho-
tonic modules,” Physical Review A, vol. 78, no. 3,
This work was supported by the Dutch Research
p. 032318, 2008.
Cooperation Funds (SMO), the European Research [5] S. Wehner, D. Elkouss, and R. Hanson, “Quantum
Council through a Starting Grant (S.W.), the QIA internet: A vision for the road ahead,” Science,
project (funded by European Union’s Horizon 2020, vol. 362, no. 6412, 2018.
Grant Agreement No. 820445) and the Netherlands [6] W. J. Munro, K. Azuma, K. Tamaki, and
Organisation for Scientific Research (NWO/OCW), K. Nemoto, “Inside quantum repeaters,”
as part of the Quantum Software Consortium pro- IEEE Journal of Selected Topics in Quantum
gram (project number 024.003.037/3368). The au- Electronics, vol. 21, pp. 78–90, may 2015.
thors would like to thank Francisco Ferreira da [7] S. Muralidharan, L. Li, J. Kim, N. Lütkenhaus,
Silva, Wojciech Kozlowski and Gayane Vardoyan M. D. Lukin, and L. Jiang, “Optimal architec-
tures for long distance quantum communication,”
for critical reading of the manuscript. The authors
Scientific Reports, vol. 6, pp. 20463 EP –, Feb
would like to thank Gustavo Amaral, Guus Avis, 2016. Article.
Conor Bradley, Chris Elenbaas, Francisco Ferreira [8] N. Gisin and R. Thew, “Quantum communication,”
da Silva, Sophie Hermans, Roeland ter Hoeven, Nature Photonics, vol. 1, pp. 165 EP –, Mar 2007.
Hana Jirovská, Wojciech Kozlowski, Matteo Pom- Review Article.
pili, Arian Stolk and Gayane Vardoyan for useful [9] H.-J. Briegel, W. Dür, J. I. Cirac, and P. Zoller,
discussions. “Quantum repeaters: The role of imperfect lo-
cal operations in quantum communication,” Phys.
Rev. Lett., vol. 81, pp. 5932–5935, Dec 1998.
[10] W. Dür, H.-J. Briegel, J. I. Cirac, and P. Zoller,
AUTHOR CONTRIBUTIONS
“Quantum repeaters based on entanglement purifi-
cation,” Phys. Rev. A, vol. 59, pp. 169–181, Jan
T.C. realised the NV repeater chain and the quan- 1999.
tum switch simulations. R.K., L.W. realised the [11] L.-M. Duan, M. D. Lukin, J. I. Cirac, and
benchmarking simulations. D.M., J.R. realised the P. Zoller, “Long-distance quantum communication
atomic ensembles simulations. R.K. and J.O. de- with atomic ensembles and linear optics,” Nature,
signed NetSquid’s software architecture and R.K. vol. 414, pp. 413 EP –, Nov 2001. Article.
[12] J. Amirloo, M. Razavi, and A. H. Majedi, “Quan-
led its software development. T.C, A.D, R.K., D.M.,
tum key distribution over probabilistic quantum
L.N., J.O., M.P., F.R, J.R., M.S., A.T., L.W., and repeaters,” Phys. Rev. A, vol. 82, p. 032304, Sep
S.W designed use case driven architectures, and con- 2010.
tributed to the development of NetSquid and the [13] F. Kimiaee Asadi, N. Lauk, S. Wein, N. Sinclair,
modelling libraries used in the simulations. W.J., C. O’Brien, and C. Simon, “Quantum repeaters
D.P., A.T. contributed to the optimal execution of with individual rare-earth ions at telecommunica-
simulations on computing clusters. T.C., D.E., R.K., tion wavelengths,” Quantum, vol. 2, p. 93, Sept.
D.M. and S.W. wrote the manuscript. All authors 2018.
revised the manuscript. D.E. and S.W. conceived [14] N. K. Bernardes, L. Praxmeyer, and P. van Loock,
and supervised the project. “Rate analysis for a hybrid quantum repeater,”
Phys. Rev. A, vol. 83, p. 012323, Jan 2011.
[15] J. Borregaard, P. Kómár, E. M. Kessler, A. S.
Sørensen, and M. D. Lukin, “Heralded quantum
COMPETING INTERESTS STATEMENT gates with integrated error detection in optical
cavities,” Phys. Rev. Lett., vol. 114, p. 110502, Mar
The authors declare no competing interests. 2015.
[16] D. E. Bruschi, T. M. Barlow, M. Razavi,
and A. Beige, “Repeat-until-success quantum re-
peaters,” Phys. Rev. A, vol. 90, p. 032306, Sep
REFERENCES 2014.
[17] Z.-B. Chen, B. Zhao, Y.-A. Chen, J. Schmied-
[1] R. Van Meter and S. J. Devitt, “The path to scal- mayer, and J.-W. Pan, “Fault-tolerant quantum
able distributed quantum computing,” Computer, repeater with atomic ensembles and linear optics,”
vol. 49, no. 9, pp. 31–42, 2016. Phys. Rev. A, vol. 76, p. 022329, Aug 2007.
[2] B. Lekitsch, S. Weidt, A. G. Fowler, K. Mølmer, [18] O. A. Collins, S. D. Jenkins, A. Kuzmich,
S. J. Devitt, C. Wunderlich, and W. K. Hensinger, and T. A. B. Kennedy, “Multiplexed memory-
“Blueprint for a microwave trapped ion quan- insensitive quantum repeaters,” Phys. Rev. Lett.,
tum computer,” Science Advances, vol. 3, no. 2, vol. 98, p. 060502, Feb 2007.
p. e1601540, 2017. [19] S. Guha, H. Krovi, C. A. Fuchs, Z. Dutton, J. A.
[3] C. Monroe, R. Raussendorf, A. Ruthven, K. R. Slater, C. Simon, and W. Tittel, “Rate-loss analy-
Brown, P. Maunz, L.-M. Duan, and J. Kim, sis of an efficient quantum repeater architecture,”
“Large-scale modular quantum-computer architec- Phys. Rev. A, vol. 92, p. 022357, Aug 2015.
ture with atomic memory and photonic intercon- [20] L. Hartmann, B. Kraus, H.-J. Briegel, and W. Dür,
nects,” Phys. Rev. A, vol. 89, p. 022317, Feb 2014. “Role of memory errors in quantum repeaters,”
[4] A. M. Stephens, Z. W. Evans, S. J. Devitt, A. D. Phys. Rev. A, vol. 75, p. 032310, Mar 2007.
Greentree, A. G. Fowler, W. J. Munro, J. L.
17
[21] L. Jiang, J. M. Taylor, K. Nemoto, W. J. Munro, p. 240501, Jun 2006.
R. Van Meter, and M. D. Lukin, “Quantum re- [37] M. Zwerger, B. Lanyon, T. Northup, C. Muschik,
peater with encoding,” Phys. Rev. A, vol. 79, W. Dür, and N. Sangouard, “Quantum re-
p. 032325, Mar 2009. peaters based on trapped ions with decoherence-
[22] K. Nemoto, M. Trupke, S. J. Devitt, B. Scharfen- free subspace encoding,” Quantum Science and
berger, K. Buczak, J. Schmiedmayer, and W. J. Technology, vol. 2, no. 4, p. 044001, 2017.
Munro, “Photonic quantum networks formed from [38] L. Jiang, J. M. Taylor, and M. D. Lukin, “Fast and
NV- centers,” Scientific Reports, vol. 6, pp. 26284 robust approach to long-distance quantum com-
EP –, May 2016. Article. munication with atomic ensembles,” Phys. Rev. A,
[23] M. Razavi, M. Piani, and N. Lütkenhaus, “Quan- vol. 76, p. 012301, Jul 2007.
tum repeaters with imperfect memories: Cost and [39] A. Dahlberg, M. Skrzypczyk, T. Coopmans,
scalability,” Phys. Rev. A, vol. 80, p. 032301, Sep L. Wubben, F. Rozpędek, M. Pompili, A. Stolk,
2009. P. Pawełczak, R. Knegjens, J. de Oliveira Filho,
[24] M. Razavi and J. H. Shapiro, “Long-distance quan- R. Hanson, and S. Wehner, “A link layer protocol
tum communication with neutral atoms,” Phys. for quantum networks,” in Proceedings of the ACM
Rev. A, vol. 73, p. 042303, Apr 2006. Special Interest Group on Data Communication,
[25] C. Simon, H. de Riedmatten, M. Afzelius, N. San- SIGCOMM ’19, (New York, NY, USA), pp. 159–
gouard, H. Zbinden, and N. Gisin, “Quantum re- 173, Association for Computing Machinery, 2019.
peaters with photon pair sources and multimode [40] R. V. Meter, “Quantum networking and internet-
memories,” Phys. Rev. Lett., vol. 98, p. 190503, working,” IEEE Network, vol. 26, no. 4, pp. 59–64,
May 2007. 2012.
[26] S. E. Vinay and P. Kok, “Practical repeaters [41] L. Aparicio, R. Van Meter, and H. Esaki, “Pro-
for ultralong-distance quantum communication,” tocol design for quantum repeater networks,” in
Phys. Rev. A, vol. 95, p. 052336, May 2017. Proceedings of the 7th Asian Internet Engineering
[27] Y. Wu, J. Liu, and C. Simon, “Near-term per- Conference, AINTEC ’11, (New York, NY, USA),
formance of quantum repeaters with imperfect pp. 73–80, Association for Computing Machinery,
ensemble-based quantum memories,” Phys. Rev. 2011.
A, vol. 101, p. 042301, Apr 2020. [42] R. V. Meter and J. Touch, “Designing quan-
[28] N. Sangouard, C. Simon, J. c. v. Minář, tum repeater networks,” IEEE Communications
H. Zbinden, H. de Riedmatten, and N. Gisin, Magazine, vol. 51, pp. 64–71, August 2013.
“Long-distance entanglement distribution with [43] R. V. Meter, T. D. Ladd, W. J. Munro,
single-photon sources,” Phys. Rev. A, vol. 76, and K. Nemoto, “System design for a long-line
p. 050301, Nov 2007. quantum repeater,” IEEE/ACM Transactions on
[29] N. Sangouard, C. Simon, B. Zhao, Y.-A. Chen, Networking, vol. 17, pp. 1002–1013, June 2009.
H. de Riedmatten, J.-W. Pan, and N. Gisin, “Ro- [44] A. Pirker and W. Dür, “A quantum network stack
bust and efficient quantum repeaters with atomic and protocols for reliable entanglement-based net-
ensembles and linear optics,” Phys. Rev. A, vol. 77, works,” New Journal of Physics, vol. 21, p. 033003,
p. 062301, Jun 2008. mar 2019.
[30] N. Sangouard, R. Dubessy, and C. Simon, “Quan- [45] A. Acín, N. Brunner, N. Gisin, S. Massar, S. Piro-
tum repeaters based on single trapped ions,” Phys. nio, and V. Scarani, “Device-independent security
Rev. A, vol. 79, p. 042340, Apr 2009. of quantum cryptography against collective at-
[31] S. Abruzzo, S. Bratzik, N. K. Bernardes, H. Kam- tacks,” Phys. Rev. Lett., vol. 98, p. 230501, Jun
permann, P. van Loock, and D. Bruß, “Quantum 2007.
repeaters and quantum key distribution: Analy- [46] C. Branciard, E. G. Cavalcanti, S. P. Walborn,
sis of secret-key rates,” Phys. Rev. A, vol. 87, V. Scarani, and H. M. Wiseman, “One-sided
p. 052315, May 2013. device-independent quantum key distribution: Se-
[32] J. B. Brask and A. S. Sørensen, “Memory im- curity, feasibility, and the connection with steer-
perfections in atomic-ensemble-based quantum re- ing,” Phys. Rev. A, vol. 85, p. 010301, Jan 2012.
peaters,” Phys. Rev. A, vol. 78, p. 012350, Jul [47] V. Scarani, H. Bechmann-Pasquinucci, N. J. Cerf,
2008. M. Dušek, N. Lütkenhaus, and M. Peev, “The se-
[33] S. Muralidharan, J. Kim, N. Lütkenhaus, M. D. curity of practical quantum key distribution,” Rev.
Lukin, and L. Jiang, “Ultrafast and fault-tolerant Mod. Phys., vol. 81, pp. 1301–1350, Sep 2009.
quantum communication across long distances,” [48] F. Xu, X. Ma, Q. Zhang, H.-K. Lo, and J.-W. Pan,
Phys. Rev. Lett., vol. 112, p. 250501, Jun 2014. “Secure quantum key distribution with realistic de-
[34] M. Pant, H. Krovi, D. Englund, and S. Guha, vices,” Rev. Mod. Phys., vol. 92, p. 025002, May
“Rate-distance tradeoff and resource costs for all- 2020.
optical quantum repeaters,” Phys. Rev. A, vol. 95, [49] S. Pirandola, U. L. Andersen, L. Banchi, M. Berta,
p. 012304, Jan 2017. D. Bunandar, R. Colbeck, D. Englund, T. Gehring,
[35] T. D. Ladd, P. van Loock, K. Nemoto, W. J. C. Lupo, C. Ottaviani, et al., “Advances in
Munro, and Y. Yamamoto, “Hybrid quantum re- quantum cryptography,” Advances in Optics and
peater based on dispersive CQED interactions be- Photonics, vol. 12, no. 4, pp. 1012–1236, 2020.
tween matter qubits and bright coherent light,” [50] S. Barz, E. Kashefi, A. Broadbent, J. F. Fitzsi-
New Journal of Physics, vol. 8, pp. 184–184, sep mons, A. Zeilinger, and P. Walther, “Demon-
2006. stration of blind quantum computing,” Science,
[36] P. van Loock, T. D. Ladd, K. Sanaka, F. Yam- vol. 335, no. 6066, pp. 303–308, 2012.
aguchi, K. Nemoto, W. J. Munro, and Y. Ya- [51] N. H. Nickerson, J. F. Fitzsimons, and S. C. Ben-
mamoto, “Hybrid quantum repeater using bright jamin, “Freely scalable quantum technologies using
coherent light,” Phys. Rev. Lett., vol. 96, cells of 5-to-50 qubits with very lossy and noisy
18
photonic links,” Phys. Rev. X, vol. 4, p. 041041, [69] D. M. Greenberger, M. A. Horne, and A. Zeilinger,
Dec 2014. “Going beyond Bell’s theorem,” in Bell’s theorem,
[52] V. Lipinska, G. Murta, and S. Wehner, “Anony- quantum theory and conceptions of the universe,
mous transmission in a noisy quantum network us- pp. 69–72, Springer, 1989.
ing the w state,” Phys. Rev. A, vol. 98, p. 052320, [70] D. D. Awschalom, R. Hanson, J. Wrachtrup, and
Nov 2018. B. B. Zhou, “Quantum technologies with optically
[53] E. T. Khabiboulline, J. Borregaard, K. De Greve, interfaced solid-state spins,” Nature Photonics,
and M. D. Lukin, “Optical interferometry with vol. 12, no. 9, pp. 516–527, 2018.
quantum networks,” Phys. Rev. Lett., vol. 123, [71] M. W. Doherty, N. B. Manson, P. Delaney,
p. 070504, Aug 2019. F. Jelezko, J. Wrachtrup, and L. C. Hollenberg,
[54] E. Shchukin, F. Schmidt, and P. van Loock, “Wait- “The nitrogen-vacancy colour centre in diamond,”
ing time in quantum repeaters with probabilistic Physics Reports, vol. 528, pp. 1–45, jul 2013.
entanglement swapping,” Phys. Rev. A, vol. 100, [72] M. Afzelius, C. Simon, H. De Riedmatten, and
p. 032322, Sep 2019. N. Gisin, “Multimode quantum memory based
[55] S. E. Vinay and P. Kok, “Statistical analysis on atomic frequency combs,” Physical Review A,
of quantum-entangled-network generation,” Phys. vol. 79, no. 5, p. 052329, 2009.
Rev. A, vol. 99, p. 042313, Apr 2019. [73] M. Fleischhauer, A. Imamoglu, and J. P. Maran-
[56] G. Vardoyan, S. Guha, P. Nain, and D. Towsley, gos, “Electromagnetically induced transparency:
“On the stochastic analysis of a quantum entangle- Optics in coherent media,” Reviews of modern
ment switch,” SIGMETRICS Perform. Eval. Rev., physics, vol. 77, no. 2, p. 633, 2005.
vol. 47, pp. 27–29, Dec. 2019. [74] M. Lukin, “Colloquium: Trapping and manipulat-
[57] M. Razavi, K. Thompson, H. Farmanbar, ing photon states in atomic ensembles,” Reviews
M. Piani, and N. Lütkenhaus, “Physical and of Modern Physics, vol. 75, no. 2, p. 457, 2003.
architectural considerations in quantum re- [75] H. Krovi, S. Guha, Z. Dutton, J. A. Slater,
peaters,” in Quantum Communications Realized C. Simon, and W. Tittel, “Practical Quan-
II (Y. Arakawa, M. Sasaki, and H. Sotobayashi, tum Repeaters with Parametric Down-Conversion
eds.), vol. 7236, pp. 18 – 30, International Society Sources,” Applied Physics B, vol. 122, p. 52, Mar.
for Optics and Photonics, SPIE, 2009. 2016.
[58] M. M. Wilde, Quantum information theory. Cam- [76] C. H. Bennett and G. Brassard, “Quantum cryp-
bridge University Press, 2013. tography: Public key distribution and coin toss-
[59] M. Pant, H. Krovi, D. Towsley, L. Tassiulas, ing,” Theoretical Computer Science, vol. 560,
L. Jiang, P. Basu, D. Englund, and S. Guha, “Rout- pp. 7–11, Dec. 2014.
ing entanglement in the quantum internet,” npj [77] S. Aaronson and D. Gottesman, “Improved sim-
Quantum Information, vol. 5, p. 25, Mar 2019. ulation of stabilizer circuits,” Physical Review A,
[60] V. Kuzmin, D. Vasilyev, N. Sangouard, W. Dür, vol. 70, no. 5, p. 052328, 2004.
and C. Muschik, “Scalable repeater architectures [78] S. Anders and H. J. Briegel, “Fast simulation of
for multi-party states,” npj Quantum Information, stabilizer circuits using a graph-state representa-
vol. 5, no. 1, pp. 1–6, 2019. tion,” Physical Review A, vol. 73, no. 2, p. 022334,
[61] S. Khatri, C. T. Matyas, A. U. Siddiqui, and J. P. 2006.
Dowling, “Practical figures of merit and thresh- [79] D. S. Steiger, T. Häner, and M. Troyer, “ProjectQ:
olds for entanglement distribution in quantum net- an open source software framework for quantum
works,” Phys. Rev. Research, vol. 1, p. 023032, Sep computing,” Quantum, vol. 2, p. 49, 2018.
2019. [80] J. de Oliveira Filho, Z. Papp, R. Djapic,
[62] A. Varga, “The OMNeT++ discrete event simula- and J. Oosteveen, “Model-based design of self-
tion system,” in Proc. of the European Simulation adapting networked signal processing systems,”
Multiconference (ESM’2001), 2001. in 2013 IEEE 7th International Conference
[63] G. F. Riley and T. R. Henderson, The ns-3 on Self-Adaptive and Self-Organizing Systems,
Network Simulator, pp. 15–34. Berlin, Heidelberg: pp. 41–50, IEEE, 2013.
Springer Berlin Heidelberg, 2010. [81] A. Dahlberg and S. Wehner, “SimulaQron – a sim-
[64] B. Lantz, B. Heller, and N. McKeown, “A net- ulator for developing quantum internet software,”
work in a laptop: rapid prototyping for software- Quantum Science and Technology, vol. 4, no. 1,
defined networks,” in Proceedings of the 9th ACM p. 015001, 2018.
SIGCOMM Workshop on Hot Topics in Networks, [82] S. DiAdamo, J. Nötzel, B. Zanger, and M. M. Beşe,
pp. 1–6, 2010. “QuNetSim: A software framework for quantum
[65] M. Fingerhuth, T. Babej, and P. Wittek, “Open networks,” arXiv:2003.06397, 2020.
source software in quantum computing,” PLOS [83] B. Bartlett, “A distributed simulation frame-
ONE, vol. 13, p. e0208561, dec 2018. work for quantum networks and channels,”
[66] “Netsquid website and online documentation.” arXiv:quant-ph/1808.07047, 2018.
https://netsquid.org. Access to documentation [84] T. Matsuo, “Simulation of a dynamic, RuleSet-
requires registration. based quantum network,” arXiv:1908.10758, 2020.
[67] D. Deutsch, A. Ekert, R. Jozsa, C. Macchiavello, [85] L. O. Mailloux, J. D. Morris, M. R. Grimaila,
S. Popescu, and A. Sanpera, “Quantum privacy D. D. Hodson, D. R. Jacques, J. M. Colombi, C. V.
amplification and the security of quantum cryptog- Mclaughlin, and J. A. Holes, “A modeling frame-
raphy over noisy channels,” Physical review letters, work for studying quantum key distribution sys-
vol. 77, no. 13, p. 2818, 1996. tem implementation nonidealities,” IEEE Access,
[68] K. Wehrle, M. Günes, and J. Gross, Modeling and vol. 3, pp. 110–130, 2015.
tools for network simulation. Springer Science & [86] X. Wu, A. Kolar, J. Chung, D. Jin, T. Zhong,
Business Media, 2010. R. Kettimuthu, and M. Suchara, “SeQUeNCe: A
19
customizable discrete-event simulator of quantum [101] D. Riedel, I. Söllner, B. J. Shields, S. Starosielec,
networks,” arXiv:2009.12000, 2020. P. Appel, E. Neu, P. Maletinsky, and R. J. War-
[87] Y. Lee, E. Bersin, A. Dahlberg, S. Wehner, burton, “Deterministic enhancement of coherent
and D. Englund, “A quantum router architecture photon generation from a nitrogen-vacancy cen-
for high-fidelity entanglement flows in multi-user ter in ultrapure diamond,” Phys. Rev. X, vol. 7,
quantum networks,” arXiv:2005.01852, 2020. p. 031040, Sep 2017.
[88] W. Kozlowski, A. Dahlberg, and S. Wehner, [102] B. Hensen, H. Bernien, A. E. Dréau, A. Reiserer,
“Designing a quantum network protocol,” in N. Kalb, M. S. Blok, J. Ruitenberg, R. F. L. Ver-
Proceedings of the 16th International Conference meulen, R. N. Schouten, C. Abellán, W. Amaya,
on emerging Networking EXperiments and V. Pruneri, M. W. Mitchell, M. Markham, D. J.
Technologies (CoNEXT ’20), p. 16, ACM, 2020. Twitchen, D. Elkouss, S. Wehner, T. H. Taminiau,
[89] S. Behnel, R. Bradshaw, C. Citro, L. Dalcin, and R. Hanson, “Loophole-free bell inequality vi-
D. S. Seljebotn, and K. Smith, “Cython: The olation using electron spins separated by 1.3 kilo-
best of both worlds,” Computing in Science & metres,” Nature, vol. 526, pp. 682 EP –, Oct 2015.
Engineering, vol. 13, no. 2, pp. 31–39, 2011. [103] S. Zaske, A. Lenhard, C. A. Keßler, J. Kettler,
[90] K. De Raedt, K. Michielsen, H. De Raedt, B. Trieu, C. Hepp, C. Arend, R. Albrecht, W.-M. Schulz,
G. Arnold, M. Richter, T. Lippert, H. Watanabe, M. Jetter, P. Michler, and C. Becher, “Visible-
and N. Ito, “Massively parallel quantum computer to-telecom quantum frequency conversion of light
simulator,” Computer Physics Communications, from a single quantum emitter,” Phys. Rev. Lett.,
vol. 176, no. 2, pp. 121 – 136, 2007. vol. 109, p. 147404, Oct 2012.
[91] T. Häner and D. S. Steiger, “0.5 petabyte [104] N. Kalb, A. A. Reiserer, P. C. Humphreys, J. J. W.
simulation of a 45-qubit quantum circuit,” in Bakermans, S. J. Kamerling, N. H. Nickerson,
Proceedings of the International Conference S. C. Benjamin, D. J. Twitchen, M. Markham, and
for High Performance Computing, Networking, R. Hanson, “Entanglement distillation between
Storage and Analysis, SC ’17, (New York, NY, solid-state quantum network nodes,” Science,
USA), Association for Computing Machinery, vol. 356, pp. 928–932, jun 2017.
2017. [105] N. Kalb, P. C. Humphreys, J. J. Slim, and R. Han-
[92] F. Rozpędek, R. Yehia, K. Goodenough, M. Ruf, son, “Dephasing mechanisms of diamond-based
P. C. Humphreys, R. Hanson, S. Wehner, and nuclear-spin memories for quantum networks,”
D. Elkouss, “Near-term quantum repeater experi- Phys. Rev. A, vol. 97, p. 062330, Jun 2018.
ments with NV centers: overcoming the limitations [106] H. Beukers, “Improving coherence of quantum
of direct transmission,” Physical Review A, vol. 99, memory during entanglement creation between ni-
no. 5, p. 052330, 2019. trogen vacancy centres in diamond (master the-
[93] P. C. Humphreys, N. Kalb, J. P. J. Morits, R. N. sis),” 2019.
Schouten, R. F. L. Vermeulen, D. J. Twitchen, [107] M. H. Abobeih, J. Cramer, M. A. Bakker, N. Kalb,
M. Markham, and R. Hanson, “Deterministic de- M. Markham, D. J. Twitchen, and T. H. Taminiau,
livery of remote entanglement on a quantum net- “One-second coherence for a single electron spin
work,” Nature, vol. 558, no. 7709, pp. 268–273, coupled to a multi-qubit nuclear-spin environ-
2018. ment,” Nature Communications, vol. 9, p. 2552,
[94] T. Coopmans, R. Knegjens, A. Dahlberg, Jun 2018.
D. Maier, L. Nijsten, J. Oliveira, M. Papen- [108] C. E. Bradley, J. Randall, M. H. Abobeih,
drecht, J. Rabbie, F. Rozpędek, M. Skrzypczyk, R. C. Berrevoets, M. J. Degen, M. A. Bakker,
L. Wubben, W. de Jong, D. Podareanu, A. Tor- M. Markham, D. J. Twitchen, and T. H. Taminiau,
res Knoop, D. Elkouss, and S. Wehner, “Repli- “A ten-qubit solid-state spin register with quantum
cation Data for: NetSquid, a discrete-event memory up to one minute,” Phys. Rev. X, vol. 9,
simulation platform for quantum networks,” 2021. p. 031045, Sep 2019.
[95] T. Coopmans, R. Knegjens, A. Dahlberg, [109] A. Reiserer, N. Kalb, M. S. Blok, K. J. M. van
D. Maier, L. Nijsten, J. Oliveira, M. Papen- Bemmelen, T. H. Taminiau, R. Hanson, D. J.
drecht, J. Rabbie, F. Rozpędek, M. Skrzypczyk, Twitchen, and M. Markham, “Robust quantum-
L. Wubben, W. de Jong, D. Podareanu, A. Tor- network memory using decoherence-protected sub-
res Knoop, D. Elkouss, and S. Wehner, “Simulation spaces of nuclear spins,” Phys. Rev. X, vol. 6,
Code for: NetSquid, a discrete-event simulation p. 021040, Jun 2016.
platform for quantum networks,” 2021. [110] T. H. Taminiau, J. Cramer, T. van der Sar, V. V.
[96] D. Gottesman, “The Heisenberg representation of Dobrovitski, and R. Hanson, “Universal control
quantum computers,” arXiv:quant-ph/9807006v1, and error correction in multi-qubit spin registers in
1998. diamond,” Nature Nanotechnology, vol. 9, pp. 171–
[97] M. A. Nielsen and I. L. Chuang, “Quantum infor- 176, feb 2014.
mation and quantum computation,” Cambridge: [111] C. H. Bennett, G. Brassard, C. Crépeau, R. Jozsa,
Cambridge University Press, vol. 2, no. 8, p. 23, A. Peres, and W. K. Wootters, “Teleporting an
2000. unknown quantum state via dual classical and
[98] M. Hein, W. Dür, J. Eisert, R. Raussendorf, Einstein-Podolsky-Rosen channels,” Phys. Rev.
M. Nest, and H.-J. Briegel, “Entanglement in Lett., vol. 70, pp. 1895–1899, Mar 1993.
graph states and its applications,” arXiv:0602096, [112] D.Maier 2020. In preparation.
2006. [113] N. Sinclair, E. Saglamyurek, H. Mallahzadeh, J. A.
[99] S. Hermans. Personal communication, 2020. Slater, M. George, R. Ricken, M. P. Hedges,
[100] R. Paschotta, “ ‘Refractive Index’ in RP Photonics D. Oblak, C. Simon, W. Sohler, and W. Tittel,
Encyclopedia,” 2020. “Spectral Multiplexing for Scalable Quantum Pho-
tonics using an Atomic Frequency Comb Quan-
20
tum Memory and Feed-Forward Control,” Physical [120] P. Jobez, N. Timoney, C. Laplane, J. Etesse,
Review Letters, vol. 113, p. 053603, July 2014. A. Ferrier, P. Goldner, N. Gisin, and M. Afzelius,
[114] N. Sangouard, C. Simon, H. de Riedmatten, and “Towards highly multimode optical quantum mem-
N. Gisin, “Quantum repeaters based on atomic ory for quantum repeaters,” Phys. Rev. A, vol. 93,
ensembles and linear optics,” Rev. Mod. Phys., p. 032327, Mar 2016.
vol. 83, pp. 33–80, Mar 2011. [121] A. Holzäpfel, J. Etesse, K. T. Kaczmarek, A. Tira-
[115] J. S. Ivan, K. K. Sabapathy, and R. Simon, nov, N. Gisin, and M. Afzelius, “Optical storage for
“Operator-sum representation for bosonic gaussian 0.53 s in a solid-state atomic frequency comb mem-
channels,” Phys. Rev. A, vol. 84, p. 042311, Oct ory using dynamical decoupling,” New Journal of
2011. Physics, vol. 22, p. 063009, Jun 2020.
[116] I. L. Chuang, D. W. Leung, and Y. Yamamoto, [122] M. Bonarota, J.-L. Le Gouët, and T. Chanelière,
“Bosonic quantum codes for amplitude damping,” “Highly multimode storage in a crystal,” New
Physical Review A, vol. 56, pp. 1114–1125, Aug. Journal of Physics, vol. 13, p. 013013, Jan 2011.
1997. [123] S. E. Harris, J. E. Field, and A. Imamoğlu, “Non-
[117] R. H. Dicke, “Coherence in spontaneous radiation linear optical processes using electromagnetically
processes,” Phys. Rev., vol. 93, pp. 99–110, Jan induced transparency,” Phys. Rev. Lett., vol. 64,
1954. pp. 1107–1110, Mar 1990.
[118] M. Sabooni, Q. Li, S. Kröll, and L. Rippe, “Effi- [124] M. Cao, F. Hoffet, S. Qiu, A. S. Sheremet,
cient quantum memory using a weakly absorbing and J. Laurat, “Efficient reversible entanglement
sample,” Physical Review Letters, vol. 110, Mar transfer between light and quantum memories,”
2013. arXiv:2007.00022, June 2020.
[119] A. Seri, D. Lago-Rivera, A. Lenhard, G. Corrielli, [125] P. Vernaz-Gris, K. Huang, M. Cao, A. S. Sheremet,
R. Osellame, M. Mazzera, and H. de Riedmatten, and J. Laurat, “Highly-efficient quantum memory
“Quantum storage of frequency-multiplexed her- for polarization qubits in a spatially-multiplexed
alded single photons,” Phys. Rev. Lett., vol. 123, cold atomic ensemble,” Nature Communications,
p. 080502, Aug 2019. vol. 9, p. 363, Jan. 2018.
This section supplements the Methods, section Design and functionality of NetSquid, by going into more
depth on specific details of NetSquid’s design. The version of NetSquid that we consider is 0.10. For up-to-
date documentation of the latest NetSquid version, including a detailed user tutorial, code examples, and
its application programming interface, please visit the NetSquid website: https://netsquid.org [66].
The qubits sub-package of NetSquid, shown in Figure 10 (main text), provides a specialised quantum com-
putation library for tracking the lifetimes of many qubits across a quantum network. A class diagram of the
main classes present in this sub-package is shown in in Supplementary Figure 11. Rather than assigning a
single quantum state for a predefined number of qubits, both the number of qubits and the quantum states
describing them are managed dynamically during a simulation run. Every Qubit (Qubit) object references
a shared quantum state (QState) object, which varies in size according to the number of qubits sharing it.
When two or more qubits interact, for instance via a multi-qubit operation, their respective shared quantum
states are merged together. On the other hand, when a qubit is projectively measured or discarded it can
be split from the quantum state it’s sharing and optionally be assigned a new single-qubit state.
The QState class is an interface for shared quantum states that NetSquid implements for four different
quantum state formalisms – described in more detail below. To allow simulations to seamlessly switch
between formalisms NetSquid offers a formalism agnostic API, which is defined in the qubitapi module. The
functions in this API take as their primary input parameters the qubits to manipulate and the operators
(Operator) describing a quantum operation to perform, if applicable. The merging and splitting of shared
quantum states is handled automatically under the hood, as are conversions between states using different
formalisms (where this is possible). This allows users to program in a “qubit-centric” way, by for instance
applying local operations to qubits at a network node without knowledge of their positions within a quantum
state representation or any entanglement they may have across the network.
We proceed to give a high-level description of the available quantum state formalisms. The first two for-
malisms are ket state vectors (KET) and density matrices (DM), which both enable universal quantum
computation. A ket state vector represents a quantum pure state, while a density matrix can represent
statistical ensembles of pure states. The stabiliser formalism (STAB) [77, 96] and graph states with local
Cliffords formalisms (GSLC) [78] can only represent stabiliser states. Stabiliser states form a subset of all
quantum states that are closed under the application of:
• Clifford gates. Each Clifford gate can be written as circuit consisting of the following three gates only:
21
DMState
Density matrix
representation
qubitapi Qubit +dm: array
Module with functions that A quantum bit ...
manipulate qubits +name: str
+qstate: QState QState
create_qubits() ◄ parameter +is_number_state: bool KetState
Class interface for a quantum state
operate() +combine(other_qubit: Qubit) shared by qubits. Ket vector
stochastic_operate() representation
multi_operate() +indices: dict
+qubits: list of Qubit +ket: array
measure()
gmeasure() +num_qubits: int ...
discard() ...
Operator
reduced_dm() A quantum operator +operate_qubits(...)
fidelity() +measure_qubit(...) StabState
+name: str
exp_value() +fidelity(...) Stabiliser tableau
+description: str
apply_pauli_noise() +reduce_dm(qubits: list of Qubit) representation
+num_qubits: int
depolarize() +drop_qubit(qubit: Qubit) +stabiliser: Stabilizer
◄ parameter +ctrl: Operator transforms ►
dephase() +combine_qstate(other_qstate: QState)
+inv: Operator ...
amplitude_dampen() ...
+conj: Operator
apply_dda_noise()
...
delay_depolarize()
... +projectors(): list of Operator GSLCState
... Graph state with local
Cliffords representation
...
...
Figure 11: Design overview of NetSquid’s qubits sub-package. The main classes and module of the
netsquid.qubits sub-package. Qubit objects can be manipulated, as described for instance by Operator
objects, using the functions of the qubitapi module. Under the hood the qubits share a specific sub-class of
the QState interface. Ellipses indicate that not all of a class’s public variables and methods are listed.
Supplementary Table I: The four different quantum state formalisms implemented in NetSquid.
Where n is the amount of qubits in the quantum states and d is the average amount of edges per vertex in
the GSLC formalism with 0 ≤ d < n.
the Hadamard gate H (eq. (52)), the phase gate |0ih0| + i |1ih1| and the CNOT gate |00ih00| + |01ih01| +
|10ih01| + |01ih10|. Not all unitaries are Clifford gates;
P2n
In the KET formalism, an n-qubit pure state |ψi = k=1 ck |ki is stored as a vector of length 2n containing
the complex amplitudes ck . Here, |ki denotes the product state of the binary representation of k, e.g.
|5i = |1i ⊗ |0i ⊗ |1i.
†
The density matrix of a pure state |ψi is |ψihψ| = |ψi · (|ψi) , where · denotes matrix multiplication and (.)†
refers to complex transposition. An n-qubit mixed state is a statistical ensemble of n-qubit pure states and
22
1 1
− 14 0 0 0 0 − 14 i 41 i
2 4
− 12 − 14
1
4
0 0 0 1 1
0 4 i − 4 i
0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0
ρ=
0 0 0 0 0 0 0 0 0
0
0
0 0 0 0 0 0 0
1 1i −1i 0
2
i 4 4
0 0 0 14 − 41
− 21 i − 14 i 14 i 0 0 0 0 − 14 1
4
Figure 12: Quantum state representations available in NetSquid. Four different representations of
the same quantum state |ψi = √12 (|00i + i |11i) |−i. Each representation type is supported by NetSquid
and has different trade-offs (see text of section 1 A in Supplementary Note 1).
can be represented as
m
X
pk |ψk ihψk |
k=1
where |ψ1 i , . . . , |ψm i are n-qubit pure states (with 1 ≤ m ≤ n) and the pk are probabilities that sum to 1.
In DM, the density matrix of a pure or mixed state is represented as a matrix of dimension 2n × 2n with
complex entries.
In the stabiliser formalism [96], one tracks the generators of the stabiliser group of a state. We briefly
explain the concept here; for a more accessible introduction to the topic, we refer to [97]. In order to define a
stabiliser group, let us give the Pauli group, which consists of strings of Pauli operators with multiplicative
phases ±1, ±i:
n
O
{β · Pk | Pk ∈ {112 , X, Y, Z} and β ∈ {±1, ±i}}.
k=1
A stabiliser group is a subgroup of the Pauli group which is commutative (i.e. any two elements A and B
satisfy A · B = B · A) and moreover does not contain the element −112 ⊗ 112 ⊗ · · · ⊗ 112 . In case the stabiliser
group contains 2n elements, there is a unique quantum state |ψi for which each element A from the stabiliser
group stabilises |ψi, i.e. A |ψi = |ψi. Not all quantum states have such a corresponding stabiliser group;
those that do are called stabiliser states. The intuition behind the stabiliser state formalism is that one
tracks how the stabiliser group is altered by Clifford operations and |0i / |1i-basis measurements. Since the
stabiliser state belonging to a stabiliser group is unique, one could in principle always convert the group
back to any other formalism, such as KET. Concrete examples of stabiliser groups and their corresponding
stabiliser states are:
• the stabiliser group {112 , Z}, which corresponds to the state |0i;
• the stabiliser group {112 ⊗ 112 , 112 ⊗ Z, Z ⊗ 112 , Z ⊗ Z}, which corresponds to the state |0i ⊗ |0i;
√
• the stabiliser group {112 ⊗ 112 , X ⊗ X, Z ⊗ Z, −Y ⊗ Y }, which corresponds to the state (|00i + |11i)/ 2.
Rather than tracking the entire 2n -sized stabiliser group, it suffices to track a generating set, i.e. a set of
n Pauli strings whose 2n product combinations yield precisely the 2n elements of the stabiliser group. The
choice of generators is not unique. For the examples given above, example sets of stabiliser generators are:
• for |0i, the stabiliser group is generated by the single element Z, since Z 2 = 112
23
• for |00i, the stabiliser group is generated by {Z ⊗ 112 , 112 ⊗ Z}, since squaring any of these two yields
112 ⊗ 112 , while multiplying them yields Z ⊗ Z;
√
• for the state (|00i + |11i)/ 2, one possible set of of generators is {X ⊗ X, Z ⊗ Z}.
The k-th generator corresponds to the k-th row of this tableau and is given by
n
O
(−1)pk X xjk Z zjk
j=1
For updating the stabiliser tableau after the application of a Clifford gate or a |0i / |1i-basis measurement,
NetSquid uses the algorithms by [96] and [77]. The runtime performance of stabiliser tableau algorithms is
a direct function of the number of qubits: linear for applying single- or two-qubit Clifford unitaries, which
any Clifford can be composed into, and cubic for single-qubit measurement [96].
The last formalism is GSLC: graph states with local Cliffords [78]. Graph states are a subset of all stabiliser
states (see [98] for a review) and an n-qubit graph state |ψi can be written as
⊗n
Y
|ψi = Zjk |+i (11)
(j,k)∈E
where Zjk indicates a controlled-Z √ gate |00ih00| + |01ih01| + |10ih10| − |11ih11| between qubits j and k, and
we have denoted |+i = (|0i + |1i)/ 2. As such, a graph state is completely determined by the set of qubit
index pairs (j, k) at which a controlled-Z operation is performed. These indices can be captured in a graph
with undirected edges; in eq. (11), the edge set is E. Each stabiliser state can be written as a graph state,
followed by the application of single-qubit Clifford operations. Thus, a stabiliser state in the GSLC formalism
is represented by a set of edges E and a list of n single qubit Cliffords. There exist 24 single-qubit Cliffords,
so the Clifford list only requires O(n) space. For updating the graph and the list of single-qubit Cliffords
after the application of a Clifford gate or a |0i / |1i-basis measurement, NetSquid uses the algorithms by
[78]. The runtime scaling of the graph-state-based formalism depends on the edge degree d of the vertices
involved in the operation – constant-time for single-qubit Cliffords, quadratic in d for two-qubit Cliffords
and measurement – and thus scales favourably if the graph is sparse.
The discrete-event modelling framework used by NetSquid is provided by the Python package PyDynAA,
which is based on the core engine layer of DynAA, a system analysis and design tool [80]. This foundation
provides a simple yet powerful language for describing large and complex system architectures. To realise
PyDynAA, the simulation engine core was written in C++ for increased performance, and bindings to Python
were added using Cython. NetSquid takes advantage of the Cython headers exposed by PyDynAA to
efficiently integrate the engine into its own compiled C extension libraries.
Several of NetSquid’s sub-packages depend and build on the classes provided by PyDynAA, as illustrated in
Figure 10 (main text). In Supplementary Figure 13 we highlight several of these key classes and how they
interact with the simulation timeline in more detail, namely: the simulation engine (SimulationEngine),
events (Event and EventType), simulation entities (Entity), and event handlers (EventHandler). We proceed
to describe the concepts these classes represent in more detail.
Simulation entities represent anything in the simulation world capable of generating or responding to events.
They may be dynamically added or removed during a simulation. The Entity superclass provides methods
for scheduling events to the timeline at specific instances and waiting for them to trigger. The intended use
is that users subclass the Entity class to implement their own entities. The simulation engine efficiently
handles the scheduling of events at arbitrary (future) times by storing them in a self-balancing binary search
24
Entity
... wait for event to trigger
schedule_at (time, EventType)
wait (EventHandler, <event mask>) EventHandler
... ...
handle (Event)
Figure 13: Design overview of the PyDynAA package. Schematic overview of key classes defined by
the PyDynAA package, the discrete-event simulation engine used by NetSquid. Also shown is the relation
of each class to the simulation timeline. Events are scheduled onto the simulation timeline by Entity
objects. Entities wait for events to trigger by registering EventHandlers, which respond to an event by
passing it as input to a specified callback function. The events to wait for can be specified by their type,
id, and source entity. Ellipses indicate that not all of a class’s public variables and methods are listed.
Omitted from this class diagram is the EventExpression class – see the text for more details.
tree. Events may only be scheduled by entities, which ensures that events always have a source entity. If an
entity is removed during a simulation, then any future events it had scheduled will no longer trigger.
An entity responds to events by registering an event handler object with a callback function. Responses can
be associated to a specific type, source, and id (including wildcard combinations). The simulation engine
runs by stepping sequentially from event to event in a discrete fashion and checking if any event handlers
in its registry match. A hash table together with an efficient hashing algorithm ensure efficient lookups of
the event handlers in the registry.
PyDynAA implements an event expression class to allow entities to wait on logical combinations of events.
Atomic event expressions, which describe regular wait conditions for standard events, can be combined
to form composite expressions using logical and and or operators to any depth. Event expressions enable
NetSquid simulations to deal with timing complexities. This feature has been used extensively in NetSquid to
model both the internal behaviour of hardware components, as well as for programming network protocols.
As example, consider DEJMPS entanglement distillation [67]: two nodes participate in this protocol and a
node can only decide whether the distillation succeeded or failed when both its local quantum operations
have finished and it has received the measurement outcome from the remote node. Thus, the node waits for
the logical and of the receive-event and the event that the local operations have finished.
The physical modelling of network devices is provided by several NetSquid sub-packages: components, models
and nodes, which are shown stacked with relation the NetSquid package in Figure 10 (main text). The
pivotal base class connecting all them is the component (Component), which is used to model all hardware
devices. Specifically, it represents all physical entities in the simulation, and as such sub-classes the entity
(Entity),which enables it to interact with the event timeline. In Supplementary Figure 14 we show a class
diagram of the component class and its relationships to other classes from these sub-packages.
The modularity of NetSquid’s modelling framework is achieved by the composition of components in terms
of properties, models, communication ports and subcomponents. A component’s properties are values that
physically characterise it, such as the length of a channel or the frequency of a source. A special constrained
map (ConstrainedMap) container is used to store the properties (as well as the other composed objects)
to give control of the expected types and immutability of properties during a simulation. Models (Model)
are used to describe the physical behaviour of a component, such as the transmission delay of a channel,
or the quantum decoherence of a qubit in memory. Model objects are essentially elaborate functions and
generally do not store any state; when a model is called it is passed its component’s properties, in addition
to any modelling specific input, such as, in the case of a quantum noise model, the qubit to apply noise and
the time the qubit has been waiting on a memory. Components can be composed of other subcomponents,
which allows networks to be pieced together in a very modular fashion. For instance, a complete network
25
Channel QuantumChannel
Entity +properties: +models
+uid: int length: float quantum_noise_model: QuantumErrorModel
+ports: quantum_loss_model: QuantumErrorModel
#_schedule_{now,after,at}(...)
send
#_wait{_once}(...)
recv
#_dismiss(...) ClassicalChannel
+models
...
delay_model: DelayModel +models
... classical_noise_model: QuantumErrorModel
classical_loss_model: QuantumErrorModel
Port Component
MemoryPosition QuantumMemory
+name: str +name: str
+component: Component +properties: ConstrainedMap +models: +properties:
... +ports: ConstrainedMap noise_model: QuantumErrorModel num_positions: int
+models: ConstrainedMap ... +ports:
+connect(other_port: Port) qin
+forward_input(other_port: Port) +subcomponents: ConstrainedMap
... qout
+forward_output(other_port: Port) +models:
+tx_input(message: Message) ... qin_noise_model: QuantumErrorModel
+tx_output(message: Message) qout_noise_model: QuantumErrorModel
+rx_input() +subcomponents:
+rx_output() mem_position{0...N}: MemoryPosition
...
...
Model
+properties: dict
+required_properties: list
Message
+validate(...) QuantumSource, QuantumDetector, Clock, QuantumProcessor, ...
+items: list +compute_model(...) All modeled hardware devices are components
+meta: dict ...
Node
+subcomponents:
ErrorModel DelayModel
Network qmemory: QuantumMemory
...
+nodes: ConstrainedMapView
+error_operation() +generate_delay() +connections: ConstrainedMapView connects ▲
Connection
ports:
QuantumErrorModel ClassicalErrorModel
A
B
Figure 14: Design overview of components in NetSquid. Class diagram for the Component class, a
simulation entity that is used to model all network hardware devices, including composite components
such as nodes, connections and the network itself. A component is shown to be composed of properties,
ports, models and subcomponents. Ellipses indicate that not all of a class’s public variables and methods
are listed.
can be represented by a single component, which is composed of node and connection sub-components,
which in turn are composed of devices such as channels, sources, memories, etc. To streamline and automate
the communication between components, including to and from sub-components, components can be linked
using ports (Port) that can send, receive and forward both quantum and classical messages (Message).
While the component base class defines a modular interface for modelling all kinds of hardware, it doesn’t
internally implement any event-driven behaviour itself. That behaviour is implemented by a library of base
classes that sub-class Component. The right half of Supplementary Figure 14 shows the sub-classing hierarchy
of the provided components, ranging from quantum and classical channels, quantum memory and processing
devices, sources, detectors, clocks, to nodes, connections, and networks.
The quantum processor (QuantumProcessor) is a component from the base class library used for modelling
general quantum processing devices. It sub-classes the quantum memory (QuantumMemory) component, from
which it inherits a collection of quantum memory positions (MemoryPosition) for tracking the quantum noise
of stored qubits. The processor can assign a set of physical instructions to these positions to describe the
operations possible for manipulating their stored qubits, such as quantum gates and measurements, or ini-
tialisation, absorption, and emission processes. The physical instructions map to general device-independent
instructions, for which they specify physical models such as duration and error models specific to the
modelled device. This mapping allows users to write quantum programs in terms of device-independent in-
structions and re-use them across devices. The quantum programs can include classical conditional logic,
make use of parallel execution (if supported by the device), and import other programs.
While components are entities in the simulation describing physical hardware, protocols – represented by the
Protocol base class as shown in Supplementary Figure 15 – are entities that describe the intended virtual
behaviour of a simulation. In other words, the protocol base class is used to model the various layers of
software running on top of the components at the various nodes and connections of a network. That can
include, for instance, any automated control software at the physical or link layers of a quantum network
stack, up to higher-level programs written at the application layer.
Protocols in NetSquid can be likened to background processes: they can be started, stopped, as well as reset
to clear any state. They can also be nested i.e. a protocol can manage the execution of sub-protocols under
its control. To communicate changes of state, such as a successful or failed run, protocols can use a signalling
mechanism (Signal).
26
NetSquid defines several sub-classes of the protocol base class that add extra restrictions or functionality.
To restrict the influence of a protocol to only a local set of nodes the local protocol (LocalProtocol) can be
used. Similarly, to restrict a protocol to executing on only a single node, which is a typical use case, a node
protocol (NodeProtocol) is available. The service protocol (ServiceProtocol) describes a protocol interface
in terms of the types of requests and responses they support. Lastly, a data node protocol adds functionality
to process data arriving from a port linked to a connection, and the timed node protocol supports carrying
out actions at regularly timed intervals.
Programming a protocol involves waiting for and responding to events, which is achieved in the simulation
engine by defining event handlers that wrap callback functions. As the complexity of a protocol grows,
typically the flow and dependencies of the callback calls do too. To make the asynchronous interaction
between protocol and component entities easier and more intuitive to program and read, the main execution
function of a protocol (the run() method) can be suspended mid-function to wait for certain combinations of
events to trigger. This is implemented in Python using the yield statement, which takes as its argument an
event expression. Several helper methods have been defined that generate useful event expressions a protocol
can await, for instance: await_port_input() to wait for a message to arrive on a port, or await_timer() to
have the protocol sleep for some time.
ServiceProtocol
Entity Protocol LocalProtocol +request_types: ConstrainedMap
+uid: int +name: str +nodes: ConstrainedMap +response_types: ConstrainedMap
+signals: dict +max_nodes: int +response_handlers: ConstrainedMap
#_schedule_{now,after,at}(...)
#_wait{_once}(...) +subprotocols: ConstrainedMap ... ...
#_dismiss(...) ...
... +run()
+start()
+stop() TimedNodeProtocol
+reset() NodeProtocol +time_step: float
«Enum» +start_subprotocols() +node: Node +start_time: float
Signals +send_signal()
...
FINISHED: EventType +await_timer(...)
SUCCESS: EventType +await_signal(...)
FAIL: EventType +await_port_input(port: Port, ...)
BUSY: EventType +await_port_output(port: Port, ...) DataNodeProtocol
WAITING: EventType +await_program(...)
READY: EventType ... +port_name: str
+process_data(message: Message)
+post_process_data(message: Message)
Figure 15: Design overview of protocols in NetSquid. Class diagram of the Protocol class and its
subclasses. Ellipses indicate that not all of a class’s public variables and methods are listed.
In this section we extend the Methods, section Benchmarking, to provide additional details on the bench-
marking simulations presented in the Results, section Fast and scalable quantum network simulation.
The quantum circuit used to benchmark the runtime for generating an n qubit GHZ state is shown in
Supplementary Figure 16a. The n qubits are created in NetSquid with independent quantum states and are
combined into the larger state via the CNOT operation. The measurement operations at the end of the circuit
are performed sequentially and each split the measured qubit from its shared quantum state. Unless otherwise
specified the KET and DM formalisms utilise memoization (see Methods, section Qubits and quantum
computation). Memoization is effective because the circuit is successively iterated 30 times. The reported
runtime is the mean runtime of the iterations. For the baseline comparison with the ProjectQ simulator we
set up the circuit in an analogous way to NetSquid, and its default MainEngine was used with no special
settings applied. Qubits are similarly added sequentially to the growing state via the CNOT operation, and
also the measurements are performed sequentially with the measured qubit directly deallocated afterwards.
The quantum circuit used to benchmark the runtime of only the quantum computation involved for a simple
repeater chain involving n qubits is shown in Supplementary Figure 16b. It is implemented for NetSquid
and ProjectQ similarly to the GHZ benchmark, with qubits only combining their quantum states when a
multi-qubit gate is performed. An option has been added to keep qubits inplace after measurements i.e.
they are not split from their shared quantum states – in ProjectQ this is achieved by keeping a reference to
prevent deallocation. Noise is applied to each qubit after entanglement by selecting a Pauli gate to mimic
depolarising noise, which is done deterministically for convenience. For this process the runtime is also
determined as the mean of 30 successive iterations.
27
Entangle Noise Swap
q1
|0i H • {X, Y, Z}
q2
|0i {X, Y, Z} • H •
q3
q1 |0i H • {X, Y, Z} •
|0i H • • ··· •
q4
q2 |0i {X, Y, Z} • H •
|0i ···
q3 ··· ··· ··· ···
|0i ···
qn−1
··· ··· |0i H • {X, Y, Z} •
qn qn
|0i ··· |0i {X, Y, Z} X Z
To benchmark the runtimes of quantum computation circuits the processes were timed in isolation from
any setup code using the Python timeit package. Python garbage collection is disabled during the timing
of each process. To avoid fluctuations due to interfering CPU processes the reported time is a minimum of
five repetitions.
The runtime profiling of NetSquid presented in the Results, section Benchmarking of event-driven simu-
lations, is performed for a simple repeater chain. The network setup of this simulation extends the single
repeater presented in Supplementary Figure 1 to a chain of nodes by adding the entangling connection shown
between each pair of neighbouring nodes. Direct classical connections are connected between each node and
one of the end-nodes, rather than between neighbouring nodes, and are used to transmit the swapping
corrections. The chosen configuration for this network does not need to be physically realistic; it suffices for
it to be representative of the typical computational complexities. The nodes are placed at 20km intervals
and the channels transmit messages at the speed of light in fibre. The entanglement sources, assumed to be
perfect, are all synchronised and operate at a frequency of 100 kHz. Physical non-idealities are represented
by adding time-dependent depolarising noise to both the quantum channels and quantum memories, as well
as dephasing noise to quantum gates. The corresponding depolarising and dephasing times are 0.1 s and
0.04 s, which correspond to the T1 and T2 times presented in section Modelling a nitrogen-vacancy centre
in diamond of the Methods.
In a simulation run entanglement is created once between the end-nodes by performing entanglement swaps
along the chain. Protocols are assigned to all but the end-nodes to perform entanglement swaps after each
round of entanglement generation, and send their measurement results as corrections to the same end-node.
A protocol running on the end-node collects these corrections, and applies them if needed.
The runtime of this simulation is profiled to determine the distribution of time spent in the functions
of NetSquid’s sub-packages, as well as its dependency packages NumPy and PyDynAA. To perform this
profiling the cProfile package is used. The reported runtime for a given number of nodes is the mean of
400 successive simulation runs.
Here, we provide the details of the quantum switch simulations, whose results are presented in section Sim-
ulating a quantum network switch beyond its analytically known regime of the Results.
28
We implement the model of Vardoyan et al. [56], for which the parameters of the simulation are:
• the number of leaf nodes k;
• the desired size n of the shared entanglement on the leaf nodes;
• for each leaf node: the rate µ at which bipartite entanglement is generated between leaf node and
switch;
• B: the buffer size, i.e. the number of dedicated qubits per leaf node at the switch.
In addition, we include T2 , the memory coherence time.
A. Physical network
In the scenario we study, the quantum switch is the centre node of a star-topology network, with k ≥ 2 leaf
nodes. Each leaf node individually is connected to the switch √ by a connection, which consists of a source
producing perfect bipartite entangled states (|00i + |11i)/ 2 on a randomised clock and two quantum
connections, from the source to the leaf and switch node, respectively, for transporting the two produced
qubits. The interval ∆t between clock triggers is randomly sampled from an exponential distribution with
probability µ · e−µ·∆t where µ is the rate of the source. We set the delay of the quantum channels to zero.
Each node holds a single quantum processor with enough quantum memory positions for the total duration of
our runs. Each memory position has a T2 noise model : if a qubit is acted upon after having resided in memory
for time ∆t, then a dephasing map (eq. (1)) is applied with dephasing probability p = 21 1 − e−∆t/T2 . Each
quantum processor can perform any unitary operation or single-qubit measurement; these operations are
noiseless and take no time.
The switch node continuously waits for incoming qubits. Upon arrival of a qubit from leaf node `, the switch
first checks whether it shares more entangled pairs of qubits with ` than the pre-specified buffer size B; if so,
it discards the oldest of those pairs. Then, it checks whether it holds entangled pairs with at least n different
leaves. If so, then it performs and n-qubit GHZ-basis measurement (see below) on its qubits of those pairs.
If multiple groups of n qubits from n distinct nodes are available, then it chooses the oldest pairs.
Directly after completion of the GHZ-basis measurement, we register the measurement outcomes and obtain
the resulting n-partite entangled state |ψi on the leaf nodes. From these, the fidelity |hψ|φideal i|2 with the
ideal target GHZ state |φideal i is computed.
The n-qubit GHZ states are
.√
|0i ⊗ |b2 i ⊗ |b3 i ⊗ · · · ⊗ |bn i + (−1)b1 |1i ⊗ b2 ⊗ b3 ⊗ · · · ⊗ bn (31)
2
where bj ∈ {0, 1} and we have denoted b = 1 − b. The n-qubit quantum program that the switch node applies
for performing a measurement in the n-qubit GHZ basis is as follows: first, a CNOT operation on qubits 1
and j (1 is the control qubit) is applied for all j = 2, 3, . . . , n, followed by a Hadamard operation (eq. 52)
on qubit 1. Then, all qubits are measured in the |0i / |1i-basis. If we denote the outcome of qubit j as bj ,
the GHZ-state that is measured is precisely the one in eq. (31).
Here, we provide the values for the hardware parameters of the nitrogen-vacancy setup used in our simula-
tions. An overview of all parameters is provided in Supplementary Table II, including two example sets of
improved parameters following the approach in section How we choose improved hardware parameters of
the Methods.
For generating entanglement between the electron spins of two remote NV centres in diamond, we simulate
a scheme based on single-photon detection, following its experimental implementation in [93]. The setup
consists of a middle station which is positioned exactly in between two remote NV centres in diamond.
29
Noise parameter Duration/time Probability Improved noise param.
(‘near-term’) of no-error 3× 10×
Probability of double excitation pdexc (4 A b) 0.06 - pdexc 0.01 0.003
Transmission loss γ (dB/km, 4 A a) 0.2 - × × ×
Dark count probability pdc (4 A b) 2.5 · 10−8 - 1 − pdc 8.3 · 10−8 2.5 · 10−9
Probability of photon detection (4 A a)
for zero-length fibre pnofibre
det 0.0046 - pnofibre
det 0.16 0.58
Interferometric phase uncertainty 0.35 - 1 − pphase 0.20 0.11
σphase (rad, 4 A b) (eq. (43))
Photon visibility V (4 A b) 0.9 - V 0.97 0.99
N1/e : indicates nuclear dephasing 1400 - p from eq. (45) 4206 14006
during electron initialization (4 A c)
Electron T1 (4 A d) - 1h e−1/T1 2.8h 10h
∗
∗
Electron T2 (4 A d) - 1.46 s e−1/T2 4.4s 14.6s
Carbon T1 (4 A d) - 10h e−1/T1 27h 100h
30
Carbon T2 (4 A d) 1s e−1/T2 3s 10s
Carbon initialization to |0i (4 A d) F =0.997 310 µs 2F − 1 F = 0.999 F = 0.9997
Carbon Z-rotation gate (4 A d) F =0.999 20 µs 4(F − 1)/3
√ F > 0.9999 F > 0.9999
E-C controlled-RX -gate FEC =0.97 500 µs (4 FEC − 1)/3 FEC = 0.990 FEC = 0.997
(electron=control) (4 A d)
Electron initialization to |0i (4 A d) F =0.99 2 µs 2F − 1 F = 0.997 F = 0.999
Electron single-qubit gate (4 A d) F =1 5 ns (4F − 1)/3 F =1 F =1
Electron readout (eq. (4) and sec. 4 A d ) 0.95/0.995(f0 /f1 ) 3.7 µs fx 0.983/0.9983 0.995/0.9995
Supplementary Table II: Physical parameters dealing with elementary link generation, memory coherence times and duration and fidelities (F ) of
the gates. Depicted are both parameters of the dataset ‘near-term’ and two examples of improved parameter sets (see Methods, section How we choose improved
hardware parameters), for 3 times and 10 times improved, respectively, together with the function to convert the parameter to a ‘probability of no-error’ to
compute the improved parameter value for other factors. The ‘near-term’ values correspond to 1× improvement. The transmission loss parameter γ is not changed
by the improvement procedure and equals γ = 0.2 dB/km during any of our simulations.
The middle station is connected to the two NVs by glass fibre and contains a 50:50 beam splitter and
two non-number resolving photon detectors. In the single-photon scheme, each NV performs √ the√following
operations in parallel. First, the electron of each NV system is brought into the state α |0i + 1 − α |1i
by optical and microwave pulses, where α is referred to as the √ bright-state parameter.
√ Then, a laser pulse
triggers the emission of a photon, yielding the spin-photon state α |0is ⊗ |1ip + 1 − α |1is ⊗ |0ip , where |0i
(|1i) denotes absence (presence) of a photon. We set α = 0.1 since for that value, fidelity is approximately
maximal at lab-scale distances [93]; optimising over α is out of the scope for this work. We assume that the
delay until emission of the photon is fixed at 3.8 µs [99].
From each NV centre, the emitted photons are transmitted to the middle station through glass fibre, where
a 50:50 beam splitter effectively erases the which-way information of an incoming photon. An attempt at
generating entanglement using this single-click scheme is declared successful if precisely one of the detectors
clicks, which happens if either (a) a single photon arrives at the detector and the other does not or (b) both
photons arrive (in case (b), only a single detector clicks due√ to the Hong-Ou-Mandel effect). Case (a) yields
the generation of the spin-spin state |φ± i = (|01i ± |10i)/ 2, where ± indicates which of the two detectors
clicked, while case (b) results in |00ih00|. Given that a single photon arrives, the probabilities that the other
photon has or has not arrived are respectively 1 − α and α (in the absence of loss). Therefore, a successful
attempt results in the generation of the spin-spin state (1 − α) |φ± ihφ± | + α |00ih00|. We refer to [93] for
a more in-depth description of the scheme. We assume that the speed of the photons and of all classical
communication equals c/nri , where c is the speed of light in vacuum and nri = 1.44 is the refractive index
of glass [100].
In reality, however, several sources of noise affect the produced state, which we treat below.
a. Imperfect detection
The total probability pdet that a photon, emitted by the NV, will be detected in the midpoint is given by
the product of four probabilities [92]
• the probability pzero_phonon that the photon frequency is in the zero-phonon line [101];
• the probability pcollection that the photon is collected into the glass fibre;
• the probability ptransmission that the photon does not dissipate in the fibre during transmission;
• the probability pdetection that the photon is detected, conditioned on the fact that it reaches the
detector.
Thus we can write
pdet = pnofibre
det · ptransmission (41)
where
pnofibre
det = pzero_phonon · pcollection · pdetection . (42)
ptransmission = 10−(L/2)·γ/10
where L is the internode distance (i.e. L/2 is the length of the fibre from NV to middle station) and γ is
the loss parameter which depends on the photon frequency. In our simulations, we assume that the photon
frequency is converted to the telecom frequency, corresponding to γ = 0.2 dB/km. Also, we assume that the
emission in the zero-phonon line is enhanced by an optical cavity from pzero_phonon = 3% (without cavity)
to pzero_phonon = 46% (with cavity) [101]. We set the detection efficiency pdetection to 0.8 [102].
What remains is the collection efficiency pcollection , which we compute from experimental values (no cavity,
no conversion to the telecom frequency) using eq. (41) with L = 2m, pdet = 0.001 [99] and γ = 5 dB/km [39]
(for the zero-photon line frequency), yielding pcollection = 0.042. Since frequency conversion to the telecom
frequency is a probabilistic process and only succeeds with probability 30% [103], we set pcollection = 0.3·0.042.
31
• Dark counts: a photon detector falsely registering. The dark count probability follows a Poisson distri-
bution pdc = 1 − e−tw ·λdark where tw = 25 ns [93] is the duration of the time window at the midpoint.
We set λdark = 1 Hz as the dark count rate.
• Imperfect photon indistinguishability. The generation of entanglement at the middle station is based
upon the erasure of the which-way information with respect to the path of the photons. Only in case
the photons are fully indistinguishable, the which-way information is erased perfectly. The overlap of
the photon states is given by the visibility V , which we set to 0.9 [93].
• Double excitation of the electron spin. When triggered to emit a photon by a resonant laser pulse, an
NV centre could be excited twice, which results into the emission of two photons. We set its occurrence
probability to pdexc = 0.06 [99].
• Photon phase uncertainty. The photons which interfere at the midpoint acquired a phase during trans-
mission and a difference of these phases influences the precise entangled state that is produced [104].
Given a standard deviation σphase = 0.35 rad [99] of the acquired phase, we compute the dephasing
probability as [93]
1 2
pphase = 1 − e−σphase /2 . (43)
2
The initialisation of the electron spin state induces dephasing of the carbon spin states through their
hyperfine coupling. Following [105], we model this uncertainty by a dephasing channel for each attempt
with dephasing probability
1 2
psingle = (1 − α) · (1 − e−Cnucl /2 ). (44)
2
The parameter Cnucl is the product of the coupling strength between the electron spin and the carbon nuclear
spin, and an empirically determined decay constant. Rather than expressing the dephasing probability as
function of Cnucl , we express the magnitude of nuclear dephasing as N1/e , the number of electron spin
√
pumping cycles after which the Bloch vector length of a nuclear spin in the state (|0i + |1i)/ 2 in the X − Y
plane of the Bloch sphere has shrunk to 1/e, when √ the electron spin state has bright-state parameter α = 0.5
(i.e the electron spin is in the state (|0i + |1i)/ 2).
Let us compute how psingle depends on N1/e instead of on Cnucl . First, we find by direct computation that
the equatorial Bloch vector length of a state is shrunk by a factor 1 − 2p after a single application of the
single-qubit dephasing channel (eq. (1)) with probability p (p ≤ 12 ).
Equating (1 − 2p)N1/e = 1/e yields
1
p= 1 − e−1/N1/e . (45)
2
Equating psingle from eq. (44) with α = 0.5 and p from eq. (45), followed by solving for Cnucl yields
2
1 − e−Cnucl /2 = 2 1 − e−1/N1/e .
For the dynamics of the electron spin, we use T1 = 1 hour and T2∗ = 1.46s [107]. For the carbon nuclear
spin, we take T1 = 10 hours and T2 = 1 s (experimentally realised: T1 = 6m and T2 ≈ 0.26 − 25s [108]). For
the noise of the controlled-RX gate (Methods, section Modelling a nitrogen-vacancy centre in diamond), we
set the depolarising probability p = 0.02 (denoted as pEC in Supplementary Table II), since by simulation
of the circuit [104, Fig. 2a], we find that this value agrees with the experimentally found effective circuit
32
fidelity of 0.95. The corresponding fidelity of the gate is FEC = (1 − 3pEC /4)2 = 0.97. The initialisation
fidelities of the electron and carbon spins are set at 0.99 [109] and 0.997 [108]. We use 0.999 for the carbon
Z-rotation gate fidelity (experimentally achieved: 1 [110]). The durations of local operations are identical to
our earlier simulations (see Appendix D, Table 6 in [39] and references therein). We summarise all hardware
values in Supplementary Table II.
Supplementary Note 5: Protocols and quantum programs for the NV repeater chain
Here, we first elaborate on the sequence of quantum operations and classical communication that the NV
protocol building blocks consist of (Methods, section NV repeater chain protocols). Then, we describe in
detail the two repeater chain protocols we simulated.
A. Operations for the building blocks: store, retrieve, distill and swap
store is the mapping of the electron spin state onto a free nuclear spin. The operation requires the nuclear
spin state to be |0i and the circuit, given in Supplementary Figure 17(a), performs the following mapping:
1
H := √ (|0ih0| + |0ih1| + |1ih0| − |1ih1|) (52)
2
is the Hadamard gate. By retrieve (Supplementary Figure 17(b)), we denote the reverse operation,
We simulate the specific entanglement distillation protocol (distill) from Kalb et al. [104], which acts upon
an electron-electron state and a nuclear-nuclear state to probabilistically increase the quality of the nuclear-
nuclear state, at the cost of having to read out the electron-electron state. In the protocol, the two involved
nodes each perform a sequence of local operations including a measurement (Supplementary Figure 17(c)),
followed by communicating the measurement outcome from the circuit to each other. In this work, we only
use distillation in one of the two repeater schemes we consider (nested-with-distill) and in that case,
the success condition is as follows: if the nodes are adjacent, then the measurement outcomes should both
equal 0 (i.e. the bright state of the electron), while otherwise the measurement outcomes only need to be
equal (i.e. both 0 or both 1). In the case of failure, the nuclear-nuclear state is considered lost.
The entanglement swap (swap) converts two short-distance entangled qubit pairs A − M and M − B into
a single long-distance one A − B, where A, B and M are nodes. It is equivalent to performing quantum
teleportation [111] to a qubit which is part of a larger remote-entangled state. Our entanglement swapping
protocol at node M starts by assuming that one of M ’s qubits which is involved in the entanglement swap is
the electron spin. Then, a series of local operations including measurements (Supplementary Figure 17(d))
is performed; the measurement outcomes are transferred to both A and B. In the original teleportation
proposal, B performs a local operation to correct the state A − B to the expected one. However, due to the
fact that such correction operation is generally not directly possible to perform on the nuclear spin state
(see the allowed operations in section Modelling a nitrogen-vacancy centre in diamond of the Methods),
we opt for the approach where the correction operation is tracked in a classical database. Details of this
tracking, including how it affects the entanglement distillation and entanglement swap protocols, are given
in Supplementary Note 6.
We describe two protocols for the NV repeater chain: swap-asap, a protocol where a node performs an
entanglement swap as soon as it holds two entangled pairs, one in each direction of the chain, and nested-
with-distill, a nested protocol with distillation at each nesting level which is based on the BDCZ proto-
col [9]. Both protocols run asynchronously on each node.
In both protocols, a node remains idle until it is triggered to check whether it should perform an action. It
is triggered at the following three moments: (a) at the start of the simulation, (b) when the node receives
a classical message (if a node is busy upon reception, the message is stored and responded to later) , (c)
33
(a) e • RX ( π2 ) • RY (− π2 )
store =
n initialise RZ (− π2 ) RX (± π2 ) RZ ( π2 ) RX (± π2 )
(b) e initialise RY ( π2 ) • RX (− π2 ) •
retrieve =
n RX (∓ π2 ) RZ (− π2 ) RX (∓ π2 ) RZ ( π2 )
(c) e RY ( π2 ) • RX ( π2 )
n RX (∓ π2 )
(d) e • RY ( π2 ) H
retrieve
n RZ ( π2 ) RX (± π2 ) RZ (− π2 )
Figure 17: Quantum circuits used in simulations of the NV repeater chain, acting on an
electron (e) and nuclear (n) spin. Figure depicts the quantum circuit for the NV repeater protocol
building blocks: (a) store operation (mapping electron spin state onto the nuclear spin), (b)
retrieve (reverse operation to store), (c) entanglement distillation, (d) entanglement swap.
when its previous action is finished. A simulation run finishes as soon as the two end nodes share a single
entangled pair of qubits.
For the swap-asap protocol, the sequence of operations that a node performs depends on its index in the
chain (start counting from left to right, nodes have indices 1, 2, 3, . . . ). If the index of the node is even, the
node sends a request for entgen to its left neighbour, and starts the operation as soon as it has received
confirmation. After performing store to free the electron spin, it repeats it for its right neighbour. Odd-
indexed nodes remain idle until reception of an entgen request, after which they perform store if necessary
to free the electron, send a confirmation, sleep for the duration of the message transmission, followed by
performing entgen. Once a node has entanglement with both directions, it performs a swap and sends the
outcome to the end nodes.
The two end nodes are exceptions to the above. The left end node (i.e. with index 1) behaves like an odd-
indexed node, but without performing swap. The same holds for the rightmost node (i.e. the node with the
largest index), unless its index is even, in which case it initiates and performs entanglement generation with
the adjacent node on the left.
The nested-with-distill protocol is a variant of the BDCZ protocol [9], adapted to the fact that an NV
cannot perform multiple entgen , distill or swap operations in parallel due to its restricted topology
(Methods, section Modelling a nitrogen-vacancy centre in diamond). In the adapted version, nodes take the
role of initiator of one of the three main actions (entgen, distill, swap) if the action occurs at the highest
nesting level that this node belongs to. To be precise, we do the following. In a repeater chain with 2n + 1
nodes, denote by {0, 1, 2, . . . , 2n } the indices of the nodes from left to right. A node (not an end node) with
index k ∈ {1, 2, 3, . . . , 2n − 1} initiates an action only if the entanglement that is involved in the task spans
precisely fn (k) segments, where
f1 (k) = 1 for all k
fn−1 (k)
if k < 2n−1 ,
fn (k) = fn−1 (2n − k) if k > 2n−1 ,
2n−1 if k = 2n−1 .
34
3. Same as 2, but now for distill on the right, i.e. remote node has index k + fn (k)
4. If there are any request-messages that have not been responded to yet: pick the oldest one and act as
follows. Respond to the message with a confirmation message, followed by sleeping for the time that
the confirmation takes to arrive at the remote node. Then perform the requested action (entgen or
distill).
5. If fn (k) = 1 and the node does not hold entanglement with its immediate left neighbour that is
the result of successful entanglement distillation: send a request for entgen to the node, wait for
confirmation, followed by performing entgen.
6. Same as 5 for right adjacent node.
If no action follows from the checks above, then the node remains idle until the next time at which it is
triggered. In the operations above, if necessary entgen is preceded by store to free the electron by storing
its state into a free carbon spin. distill is preceded by a combination of store and retrieve to ensure
the correct state lives on the electron spin, and so is swap in case neither of the two to-be-swapped qubits
live on the electron. Since end nodes are never initiators, they only check 4.
Here, we explain how nodes of the NV repeater chain track the precise entangled state they hold. This is
done by associating unitary
√ operations to each qubit, which map the state of two remotely entangled qubits
back to (|01i + |10i)/ 2 in the ideal case. Tracking these unitaries (gates) in a classical database, instead
of performing them on the (imperfect) quantum hardware, has the advantage of avoiding gate noise. This
argument is even stronger for NV centres in case the remote-entangled state is held by a carbon nuclear
spin, because direct application of a correction operator to a carbon spin is generally not possible due to the
restricted topology of the NV quantum processor (Methods, section Modelling a nitrogen-vacancy centre in
diamond). Thus, performing the correction operator to the nuclear spin requires even more gates, namely
the ones to map the nuclear spin to the electron spin (the retrieve operation, see section NV repeater
chain protocols of the Methods), where the correction operator could be applied.
In what follows, we first explain how we track the correction operations. Then, we describe how the track-
ing changes the protocol building blocks from section NV repeater chain protocols of the Methods and
subsequently prove the correctness of the tracking in the ideal case.
Let us denote the four Bell states as
√
|φ[±1, 1]i = (|00i ± |11i)/ 2,
√
|φ[±1, −1]i = (|01i ± |10i)/ 2.
To each of the qubits it holds, a node associates a single-qubit Pauli operator 11, X, Y or Z, which are defined
as
The goal of the tracking is, at any time during the simulation, for any two nodes A and B sharing electron-
electron entanglement, that the target electron-electron state equals
Here, PA and PB denote the Pauli correction operations of node A or B, respectively, and ≡ denotes equality
modulo a complex number of norm 1.
In what follows, it will be more convenient to use the following equivalent statement to eq. (61):
Here, we explain how each of the four protocol building blocks from section NV repeater chain protocols of
the Methods are adjusted to ensure that eq. (62) holds after the operations entgen, distill and swap.
Entanglement generation. Suppose that nodes A and B perform the entgen protocol. In the absence
of noise, this protocol (approximately) produces the state |φ[±1, −1]i, where ± denotes which detector
35
clicked (Methods, section Simulation speedup via state insertion). If the +-detector clicked, then the
state that A and B hold is the desired state |φ[1, −1]i, so we set PA = PB = 11. If the other detector
clicked, then the produced state is |φ[−1, −1]i. Therefore, one of the nodes (for example, the one with the
higher position index in the chain) sets the correction operator to Z, whereas the other sets it to 11, since
(11 ⊗ Z) |φ[−1, −1]i = |φ[1, −1]i.
Storing and retrieving qubits. Locally mapping the state of a qubit onto a different memory position by the
store or retrieve circuits does not alter the correction Pauli corresponding to that qubit.
Entanglement distillation. Suppose that nodes A and B wish to perform the distill protocol, which starts
by A and B sharing an electron-electron pair (correction Paulis PAe and PBe at node A and B, respectively)
and a nuclear-nuclear pair (PAn and PBn ). In the protocol, first both nodes apply P n · P e to their electron spin
qubit. Then, both nodes locally perform the distillation circuit from Supplementary Figure 17(c), followed
by sending both the measurement outcome and P n to the other node. The nodes determine whether the
distillation succeeded using the condition explained in section 5. In case of failure, the nuclear-nuclear state
is discarded. In case of success, one of the nodes in the chain (for example, the one with the lower position
index in the chain) sets P n = 11, while the other sets
Y if PA ∈ {X, Y } and PB ∈ {11, Z}
n n
Below, in section 6 B of this Supplementary Note, we show that after this procedure, eq. (62) still holds.
Entanglement swapping. Suppose that node M wants to execute the swap protocol on shared pairs A − M
and M − B, with nodes A and B respectively. We denote M ’s correction Paulis as PM A
and PM
B
. First, M
performs the Bell-state measurement circuit from Supplementary Figure 17(d). Let us denote the individual
measurement outcomes of the circuit as mearlier and mlater (both take values from {1, −1}), which correspond
to the measured Bell state |φ[a, b]i with a = −1 · mearlier · mlater and b = mlater . Then, M sends the Pauli 11
to A, while to B it sends PMA
· PMB
· Q, where Q is given by
(a, b) Q
(1, 1) X
(1, −1) 11 (64)
(−1, 1) Y
(−1, −1) Z
Both nodes A and B multiply their local Pauli with the Pauli they received from M . The proof that after
the swap, eq. (62) still holds can be found below in section 6 C of this Supplementary Note.
Here, we prove that eq. (62) holds for the states that are outputted by the protocols for entanglement
distillation and swapping explained above.
Let us start with entanglement distillation. For this, we denote by ‘physical nuclear-nuclear state’ the joint
state of the nuclear spins of node A and B. By direct computation, one can show the following.
Proposition 1. Suppose that nodes A and B share the state |φ[a, b]i on the electrons and the physical
nuclear-nuclear state |φ[c, d]i, where a, b, c, d ∈ {1, −1}. When both nodes execute the distillation circuit
from Supplementary Figure 17(c), the resulting state on the carbon nuclear spins is
|φ[c, −a · c · d]i
and the measurement outcome m1 ∈ {1, −1} on one side is uniformly random, while the outcome of the
other node equals m2 = m1 · b · c.
We emphasise that using the correction-operator tracking for the store and retrieve operations as de-
scribed in section 6 A of this Supplementary Note, the physical nuclear-nuclear state between any two nodes
does not satisfy eq. (62). The reason for this is that the store operation maps the electron spin state to
the nuclear spin in a rotated basis, where the rotation operator is a Hadamard gate H (eq. 51). However,
the correction operators are not updated when the store is applied (see ‘Storing and retrieving qubits’ in
section 6 A). Consequently, if nodes A and B share the physical nuclear-nuclear state |ψi, then mapping |ψi
36
to the reference Bell state |φ[1, −1]i requires first the application of H ⊗ H, followed by applying PA ⊗ PB .
By ‘virtual nuclear-nuclear state’, we mean the state |ψ 0 i = (H ⊗ H) |ψi, i.e. the state that satisfies eq. (62).
Let us first convert Prop. 1 to a statement with the virtual-virtual nuclear state.
Proposition 2. Suppose nodes A and B share the electron-electron state |φ[a, b]i and the virtual nuclear-
nuclear state |φ[c, d]i. Then after the distillation circuit from Supplementary Figure 17(c), the virtual state
on the nuclear spins after performing the distillation equals
|φ[−a · c · d, d]i
and the measurement outcomes are m1 ∈ {1, −1} (uniformly random) and m2 = m1 · b · d.
Proof. The virtual nuclear-nuclear state and the physical one are related by H ⊗ H. It is not hard to see
that H ⊗ H |φ[x, y]i = |φ[y, x]i for any x, y ∈ {1, −1}. Applying this to Prop. 1 results in the measurement
outcomes m1 (uniformly random) and m2 = m1 ·b·d and resulting physical nuclear-nuclear state |φ[d, −acd]i.
Obtaining the virtual state is done by applying H ⊗ H again, which yields |φ[−acd, d]i.
Using Prop. 2, it is straightforward to check that the output state of the distillation protocol from section 6 A
satisfies eq. (62).
Suppose A and B share the electron-electron state |φ[a, b]i and the virtual nuclear-nuclear state |φ[c, d]i for
some a, b, c, d ∈ {1, −1}, with correction Paulis PAe (PBe ) and PAn (PBn ) for A (B). In the first step of the
protocol, A and B apply P n · P e to the electron-electron state, resulting in the electron-electron state
(PAn PAe ⊗ PBn PBe ) |φ[a, b]i = (PAn PAe ⊗ PBn PBe )(PAe ⊗ PBe ) |φ[1, −1]i = (PAn ⊗ PBn ) |φ[1, −1]i = |φ[c, d]i
where we made use of the fact that each Pauli squares to 11. In case of successful distillation, the virtual
nuclear-nuclear state can be found using Prop. 2 and equals |φ[−ccd, d]i = |φ[−d, d]i. What remains is to
determine the correction operators conditioned on the value of d. If d = 1, then the correction operators are
11 for one node and Y for the other (since 11 ⊗ Y |φ[−1, −1]i equals the target Bell state |φ[1, −1]i), while
for d = −1 the resulting state is already the target Bell state and both correction operators should be 11.
Determining the value of d can be done by using the fact that eq. (62) was satisfied by the pre-distillation
virtual nuclear-nuclear state,
and thus |φ[c, d]i = PAn ⊗ PBn |φ[1, −1]i. From checking all possible cases of PAn and PBn we find that d = 1
precisely if one of PAn , PBn equals X or Y , while the other equals 11 or Z.
Here we show that eq. (62) holds for the state between nodes A and B after node M has performed an
entanglement swap on Bell states A − M and M − B. Let us denote A’s (B’s) correction operator as PA
(PB ) and M ’s correction operator as PM
A
(PM
B
) for the state it shares with node A (B). That is, in the ideal
case, the nodes hold the state
A
(PA ⊗ PM B
⊗ PM ⊗ PB )(|φ[1, −1]iAM ⊗ |φ[1, −1]iM B ). (65)
for single-qubit Paulis P, Q and a, b ∈ {1, −1}, where ≡ as before indicates that the two states differ only
by a complex factor of norm 1 (in fact, for eq.(66) we can restrict this to a multiplicative factor ±1). Using
eq. (66), we rewrite eq. (65) to
A
(PM B
PA ⊗ 11 ⊗ 11 ⊗ PM PB )(|φ[1, −1]iAM ⊗ |φ[1, −1]iM B ). (67)
Eq. (67) implies that we may assume that M ’s two correction operators are both 11. Thus M only needs
to communicate the correction operator that corresponds to having measured one qubit of each pair of the
pair |φ[1, −1]i ⊗ |φ[1, −1]i. The resulting correction operator Q can be straightforwardly worked out in a
similar way as in [111] and the result is given in 64.
The state after the entanglement swap is thus
A B
(PM PA ⊗ PM PB Q) |φ[1, −1]iAB
37
which we rewrite using eq. (66) to
A B
(PA ⊗ PM PM PB Q) |φ[1, −1]iAB .
Indeed, PA and PM A B
PM PB Q are (modulo possible factor −1) the correction operators of node A and B,
respectively, after finishing the entanglement swapping protocol described above in section 6 A of this Sup-
plementary Note.
What remains is to convert the measurement outcomes from the circuit from Supplementary Figure 17(d)
to the measured Bell state. For this, a direct computation shows that applying the circuit to the electron-
nuclear state (11e ⊗ Hn ) |φ[a, b]i (the Hadamard gate H is needed since the nuclear qubit lives in a rotated
basis, see section 5) yields the measurement outcomes mearlier = −ab and mlater = b. Rewriting gives
a = −mearlier mlater and b = mlater .
Here, we provide the details of the simulation comparing different memory technologies for atomic-ensemble
quantum repeaters, whose results are presented in section Performance comparison between two atomic-
ensemble memory types through NetSquid’s modular design of the Result. For a more detailed discussion
see [112].
In our experiment we simulate the protocol proposed by Sinclair et al. [113] and analysed in detail by Guha
et al. [19]. However, in our simulation we go further than any previous analysis by not only including dark
counts and detector efficiency but also multi-photon emissions, photon distinguishability and time-dependent
memory efficiency. For a detailed review of different atomic-ensemble protocols see Sangouard et al. [114].
Let us briefly review the main points necessary to understand our results.
a. The protocol
The simulation setup consists of two elementary links connected by a quantum repeater station. Each
elementary link contains two photon-pair sources sending one half of the produced state to a midpoint
station through optical fibres. We assume that the speed of all photons and classical communication is
c/nri , where c is the speed of light in vacuum and nri = 1.44 is the refractive index of glass [100]. The
midpoint station contains a 50:50 beam splitter and two photon detectors to perform a linear-optical Bell
state measurement (BSM) [114]. Detection of a single photon per time-bin heralds successful elementary link
entanglement generation. By performing the entanglement attempts on the elementary link simultaneously
in multiple modes M (e.g. different temporal, spatial or frequency modes) the probability of successfully
generating elementary link entanglement can be greatly increased as p = 1 − (1 − psingle−mode )M . This is
called multiplexing.
The repeater station also contains two quantum memories, which store the second half of the quantum state
emitted by the adjacent sources.
If both elementary links herald a successful BSM at their respective midpoint station, the successful modes
are extracted from the memories. Another BSM is then performed on those modes at the repeater station.
The second halves of the quantum state at the end nodes are measured directly in either the X or Z basis
without storing them on a memory first.
The photon-pair source generates a time-bin encoded superposition of photon pairs with a joint quantum
state given by [75]
∞ p
X
|ψi = p(n) |ψn i , (71)
n=0
where
n
1 X
|ψn i = √ (−1)m |n − m, m; n − m, mi . (72)
n + 1 m=0
38
Here p(n) is the probability to generate n pairs and a state |n − m, m; n − m, mi describes n − m photons
travelling to the left (/right) side in the early and m in the late time window.
Photon loss in the optical fibres is modelled following the beam-splitter-attenuator channel [115], which is
P∞
also referred to as generalised amplitude damping [116]. Such a channel performs the map ρ 7→ k=0 Ak ρA†k
where the Kraus operator Ak corresponds to the case where exactly k photons are lost and is given by
s
∞
n
X q
Ak = (1 − γ)n−k γ k |n − ki hn| ,
k
n=k
For a more detailed discussion of the protocol and the reasoning behind our model please see our upcoming
work [112].
In order to compare the two memory technologies, we also need to define figures of merit we want to
investigate. To this end we choose the secret key rate (SKR) obtainable for quantum key distribution using
the BB84 protocol [76], the quantum bit error rate (QBER) and the average number of attempts per
successful end node measurement.
For the QBER we compare the end node measurement outcomes with the expected correlations in each
basis. The fraction of wrong bits among the measurement outcomes in each basis is then called the QBER
and is determined by performing end node measurements in either X or Z basis
The secret key rate RSK is then computed as
where H(x) = −x log(x) − (1 − x) log(1 − x) is the binary entropy, Qx , Qz are the QBERs in the X and Z
bases and AS is the average number of attempts per successful end-to-end entanglement generation. The
factor 1/2 (in eq. 75 and eq. 76) accounts for the fact that in the BB84 protocol the two end nodes randomly
choose between measuring in X or Z basis and therefore only measure in the same basis in 1/2 of the
successful entanglement generations.
Errors for the number of attempt are calculated from the standard deviation of the mean. The error on the
secret key rate is computed as follow from the error on the number of attempts per success ∆AS and the
errors ∆Qx and ∆Qz on the QBER in X and Z basis respectively:
s 2 2
1 ∂H(Qx ) ∂H(Qz )
∆RSK = ∆Qx + ∆Qz + (RSK × ∆AS )2 . (76)
2AS ∂Qx ∂Qz
In this work, we study two promising types of atomic-ensemble memories, both based upon photon ab-
sorption: electronically induced transparency (EIT) quantum memories as an example of an optical control
39
protocol and atomic frequency comb (AFC) memories as an example for an engineered absorption protocol.
For a more detailed comparison of these two types of memories see [112]. AFC memories are very promising
due to their great potential for multiplexing, while EIT memories promise superior efficiency with limited
multiplexing. Here we will give a brief overview of both technologies.
a. AFC
AFC memories require an inhomogeneously broadened material (e.g. rare-earth-doped crystals) with equidis-
tant peaks in occupation density created by spectral hole burning [72]. When a photon is absorbed by the
memory, the system will be in a collective delocalised state (Dicke state [117]) which then rapidly dephases
with time. After a fixed time the Dicke state rephases and the absorbed photon is re-emitted. The retrieval
efficiency decreases exponentially with storage time. Due to the large linewidth of the inhomogeneously
broadened state, AFC memories have great potential for massive multiplexing as the number of modes is
not limited by the optical depth of the material. Currently, the efficiencies that have been experimentally
achieved are up to 58% [118] reported for a cavity-enhanced AFC protocol and around 8.5% [119, 120] for
most multiplexed memories. Memory lifetimes of up to 0.53 s [121] have been reported for a dynamically
decoupled AFC protocol (however with an efficiency of just 0.5%). In our simulation we set a maximum
memory efficiency of 45% (currently optimistic value for multimode memories, but still below the highest
demonstrated single-mode storage [118]) with 1000 modes, consisting of 50 spectral and 20 temporal modes
(15 x 9 already demonstrated [119], over 1000 total modes also demonstrated [122]), and a lifetime of 1 ms
(0.542 ms already achieved for multimode on-demand AFC memory [120]).
b. EIT
EIT [123] is an effect where an opaque sample of atomic-ensembles becomes transparent due to interaction
with electromagnetic fields. This creates a steep dispersion which in turn affects the group velocity of
incoming light. The effect can be used to slow or completely stop and later re-emit incoming photonic
states. Due to the use of a strong resonant control laser to store the incoming light, these kind of memories
are subject to background noise in the form of additional photons introduced by the control beam. These
additional photons need to be compensated by filtering. Another disadvantage is that multiplexing in EIT
is limited to using only the spatial degree of freedom, thus making it more difficult to realise a highly
multiplexed protocol. The great advantage of these memories is the high efficiency of 85% [124] at a memory
lifetime of 15 µs. In our simulation we set a maximum efficiency of 90% (within reach of [124]) with 1000
spatial modes (experimentally 2 spatial modes have been demonstrated [125]), and a lifetime of 100 µs ([124]
gives 200µs as a theoretical limit) . For a review of EIT see [73].
C. Parameters
For the comparison we used the optimistic elementary link parameters taken from [19](Fig 10 (g)). We then
added optimistic values for the the memory parameters (see above) and the additional noise parameters we
use, such as the photon visibility. In line with the analysis of [19], we model the source as an almost perfect
single-pair source with a small probability p(2) of emitting two pairs.
We first list the common parameters of both simulations before we compare the parameters for the memory
components in Supplementary Table III. It is worth pointing out that using the same number of modes for
both technologies slightly biases this comparison as the high multiplexing potential is the main advantage
of AFC memories.
• Source total number of modes (spectral x temporal x spatial) = 1000
• Source emission probabilities: p(0) = 1 − p(1) − p(2), p(1) = 0.9, p(2) = 0.013 (see eq.71)
• Fibre coupling loss probability γchan (0) = 0
• Fibre attenuation α = 0.15dB/km
• Visibility = 0.9
• Detector dark count probability = 10−6
• Detector detection efficiency = 90%
• Detectors number-resolving: No
40
AFC EIT
spectral modes 50 1
temporal modes 20 1
spatial modes 1 1000
maximum efficiency (t = 0) 45% 90%
memory lifetime 1 ms 0.1 ms
time dependence exponential Gaussian
Supplementary Table III: Parameters for the two different atomic-ensemble memory
technologies.
41