sequence 1.0.0.dev1539950__tar.gz → 1.2.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (148) hide show
  1. {sequence-1.0.0.dev1539950 → sequence-1.2.0}/PKG-INFO +5 -20
  2. {sequence-1.0.0.dev1539950 → sequence-1.2.0}/README.md +4 -11
  3. sequence-1.2.0/pyproject.toml +157 -0
  4. sequence-1.0.0.dev1539950/pyproject.toml → sequence-1.2.0/pyproject.toml.orig +71 -13
  5. {sequence-1.0.0.dev1539950 → sequence-1.2.0}/sequence/__init__.py +1 -1
  6. sequence-1.2.0/sequence/app/__init__.py +5 -0
  7. sequence-1.2.0/sequence/app/app.py +81 -0
  8. {sequence-1.0.0.dev1539950 → sequence-1.2.0}/sequence/app/request_app.py +13 -12
  9. {sequence-1.0.0.dev1539950 → sequence-1.2.0}/sequence/components/circuit.py +12 -32
  10. {sequence-1.0.0.dev1539950 → sequence-1.2.0}/sequence/constants.py +8 -0
  11. {sequence-1.0.0.dev1539950 → sequence-1.2.0}/sequence/entanglement_management/entanglement_protocol.py +9 -0
  12. {sequence-1.0.0.dev1539950 → sequence-1.2.0}/sequence/entanglement_management/generation/barret_kok.py +4 -1
  13. {sequence-1.0.0.dev1539950 → sequence-1.2.0}/sequence/entanglement_management/generation/generation_base.py +5 -1
  14. {sequence-1.0.0.dev1539950 → sequence-1.2.0}/sequence/entanglement_management/generation/single_heralded.py +4 -1
  15. sequence-1.2.0/sequence/entanglement_management/purification/__init__.py +18 -0
  16. sequence-1.2.0/sequence/entanglement_management/purification/bbpssw_bds.py +205 -0
  17. {sequence-1.0.0.dev1539950 → sequence-1.2.0}/sequence/entanglement_management/purification/bbpssw_circuit.py +14 -14
  18. sequence-1.2.0/sequence/entanglement_management/purification/dejmps_bds.py +164 -0
  19. sequence-1.0.0.dev1539950/sequence/entanglement_management/purification/bbpssw_protocol.py → sequence-1.2.0/sequence/entanglement_management/purification/purification_protocol.py +26 -18
  20. {sequence-1.0.0.dev1539950 → sequence-1.2.0}/sequence/entanglement_management/swapping/swapping_base.py +14 -2
  21. {sequence-1.0.0.dev1539950 → sequence-1.2.0}/sequence/entanglement_management/swapping/swapping_bds.py +17 -3
  22. {sequence-1.0.0.dev1539950 → sequence-1.2.0}/sequence/entanglement_management/swapping/swapping_circuit.py +15 -1
  23. sequence-1.2.0/sequence/kernel/__init__.py +5 -0
  24. sequence-1.2.0/sequence/kernel/quantum_gates.py +149 -0
  25. sequence-1.2.0/sequence/kernel/quantum_manager/base.py +145 -0
  26. {sequence-1.0.0.dev1539950 → sequence-1.2.0}/sequence/kernel/quantum_manager/density_matrix.py +54 -14
  27. sequence-1.2.0/sequence/kernel/quantum_manager/ket_vector.py +222 -0
  28. sequence-1.2.0/sequence/kernel/quantum_manager/utils.py +47 -0
  29. {sequence-1.0.0.dev1539950 → sequence-1.2.0}/sequence/kernel/quantum_utils.py +74 -74
  30. {sequence-1.0.0.dev1539950 → sequence-1.2.0}/sequence/kernel/timeline.py +2 -1
  31. {sequence-1.0.0.dev1539950 → sequence-1.2.0}/sequence/network_management/network_manager.py +39 -1
  32. {sequence-1.0.0.dev1539950 → sequence-1.2.0}/sequence/network_management/reservation.py +31 -4
  33. {sequence-1.0.0.dev1539950 → sequence-1.2.0}/sequence/network_management/routing/routing_distributed.py +1 -1
  34. {sequence-1.0.0.dev1539950 → sequence-1.2.0}/sequence/network_management/rsvp.py +20 -0
  35. {sequence-1.0.0.dev1539950 → sequence-1.2.0}/sequence/qkd/cascade.py +1 -2
  36. {sequence-1.0.0.dev1539950 → sequence-1.2.0}/sequence/resource_management/action_condition_set.py +6 -6
  37. {sequence-1.0.0.dev1539950 → sequence-1.2.0}/sequence/resource_management/resource_manager.py +60 -17
  38. {sequence-1.0.0.dev1539950 → sequence-1.2.0}/sequence/resource_management/rule_manager.py +14 -13
  39. {sequence-1.0.0.dev1539950 → sequence-1.2.0}/sequence/topology/node.py +3 -2
  40. {sequence-1.0.0.dev1539950 → sequence-1.2.0}/sequence/utils/__init__.py +1 -1
  41. sequence-1.2.0/sequence/utils/classical_delay.py +80 -0
  42. sequence-1.2.0/sequence/utils/draw_topo.py +84 -0
  43. sequence-1.2.0/sequence/utils/metrics/__init__.py +272 -0
  44. sequence-1.2.0/sequence/utils/metrics/builtins.py +134 -0
  45. sequence-1.2.0/sequence/utils/metrics/event_types.py +207 -0
  46. sequence-1.2.0/sequence/utils/metrics/metric_types.py +615 -0
  47. sequence-1.2.0/sequence/utils/metrics/registry.py +81 -0
  48. sequence-1.2.0/sequence/utils/metrics/storage.py +76 -0
  49. {sequence-1.0.0.dev1539950 → sequence-1.2.0}/sequence/utils/nx_converter.py +5 -5
  50. sequence-1.0.0.dev1539950/sequence/app/__init__.py +0 -4
  51. sequence-1.0.0.dev1539950/sequence/entanglement_management/purification/__init__.py +0 -8
  52. sequence-1.0.0.dev1539950/sequence/entanglement_management/purification/bbpssw_bds.py +0 -236
  53. sequence-1.0.0.dev1539950/sequence/gui/__init__.py +0 -4
  54. sequence-1.0.0.dev1539950/sequence/gui/app.py +0 -1240
  55. sequence-1.0.0.dev1539950/sequence/gui/assets/argonne.png +0 -0
  56. sequence-1.0.0.dev1539950/sequence/gui/assets/attributions_req +0 -11
  57. sequence-1.0.0.dev1539950/sequence/gui/assets/bsmnode.png +0 -0
  58. sequence-1.0.0.dev1539950/sequence/gui/assets/detector.png +0 -0
  59. sequence-1.0.0.dev1539950/sequence/gui/assets/logo.png +0 -0
  60. sequence-1.0.0.dev1539950/sequence/gui/assets/photonsource.png +0 -0
  61. sequence-1.0.0.dev1539950/sequence/gui/assets/quantum.png +0 -0
  62. sequence-1.0.0.dev1539950/sequence/gui/assets/repeater.png +0 -0
  63. sequence-1.0.0.dev1539950/sequence/gui/assets/router.png +0 -0
  64. sequence-1.0.0.dev1539950/sequence/gui/assets/sequence.jpg +0 -0
  65. sequence-1.0.0.dev1539950/sequence/gui/assets/svg/bsmnode.svg +0 -9
  66. sequence-1.0.0.dev1539950/sequence/gui/assets/svg/detector.svg +0 -30
  67. sequence-1.0.0.dev1539950/sequence/gui/assets/svg/photonsource.svg +0 -9
  68. sequence-1.0.0.dev1539950/sequence/gui/assets/svg/quantum.svg +0 -1
  69. sequence-1.0.0.dev1539950/sequence/gui/assets/svg/repeater.svg +0 -1
  70. sequence-1.0.0.dev1539950/sequence/gui/assets/svg/router.svg +0 -78
  71. sequence-1.0.0.dev1539950/sequence/gui/assets/svg/temp.svg +0 -4
  72. sequence-1.0.0.dev1539950/sequence/gui/assets/temp.png +0 -0
  73. sequence-1.0.0.dev1539950/sequence/gui/css_styles.py +0 -163
  74. sequence-1.0.0.dev1539950/sequence/gui/default_params.json +0 -34
  75. sequence-1.0.0.dev1539950/sequence/gui/default_templates.json +0 -43
  76. sequence-1.0.0.dev1539950/sequence/gui/graph_comp.py +0 -10
  77. sequence-1.0.0.dev1539950/sequence/gui/layout.py +0 -265
  78. sequence-1.0.0.dev1539950/sequence/gui/menus.py +0 -982
  79. sequence-1.0.0.dev1539950/sequence/gui/run_gui.py +0 -91
  80. sequence-1.0.0.dev1539950/sequence/gui/simulator_bindings.py +0 -206
  81. sequence-1.0.0.dev1539950/sequence/gui/starlight.json +0 -115
  82. sequence-1.0.0.dev1539950/sequence/gui/test.txt +0 -49
  83. sequence-1.0.0.dev1539950/sequence/gui/user_templates.json +0 -43
  84. sequence-1.0.0.dev1539950/sequence/kernel/__init__.py +0 -4
  85. sequence-1.0.0.dev1539950/sequence/kernel/quantum_manager/base.py +0 -252
  86. sequence-1.0.0.dev1539950/sequence/kernel/quantum_manager/ket_vector.py +0 -192
  87. sequence-1.0.0.dev1539950/sequence/utils/dqc_node_generator.py +0 -20
  88. sequence-1.0.0.dev1539950/sequence/utils/draw_topo.py +0 -81
  89. {sequence-1.0.0.dev1539950 → sequence-1.2.0}/LICENSE +0 -0
  90. {sequence-1.0.0.dev1539950 → sequence-1.2.0}/sequence/app/random_request.py +0 -0
  91. {sequence-1.0.0.dev1539950 → sequence-1.2.0}/sequence/app/teleport_app.py +0 -0
  92. {sequence-1.0.0.dev1539950 → sequence-1.2.0}/sequence/components/__init__.py +0 -0
  93. {sequence-1.0.0.dev1539950 → sequence-1.2.0}/sequence/components/beam_splitter.py +0 -0
  94. {sequence-1.0.0.dev1539950 → sequence-1.2.0}/sequence/components/bsm.py +0 -0
  95. {sequence-1.0.0.dev1539950 → sequence-1.2.0}/sequence/components/detector.py +0 -0
  96. {sequence-1.0.0.dev1539950 → sequence-1.2.0}/sequence/components/fiber_stretcher.py +0 -0
  97. {sequence-1.0.0.dev1539950 → sequence-1.2.0}/sequence/components/interferometer.py +0 -0
  98. {sequence-1.0.0.dev1539950 → sequence-1.2.0}/sequence/components/light_source.py +0 -0
  99. {sequence-1.0.0.dev1539950 → sequence-1.2.0}/sequence/components/memory.py +0 -0
  100. {sequence-1.0.0.dev1539950 → sequence-1.2.0}/sequence/components/mirror.py +0 -0
  101. {sequence-1.0.0.dev1539950 → sequence-1.2.0}/sequence/components/optical_channel.py +0 -0
  102. {sequence-1.0.0.dev1539950 → sequence-1.2.0}/sequence/components/photon.py +0 -0
  103. {sequence-1.0.0.dev1539950 → sequence-1.2.0}/sequence/components/spdc_lens.py +0 -0
  104. {sequence-1.0.0.dev1539950 → sequence-1.2.0}/sequence/components/switch.py +0 -0
  105. {sequence-1.0.0.dev1539950 → sequence-1.2.0}/sequence/components/transducer.py +0 -0
  106. {sequence-1.0.0.dev1539950 → sequence-1.2.0}/sequence/components/transmon.py +0 -0
  107. {sequence-1.0.0.dev1539950 → sequence-1.2.0}/sequence/entanglement_management/__init__.py +0 -0
  108. {sequence-1.0.0.dev1539950 → sequence-1.2.0}/sequence/entanglement_management/generation/__init__.py +0 -0
  109. {sequence-1.0.0.dev1539950 → sequence-1.2.0}/sequence/entanglement_management/generation/generation_message.py +0 -0
  110. {sequence-1.0.0.dev1539950 → sequence-1.2.0}/sequence/entanglement_management/swapping/__init__.py +0 -0
  111. {sequence-1.0.0.dev1539950 → sequence-1.2.0}/sequence/entanglement_management/teleportation.py +0 -0
  112. {sequence-1.0.0.dev1539950 → sequence-1.2.0}/sequence/kernel/entity.py +0 -0
  113. {sequence-1.0.0.dev1539950 → sequence-1.2.0}/sequence/kernel/event.py +0 -0
  114. {sequence-1.0.0.dev1539950 → sequence-1.2.0}/sequence/kernel/eventlist.py +0 -0
  115. {sequence-1.0.0.dev1539950 → sequence-1.2.0}/sequence/kernel/process.py +0 -0
  116. {sequence-1.0.0.dev1539950 → sequence-1.2.0}/sequence/kernel/quantum_manager/__init__.py +0 -0
  117. {sequence-1.0.0.dev1539950 → sequence-1.2.0}/sequence/kernel/quantum_manager/bell_diagonal.py +0 -0
  118. {sequence-1.0.0.dev1539950 → sequence-1.2.0}/sequence/kernel/quantum_manager/fock_density_matrix.py +0 -0
  119. {sequence-1.0.0.dev1539950 → sequence-1.2.0}/sequence/kernel/quantum_manager/stabilizer.py +0 -0
  120. {sequence-1.0.0.dev1539950 → sequence-1.2.0}/sequence/kernel/quantum_state/__init__.py +0 -0
  121. {sequence-1.0.0.dev1539950 → sequence-1.2.0}/sequence/kernel/quantum_state/base.py +0 -0
  122. {sequence-1.0.0.dev1539950 → sequence-1.2.0}/sequence/kernel/quantum_state/bell_diagonal.py +0 -0
  123. {sequence-1.0.0.dev1539950 → sequence-1.2.0}/sequence/kernel/quantum_state/density_matrix.py +0 -0
  124. {sequence-1.0.0.dev1539950 → sequence-1.2.0}/sequence/kernel/quantum_state/free.py +0 -0
  125. {sequence-1.0.0.dev1539950 → sequence-1.2.0}/sequence/kernel/quantum_state/ket_vector.py +0 -0
  126. {sequence-1.0.0.dev1539950 → sequence-1.2.0}/sequence/kernel/quantum_state/stabilizer.py +0 -0
  127. {sequence-1.0.0.dev1539950 → sequence-1.2.0}/sequence/message.py +0 -0
  128. {sequence-1.0.0.dev1539950 → sequence-1.2.0}/sequence/network_management/__init__.py +0 -0
  129. {sequence-1.0.0.dev1539950 → sequence-1.2.0}/sequence/network_management/forwarding.py +0 -0
  130. {sequence-1.0.0.dev1539950 → sequence-1.2.0}/sequence/network_management/memory_timecard.py +0 -0
  131. {sequence-1.0.0.dev1539950 → sequence-1.2.0}/sequence/network_management/routing/__init__.py +0 -0
  132. {sequence-1.0.0.dev1539950 → sequence-1.2.0}/sequence/network_management/routing/routing_base.py +0 -0
  133. {sequence-1.0.0.dev1539950 → sequence-1.2.0}/sequence/network_management/routing/routing_static.py +0 -0
  134. {sequence-1.0.0.dev1539950 → sequence-1.2.0}/sequence/protocol.py +0 -0
  135. {sequence-1.0.0.dev1539950 → sequence-1.2.0}/sequence/qkd/BB84.py +0 -0
  136. {sequence-1.0.0.dev1539950 → sequence-1.2.0}/sequence/qkd/__init__.py +0 -0
  137. {sequence-1.0.0.dev1539950 → sequence-1.2.0}/sequence/resource_management/__init__.py +0 -0
  138. {sequence-1.0.0.dev1539950 → sequence-1.2.0}/sequence/resource_management/memory_manager.py +0 -0
  139. {sequence-1.0.0.dev1539950 → sequence-1.2.0}/sequence/topology/__init__.py +0 -0
  140. {sequence-1.0.0.dev1539950 → sequence-1.2.0}/sequence/topology/dqc_net_topo.py +0 -0
  141. {sequence-1.0.0.dev1539950 → sequence-1.2.0}/sequence/topology/qkd_topo.py +0 -0
  142. {sequence-1.0.0.dev1539950 → sequence-1.2.0}/sequence/topology/router_net_topo.py +0 -0
  143. {sequence-1.0.0.dev1539950 → sequence-1.2.0}/sequence/topology/topology.py +0 -0
  144. {sequence-1.0.0.dev1539950 → sequence-1.2.0}/sequence/utils/config_generator_cli.py +0 -0
  145. {sequence-1.0.0.dev1539950 → sequence-1.2.0}/sequence/utils/encoding.py +0 -0
  146. {sequence-1.0.0.dev1539950 → sequence-1.2.0}/sequence/utils/graphs.py +0 -0
  147. {sequence-1.0.0.dev1539950 → sequence-1.2.0}/sequence/utils/log.py +0 -0
  148. {sequence-1.0.0.dev1539950 → sequence-1.2.0}/sequence/utils/noise.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: sequence
3
- Version: 1.0.0.dev1539950
3
+ Version: 1.2.0
4
4
  Summary: Simulator of QUantum Network Communication (SeQUeNCe) is an open-source tool that allows modeling of quantum networks including photonic network components, control protocols, and applications.
5
5
  Keywords: quantum,network,discrete,event,simulator
6
6
  Author: Xiaoliang Wu, Joaquin Chung, Alexander Kolar, Alexander Kiefer, Eugene Wang, Tian Zhong, Rajkumar Kettimuthu, Martin Suchara, Robert Hayek, Ansh Singal, Caitao Zhan
@@ -9,12 +9,6 @@ License-File: LICENSE
9
9
  Classifier: Programming Language :: Python :: 3.12
10
10
  Classifier: Programming Language :: Python :: 3.13
11
11
  Classifier: Programming Language :: Python :: 3.14
12
- Requires-Dist: dash>=3.3.0
13
- Requires-Dist: dash-bootstrap-components>=2.0.4
14
- Requires-Dist: dash-core-components>=2.0.0
15
- Requires-Dist: dash-cytoscape>=1.0.2
16
- Requires-Dist: dash-html-components>=2.0.0
17
- Requires-Dist: dash-table>=5.0.0
18
12
  Requires-Dist: gmpy2>=2.2.2
19
13
  Requires-Dist: graphviz>=0.21
20
14
  Requires-Dist: ipywidgets>=8.1.8
@@ -23,8 +17,6 @@ Requires-Dist: matplotlib>=3.10.7
23
17
  Requires-Dist: networkx>=3.6.1
24
18
  Requires-Dist: numpy>=2.3.5
25
19
  Requires-Dist: pandas>=2.3.3
26
- Requires-Dist: plotly>=6.5.0
27
- Requires-Dist: pytest>=9.0.2
28
20
  Requires-Dist: pyyaml>=6.0.3
29
21
  Requires-Dist: qutip>=5.2.2
30
22
  Requires-Dist: qutip-qip>=0.4.1
@@ -61,7 +53,8 @@ Description-Content-Type: text/markdown
61
53
  [![QuTiP](https://img.shields.io/badge/integration-QuTiP-blue)](https://qutip.org/)
62
54
  [![Stim](https://img.shields.io/badge/integration-Stim-blue)](https://github.com/quantumlib/Stim)
63
55
  [![Paper](https://img.shields.io/badge/10.1088%2F2058-9565%2Fac22f6?label=DOI)](https://iopscience.iop.org/article/10.1088/2058-9565/ac22f6)
64
- [![Download-month](https://img.shields.io/pypi/dm/sequence)](https://pypistats.org/packages/sequence)
56
+ [![Downloads](https://static.pepy.tech/badge/sequence/month)](https://pepy.tech/project/sequence)
57
+
65
58
 
66
59
  </div>
67
60
 
@@ -95,7 +88,7 @@ Editable installations let Python use your local source tree directly, so change
95
88
  #### (1) Using pip
96
89
  ```
97
90
  git clone https://github.com/sequence-toolbox/SeQUeNCe.git
98
- cd sequence
91
+ cd SeQUeNCe
99
92
  make install_editable
100
93
  ```
101
94
 
@@ -122,7 +115,7 @@ powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | ie
122
115
  Here we clone the repository and let uv configure the development environment with the target python version.
123
116
  ```bash
124
117
  git clone https://github.com/sequence-toolbox/SeQUeNCe.git
125
- cd sequence
118
+ cd SeQUeNCe
126
119
  uv sync
127
120
  ```
128
121
 
@@ -158,14 +151,6 @@ publisher = {IOP Publishing},
158
151
  }
159
152
  ```
160
153
 
161
- <!-- * X. Wu, A. Kolar, J. Chung, D. Jin, T. Zhong, R. Kettimuthu and M. Suchara. "SeQUeNCe: Simulator of QUantum Network Communication." GitHub repository, https://github.com/sequence-toolbox/SeQUeNCe, 2021. -->
162
-
163
- ## Running the GUI
164
- Once SeQUeNCe has been installed as described above, run the `gui.py` script found in the root of the project directory
165
- ```
166
- python gui.py
167
- ```
168
-
169
154
  ## Usage Examples
170
155
  Many examples of SeQUeNCe in action can be found in the [example](/example) folder. The example includes jupyter notebook demos, and code used in published papers.
171
156
 
@@ -17,7 +17,8 @@
17
17
  [![QuTiP](https://img.shields.io/badge/integration-QuTiP-blue)](https://qutip.org/)
18
18
  [![Stim](https://img.shields.io/badge/integration-Stim-blue)](https://github.com/quantumlib/Stim)
19
19
  [![Paper](https://img.shields.io/badge/10.1088%2F2058-9565%2Fac22f6?label=DOI)](https://iopscience.iop.org/article/10.1088/2058-9565/ac22f6)
20
- [![Download-month](https://img.shields.io/pypi/dm/sequence)](https://pypistats.org/packages/sequence)
20
+ [![Downloads](https://static.pepy.tech/badge/sequence/month)](https://pepy.tech/project/sequence)
21
+
21
22
 
22
23
  </div>
23
24
 
@@ -51,7 +52,7 @@ Editable installations let Python use your local source tree directly, so change
51
52
  #### (1) Using pip
52
53
  ```
53
54
  git clone https://github.com/sequence-toolbox/SeQUeNCe.git
54
- cd sequence
55
+ cd SeQUeNCe
55
56
  make install_editable
56
57
  ```
57
58
 
@@ -78,7 +79,7 @@ powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | ie
78
79
  Here we clone the repository and let uv configure the development environment with the target python version.
79
80
  ```bash
80
81
  git clone https://github.com/sequence-toolbox/SeQUeNCe.git
81
- cd sequence
82
+ cd SeQUeNCe
82
83
  uv sync
83
84
  ```
84
85
 
@@ -114,14 +115,6 @@ publisher = {IOP Publishing},
114
115
  }
115
116
  ```
116
117
 
117
- <!-- * X. Wu, A. Kolar, J. Chung, D. Jin, T. Zhong, R. Kettimuthu and M. Suchara. "SeQUeNCe: Simulator of QUantum Network Communication." GitHub repository, https://github.com/sequence-toolbox/SeQUeNCe, 2021. -->
118
-
119
- ## Running the GUI
120
- Once SeQUeNCe has been installed as described above, run the `gui.py` script found in the root of the project directory
121
- ```
122
- python gui.py
123
- ```
124
-
125
118
  ## Usage Examples
126
119
  Many examples of SeQUeNCe in action can be found in the [example](/example) folder. The example includes jupyter notebook demos, and code used in published papers.
127
120
 
@@ -0,0 +1,157 @@
1
+ [project]
2
+ name = "sequence"
3
+ version = "1.2.0"
4
+ license-files = ["LICENSE"]
5
+ description = "Simulator of QUantum Network Communication (SeQUeNCe) is an open-source tool that allows modeling of quantum networks including photonic network components, control protocols, and applications."
6
+ readme = "README.md"
7
+ requires-python = ">=3.12, <3.15"
8
+ classifiers = [
9
+ "Programming Language :: Python :: 3.12",
10
+ "Programming Language :: Python :: 3.13",
11
+ "Programming Language :: Python :: 3.14",
12
+ ]
13
+ keywords = [
14
+ "quantum",
15
+ "network",
16
+ "discrete",
17
+ "event",
18
+ "simulator",
19
+ ]
20
+ dependencies = [
21
+ "gmpy2>=2.2.2",
22
+ "graphviz>=0.21",
23
+ "ipywidgets>=8.1.8",
24
+ "jupyterlab>=4.5.0",
25
+ "matplotlib>=3.10.7",
26
+ "networkx>=3.6.1",
27
+ "numpy>=2.3.5",
28
+ "pandas>=2.3.3",
29
+ "pyyaml>=6.0.3",
30
+ "qutip>=5.2.2",
31
+ "qutip-qip>=0.4.1",
32
+ "scipy>=1.16.3",
33
+ "seaborn>=0.13.2",
34
+ "tqdm>=4.67.1",
35
+ "typer>=0.24.1",
36
+ "stim>=1.15",
37
+ ]
38
+
39
+ [[project.authors]]
40
+ name = "Xiaoliang Wu, Joaquin Chung, Alexander Kolar, Alexander Kiefer, Eugene Wang, Tian Zhong, Rajkumar Kettimuthu, Martin Suchara, Robert Hayek, Ansh Singal, Caitao Zhan"
41
+ email = "czhan@anl.gov"
42
+
43
+ [[project.maintainers]]
44
+ name = "Caitao Zhan"
45
+ email = "czhan@anl.gov"
46
+
47
+ [[project.maintainers]]
48
+ name = "Robert Hayek"
49
+ email = "rhayek@anl.gov"
50
+
51
+ [project.scripts]
52
+ generate-topology = "sequence.utils.config_generator_cli:app"
53
+
54
+ [project.urls]
55
+ Homepage = "https://github.com/sequence-toolbox/SeQUeNCe"
56
+ Documentation = "https://sequence-rtd-tutorial.readthedocs.io/"
57
+ Issues = "https://github.com/sequence-toolbox/SeQUeNCe/issues"
58
+ Changelog = "https://github.com/sequence-toolbox/SeQUeNCe/blob/master/CHANGELOG.md"
59
+
60
+ [build-system]
61
+ requires = ["uv_build>=0.11.11,<0.13"]
62
+ build-backend = "uv_build"
63
+
64
+ [tool.uv.build-backend]
65
+ module-root = ""
66
+ module-name = "sequence"
67
+
68
+ [tool.pytest.ini_options]
69
+ markers = ["unit: Marks tests as unit tests"]
70
+
71
+ [tool.semantic_release]
72
+ build_command = """
73
+ python -m pip install "uv>=0.11,<0.12"
74
+ uv lock --upgrade-package "$PACKAGE_NAME"
75
+ git add uv.lock
76
+ """
77
+ assets = ["uv.lock"]
78
+ version_toml = ["pyproject.toml:project.version"]
79
+ commit_message = """
80
+ {version}
81
+
82
+ Automatically generated by python-semantic-release"""
83
+ commit_parser = "conventional"
84
+ logging_use_named_masks = false
85
+ major_on_zero = true
86
+ allow_zero_version = false
87
+ no_git_verify = false
88
+ tag_format = "v{version}"
89
+ add_partial_tags = false
90
+
91
+ [tool.semantic_release.branches.main]
92
+ match = "master"
93
+
94
+ [tool.semantic_release.changelog]
95
+ changelog_file = "CHANGELOG.md"
96
+ exclude_commit_patterns = []
97
+ mode = "update"
98
+ insertion_flag = "<!-- version list -->"
99
+
100
+ [tool.semantic_release.changelog.default_templates]
101
+ changelog_file = "CHANGELOG.md"
102
+ output_format = "md"
103
+ mask_initial_release = true
104
+
105
+ [tool.semantic_release.changelog.environment]
106
+ block_start_string = "{%"
107
+ block_end_string = "%}"
108
+ variable_start_string = "{{"
109
+ variable_end_string = "}}"
110
+ comment_start_string = "{#"
111
+ comment_end_string = "#}"
112
+ trim_blocks = true
113
+ lstrip_blocks = true
114
+ newline_sequence = """
115
+
116
+ """
117
+ keep_trailing_newline = true
118
+ extensions = []
119
+ autoescape = false
120
+
121
+ [tool.semantic_release.commit_parser_options]
122
+ minor_tags = ["feat"]
123
+ patch_tags = [
124
+ "fix",
125
+ "docs",
126
+ "test",
127
+ "ci",
128
+ "refactor",
129
+ "perf",
130
+ "chore",
131
+ "revert",
132
+ ]
133
+ allowed_tags = [
134
+ "feat",
135
+ "fix",
136
+ "perf",
137
+ "build",
138
+ "ci",
139
+ "docs",
140
+ "style",
141
+ "refactor",
142
+ "test",
143
+ ]
144
+ other_allowed_tags = ["chore"]
145
+ default_bump_level = 0
146
+ parse_squash_commits = true
147
+ ignore_merge_commits = true
148
+
149
+ [dependency-groups]
150
+ dev = [
151
+ "coverage>=7.13.4",
152
+ "ruff>=0.15.1",
153
+ "ty>=0.0.16",
154
+ "scipy-stubs>=1.16.3,<1.19.0",
155
+ "pytest-cov>=7.1.0",
156
+ "pytest>=9.0.2",
157
+ ]
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "sequence"
3
- version = "1.0.0.dev1539950"
3
+ version = "1.2.0"
4
4
  authors = [
5
5
  { name = "Xiaoliang Wu, Joaquin Chung, Alexander Kolar, Alexander Kiefer, Eugene Wang, Tian Zhong, Rajkumar Kettimuthu, Martin Suchara, Robert Hayek, Ansh Singal, Caitao Zhan", email = "czhan@anl.gov" }
6
6
  ]
@@ -19,12 +19,6 @@ classifiers = [
19
19
  ]
20
20
  keywords = ["quantum", "network", "discrete", "event", "simulator"]
21
21
  dependencies = [
22
- "dash>=3.3.0",
23
- "dash-bootstrap-components>=2.0.4",
24
- "dash-core-components>=2.0.0",
25
- "dash-cytoscape>=1.0.2",
26
- "dash-html-components>=2.0.0",
27
- "dash-table>=5.0.0",
28
22
  "gmpy2>=2.2.2",
29
23
  "graphviz>=0.21",
30
24
  "ipywidgets>=8.1.8",
@@ -33,8 +27,6 @@ dependencies = [
33
27
  "networkx>=3.6.1",
34
28
  "numpy>=2.3.5",
35
29
  "pandas>=2.3.3",
36
- "plotly>=6.5.0",
37
- "pytest>=9.0.2",
38
30
  "pyyaml>=6.0.3",
39
31
  "qutip>=5.2.2",
40
32
  "qutip-qip>=0.4.1",
@@ -49,7 +41,7 @@ dependencies = [
49
41
  generate-topology = "sequence.utils.config_generator_cli:app"
50
42
 
51
43
  [build-system]
52
- requires = ["uv_build>=0.11.11,<0.12"]
44
+ requires = ["uv_build>=0.11.11,<0.13"]
53
45
  build-backend = "uv_build"
54
46
 
55
47
  [tool.uv.build-backend]
@@ -66,12 +58,78 @@ dev = [
66
58
  "coverage>=7.13.4",
67
59
  "ruff>=0.15.1",
68
60
  "ty>=0.0.16",
69
- "pandas-stubs~=2.3.3",
70
- "scipy-stubs~=1.16.3",
61
+ "scipy-stubs>=1.16.3,<1.19.0",
62
+ "pytest-cov>=7.1.0",
63
+ "pytest>=9.0.2",
71
64
  ]
72
65
 
73
66
  [project.urls]
74
67
  Homepage = "https://github.com/sequence-toolbox/SeQUeNCe"
75
68
  Documentation = "https://sequence-rtd-tutorial.readthedocs.io/"
76
69
  Issues = "https://github.com/sequence-toolbox/SeQUeNCe/issues"
77
- Changelog = "https://github.com/sequence-toolbox/SeQUeNCe/blob/master/CHANGELOG.md"
70
+ Changelog = "https://github.com/sequence-toolbox/SeQUeNCe/blob/master/CHANGELOG.md"
71
+
72
+ [tool.semantic_release]
73
+ build_command = """
74
+ python -m pip install "uv>=0.11,<0.12"
75
+ uv lock --upgrade-package "$PACKAGE_NAME"
76
+ git add uv.lock
77
+ """
78
+ assets = ["uv.lock"]
79
+ version_toml = ["pyproject.toml:project.version"]
80
+ commit_message = "{version}\n\nAutomatically generated by python-semantic-release"
81
+ commit_parser = "conventional"
82
+ logging_use_named_masks = false
83
+ major_on_zero = true
84
+ allow_zero_version = false
85
+ no_git_verify = false
86
+ tag_format = "v{version}"
87
+ add_partial_tags = false
88
+
89
+ [tool.semantic_release.branches.main]
90
+ match = "master"
91
+
92
+ [tool.semantic_release.changelog]
93
+ changelog_file = "CHANGELOG.md"
94
+ exclude_commit_patterns = []
95
+ mode = "update"
96
+ insertion_flag = "<!-- version list -->"
97
+
98
+
99
+ [tool.semantic_release.changelog.default_templates]
100
+ changelog_file = "CHANGELOG.md"
101
+ output_format = "md"
102
+ mask_initial_release = true
103
+
104
+ [tool.semantic_release.changelog.environment]
105
+ block_start_string = "{%"
106
+ block_end_string = "%}"
107
+ variable_start_string = "{{"
108
+ variable_end_string = "}}"
109
+ comment_start_string = "{#"
110
+ comment_end_string = "#}"
111
+ trim_blocks = true
112
+ lstrip_blocks = true
113
+ newline_sequence = "\n"
114
+ keep_trailing_newline = true
115
+ extensions = []
116
+ autoescape = false
117
+
118
+ [tool.semantic_release.commit_parser_options]
119
+ minor_tags = ["feat"]
120
+ patch_tags = [
121
+ "fix",
122
+ "docs",
123
+ "test",
124
+ "ci",
125
+ "refactor",
126
+ "perf",
127
+ "chore",
128
+ "revert",
129
+ ]
130
+ allowed_tags = ["feat", "fix", "perf", "build", "ci", "docs", "style", "refactor", "test"]
131
+ other_allowed_tags = ["chore"]
132
+
133
+ default_bump_level = 0
134
+ parse_squash_commits = true
135
+ ignore_merge_commits = true
@@ -1,7 +1,7 @@
1
1
  from pathlib import Path
2
2
 
3
3
  __all__ = ['app', 'components', 'entanglement_management', 'kernel', 'network_management', 'qkd', 'resource_management',
4
- 'topology', 'utils', 'message', 'protocol', 'gui', 'read_version_from_pyproject']
4
+ 'topology', 'utils', 'message', 'protocol', 'read_version_from_pyproject']
5
5
 
6
6
 
7
7
  def read_version_from_pyproject() -> str:
@@ -0,0 +1,5 @@
1
+ __all__ = ["app", "random_request", "teleport_app", "request_app"]
2
+
3
+
4
+ def __dir__():
5
+ return sorted(__all__)
@@ -0,0 +1,81 @@
1
+ """Abstract base class for SeQUeNCe applications.
2
+
3
+ This module defines the `App` interface that all node-attached applications
4
+ must implement. The three abstract callback methods, `get_memory`, `get_reservation_result`,
5
+ and `get_other_reservation` are correspond to the calls that `QuantumRouter` already
6
+ makes on whatever application is attached via `set_app`.
7
+
8
+ Subclasses that track throughput (e.g. `RequestApp`) should override it with a
9
+ meaningful implementation.
10
+ """
11
+
12
+ from __future__ import annotations
13
+
14
+ from abc import ABC, abstractmethod
15
+ from typing import TYPE_CHECKING
16
+
17
+ if TYPE_CHECKING:
18
+ from ..network_management.reservation import Reservation
19
+ from ..resource_management.memory_manager import MemoryInfo
20
+ from ..topology.node import QuantumRouter
21
+
22
+
23
+ class App(ABC):
24
+ """Abstract base application attached to a quantum network node.
25
+
26
+ Every concrete application must subclass `App` and implement the three
27
+ abstract callback methods that `QuantumRouter` relies on.
28
+
29
+ The constructor automatically registers the application on the node via
30
+ `node.set_app(self)`, so subclasses should always call
31
+ `super().__init__(node)`!
32
+
33
+ Attributes:
34
+ node (QuantumRouter): The node this application is attached to.
35
+ name (str): Human-readable name for the application instance.
36
+ """
37
+
38
+ def __init__(self, node: QuantumRouter):
39
+ self.node: QuantumRouter = node
40
+ self.node.set_app(self)
41
+ self.name: str = f"{self.node.name}.{self.__class__.__name__}"
42
+
43
+ @abstractmethod
44
+ def get_memory(self, info: MemoryInfo) -> None:
45
+ """Called when an entangled memory becomes available.
46
+
47
+ Args:
48
+ info (MemoryInfo): Information about the available memory.
49
+ """
50
+ pass
51
+
52
+ @abstractmethod
53
+ def get_reservation_result(self, reservation: Reservation, result: bool) -> None:
54
+ """Called when a reservation result is received from the network manager.
55
+
56
+ Args:
57
+ reservation (Reservation): The reservation that completed.
58
+ result (bool): Whether the reservation was approved.
59
+ """
60
+ pass
61
+
62
+ @abstractmethod
63
+ def get_other_reservation(self, reservation: Reservation) -> None:
64
+ """Called when a reservation initiated by another node is approved and
65
+ uses this node as the responder.
66
+
67
+ Args:
68
+ reservation (Reservation): The approved reservation.
69
+ """
70
+ pass
71
+
72
+ def set_name(self, name: str) -> None:
73
+ """Override the default application name.
74
+
75
+ Args:
76
+ name (str): New name for the application.
77
+ """
78
+ self.name = name
79
+
80
+ def __str__(self) -> str:
81
+ return self.name
@@ -1,4 +1,5 @@
1
1
  from __future__ import annotations
2
+ import warnings
2
3
  from typing import TYPE_CHECKING
3
4
 
4
5
  if TYPE_CHECKING:
@@ -6,12 +7,14 @@ if TYPE_CHECKING:
6
7
  from ..network_management.reservation import Reservation
7
8
  from ..resource_management.memory_manager import MemoryInfo
8
9
 
10
+ from .app import App
9
11
  from ..kernel.event import Event
10
12
  from ..kernel.process import Process
11
- from ..utils import log
13
+ from ..utils import log, metrics
14
+ from ..utils.metrics.event_types import EventTypes
12
15
 
13
16
 
14
- class RequestApp:
17
+ class RequestApp(App):
15
18
  """Code for the request application.
16
19
 
17
20
  This application will create a request for entanglement.
@@ -35,8 +38,7 @@ class RequestApp:
35
38
  """
36
39
 
37
40
  def __init__(self, node: QuantumRouter):
38
- self.node: QuantumRouter = node
39
- self.node.set_app(self)
41
+ super().__init__(node)
40
42
  self.responder: str = ""
41
43
  self.start_t: int = -1
42
44
  self.end_t: int = -1
@@ -46,7 +48,6 @@ class RequestApp:
46
48
  self.memory_counter: int = 0
47
49
  self.path: list[str] = []
48
50
  self.memo_to_reservation: dict[int, Reservation] = {}
49
- self.name: str = f"{self.node.name}.RequestApp"
50
51
 
51
52
  def start(self, responder: str, start_t: int, end_t: int, memo_size: int, fidelity: float):
52
53
  """Method to start the application.
@@ -135,14 +136,19 @@ class RequestApp:
135
136
 
136
137
  if info.index in self.memo_to_reservation:
137
138
  reservation = self.memo_to_reservation[info.index]
138
- if info.remote_node == reservation.initiator and info.fidelity >= reservation.fidelity:
139
+ valid_fidelity = info.fidelity >= reservation.fidelity
140
+ if info.remote_node == reservation.initiator and valid_fidelity:
139
141
  self.node.resource_manager.update(None, info.memory, "RAW")
140
- elif info.remote_node == reservation.responder and info.fidelity >= reservation.fidelity:
142
+ metrics.record(EventTypes.DELIVERY, self.node.name, fidelity=info.fidelity, **reservation)
143
+ elif info.remote_node == reservation.responder and valid_fidelity:
141
144
  self.memory_counter += 1
142
145
  log.logger.info(f"Successfully generated entanglement. Counter is at {self.memory_counter}.")
143
146
  self.node.resource_manager.update(None, info.memory, "RAW")
147
+ metrics.record(EventTypes.DELIVERY, self.node.name, fidelity=info.fidelity, **reservation)
144
148
 
145
149
  def get_throughput(self) -> float:
150
+ warnings.warn("get_throughput is deprecated and will be removed in a future release, "
151
+ "use THROUGHPUT_METRIC from the metrics module instead", category=FutureWarning, stacklevel=2)
146
152
  return self.memory_counter / (self.end_t - self.start_t) * 1e12
147
153
 
148
154
 
@@ -167,8 +173,3 @@ class RequestApp:
167
173
  event = Event(reservation.end_time, process)
168
174
  self.node.timeline.schedule(event)
169
175
 
170
- def set_name(self, name: str):
171
- self.name = name
172
-
173
- def __str__(self) -> str:
174
- return self.name
@@ -3,68 +3,48 @@
3
3
  This module introduces the QuantumCircuit class. The qutip library is used to calculate the unitary matrix of a circuit.
4
4
  """
5
5
 
6
- from math import e, pi, sqrt
7
-
8
6
  import numpy as np
9
7
  from qutip_qip.circuit import QubitCircuit
10
8
  from qutip_qip.operations import gate_sequence_product
11
9
  from qutip import Qobj
12
10
 
11
+ from ..kernel.quantum_gates import gate_matrix
12
+
13
13
  GATE_INFO_TYPE = list[str | list[int] | float]
14
14
 
15
15
 
16
16
  def x_gate():
17
- mat = np.array([[0, 1],
18
- [1, 0]])
19
- return Qobj(mat, dims=[[2], [2]])
17
+ return Qobj(gate_matrix("x"), dims=[[2], [2]])
20
18
 
21
19
 
22
20
  def y_gate():
23
- mat = np.array([[0, -1.j],
24
- [1.j, 0]])
25
- return Qobj(mat, dims=[[2], [2]])
21
+ return Qobj(gate_matrix("y"), dims=[[2], [2]])
26
22
 
27
23
 
28
24
  def z_gate():
29
- mat = np.array([[1, 0],
30
- [0, -1]])
31
- return Qobj(mat, dims=[[2], [2]])
25
+ return Qobj(gate_matrix("z"), dims=[[2], [2]])
32
26
 
33
27
 
34
28
  def s_gate():
35
- mat = np.array([[1., 0],
36
- [0., 1.j]])
37
- return Qobj(mat, dims=[[2], [2]])
29
+ return Qobj(gate_matrix("s"), dims=[[2], [2]])
38
30
 
39
31
  def sdg_gate():
40
- mat = np.array([[1., 0],
41
- [0., -1.j]])
42
- return Qobj(mat, dims=[[2], [2]])
32
+ return Qobj(gate_matrix("sdg"), dims=[[2], [2]])
43
33
 
44
34
  def t_gate():
45
- mat = np.array([[1., 0],
46
- [0., e ** (1.j * (pi / 4))]])
47
- return Qobj(mat, dims=[[2], [2]])
35
+ return Qobj(gate_matrix("t"), dims=[[2], [2]])
48
36
 
49
37
  def root_iZ_gate():
50
- mat = 1/sqrt(2)*np.array([[1.+1.j, 0],
51
- [0, 1.-1.j]])
52
- return Qobj(mat, dims=[[2], [2]])
38
+ return Qobj(gate_matrix("root_iZ"), dims=[[2], [2]])
53
39
 
54
40
  def minus_root_iZ_gate():
55
- mat = 1/sqrt(2)*np.array([[1.-1.j, 0],
56
- [0, 1.+1.j]])
57
- return Qobj(mat, dims=[[2], [2]])
41
+ return Qobj(gate_matrix("minus_root_iZ"), dims=[[2], [2]])
58
42
 
59
43
  def root_iY_gate():
60
- mat = 1/sqrt(2)*np.array([[1., 1.],
61
- [-1., 1.]])
62
- return Qobj(mat, dims=[[2], [2]])
44
+ return Qobj(gate_matrix("root_iY"), dims=[[2], [2]])
63
45
 
64
46
  def minus_root_iY_gate():
65
- mat = 1/sqrt(2)*np.array([[1., -1.],
66
- [1., 1.]])
67
- return Qobj(mat, dims=[[2], [2]])
47
+ return Qobj(gate_matrix("minus_root_iY"), dims=[[2], [2]])
68
48
 
69
49
 
70
50
  def validator(func):
@@ -43,6 +43,9 @@ MILLISECOND: Final = 10**9
43
43
  #: Number of picoseconds in one second.
44
44
  SECOND: Final = 10**12
45
45
 
46
+
47
+ # Formalism #
48
+
46
49
  #: Built-in ket-vector formalism identifier.
47
50
  KET_VECTOR_FORMALISM: Final = "ket_vector"
48
51
  #: Built-in density-matrix formalism identifier.
@@ -54,7 +57,12 @@ BELL_DIAGONAL_STATE_FORMALISM: Final = "bell_diagonal"
54
57
  #: Built-in stabilizer-state formalism identifier.
55
58
  STABILIZER_FORMALISM: Final = "stabilizer"
56
59
 
60
+
61
+ # Protocol Type #
62
+
57
63
  #: Built-in Barrett-Kok generation protocol identifier.
58
64
  BARRET_KOK: Final = 'barret_kok'
59
65
  #: Built-in single-heralded generation protocol identifier.
60
66
  SINGLE_HERALDED: Final = 'single_heralded'
67
+ #: Built-in DEJMPS Bell-diagonal-state purification protocol identifier.
68
+ DEJMPS: Final = "dejmps_bds"
@@ -8,6 +8,8 @@ if TYPE_CHECKING:
8
8
  from ..components.memory import Memory
9
9
 
10
10
  from ..protocol import Protocol
11
+ from ..utils import metrics
12
+ from ..utils.metrics.event_types import EventTypes
11
13
 
12
14
 
13
15
  class EntanglementProtocol(Protocol):
@@ -80,3 +82,10 @@ class EntanglementProtocol(Protocol):
80
82
 
81
83
  self.owner.resource_manager.update(self, memory, state)
82
84
 
85
+ def record_memory_expired(self, memory: "Memory") -> None:
86
+ """Record a MEMORY_EXPIRED metrics event for the given memory."""
87
+ memo_info = self.owner.resource_manager.memory_manager.get_info_by_memory(memory)
88
+ identity = None
89
+ if self.rule is not None and self.rule.reservation is not None:
90
+ identity = self.rule.reservation.identity
91
+ metrics.record(EventTypes.MEMORY_EXPIRED, self.owner.name, memory_index=memo_info.index, identity=identity)