Skip to content

Commit

Permalink
* Switch examples/tutorial 4.3_parameter-sweeping -> 4.4_multi-node a…
Browse files Browse the repository at this point in the history
…nd the reverse

* Added clinks to API documentation
* Fix for configurations now inheriting from netbuilder not showing documentation in API documentation
  • Loading branch information
mkvanhooft committed Mar 5, 2024
1 parent d9f79d7 commit 3864cf8
Show file tree
Hide file tree
Showing 13 changed files with 45 additions and 12 deletions.
11 changes: 10 additions & 1 deletion docs/source/modules/configurations.rst
Original file line number Diff line number Diff line change
Expand Up @@ -39,4 +39,13 @@ Link configurations
.. toctree::
:maxdepth: 2

configurations/link_configurations
configurations/link_configurations


CLink configurations
+++++++++++++++++++++

.. toctree::
:maxdepth: 2

configurations/clink_configurations
21 changes: 21 additions & 0 deletions docs/source/modules/configurations/clink_configurations.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
CLink Configurations
=====================


.. autoclass:: squidasm.run.stack.config.CLinkConfig
:members:
:undoc-members:
:member-order: bysource


.. autoclass:: squidasm.run.stack.config.InstantCLinkConfig
:members:
:undoc-members:
:inherited-members: BaseModel
:member-order: bysource

.. autoclass:: squidasm.run.stack.config.DefaultCLinkConfig
:members:
:undoc-members:
:inherited-members: BaseModel
:member-order: bysource
2 changes: 2 additions & 0 deletions docs/source/modules/configurations/link_configurations.rst
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,11 @@ Link Configurations
.. autoclass:: squidasm.run.stack.config.DepolariseLinkConfig
:members:
:undoc-members:
:inherited-members: BaseModel
:member-order: bysource

.. autoclass:: squidasm.run.stack.config.HeraldedLinkConfig
:members:
:undoc-members:
:inherited-members: BaseModel
:member-order: bysource
2 changes: 2 additions & 0 deletions docs/source/modules/configurations/stack_configurations.rst
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ The rotation gates will rotate the qubit around the specified axis with a given
.. autoclass:: squidasm.run.stack.config.GenericQDeviceConfig
:members:
:undoc-members:
:inherited-members: BaseModel
:member-order: bysource

NV QDevice
Expand All @@ -44,4 +45,5 @@ The topology of the NV qdevice only allows for CXDIR and CYDIR gates between the
.. autoclass:: squidasm.run.stack.config.NVQDeviceConfig
:members:
:undoc-members:
:inherited-members: BaseModel
:member-order: bysource
4 changes: 2 additions & 2 deletions docs/source/tutorial/section4_NetworkConfiguration.rst
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@ Our goal is to use ``run_simulation.py`` to modify the network of ``config.yaml`
replace its link with a depolarize link, perform multiple simulations with varying fidelity for the link
and generate an graph of the fidelity vs error rate.

.. literalinclude:: ../../../examples/tutorial/4.3_parameter-sweeping/run_simulation.py
.. literalinclude:: ../../../examples/tutorial/4.4_parameter-sweeping/run_simulation.py
:language: python
:caption: examples/tutorial/4.3_parameter-sweeping/run_simulation.py
:emphasize-lines: 12-20, 26-27
Expand All @@ -265,7 +265,7 @@ We then load in the configuration options for the depolarise link:
This creates the ``DepolariseLinkConfig`` object based on the parameters in the file ``depolarise_link_config.yaml``:

.. literalinclude:: ../../../examples/tutorial/4.3_parameter-sweeping/depolarise_link_config.yaml
.. literalinclude:: ../../../examples/tutorial/4.4_parameter-sweeping/depolarise_link_config.yaml
:language: yaml
:caption: examples/tutorial/4.3_parameter-sweeping/depolarise_link_config.yaml

Expand Down
5 changes: 2 additions & 3 deletions squidasm/run/stack/build.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
from __future__ import annotations

from typing import Dict, TYPE_CHECKING
from typing import Dict

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

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


class StackNodeBuilder(NodeBuilder):
Expand Down
12 changes: 6 additions & 6 deletions squidasm/run/stack/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@


class GenericQDeviceConfig(netbuilder_qdevices.GenericQDeviceConfig):
pass
__doc__ = netbuilder_qdevices.GenericQDeviceConfig.__doc__


class NVQDeviceConfig(netbuilder_qdevices.NVQDeviceConfig):
pass
__doc__ = netbuilder_qdevices.NVQDeviceConfig.__doc__


class StackConfig(YamlLoadable):
Expand Down Expand Up @@ -43,19 +43,19 @@ def perfect_generic_config(cls, name: str) -> StackConfig:


class DepolariseLinkConfig(netbuilder_links.DepolariseLinkConfig):
pass
__doc__ = netbuilder_links.DepolariseLinkConfig.__doc__


class HeraldedLinkConfig(netbuilder_links.HeraldedDoubleClickLinkConfig):
pass
__doc__ = netbuilder_links.HeraldedDoubleClickLinkConfig.__doc__


class InstantCLinkConfig(netbuilder_clinks.InstantCLinkConfig):
pass
__doc__ = netbuilder_clinks.InstantCLinkConfig.__doc__


class DefaultCLinkConfig(netbuilder_clinks.DefaultCLinkConfig):
pass
__doc__ = netbuilder_clinks.DefaultCLinkConfig.__doc__


class LinkConfig(YamlLoadable):
Expand Down

0 comments on commit 3864cf8

Please sign in to comment.