Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,11 @@ Here is an example of using SimQN.

## Release History

- v0.2.1(Released 2025.04)
- *New functions!!!*
- Network Utilities: Add Random Topology Generator, including ER model, BA model, and dual-BA model.
- Applications: Add CASCADE Error Correction and Privacy Amplification Process for BB84 Protocol.

- v0.1.5(Released 2022.09)
- *New functions!!!*
- Simulator Core: Cython Optimization, Multi-process Support.
Expand Down
24 changes: 24 additions & 0 deletions docs/source/qns.network.topology.rst
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,30 @@ qns.network.topology.waxmantopo module
:undoc-members:
:show-inheritance:

qns.network.topology.erdosrenyitopo module
------------------------------------------

.. automodule:: qns.network.topology.erdosrenyitopo
:members:
:undoc-members:
:show-inheritance:

qns.network.topology.barabasialberttopo module
----------------------------------------------

.. automodule:: qns.network.topology.barabasialberttopo
:members:
:undoc-members:
:show-inheritance:

qns.network.topology.dualbarabasialberttopo module
--------------------------------------------------

.. automodule:: qns.network.topology.dualbarabasialberttopo
:members:
:undoc-members:
:show-inheritance:

Module contents
---------------

Expand Down
5 changes: 4 additions & 1 deletion docs/source/tutorials.network.topology.rst
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,14 @@ Topology generators may have more parameters. The following example shows how to
SimQn provides several topology generators:

- ``BasicTopology`` generates several quantum nodes but no quantum channels. All nodes are not connected with each other.
- ``LineTopology`` connects all nodes to from a line topology.
- ``LineTopology`` connects all nodes to from a line topology.
- ``GridTopology`` forms a square grid topology. ``nodes_number`` should be a perfect square number.
- ``TreeTopology`` generates a tree topology. It has an additional parameter ``children_number``. Each parent node will connect to ``children_number`` child nodes.
- ``RandomTopology`` generates a connected random topology based on the spanning tree. It has an additional parameter ``lines_number`` indicating the number of quantum channels.
- ``WaxmanTopology`` is another random topology generator based on the Waxman's algorithm. It has three additional parameters, ``size``, ``alpha``, and ``bete``. The topology is in a :math:`size*size` area. Both ``alpha`` and ``bete`` are parameters of the Waxman's algorithm.
- ``ErdosRenyiTopology`` is is randomly generated following the Erdos-Rényi model (G(n, p) model). In this model, each pair of nodes has a fixed probability `generate_prob` of being connected by a quantum channel. This model is widely used for studying random networks.
- ``BarabasiAlbertTopology`` is a random topology generator based on the Barabasi-Albert model. Each new QNode added has `new_nodes_egdes` to existing QNodes. The probability of a new QNode connecting to an existing QNode is proportional to the degree of the existing QNode.
- ``DualBarabasiAlbertTopology`` is a random topology generator based on the Dual Barabási-Albert model. This model extends the Barabási-Albert model by introducing two different edge attachment rules. Each new node connects to existing nodes with either `edges_num1` or `edges_num2` edges, based on a probability `prob`. The attachment probability is proportional to the degree of the existing nodes.

Users can build their own topology by inheriting the ``Topology`` class and implement the ``build`` method.

Expand Down
6 changes: 4 additions & 2 deletions examples/simple_bb84.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
from qns.entity.qchannel.qchannel import QuantumChannel
from qns.entity import QNode
from qns.simulator.simulator import Simulator
from qns.network.protocol.bb84 import BB84RecvApp, BB84SendApp
from qns.network.protocol.bb84 import BB84RecvApp, BB84SendApp, KEY_BLOCK_SIZE
import numpy as np

light_speed = 299791458
Expand Down Expand Up @@ -39,5 +39,7 @@ def drop_rate(length):
n2.install(s)

s.run()
results.append(len(rp.succ_key_pool) / 10)
results.append(len(sp.key_pool)*KEY_BLOCK_SIZE / 10)
print("length", length, "sp key block num", len(sp.key_pool))
print("length", length, "rp key block num", len(rp.key_pool))
print(length, np.mean(results), np.std(results))
2 changes: 1 addition & 1 deletion qns/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,6 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.

version = '0.1.5'
version = '0.2.1'
licence = 'GPLv3'
author = 'Lutong Chen, Jian Li and Kaiping Xue'
Loading