Skip to content

Commit

Permalink
* Add documentation on clinks
Browse files Browse the repository at this point in the history
  • Loading branch information
mkvanhooft committed Mar 5, 2024
1 parent ab7e748 commit d9f79d7
Show file tree
Hide file tree
Showing 3 changed files with 60 additions and 4 deletions.
35 changes: 33 additions & 2 deletions docs/source/tutorial/section4_NetworkConfiguration.rst
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ We start with the simplest configuration file, one without any noise:
:language: yaml
:caption: examples/tutorial/4.2_network-configuration/1_perfect.yaml

The network requires two types of objects to be specified: stacks and links.
The network requires three types of objects to be specified: stacks, links and clinks.

Stacks are the end nodes of the network and run applications.
Each stack requires a name, this name will be used by the links and applications for reference.
Expand All @@ -101,10 +101,16 @@ The various stack types are discussed in :ref:`label_stack_types`.

Links connect the stacks with a way of generating EPR pairs between the two nodes.
A link requires references to the two stacks it is to connect.
This is done by registering the names of the stacks in the fields ``node1`` and ``node2``.
This is done by registering the names of the stacks in the fields ``stack1`` and ``stack2``.
The model type of the link is specified using the ``typ`` field.
The various settings for the model are defined inside ``cfg``.

Clinks are shorthand for classical links. These are similar to links, but for classical message communication.
A clink requires references to the two stacks it is to connect with a classical link.
This is done by registering the names of the stacks in the fields ``stack1`` and ``stack2``.
The model type of the clink is specified using the ``typ`` field.
The various settings for the model are defined inside ``cfg``.

.. _label_stack_types:

Stack types
Expand Down Expand Up @@ -203,6 +209,31 @@ The heralded link uses the double click model as developed and described by this
:language: yaml
:caption: examples/tutorial/4.2_network-configuration/5_heralded_link.yaml

Clink types
+++++++++++

instant clink
----------------
The instant clink is a classical link model where all classical communication is instant.
It does not have any configuration options.

.. literalinclude:: ../../../examples/tutorial/4.2_network-configuration/1_perfect.yaml
:language: yaml
:caption: examples/tutorial/4.2_network-configuration/1_perfect.yaml
:lines: 19-22


default clink
----------------
The default clink is a classical link model where classical communication is delayed by exactly the delay specified in
the configuration.

.. literalinclude:: ../../../examples/tutorial/4.2_network-configuration/6_default.yaml
:language: yaml
:caption: examples/tutorial/4.2_network-configuration/1_perfect.yaml
:lines: 19-24


Parameter sweeping
=====================
Often it will be desired to simulate not a single network configuration, but a range of parameters.
Expand Down
24 changes: 24 additions & 0 deletions examples/tutorial/4.2_network-configuration/6_default.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# A 2 node network, perfect except for classical communication using a default model that has communication delay
stacks:
- name: Alice
qdevice_typ: generic
qdevice_cfg:
dummy: null
- name: Bob
qdevice_typ: generic
qdevice_cfg:
dummy: null

links:
- stack1: Alice
stack2: Bob
typ: perfect
cfg:
dummy: null

clinks:
- stack1: Alice
stack2: Bob
typ: default
cfg:
delay: 20
5 changes: 3 additions & 2 deletions squidasm/run/stack/build.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
from __future__ import annotations

from typing import Dict
from typing import Dict, TYPE_CHECKING

from netsquid_netbuilder.base_configs import NetworkConfig
from netsquid_netbuilder.builder.network_builder import NetworkBuilder, NodeBuilder
from netsquid_netbuilder.run import get_default_builder

from squidasm.sim.stack.stack import StackNode
if TYPE_CHECKING:
from squidasm.sim.stack.stack import StackNode


class StackNodeBuilder(NodeBuilder):
Expand Down

0 comments on commit d9f79d7

Please sign in to comment.