diff --git a/docs/build/doctrees/develop.doctree b/docs/build/doctrees/develop.doctree index b43d684..74e5b1d 100644 Binary files a/docs/build/doctrees/develop.doctree and b/docs/build/doctrees/develop.doctree differ diff --git a/docs/build/doctrees/environment.pickle b/docs/build/doctrees/environment.pickle index 5dd8374..8bd83aa 100644 Binary files a/docs/build/doctrees/environment.pickle and b/docs/build/doctrees/environment.pickle differ diff --git a/docs/build/doctrees/index.doctree b/docs/build/doctrees/index.doctree index 2f4192a..e70c061 100644 Binary files a/docs/build/doctrees/index.doctree and b/docs/build/doctrees/index.doctree differ diff --git a/docs/build/doctrees/install.doctree b/docs/build/doctrees/install.doctree index ca5a732..8506716 100644 Binary files a/docs/build/doctrees/install.doctree and b/docs/build/doctrees/install.doctree differ diff --git a/docs/build/doctrees/introduction.doctree b/docs/build/doctrees/introduction.doctree index 8910796..024d48c 100644 Binary files a/docs/build/doctrees/introduction.doctree and b/docs/build/doctrees/introduction.doctree differ diff --git a/docs/build/doctrees/modules.doctree b/docs/build/doctrees/modules.doctree index f1d334b..ab634d4 100644 Binary files a/docs/build/doctrees/modules.doctree and b/docs/build/doctrees/modules.doctree differ diff --git a/docs/build/doctrees/qns.doctree b/docs/build/doctrees/qns.doctree index 4908c5a..99177d8 100644 Binary files a/docs/build/doctrees/qns.doctree and b/docs/build/doctrees/qns.doctree differ diff --git a/docs/build/doctrees/qns.entity.cchannel.doctree b/docs/build/doctrees/qns.entity.cchannel.doctree index 3d607b2..c34df61 100644 Binary files a/docs/build/doctrees/qns.entity.cchannel.doctree and b/docs/build/doctrees/qns.entity.cchannel.doctree differ diff --git a/docs/build/doctrees/qns.entity.doctree b/docs/build/doctrees/qns.entity.doctree index 17e7fab..fa38680 100644 Binary files a/docs/build/doctrees/qns.entity.doctree and b/docs/build/doctrees/qns.entity.doctree differ diff --git a/docs/build/doctrees/qns.entity.memory.doctree b/docs/build/doctrees/qns.entity.memory.doctree index f545def..a47370d 100644 Binary files a/docs/build/doctrees/qns.entity.memory.doctree and b/docs/build/doctrees/qns.entity.memory.doctree differ diff --git a/docs/build/doctrees/qns.entity.monitor.doctree b/docs/build/doctrees/qns.entity.monitor.doctree index 935af4d..213411c 100644 Binary files a/docs/build/doctrees/qns.entity.monitor.doctree and b/docs/build/doctrees/qns.entity.monitor.doctree differ diff --git a/docs/build/doctrees/qns.entity.node.doctree b/docs/build/doctrees/qns.entity.node.doctree index 2b02e0a..2798b4e 100644 Binary files a/docs/build/doctrees/qns.entity.node.doctree and b/docs/build/doctrees/qns.entity.node.doctree differ diff --git a/docs/build/doctrees/qns.entity.operator.doctree b/docs/build/doctrees/qns.entity.operator.doctree index 815b9d5..1b1b627 100644 Binary files a/docs/build/doctrees/qns.entity.operator.doctree and b/docs/build/doctrees/qns.entity.operator.doctree differ diff --git a/docs/build/doctrees/qns.entity.qchannel.doctree b/docs/build/doctrees/qns.entity.qchannel.doctree index 7d3f931..609d94c 100644 Binary files a/docs/build/doctrees/qns.entity.qchannel.doctree and b/docs/build/doctrees/qns.entity.qchannel.doctree differ diff --git a/docs/build/doctrees/qns.entity.timer.doctree b/docs/build/doctrees/qns.entity.timer.doctree index d833830..0ed759c 100644 Binary files a/docs/build/doctrees/qns.entity.timer.doctree and b/docs/build/doctrees/qns.entity.timer.doctree differ diff --git a/docs/build/doctrees/qns.models.core.doctree b/docs/build/doctrees/qns.models.core.doctree index 5202805..45039c1 100644 Binary files a/docs/build/doctrees/qns.models.core.doctree and b/docs/build/doctrees/qns.models.core.doctree differ diff --git a/docs/build/doctrees/qns.models.delay.doctree b/docs/build/doctrees/qns.models.delay.doctree index 862b6b1..72017dd 100644 Binary files a/docs/build/doctrees/qns.models.delay.doctree and b/docs/build/doctrees/qns.models.delay.doctree differ diff --git a/docs/build/doctrees/qns.models.doctree b/docs/build/doctrees/qns.models.doctree index 4229d6d..8ad654e 100644 Binary files a/docs/build/doctrees/qns.models.doctree and b/docs/build/doctrees/qns.models.doctree differ diff --git a/docs/build/doctrees/qns.models.epr.doctree b/docs/build/doctrees/qns.models.epr.doctree index 362750d..596b93e 100644 Binary files a/docs/build/doctrees/qns.models.epr.doctree and b/docs/build/doctrees/qns.models.epr.doctree differ diff --git a/docs/build/doctrees/qns.models.qubit.doctree b/docs/build/doctrees/qns.models.qubit.doctree index 58c37ff..3461c82 100644 Binary files a/docs/build/doctrees/qns.models.qubit.doctree and b/docs/build/doctrees/qns.models.qubit.doctree differ diff --git a/docs/build/doctrees/qns.network.doctree b/docs/build/doctrees/qns.network.doctree index 9ec3c01..7b62761 100644 Binary files a/docs/build/doctrees/qns.network.doctree and b/docs/build/doctrees/qns.network.doctree differ diff --git a/docs/build/doctrees/qns.network.protocol.doctree b/docs/build/doctrees/qns.network.protocol.doctree index a5e8519..bcca8f9 100644 Binary files a/docs/build/doctrees/qns.network.protocol.doctree and b/docs/build/doctrees/qns.network.protocol.doctree differ diff --git a/docs/build/doctrees/qns.network.route.doctree b/docs/build/doctrees/qns.network.route.doctree index d8505d8..5cb433e 100644 Binary files a/docs/build/doctrees/qns.network.route.doctree and b/docs/build/doctrees/qns.network.route.doctree differ diff --git a/docs/build/doctrees/qns.network.topology.doctree b/docs/build/doctrees/qns.network.topology.doctree index 3dec123..6825f8e 100644 Binary files a/docs/build/doctrees/qns.network.topology.doctree and b/docs/build/doctrees/qns.network.topology.doctree differ diff --git a/docs/build/doctrees/qns.simulator.doctree b/docs/build/doctrees/qns.simulator.doctree index f9854f7..9ccc968 100644 Binary files a/docs/build/doctrees/qns.simulator.doctree and b/docs/build/doctrees/qns.simulator.doctree differ diff --git a/docs/build/doctrees/qns.utils.doctree b/docs/build/doctrees/qns.utils.doctree index 89adbf0..94f7a6d 100644 Binary files a/docs/build/doctrees/qns.utils.doctree and b/docs/build/doctrees/qns.utils.doctree differ diff --git a/docs/build/doctrees/tutorials.doctree b/docs/build/doctrees/tutorials.doctree index 8fdfd5e..329d28c 100644 Binary files a/docs/build/doctrees/tutorials.doctree and b/docs/build/doctrees/tutorials.doctree differ diff --git a/docs/build/doctrees/tutorials.entity.cchannel.doctree b/docs/build/doctrees/tutorials.entity.cchannel.doctree index 0455add..af8db02 100644 Binary files a/docs/build/doctrees/tutorials.entity.cchannel.doctree and b/docs/build/doctrees/tutorials.entity.cchannel.doctree differ diff --git a/docs/build/doctrees/tutorials.entity.doctree b/docs/build/doctrees/tutorials.entity.doctree index ec6ebba..0b96914 100644 Binary files a/docs/build/doctrees/tutorials.entity.doctree and b/docs/build/doctrees/tutorials.entity.doctree differ diff --git a/docs/build/doctrees/tutorials.entity.memory.doctree b/docs/build/doctrees/tutorials.entity.memory.doctree index 87811e3..af084d4 100644 Binary files a/docs/build/doctrees/tutorials.entity.memory.doctree and b/docs/build/doctrees/tutorials.entity.memory.doctree differ diff --git a/docs/build/doctrees/tutorials.entity.monitor.doctree b/docs/build/doctrees/tutorials.entity.monitor.doctree index 8b41427..1b4c022 100644 Binary files a/docs/build/doctrees/tutorials.entity.monitor.doctree and b/docs/build/doctrees/tutorials.entity.monitor.doctree differ diff --git a/docs/build/doctrees/tutorials.entity.node.doctree b/docs/build/doctrees/tutorials.entity.node.doctree index 6d4c271..78ae42d 100644 Binary files a/docs/build/doctrees/tutorials.entity.node.doctree and b/docs/build/doctrees/tutorials.entity.node.doctree differ diff --git a/docs/build/doctrees/tutorials.entity.operator.doctree b/docs/build/doctrees/tutorials.entity.operator.doctree index 99f18ff..a7736fb 100644 Binary files a/docs/build/doctrees/tutorials.entity.operator.doctree and b/docs/build/doctrees/tutorials.entity.operator.doctree differ diff --git a/docs/build/doctrees/tutorials.entity.other.doctree b/docs/build/doctrees/tutorials.entity.other.doctree index b29b943..2d9a13b 100644 Binary files a/docs/build/doctrees/tutorials.entity.other.doctree and b/docs/build/doctrees/tutorials.entity.other.doctree differ diff --git a/docs/build/doctrees/tutorials.entity.qchannel.doctree b/docs/build/doctrees/tutorials.entity.qchannel.doctree index e2dbd5b..3cbc596 100644 Binary files a/docs/build/doctrees/tutorials.entity.qchannel.doctree and b/docs/build/doctrees/tutorials.entity.qchannel.doctree differ diff --git a/docs/build/doctrees/tutorials.models.delay.doctree b/docs/build/doctrees/tutorials.models.delay.doctree index d5ab4a1..64c3430 100644 Binary files a/docs/build/doctrees/tutorials.models.delay.doctree and b/docs/build/doctrees/tutorials.models.delay.doctree differ diff --git a/docs/build/doctrees/tutorials.models.doctree b/docs/build/doctrees/tutorials.models.doctree index b83e6bf..d67d85b 100644 Binary files a/docs/build/doctrees/tutorials.models.doctree and b/docs/build/doctrees/tutorials.models.doctree differ diff --git a/docs/build/doctrees/tutorials.models.epr.doctree b/docs/build/doctrees/tutorials.models.epr.doctree index 06890ea..853b64b 100644 Binary files a/docs/build/doctrees/tutorials.models.epr.doctree and b/docs/build/doctrees/tutorials.models.epr.doctree differ diff --git a/docs/build/doctrees/tutorials.models.qubit.doctree b/docs/build/doctrees/tutorials.models.qubit.doctree index 3dcc3be..dc80131 100644 Binary files a/docs/build/doctrees/tutorials.models.qubit.doctree and b/docs/build/doctrees/tutorials.models.qubit.doctree differ diff --git a/docs/build/doctrees/tutorials.network.doctree b/docs/build/doctrees/tutorials.network.doctree index b7ffa6b..e954b20 100644 Binary files a/docs/build/doctrees/tutorials.network.doctree and b/docs/build/doctrees/tutorials.network.doctree differ diff --git a/docs/build/doctrees/tutorials.network.request.doctree b/docs/build/doctrees/tutorials.network.request.doctree index d37d385..9a21428 100644 Binary files a/docs/build/doctrees/tutorials.network.request.doctree and b/docs/build/doctrees/tutorials.network.request.doctree differ diff --git a/docs/build/doctrees/tutorials.network.route.doctree b/docs/build/doctrees/tutorials.network.route.doctree index 60bd469..1e31b42 100644 Binary files a/docs/build/doctrees/tutorials.network.route.doctree and b/docs/build/doctrees/tutorials.network.route.doctree differ diff --git a/docs/build/doctrees/tutorials.network.topology.doctree b/docs/build/doctrees/tutorials.network.topology.doctree index b9682eb..d953331 100644 Binary files a/docs/build/doctrees/tutorials.network.topology.doctree and b/docs/build/doctrees/tutorials.network.topology.doctree differ diff --git a/docs/build/doctrees/tutorials.parallel_simulation.doctree b/docs/build/doctrees/tutorials.parallel_simulation.doctree index d564909..b7ca872 100644 Binary files a/docs/build/doctrees/tutorials.parallel_simulation.doctree and b/docs/build/doctrees/tutorials.parallel_simulation.doctree differ diff --git a/docs/build/doctrees/tutorials.quickstart.doctree b/docs/build/doctrees/tutorials.quickstart.doctree index 258fd90..71329f5 100644 Binary files a/docs/build/doctrees/tutorials.quickstart.doctree and b/docs/build/doctrees/tutorials.quickstart.doctree differ diff --git a/docs/build/doctrees/tutorials.simulator.doctree b/docs/build/doctrees/tutorials.simulator.doctree index bfbbfc9..5135965 100644 Binary files a/docs/build/doctrees/tutorials.simulator.doctree and b/docs/build/doctrees/tutorials.simulator.doctree differ diff --git a/docs/build/doctrees/tutorials.util.doctree b/docs/build/doctrees/tutorials.util.doctree index 1e5361e..7ce15e4 100644 Binary files a/docs/build/doctrees/tutorials.util.doctree and b/docs/build/doctrees/tutorials.util.doctree differ diff --git a/docs/build/html/_modules/qns/entity/cchannel/cchannel.html b/docs/build/html/_modules/qns/entity/cchannel/cchannel.html index 99d18f7..221c923 100644 --- a/docs/build/html/_modules/qns/entity/cchannel/cchannel.html +++ b/docs/build/html/_modules/qns/entity/cchannel/cchannel.html @@ -152,7 +152,7 @@

Source code for qns.entity.cchannel.cchannel

    ClassicChannel is the channel for classic message
     """
     def __init__(self, name: str = None, node_list: List[QNode] = [],
-                 bandwidth: int = 0, delay: Union[float, DelayModel] = 0, drop_rate: float = 0,
+                 bandwidth: int = 0, delay: Union[float, DelayModel] = 0, length: Optional[float] = 0, drop_rate: float = 0,
                  max_buffer_size: int = 0):
         """
         Args:
@@ -160,6 +160,7 @@ 

Source code for qns.entity.cchannel.cchannel

            node_list (List[QNode]): a list of QNodes that it connects to
             bandwidth (int): the byte per second on this channel. 0 represents unlimited
             delay (Union[float, DelayModel]): the time delay for transmitting a packet. It is a float number or a ``DelayModel``
+            length (float): the length of this channel
             drop_rate (float): the drop rate
             max_buffer_size (int): the max buffer size.
                 If it is full, the next coming packet will be dropped. 0 represents unlimited.
@@ -169,6 +170,7 @@ 

Source code for qns.entity.cchannel.cchannel

self.bandwidth = bandwidth
         self.delay_model = delay if isinstance(delay, DelayModel) else ConstantDelayModel(delay=delay)
         self.drop_rate = drop_rate
+        self.length = length
         self.max_buffer_size = max_buffer_size
 
 
[docs] def install(self, simulator: Simulator) -> None: diff --git a/docs/build/html/_modules/qns/entity/entity.html b/docs/build/html/_modules/qns/entity/entity.html index da2b297..b0a21c8 100644 --- a/docs/build/html/_modules/qns/entity/entity.html +++ b/docs/build/html/_modules/qns/entity/entity.html @@ -1,5 +1,5 @@ - + @@ -40,7 +40,7 @@
  • Install Guide
  • Tutorials
  • Develop Guide
  • -
  • API Reference
  • +
  • qns
  • diff --git a/docs/build/html/_modules/qns/entity/memory/event.html b/docs/build/html/_modules/qns/entity/memory/event.html index af706fc..96a5f50 100644 --- a/docs/build/html/_modules/qns/entity/memory/event.html +++ b/docs/build/html/_modules/qns/entity/memory/event.html @@ -40,7 +40,7 @@
  • Install Guide
  • Tutorials
  • Develop Guide
  • -
  • API Reference
  • +
  • qns
  • diff --git a/docs/build/html/_modules/qns/entity/monitor/monitor.html b/docs/build/html/_modules/qns/entity/monitor/monitor.html index 34d9b37..cc07296 100644 --- a/docs/build/html/_modules/qns/entity/monitor/monitor.html +++ b/docs/build/html/_modules/qns/entity/monitor/monitor.html @@ -88,7 +88,6 @@

    Source code for qns.entity.monitor.monitor

     import pandas as pd
     from typing import Any, Callable, Optional
     from qns.entity.entity import Entity
    -from qns.network.network import QuantumNetwork
     from qns.simulator.event import Event
     from qns.simulator.simulator import Simulator
     from qns.simulator.ts import Time
    @@ -108,7 +107,7 @@ 

    Source code for qns.entity.monitor.monitor

     
     
     
    [docs]class Monitor(Entity): - def __init__(self, name: Optional[str] = None, network: Optional[QuantumNetwork] = None) -> None: + def __init__(self, name: Optional[str] = None, network=None) -> None: """ Monitor is a virtual entity that helps users to collect network status. @@ -174,7 +173,7 @@

    Source code for qns.entity.monitor.monitor

             return self.data
    [docs] def add_attribution(self, name: str, - calculate_func: Callable[[Simulator, Optional[QuantumNetwork], Optional[Event]], Any]) -> None: + calculate_func: Callable[[Simulator, Any, Optional[Event]], Any]) -> None: """ Set an attribution that will be recorded. For example, an attribution could be the throughput, or the fidelity. @@ -224,7 +223,7 @@

    Source code for qns.entity.monitor.monitor

                 # record network status every 3 seconds.
                 m.at_period(3)
             """
    -        assert(period_time > 0)
    +        assert (period_time > 0)
             self.watch_period.append(period_time)
    [docs] def at_event(self, event_type) -> None: diff --git a/docs/build/html/_modules/qns/entity/node/app.html b/docs/build/html/_modules/qns/entity/node/app.html index b117ad7..0823fb3 100644 --- a/docs/build/html/_modules/qns/entity/node/app.html +++ b/docs/build/html/_modules/qns/entity/node/app.html @@ -40,7 +40,7 @@
  • Install Guide
  • Tutorials
  • Develop Guide
  • -
  • API Reference
  • +
  • qns
  • diff --git a/docs/build/html/_modules/qns/entity/node/node.html b/docs/build/html/_modules/qns/entity/node/node.html index 4cec522..74123d6 100644 --- a/docs/build/html/_modules/qns/entity/node/node.html +++ b/docs/build/html/_modules/qns/entity/node/node.html @@ -40,7 +40,7 @@
  • Install Guide
  • Tutorials
  • Develop Guide
  • -
  • API Reference
  • +
  • qns
  • @@ -85,7 +85,7 @@

    Source code for qns.entity.node.node

     #    You should have received a copy of the GNU General Public License
     #    along with this program.  If not, see <https://www.gnu.org/licenses/>.
     
    -from typing import List
    +from typing import List, Union
     from qns.simulator import Simulator
     from qns.simulator import Event
     from qns.entity import Entity
    @@ -122,19 +122,19 @@ 

    Source code for qns.entity.node.node

             # initiate sub-entities
             for cchannel in self.cchannels:
                 from qns.entity import ClassicChannel
    -            assert(isinstance(cchannel, ClassicChannel))
    +            assert (isinstance(cchannel, ClassicChannel))
                 cchannel.install(simulator)
             for qchannel in self.qchannels:
                 from qns.entity import QuantumChannel
    -            assert(isinstance(qchannel, QuantumChannel))
    +            assert (isinstance(qchannel, QuantumChannel))
                 qchannel.install(simulator)
             for memory in self.memories:
                 from qns.entity import QuantumMemory
    -            assert(isinstance(memory, QuantumMemory))
    +            assert (isinstance(memory, QuantumMemory))
                 memory.install(simulator)
             for operator in self.operators:
                 from qns.entity import QuantumOperator
    -            assert(isinstance(operator, QuantumOperator))
    +            assert (isinstance(operator, QuantumOperator))
                 operator.install(simulator)
     
             # initiate applications
    @@ -182,6 +182,19 @@ 

    Source code for qns.entity.node.node

             memory.node = self
             self.memories.append(memory)
    +
    [docs] def get_memory(self, memory: Union[str, int]): + """ + Get the memory by index (in memories) or its name + + Args: + memory (Union[str, int]): the index or name of the memory + """ + if isinstance(memory, str): + for m in self.memories: + if m.name == memory: + return m + return self.memories[memory]
    +
    [docs] def add_operator(self, operator): """ Add a quantum operator in this node diff --git a/docs/build/html/_modules/qns/entity/operator/event.html b/docs/build/html/_modules/qns/entity/operator/event.html index 38f57b9..726c88c 100644 --- a/docs/build/html/_modules/qns/entity/operator/event.html +++ b/docs/build/html/_modules/qns/entity/operator/event.html @@ -40,7 +40,7 @@
  • Install Guide
  • Tutorials
  • Develop Guide
  • -
  • API Reference
  • +
  • qns
  • diff --git a/docs/build/html/_modules/qns/entity/timer/timer.html b/docs/build/html/_modules/qns/entity/timer/timer.html index e2cfaa7..9f1f9a5 100644 --- a/docs/build/html/_modules/qns/entity/timer/timer.html +++ b/docs/build/html/_modules/qns/entity/timer/timer.html @@ -40,7 +40,7 @@
  • Install Guide
  • Tutorials
  • Develop Guide
  • -
  • API Reference
  • +
  • qns
  • diff --git a/docs/build/html/_modules/qns/models/core/backend.html b/docs/build/html/_modules/qns/models/core/backend.html index df9bef7..71d2394 100644 --- a/docs/build/html/_modules/qns/models/core/backend.html +++ b/docs/build/html/_modules/qns/models/core/backend.html @@ -40,7 +40,7 @@
  • Install Guide
  • Tutorials
  • Develop Guide
  • -
  • API Reference
  • +
  • qns
  • diff --git a/docs/build/html/_modules/qns/models/delay/uniformdelay.html b/docs/build/html/_modules/qns/models/delay/uniformdelay.html index 785a9a1..9628a3d 100644 --- a/docs/build/html/_modules/qns/models/delay/uniformdelay.html +++ b/docs/build/html/_modules/qns/models/delay/uniformdelay.html @@ -101,7 +101,7 @@

    Source code for qns.models.delay.uniformdelay

    max_delay (float): the maximum time delay [s] """ super().__init__(name) - assert(max_delay >= min_delay) + assert (max_delay >= min_delay) self._min_delay = min_delay self._max_delay = max_delay diff --git a/docs/build/html/_modules/qns/models/epr/entanglement.html b/docs/build/html/_modules/qns/models/epr/entanglement.html index 87b80d1..641fe90 100644 --- a/docs/build/html/_modules/qns/models/epr/entanglement.html +++ b/docs/build/html/_modules/qns/models/epr/entanglement.html @@ -40,7 +40,7 @@
  • Install Guide
  • Tutorials
  • Develop Guide
  • -
  • API Reference
  • +
  • qns
  • diff --git a/docs/build/html/_modules/qns/models/qubit/const.html b/docs/build/html/_modules/qns/models/qubit/const.html index d226f97..7d2fd44 100644 --- a/docs/build/html/_modules/qns/models/qubit/const.html +++ b/docs/build/html/_modules/qns/models/qubit/const.html @@ -1,5 +1,5 @@ - + @@ -40,7 +40,7 @@
  • Install Guide
  • Tutorials
  • Develop Guide
  • -
  • API Reference
  • +
  • qns
  • diff --git a/docs/build/html/_modules/qns/models/qubit/decoherence.html b/docs/build/html/_modules/qns/models/qubit/decoherence.html index 34243ab..296128c 100644 --- a/docs/build/html/_modules/qns/models/qubit/decoherence.html +++ b/docs/build/html/_modules/qns/models/qubit/decoherence.html @@ -40,7 +40,7 @@
  • Install Guide
  • Tutorials
  • Develop Guide
  • -
  • API Reference
  • +
  • qns
  • @@ -87,198 +87,137 @@

    Source code for qns.models.qubit.decoherence

    from typing import Optional
    +from qns.models.qubit.const import QUBIT_STATE_0
     from qns.models.qubit.gate import I, X, Y, Z
     import numpy as np
    +from qns.models.qubit.qubit import QState
    +from qns.utils.rnd import get_rand
     
     
    -
    [docs]def PrefectStorageErrorModel(self, t: Optional[float] = 0, decoherence_rate: Optional[float] = 0, **kwargs): +
    [docs]def PrefectError(self, p: Optional[float] = 0, **kwargs): """ - The default error model for storing a qubit in quantum memory. - The default behavior is doing nothing + The default error model for this qubit. Args: - t: the time stored in a quantum memory. The unit it second. - decoherence_rate (float): the decoherence rate. - kwargs: other parameters + p (float): the error possibility """ pass
    -
    [docs]def DephaseStorageErrorModel(self, t: Optional[float] = 0, decoherence_rate: Optional[float] = 0, **kwargs): +
    [docs]def DephaseError(self, p: Optional[float] = 0, **kwargs): """ - The dephase error model for storing a qubit in quantum memory. - - A random Z gate will be operate on the qubit with possibility: 1-e^(-decoherence_rate * t) + The dephase error model. + A random Z gate will be operate on the qubit with possibility p. Args: - t: the time stored in a quantum memory. The unit it second. - decoherence_rate (float): the decoherence rate - kwargs: other parameters + p (float): the error possibility """ - if decoherence_rate < 0: - raise Exception("Error decoherence rate, should be positive") - p = 1 - np.exp(-decoherence_rate * t) + if p < 0 or p > 1: + raise Exception("Error decoherence rate, should be in [0, 1]") self.stochastic_operate([I, Z], [1-p, p])
    -
    [docs]def DepolarStorageErrorModel(self, t: Optional[float] = 0, decoherence_rate: Optional[float] = 0, **kwargs): +
    [docs]def DepolarError(self, p: Optional[float] = 0, **kwargs): """ - The depolar error model for storing a qubit in quantum memory. + The depolarizing error model. - One of the random Pauli gate will be operate on the qubit with possibility: - 1-e^(-decoherence_rate * t) + One of the random Pauli gate will be operate on the qubit with possibility p : Args: - t: the time stored in a quantum memory. The unit it second. - decoherence_rate (float): the decoherence rate + p (float): the error possibility kwargs: other parameters """ - if decoherence_rate < 0: - raise Exception("Error decoherence rate, should be positive") - p = 1 - np.exp(-decoherence_rate * t) + if p < 0 or p > 1: + raise Exception("Error decoherence rate, should be in [0, 1]") if 1-3*p > 0: self.stochastic_operate([I, X, Y, Z], [1-3*p, p, p, p]) else: self.stochastic_operate([X, Y, Z], [1/3, 1/3, 1/3])
    -
    [docs]def PrefectTransferErrorModel(self, length: Optional[float] = 0, decoherence_rate: Optional[float] = 0, **kwargs): - """ - The default error model for transmitting this qubit - The default behavior is doing nothing - - Args: - length (float): the length of the channel - decoherence_rate (float): the decoherence rate. - kwargs: other parameters - """ - pass
    - - -
    [docs]def DephaseTransferErrorModel(self, length: Optional[float] = 0, decoherence_rate: Optional[float] = 0, **kwargs): - """ - The dephase error model for transmitting a qubit in quantum channel. - - A random Z gate will be operate on the qubit with possibility: 1-e^(-decoherence_rate * length) - - Args: - length: the channel length - decoherence_rate (float): the decoherence rate - kwargs: other parameters - """ - if decoherence_rate < 0: - raise Exception("Error decoherence rate, should be positive") - p = 1 - np.exp(-decoherence_rate * length) - self.stochastic_operate([I, Z], [1-p, p])
    - - -
    [docs]def DepolarTransferErrorModel(self, length: Optional[float] = 0, decoherence_rate: Optional[float] = 0, **kwargs): - """ - The depolar error model for transmitting a qubit in quantum channel. - - One of the random Pauli gate will be operate on the qubit with possibility: - 1-e^(-decoherence_rate * t) - - Args: - length: the channel length - decoherence_rate (float): the decoherence rate - kwargs: other parameters - """ - if decoherence_rate < 0: - raise Exception("Error decoherence rate, should be positive") - p = 1 - np.exp(-decoherence_rate * length) - if 1-3*p > 0: - self.stochastic_operate([I, X, Y, Z], [1-3*p, p, p, p]) - else: - self.stochastic_operate([X, Y, Z], [1/3, 1/3, 1/3])
    - - -
    [docs]def PrefectOperateErrorModel(self, decoherence_rate: Optional[float] = 0, **kwargs): - """ - The default error model for operating this qubit. - - Args: - decoherence_rate (float): the decoherence rate - """ - pass
    - - -
    [docs]def DephaseOperateErrorModel(self, decoherence_rate: Optional[float] = 0, **kwargs): - """ - The dephase error model for operating this qubit. - A random Z gate will be operate on the qubit with possibility: 1-e^(-decoherence_rate) - - Args: - decoherence_rate (float): the decoherence rate - """ - if decoherence_rate < 0: - raise Exception("Error decoherence rate, should be positive") - p = 1 - np.exp(-decoherence_rate) - self.stochastic_operate([I, Z], [1-p, p])
    - - -
    [docs]def DepolarOperateErrorModel(self, decoherence_rate: Optional[float] = 0, **kwargs): +
    [docs]def BitFlipError(self, p: Optional[float] = 0, **kwargs): """ - The depolar error model for operating on a qubit. - - One of the random Pauli gate will be operate on the qubit with possibility: - 1-e^(-decoherence_rate * t) + The bit flip error model. Args: - decoherence_rate (float): the decoherence rate + p (float): the error possibility, [0, 1] kwargs: other parameters """ - if decoherence_rate < 0: - raise Exception("Error decoherence rate, should be positive") - p = 1 - np.exp(-decoherence_rate) - if 1-3*p > 0: - self.stochastic_operate([I, X, Y, Z], [1-3*p, p, p, p]) - else: - self.stochastic_operate([X, Y, Z], [1/3, 1/3, 1/3])
    + if p < 0 or p > 1: + raise Exception("Error decoherence rate, should be in [0, 1]") + self.stochastic_operate([I, X], [1-p, p])
    -
    [docs]def PrefectMeasureErrorModel(self, decoherence_rate: Optional[float] = 0, **kwargs): +
    [docs]def DissipationError(self, p: Optional[float] = 0, **kwargs): """ - The default error model for measuring this qubit. + The dissipation error model. Args: - decoherence_rate (float): the decoherence rate - """ - pass
    - - -
    [docs]def DephaseMeasureErrorModel(self, decoherence_rate: Optional[float] = 0, **kwargs): - """ - The dephase error model for measuring this qubit, - A random Z gate will be operate on the qubit with possibility: 1-e^(-decoherence_rate) - - Args: - decoherence_rate (float): the decoherence rate - """ - if decoherence_rate < 0: - raise Exception("Error decoherence rate, should be positive") - p = 1 - np.exp(-decoherence_rate) - self.stochastic_operate([I, Z], [1-p, p])
    - - -
    [docs]def DepolarMeasureErrorModel(self, decoherence_rate: Optional[float] = 0, **kwargs): - """ - The depolar error model for measuring on a qubit. - - One of the random Pauli gate will be operate on the qubit with possibility: - 1-e^(-decoherence_rate * t) - - Args: - decoherence_rate (float): the decoherence rate + p (float): the error possibility, [0, 1] kwargs: other parameters """ - if decoherence_rate < 0: - raise Exception("Error decoherence rate, should be positive") - p = 1 - np.exp(-decoherence_rate) - if 1-3*p > 0: - self.stochastic_operate([I, X, Y, Z], [1-3*p, p, p, p]) - else: - self.stochastic_operate([X, Y, Z], [1/3, 1/3, 1/3])
    + if p < 0 or p > 1: + raise Exception("Error decoherence rate, should be in [0, 1]") + real_p = get_rand() + if real_p < p: + self.measure() + self.state = QState([self], state=QUBIT_STATE_0)
    + + +
    [docs]def ErrorWithTime(ErrorModel): + """generate the error. The error possibility is 1-e^{-decoherence_rate * t}""" + def GeneratedErrorWithTime(self, t: Optional[float] = 0, decoherence_rate: Optional[float] = 0, **kwargs): + """ + The error model with time for this qubit. The error possibility is 1-e^{-decoherence_rate * t}. + + Args: + t (float): the during time in second. + decoherence_rate (float): the decoherence rate. + """ + p = 1 - np.exp(-decoherence_rate * t) + ErrorModel(self, p, **kwargs) + return GeneratedErrorWithTime
    + + +
    [docs]def ErrorWithLength(ErrorModel): + """generate the error. The error possibility is 1-e^{-decoherence_rate * length}""" + def GeneratedErrorWithLength(self, length: Optional[float] = 0, decoherence_rate: Optional[float] = 0, **kwargs): + """ + The error model with length for this qubit. The error possibility is 1-e^{-decoherence_rate * length}. + + Args: + length (float): the transmission length in meter. + decoherence_rate (float): the decoherence rate. + """ + p = 1 - np.exp(-decoherence_rate * length) + ErrorModel(self, p, **kwargs) + return GeneratedErrorWithLength
    + + +PrefectStorageErrorModel = ErrorWithTime(PrefectError) +PrefectTransferErrorModel = ErrorWithLength(PrefectError) +PrefectOperateErrorModel = PrefectError +PrefectMeasureErrorModel = PrefectError + +DephaseStorageErrorModel = ErrorWithTime(DephaseError) +DephaseTransferErrorModel = ErrorWithLength(DephaseError) +DephaseOperateErrorModel = DephaseError +DephaseMeasureErrorModel = DephaseError + +DepolarStorageErrorModel = ErrorWithTime(DepolarError) +DepolarTransferErrorModel = ErrorWithLength(DepolarError) +DepolarOperateErrorModel = DepolarError +DepolarMeasureErrorModel = DepolarError + +BitFlipStorageErrorModel = ErrorWithTime(BitFlipError) +BitFilpTransferErrorModel = ErrorWithLength(BitFlipError) +BitFlipOperateErrorModel = BitFlipError +BitFlipMeasureErrorModel = BitFlipError + +DissipationStorageErrorModel = ErrorWithTime(DissipationError) +DissipationTransferErrorModel = ErrorWithLength(DissipationError) +DissipationOperateErrorModel = DissipationError +DissipationMeasureErrorModel = DissipationError
    diff --git a/docs/build/html/_modules/qns/models/qubit/factory.html b/docs/build/html/_modules/qns/models/qubit/factory.html index cf20849..e1d2ab7 100644 --- a/docs/build/html/_modules/qns/models/qubit/factory.html +++ b/docs/build/html/_modules/qns/models/qubit/factory.html @@ -40,7 +40,7 @@
  • Install Guide
  • Tutorials
  • Develop Guide
  • -
  • API Reference
  • +
  • qns
  • @@ -90,12 +90,12 @@

    Source code for qns.models.qubit.factory

     from typing import Optional
     import numpy as np
     from qns.models.qubit.const import QUBIT_STATE_0
    -from qns.models.qubit.decoherence import PrefectMeasureErrorModel, PrefectOperateErrorModel, PrefectStorageErrorModel,\
    +from qns.models.qubit.decoherence import PrefectMeasureErrorModel, PrefectOperateErrorModel, PrefectStorageErrorModel, \
             PrefectTransferErrorModel
     from qns.models.qubit.qubit import Qubit
     
     
    -
    [docs]class QubitFactory(): +
    [docs]class QubitFactory(): """ QubitFactory is the factory class for building qubits with special error models. """ diff --git a/docs/build/html/_modules/qns/models/qubit/gate.html b/docs/build/html/_modules/qns/models/qubit/gate.html index 4af862b..3fe4c96 100644 --- a/docs/build/html/_modules/qns/models/qubit/gate.html +++ b/docs/build/html/_modules/qns/models/qubit/gate.html @@ -87,13 +87,13 @@

    Source code for qns.models.qubit.gate

     
     from typing import Any, Optional
     import numpy as np
    -from qns.models.qubit.const import OPERATOR_HADAMARD, OPERATOR_PAULI_I,\
    +from qns.models.qubit.const import OPERATOR_HADAMARD, OPERATOR_PAULI_I, \
                                        OPERATOR_PAULI_X, OPERATOR_PAULI_Y, \
    -                                   OPERATOR_PAULI_Z, OPERATOR_PHASE_SHIFT,\
    -                                   OPERATOR_RX, OPERATOR_RY, OPERATOR_RZ,\
    +                                   OPERATOR_PAULI_Z, OPERATOR_PHASE_SHIFT, \
    +                                   OPERATOR_RX, OPERATOR_RY, OPERATOR_RZ, \
                                        OPERATOR_S, OPERATOR_T
     from qns.models.qubit.qubit import Qubit
    -from qns.models.qubit.utils import joint
    +from qns.models.qubit.utils import kron, joint
     from qns.models.qubit.errors import QGateOperatorNotMatchError, QGateQubitNotInStateError
     
     
    @@ -240,14 +240,14 @@ 

    Source code for qns.models.qubit.gate

     
             for i in range(state.num):
                 if i == idx1:
    -                full_operator_part_0 = np.kron(full_operator_part_0, np.array([[1, 0], [0, 0]]))
    -                full_operator_part_1 = np.kron(full_operator_part_1, np.array([[0, 0], [0, 1]]))
    +                full_operator_part_0 = kron(full_operator_part_0, np.array([[1, 0], [0, 0]]))
    +                full_operator_part_1 = kron(full_operator_part_1, np.array([[0, 0], [0, 1]]))
                 elif i == idx2:
    -                full_operator_part_0 = np.kron(full_operator_part_0, OPERATOR_PAULI_I)
    -                full_operator_part_1 = np.kron(full_operator_part_1, operator)
    +                full_operator_part_0 = kron(full_operator_part_0, OPERATOR_PAULI_I)
    +                full_operator_part_1 = kron(full_operator_part_1, operator)
                 else:
    -                full_operator_part_0 = np.kron(full_operator_part_0, OPERATOR_PAULI_I)
    -                full_operator_part_1 = np.kron(full_operator_part_1, OPERATOR_PAULI_I)
    +                full_operator_part_0 = kron(full_operator_part_0, OPERATOR_PAULI_I)
    +                full_operator_part_1 = kron(full_operator_part_1, OPERATOR_PAULI_I)
             full_operator = full_operator_part_0 + full_operator_part_1
             qubit1.state.operate(full_operator)
    @@ -351,25 +351,25 @@

    Source code for qns.models.qubit.gate

     
             for i in range(state.num):
                 if i == idx1:
    -                full_operator_part_00 = np.kron(full_operator_part_00, np.array([[1, 0], [0, 0]]))
    -                full_operator_part_01 = np.kron(full_operator_part_01, np.array([[1, 0], [0, 0]]))
    -                full_operator_part_10 = np.kron(full_operator_part_10, np.array([[0, 0], [0, 1]]))
    -                full_operator_part_11 = np.kron(full_operator_part_11, np.array([[0, 0], [0, 1]]))
    +                full_operator_part_00 = kron(full_operator_part_00, np.array([[1, 0], [0, 0]]))
    +                full_operator_part_01 = kron(full_operator_part_01, np.array([[1, 0], [0, 0]]))
    +                full_operator_part_10 = kron(full_operator_part_10, np.array([[0, 0], [0, 1]]))
    +                full_operator_part_11 = kron(full_operator_part_11, np.array([[0, 0], [0, 1]]))
                 elif i == idx2:
    -                full_operator_part_00 = np.kron(full_operator_part_00, np.array([[1, 0], [0, 0]]))
    -                full_operator_part_10 = np.kron(full_operator_part_10, np.array([[1, 0], [0, 0]]))
    -                full_operator_part_01 = np.kron(full_operator_part_01, np.array([[0, 0], [0, 1]]))
    -                full_operator_part_11 = np.kron(full_operator_part_11, np.array([[0, 0], [0, 1]]))
    +                full_operator_part_00 = kron(full_operator_part_00, np.array([[1, 0], [0, 0]]))
    +                full_operator_part_10 = kron(full_operator_part_10, np.array([[1, 0], [0, 0]]))
    +                full_operator_part_01 = kron(full_operator_part_01, np.array([[0, 0], [0, 1]]))
    +                full_operator_part_11 = kron(full_operator_part_11, np.array([[0, 0], [0, 1]]))
                 elif i == idx3:
    -                full_operator_part_00 = np.kron(full_operator_part_00, OPERATOR_PAULI_I)
    -                full_operator_part_01 = np.kron(full_operator_part_01, OPERATOR_PAULI_I)
    -                full_operator_part_10 = np.kron(full_operator_part_10, OPERATOR_PAULI_I)
    -                full_operator_part_11 = np.kron(full_operator_part_11, operator)
    +                full_operator_part_00 = kron(full_operator_part_00, OPERATOR_PAULI_I)
    +                full_operator_part_01 = kron(full_operator_part_01, OPERATOR_PAULI_I)
    +                full_operator_part_10 = kron(full_operator_part_10, OPERATOR_PAULI_I)
    +                full_operator_part_11 = kron(full_operator_part_11, operator)
                 else:
    -                full_operator_part_00 = np.kron(full_operator_part_00, OPERATOR_PAULI_I)
    -                full_operator_part_01 = np.kron(full_operator_part_01, OPERATOR_PAULI_I)
    -                full_operator_part_10 = np.kron(full_operator_part_10, OPERATOR_PAULI_I)
    -                full_operator_part_11 = np.kron(full_operator_part_11, OPERATOR_PAULI_I)
    +                full_operator_part_00 = kron(full_operator_part_00, OPERATOR_PAULI_I)
    +                full_operator_part_01 = kron(full_operator_part_01, OPERATOR_PAULI_I)
    +                full_operator_part_10 = kron(full_operator_part_10, OPERATOR_PAULI_I)
    +                full_operator_part_11 = kron(full_operator_part_11, OPERATOR_PAULI_I)
             full_operator = full_operator_part_00 + full_operator_part_01 + full_operator_part_10 + full_operator_part_11
             qubit1.state.operate(full_operator)
    diff --git a/docs/build/html/_modules/qns/models/qubit/qubit.html b/docs/build/html/_modules/qns/models/qubit/qubit.html index 3820d4b..8dbc652 100644 --- a/docs/build/html/_modules/qns/models/qubit/qubit.html +++ b/docs/build/html/_modules/qns/models/qubit/qubit.html @@ -88,11 +88,11 @@

    Source code for qns.models.qubit.qubit

     from typing import Any, List, Optional
     import numpy as np
     
    -from qns.models.qubit.const import QUBIT_STATE_0, QUBIT_STATE_1,\
    +from qns.models.qubit.const import QUBIT_STATE_0, QUBIT_STATE_1, \
             QUBIT_STATE_P, QUBIT_STATE_N, QUBIT_STATE_L, QUBIT_STATE_R
    -from qns.models.qubit.utils import single_gate_expand, partial_trace
    +from qns.models.qubit.utils import single_gate_expand, partial_trace, kron
     from qns.models.core.backend import QuantumModel
    -from qns.models.qubit.errors import QStateBaseError, QStateQubitNotInStateError,\
    +from qns.models.qubit.errors import QStateBaseError, QStateQubitNotInStateError, \
                                         QStateSizeNotMatchError, OperatorNotMatchError
     from qns.utils.rnd import get_rand
     
    @@ -124,7 +124,6 @@ 

    Source code for qns.models.qubit.qubit

                     raise QStateSizeNotMatchError
                 if abs(1 - rho.trace()) > 0.0000000001:
                     # trace = 1
    -                print(2333, 1 - rho.trace())
                     raise QStateSizeNotMatchError
                 self.rho = rho
     
    @@ -164,7 +163,7 @@ 

    Source code for qns.models.qubit.qubit

             try:
                 idx = self.qubits.index(qubit)
                 shift = self.num - idx - 1
    -            assert(shift >= 0)
    +            assert (shift >= 0)
             except AssertionError:
                 raise QStateQubitNotInStateError
     
    @@ -172,11 +171,11 @@ 

    Source code for qns.models.qubit.qubit

             Full_M_1 = np.array([[1]])
             for i in range(self.num):
                 if i == idx:
    -                Full_M_0 = np.kron(Full_M_0, M_0)
    -                Full_M_1 = np.kron(Full_M_1, M_1)
    +                Full_M_0 = kron(Full_M_0, M_0)
    +                Full_M_1 = kron(Full_M_1, M_1)
                 else:
    -                Full_M_0 = np.kron(Full_M_0, np.array([[1, 0], [0, 1]]))
    -                Full_M_1 = np.kron(Full_M_1, np.array([[1, 0], [0, 1]]))
    +                Full_M_0 = kron(Full_M_0, np.array([[1, 0], [0, 1]]))
    +                Full_M_1 = kron(Full_M_1, np.array([[1, 0], [0, 1]]))
     
             poss_0 = np.trace(np.dot(Full_M_0.T.conjugate(), np.dot(Full_M_0, self.rho)))
             rn = get_rand()
    diff --git a/docs/build/html/_modules/qns/models/qubit/utils.html b/docs/build/html/_modules/qns/models/qubit/utils.html
    index 26dbd47..ae26311 100644
    --- a/docs/build/html/_modules/qns/models/qubit/utils.html
    +++ b/docs/build/html/_modules/qns/models/qubit/utils.html
    @@ -90,6 +90,14 @@ 

    Source code for qns.models.qubit.utils

     from qns.models.qubit.errors import QGateStateJointError, OperatorError
     
     
    +
    [docs]def kron(a: np.ndarray, b: np.ndarray) -> np.ndarray: + if a.shape == (1,): + a = a.reshape((1, 1)) + if b.shape == (1,): + b = b.reshape((1, 1)) + return (a[:, None, :, None]*b[None, :, None, :]).reshape(a.shape[0]*b.shape[0], a.shape[1]*b.shape[1])
    + +
    [docs]def single_gate_expand(qubit, operator: np.ndarray) -> np.ndarray: state = qubit.state if operator.shape != (2, 2): @@ -103,9 +111,9 @@

    Source code for qns.models.qubit.utils

         full_operator = np.array([1])
         for i in range(state.num):
             if i == idx:
    -            full_operator = np.kron(full_operator, operator)
    +            full_operator = kron(full_operator, operator)
             else:
    -            full_operator = np.kron(full_operator, OPERATOR_PAULI_I)
    +            full_operator = kron(full_operator, OPERATOR_PAULI_I)
         return full_operator
    @@ -117,7 +125,7 @@

    Source code for qns.models.qubit.utils

     
         from qns.models.qubit.qubit import QState
         nq = QState(qubit1.state.qubits+qubit2.state.qubits,
    -                rho=np.kron(qubit1.state.rho, qubit2.state.rho))
    +                rho=kron(qubit1.state.rho, qubit2.state.rho))
         for q in nq.qubits:
             q.state = nq
    diff --git a/docs/build/html/_modules/qns/network/protocol/bb84.html b/docs/build/html/_modules/qns/network/protocol/bb84.html index 002be72..d72a31e 100644 --- a/docs/build/html/_modules/qns/network/protocol/bb84.html +++ b/docs/build/html/_modules/qns/network/protocol/bb84.html @@ -96,6 +96,8 @@

    Source code for qns.network.protocol.bb84

     from qns.models.qubit import Qubit
     
     import numpy as np
    +import random
    +import hashlib
     
     from qns.utils.rnd import get_rand, get_choice
     
    @@ -111,7 +113,28 @@ 

    Source code for qns.network.protocol.bb84

     
     
    [docs]class BB84SendApp(Application): def __init__(self, dest: QNode, qchannel: QuantumChannel, - cchannel: ClassicChannel, send_rate=1000): + cchannel: ClassicChannel, send_rate=1000, + min_length_for_post_processing=5000, + proportion_for_estimating_error=0.4, max_cascade_round=4, + cascade_alpha=0.73, cascade_beita=2, + init_lower_cascade_key_block_size=5, + init_upper_cascade_key_block_size=20, + security=0.05): + """ + Args: + dest: QNode. + qchannel: QuantumChannel. + cchannel: ClassicChannel. + send_rate: the sending rate of qubit. + min_length_for_post_processing: threshold to trigger post-processing. + proportion_for_estimating_error: what proportion of bits are used for error estimating. + max_cascade_round: how many rounds of cascade need to be executed. + cascade_alpha: init_cascade_size = cascade_alpha / error_rate. + cascade_beita: next_cascade_size = init_cascade_size * 2. + init_lower_cascade_key_block_size: lower bound of init_cascade_size. + init_upper_cascade_key_block_size: upper bound of init_cascade_size. + security: parameter for privacy amplification. + """ super().__init__() self.dest = dest self.qchannel = qchannel @@ -126,6 +149,27 @@

    Source code for qns.network.protocol.bb84

             self.succ_key_pool = {}
             self.fail_number = 0
     
    +        # variable used in cascade and error estimate
    +        self.min_length_for_post_processing = min_length_for_post_processing
    +        self.proportion_for_estimating_error = proportion_for_estimating_error
    +        self.max_cascade_round = max_cascade_round
    +        self.cascade_alpha = cascade_alpha
    +        self.cascade_beita = cascade_beita
    +        self.init_lower_cascade_key_block_size = init_lower_cascade_key_block_size
    +        self.init_upper_cascade_key_block_size = init_upper_cascade_key_block_size
    +
    +        self.using_post_processing = False
    +        self.cur_error_rate = 1e-6
    +        self.cur_cascade_round = 0
    +        self.cur_cascade_key_block_size = self.init_lower_cascade_key_block_size
    +        self.cascade_key = []
    +
    +        # variable used in privacy amplification
    +        self.security = security
    +
    +        self.bit_leak = 0
    +        self.successful_key = []
    +
             self.add_handler(self.handleClassicPacket, [RecvClassicPacket], [self.cchannel])
     
     
    [docs] def install(self, node: QNode, simulator: Simulator): @@ -145,11 +189,15 @@

    Source code for qns.network.protocol.bb84

             #     self._simulator.add_event(event)
     
     
    [docs] def handleClassicPacket(self, node: QNode, event: Event): - self.check_basis(event)
    + return self.check_basis(event) or self.recv_error_estimate_packet(event) or self.recv_cascade_ask_packet(event) or \ + self.recv_check_error_ask_packet(event) or self.recv_privacy_amplification_ask_packet(event)
    [docs] def check_basis(self, event: RecvClassicPacket): packet = event.packet msg: dict = packet.get() + packet_class = msg.get("packet_class") + if packet_class != "check_basis": + return False id = msg.get("id") basis_dest = msg.get("basis") @@ -163,9 +211,10 @@

    Source code for qns.network.protocol.bb84

                 # log.info(f"[{self._simulator.current_time}] src check {id} basis fail")
                 self.fail_number += 1
     
    -        packet = ClassicPacket(msg={"id": id, "basis": basis_src,
    +        packet = ClassicPacket(msg={"packet_class": "check_basis", "id": id, "basis": basis_src,
                                    "ret": self.measure_list[id]}, src=self._node, dest=self.dest)
    -        self.cchannel.send(packet, next_hop=self.dest)
    + self.cchannel.send(packet, next_hop=self.dest) + return True
    [docs] def send_qubit(self): @@ -193,11 +242,192 @@

    Source code for qns.network.protocol.bb84

             t = self._simulator.current_time + \
                 self._simulator.time(sec=1 / self.send_rate)
             event = func_to_event(t, self.send_qubit, by=self)
    -        self._simulator.add_event(event)
    + self._simulator.add_event(event)
    + +
    [docs] def recv_error_estimate_packet(self, event: RecvClassicPacket): + """ + BB84SendApp recv error estimate packet,and send error_estimate_reply packet. + + Args: + event:the error estimate packet. + """ + packet = event.packet + msg: dict = packet.get() + packet_class = msg.get("packet_class") + if packet_class != "error_estimate": + return False + + self.using_post_processing = True + self.cur_error_rate = 1e-6 + self.cur_cascade_round = 0 + self.cur_cascade_key_block_size = self.init_lower_cascade_key_block_size + self.cascade_key = [] + self.bit_leak = 0 + + # get some recvapp error estimate info + recv_app_bit_for_estimate = msg.get("bit_for_estimate") + recv_app_bit_index_for_estimate = msg.get("bit_index_for_estimate") + recv_app_bit_index_for_cascade = msg.get("bit_index_for_cascade") + keys = list(self.succ_key_pool.keys()) + error_in_estimate = 0 + real_bit_length_for_estimate = 0 + real_bit_index_for_cascade = [] + + # get cascade_key and count errors + for i in keys: + item_temp = self.succ_key_pool.pop(i) + if i in recv_app_bit_index_for_estimate: + # find a bit to estimate error + bit_index = recv_app_bit_index_for_estimate.index(i) + if item_temp == recv_app_bit_for_estimate[bit_index]: + real_bit_length_for_estimate += 1 + else: + real_bit_length_for_estimate += 1 + error_in_estimate += 1 + elif i in recv_app_bit_index_for_cascade: + # find a bit for cascade + self.cascade_key.append(item_temp) + real_bit_index_for_cascade.append(i) + + # error estimate and set key block size in round1 + self.cur_error_rate = error_in_estimate/real_bit_length_for_estimate + + if self.cur_error_rate <= (self.cascade_alpha/self.init_upper_cascade_key_block_size): + # error rate is smaller than threshold + self.cur_cascade_key_block_size = self.init_upper_cascade_key_block_size + elif self.cur_error_rate >= (self.cascade_alpha/self.init_lower_cascade_key_block_size): + self.cur_cascade_key_block_size = self.init_lower_cascade_key_block_size + else: + self.cur_cascade_key_block_size = int(self.cascade_alpha/self.cur_error_rate) + + self.cur_cascade_round = 1 + + # send error_estimate_reply packet + packet = ClassicPacket(msg={"packet_class": "error_estimate_reply", + "error_rate": self.cur_error_rate, + "real_bit_index_for_cascade": real_bit_index_for_cascade}, + src=self._node, + dest=self.dest) + self.cchannel.send(packet, next_hop=self.dest) + return True
    + +
    [docs] def recv_cascade_ask_packet(self, event: RecvClassicPacket): + """ + BB84SendApp recv cascade_ask packet,calculate the parity value of the corresponding block,and send cascade_reply packet. + + Args: + event:the cascade_ask packet. + """ + packet = event.packet + msg: dict = packet.get() + packet_class = msg.get("packet_class") + if packet_class != "cascade_ask": + return False + + # get cascade_ask info + parity_request = msg.get("parity_request") + round_change_flag = msg.get("round_change_flag") + shuffle_index = msg.get("shuffle_index") + + # cascade round change and shuffle cascade keys + if round_change_flag is True and shuffle_index != []: + self.cur_cascade_key_block_size = int(self.cur_cascade_key_block_size * self.cascade_beita) + self.cur_cascade_round += 1 + self.cascade_key = [self.cascade_key[i] for i in shuffle_index] + + parity_answer = [] + for key_interval in parity_request: + temp_parity = cascade_parity(self.cascade_key[key_interval[0]:key_interval[1]+1]) + parity_answer.append(temp_parity) + + self.bit_leak += len(parity_answer) + + # send cascade_reply packet + packet = ClassicPacket(msg={"packet_class": "cascade_reply", + "parity_answer": parity_answer}, + src=self._node, dest=self.dest) + self.cchannel.send(packet, next_hop=self.dest) + return True
    + +
    [docs] def recv_check_error_ask_packet(self, event: RecvClassicPacket): + """ + BB84SendApp recv check_error_ask packet,check error,and send check_error_reply packet. + + Args: + event:the check_error_ask packet. + """ + packet = event.packet + msg: dict = packet.get() + packet_class = msg.get("packet_class") + if packet_class != "check_error_ask": + return False + + recv_hash_key = msg.get("hash_key") + hash_key = hashlib.sha512(bytearray(self.cascade_key)).hexdigest() + if hash_key != recv_hash_key: + # cascade fail + pa_flag = False + packet = ClassicPacket(msg={"packet_class": "check_error_reply", + "pa_flag": pa_flag}, + src=self._node, dest=self.dest) + else: + # cascade succeed + pa_flag = True + packet = ClassicPacket(msg={"packet_class": "check_error_reply", + "pa_flag": pa_flag}, + src=self._node, dest=self.dest) + self.cchannel.send(packet, next_hop=self.dest) + return True
    + +
    [docs] def recv_privacy_amplification_ask_packet(self, event: RecvClassicPacket): + """ + BB84SendApp recv privacy_amplification_ask packet,perform privacy amplification. + + Args: + event:the privacy_amplification_ask packet. + """ + packet = event.packet + msg: dict = packet.get() + packet_class = msg.get("packet_class") + if packet_class != "privacy_amplification_ask": + return False + pa_flag = msg.get("pa_flag") + if pa_flag is True: + # Alice's privacy amplification operation + first_row = msg.get("first_row") + first_col = msg.get("first_col") + matrix_row = len(first_row) + matrix_col = len(first_col)+1 + toeplitz_matrix = pa_generate_toeplitz_matrix(matrix_row, matrix_col, first_row, first_col) + self.successful_key += list(pa_randomize_key(self.cascade_key, toeplitz_matrix)) + self.using_post_processing = False + # validation output + return True
    [docs]class BB84RecvApp(Application): - def __init__(self, src: QNode, qchannel: QuantumChannel, cchannel: ClassicChannel): + def __init__(self, src: QNode, qchannel: QuantumChannel, cchannel: ClassicChannel, + min_length_for_post_processing=5000, + proportion_for_estimating_error=0.4, max_cascade_round=4, + cascade_alpha=0.73, cascade_beita=2, + init_lower_cascade_key_block_size=5, + init_upper_cascade_key_block_size=20, + security=0.05): + """ + Args: + src: QNode. + qchannel: QuantumChannel. + cchannel: ClassicChannel. + send_rate: the sending rate of qubit. + min_length_for_post_processing: threshold to trigger post-processing. + proportion_for_estimating_error: what proportion of bits are used for error estimating. + max_cascade_round: how many rounds of cascade need to be executed. + cascade_alpha: init_cascade_size = cascade_alpha / error_rate. + cascade_beita: next_cascade_size = init_cascade_size * 2. + init_lower_cascade_key_block_size: lower bound of init_cascade_size. + init_upper_cascade_key_block_size: upper bound of init_cascade_size. + security: parameter for privacy amplification. + """ super().__init__() self.src = src self.qchannel = qchannel @@ -210,6 +440,29 @@

    Source code for qns.network.protocol.bb84

             self.succ_key_pool = {}
             self.fail_number = 0
     
    +        # variable used in cascade and error estimate
    +        self.min_length_for_post_processing = min_length_for_post_processing
    +        self.proportion_for_estimating_error = proportion_for_estimating_error
    +        self.max_cascade_round = max_cascade_round
    +        self.cascade_alpha = cascade_alpha
    +        self.cascade_beita = cascade_beita
    +        self.init_lower_cascade_key_block_size = init_lower_cascade_key_block_size
    +        self.init_upper_cascade_key_block_size = init_upper_cascade_key_block_size
    +
    +        self.using_post_processing = False
    +        self.cur_error_rate = 1e-6
    +        self.cur_cascade_round = 0
    +        self.cur_cascade_key_block_size = self.init_lower_cascade_key_block_size
    +        self.post_processing_key = {}
    +        self.cascade_key = []
    +        self.cascade_binary_set = []
    +
    +        # variable used in privacy amplification
    +        self.security = security
    +
    +        self.bit_leak = 0
    +        self.successful_key = []
    +
             self.add_handler(self.handleQuantumPacket, [RecvQubitPacket], [self.qchannel])
             self.add_handler(self.handleClassicPacket, [RecvClassicPacket], [self.cchannel])
     
    @@ -217,11 +470,15 @@ 

    Source code for qns.network.protocol.bb84

             return self.recv(event)
    [docs] def handleClassicPacket(self, node: QNode, event: Event): - return self.check_basis(event)
    + return self.check_basis(event) or self.recv_error_estimate_reply_packet(event) or \ + self.recv_cascade_reply_packet(event) or self.recv_check_error_reply_packet(event)
    [docs] def check_basis(self, event: RecvClassicPacket): packet = event.packet msg: dict = packet.get() + packet_class = msg.get("packet_class") + if packet_class != "check_basis": + return False id = msg.get("id") basis_src = msg.get("basis") @@ -236,7 +493,12 @@

    Source code for qns.network.protocol.bb84

                 self.succ_key_pool[id] = self.measure_list[id]
             else:
                 # log.info(f"[{self._simulator.current_time}] dest check {id} basis fail")
    -            self.fail_number += 1
    + self.fail_number += 1 + + if self.using_post_processing is False and len(self.succ_key_pool) >= self.min_length_for_post_processing: + # enough raw key to start cascade + self.send_error_estimate_packet() + return True
    [docs] def recv(self, event: RecvQubitPacket): qubit: Qubit = event.qubit @@ -251,8 +513,295 @@

    Source code for qns.network.protocol.bb84

             # log.info(f"[{self._simulator.current_time}] recv qubit {qubit.id}, \
             # basis: {basis_msg}, ret: {ret}")
             packet = ClassicPacket(
    -            msg={"id": qubit.id, "basis": basis_msg}, src=self._node, dest=self.src)
    -        self.cchannel.send(packet, next_hop=self.src)
    + msg={"packet_class": "check_basis", "id": qubit.id, "basis": basis_msg}, src=self._node, dest=self.src) + self.cchannel.send(packet, next_hop=self.src)
    + +
    [docs] def send_error_estimate_packet(self): + """ + BB84Recvapp send error estimate ask packet. + """ + self.using_post_processing = True + self.cur_cascade_round = 0 + self.cur_error_rate = 1e-6 + self.cur_cascade_key_block_size = self.init_lower_cascade_key_block_size + self.cascade_key = [] + self.post_processing_key = {} + self.cascade_binary_set = [] + self.bit_leak = 0 + + # info to send + bit_for_estimate = {} # [] + bits_len_for_cascade = len(self.succ_key_pool) + keys = list(self.succ_key_pool.keys())[0:bits_len_for_cascade] + + # remove uesd raw key and update cascade_key && bit_for_estimate + for i in keys: + item_temp = self.succ_key_pool.pop(i) + if random.uniform(0, 1) < self.proportion_for_estimating_error: + bit_for_estimate[i] = item_temp + else: + self.post_processing_key[i] = item_temp + + # send error_estimate packet + packet = ClassicPacket(msg={"packet_class": "error_estimate", + "bit_index_for_estimate": list(bit_for_estimate.keys()), + "bit_for_estimate": list(bit_for_estimate.values()), + "bit_index_for_cascade": list(self.post_processing_key.keys())}, + src=self._node, dest=self.src) + self.cchannel.send(packet, next_hop=self.src)
    + +
    [docs] def recv_error_estimate_reply_packet(self, event: RecvClassicPacket): + """ + BB84RecvApp recv error_estimate_reply packet,perform the first round of cascade,send cascade_ask packet. + + Args: + event:the error_estimate_reply packet. + """ + packet = event.packet + msg: dict = packet.get() + packet_class = msg.get("packet_class") + if packet_class != "error_estimate_reply": + return False + + # get error estimate info and set block size in round1 + self.cur_error_rate = msg.get("error_rate") + if self.cur_error_rate <= (self.cascade_alpha/self.init_upper_cascade_key_block_size): + # error rate is smaller than threshold + self.cur_cascade_key_block_size = self.init_upper_cascade_key_block_size + elif self.cur_error_rate >= (self.cascade_alpha/self.init_lower_cascade_key_block_size): + # error rate is bigger than threshold + self.cur_cascade_key_block_size = self.init_lower_cascade_key_block_size + else: + self.cur_cascade_key_block_size = int(self.cascade_alpha/self.cur_error_rate) + + self.cur_cascade_round = 1 + + # remain real_bit_for_cascade + real_bit_index_for_cascade = msg.get("real_bit_index_for_cascade") + for i in list(self.post_processing_key.keys()): + item_temp = self.post_processing_key.pop(i) + if i in real_bit_index_for_cascade: + self.cascade_key.append(item_temp) + + # start cascade round1,divide into top blocks of size self.keysize + count_temp = 0 + last_index = len(self.cascade_key) - 1 + while count_temp <= last_index: + end = count_temp + self.cur_cascade_key_block_size - 1 + if end <= last_index: + self.cascade_binary_set.append((count_temp, end)) + count_temp = end + 1 + else: + end = last_index + self.cascade_binary_set.append((count_temp, end)) + break + + # send cascade_ask packet + packet = ClassicPacket(msg={"packet_class": "cascade_ask", + "parity_request": self.cascade_binary_set, + "round_change_flag": False, + "shuffle_index": []}, + src=self._node, dest=self.src) + self.cchannel.send(packet, next_hop=self.src) + + return True
    + +
    [docs] def recv_cascade_reply_packet(self, event: RecvClassicPacket): + """ + BB84RecvApp recv cascade_reply packet,perform next round of cascade,and send cascade_ask packet. + + Args: + event:the cascade_reply packet. + """ + packet = event.packet + msg: dict = packet.get() + packet_class = msg.get("packet_class") + if packet_class != "cascade_reply": + return False + + # get cascade_reply info + parity_answer = msg.get("parity_answer") + self.bit_leak += len(parity_answer) + + # update cascade binary set + count_temp = 0 + # traverse all the blocks need to compare parity + copy_cascade_binary_set = self.cascade_binary_set.copy() + for key_interval in copy_cascade_binary_set: + temp_parity = cascade_parity(self.cascade_key[key_interval[0]:key_interval[1]+1]) + if temp_parity == parity_answer[count_temp]: + # this block have even errors,can not correct in this round + self.cascade_binary_set.remove(key_interval) + elif key_interval[0] != key_interval[1]: + # binary alg + self.cascade_binary_set.remove(key_interval) + left_temp, right_temp = cascade_binary_divide(key_interval[0], key_interval[1]) + self.cascade_binary_set.append(left_temp) + self.cascade_binary_set.append(right_temp) + else: + # find the odd error + self.cascade_binary_set.remove(key_interval) + self.cascade_key[key_interval[0]] = parity_answer[count_temp] + + count_temp += 1 + + round_change_flag = False + check_error_flag = False + shuffle_index = [] + if len(self.cascade_binary_set) == 0: + if self.cur_cascade_round == self.max_cascade_round: + # update round info + check_error_flag = True + # check error + hash_key = hashlib.sha512(bytearray(self.cascade_key)).hexdigest() + else: + # update round info + round_change_flag = True + self.cur_cascade_round += 1 + self.cur_cascade_key_block_size = int(self.cur_cascade_key_block_size * self.cascade_beita) + # need shuffle + shuffle_index = [i for i in range(len(self.cascade_key))] + shuffle_index = cascade_key_shuffle(shuffle_index) + self.cascade_key = [self.cascade_key[i] for i in shuffle_index] + # divide into top blocks of size self.keysize + count_temp = 0 + last_index = len(self.cascade_key) - 1 + while count_temp <= last_index: + end = count_temp + self.cur_cascade_key_block_size - 1 + if end <= last_index: + self.cascade_binary_set.append((count_temp, end)) + count_temp = end + 1 + else: + end = last_index + self.cascade_binary_set.append((count_temp, end)) + break + + # send cascade_ask packet,distinguish whether privacy amplification is required + if check_error_flag is False: + packet = ClassicPacket(msg={"packet_class": "cascade_ask", + "parity_request": self.cascade_binary_set, + "round_change_flag": round_change_flag, + "shuffle_index": shuffle_index}, + src=self._node, dest=self.src) + else: + # check error + packet = ClassicPacket(msg={"packet_class": "check_error_ask", + "hash_key": hash_key}, + src=self._node, dest=self.src) + self.cchannel.send(packet, next_hop=self.src) + return True
    + +
    [docs] def recv_check_error_reply_packet(self, event: RecvClassicPacket): + """ + BB84RecvApp recv check_error_reply packet,perform privacy amplification,and send privacy_amplification_ask packet. + + Args: + event:the check_error_reply packet. + """ + packet = event.packet + msg: dict = packet.get() + packet_class = msg.get("packet_class") + if packet_class != "check_error_reply": + return False + pa_flag = msg.get("pa_flag") + if pa_flag is True: + # check error succeed,Bob's privacy amplification operation + matrix_row = len(self.cascade_key) + matrix_col = (1-self.security)*len(self.cascade_key)-self.bit_leak + first_row = [random.randint(0, 1) for _ in range(matrix_row)] + first_col = [random.randint(0, 1) for _ in range(int(matrix_col)-1)] + toeplitz_matrix = pa_generate_toeplitz_matrix(matrix_row, matrix_col, first_row, first_col) + self.successful_key += list(pa_randomize_key(self.cascade_key, toeplitz_matrix)) + packet = ClassicPacket(msg={"packet_class": "privacy_amplification_ask", + "pa_flag": True, + "first_row": first_row, + "first_col": first_col}, + src=self._node, dest=self.src) + self.using_post_processing = False + else: + # check error fail,drop + first_row = [] + first_col = [] + packet = ClassicPacket(msg={"packet_class": "privacy_amplification_ask", + "pa_flag": False, + "first_row": first_row, + "first_col": first_col}, + src=self._node, dest=self.src) + self.using_post_processing = False + self.cchannel.send(packet, next_hop=self.src) + return True
    + + +
    [docs]def cascade_parity(target: list): + """ + Calculate key block parity. + + Args: + target:target key block. + """ + count = sum(target) + return count % 2
    + + +
    [docs]def cascade_binary_divide(begin: int, end: int): + """ + Evenly divided the key block. + + Args: + begin: key block begin index. + end: key block end index. + """ + len = end - begin + 1 + if len % 2 == 1: + middle = int(len/2) + begin + else: + middle = int(len/2) + begin - 1 + return (begin, middle), (middle+1, end)
    + + +
    [docs]def cascade_key_shuffle(index: list): + """ + Shuffle the index. + + Args: + index: the index list. + """ + np.random.shuffle(index) + return index
    + + +
    [docs]def pa_generate_toeplitz_matrix(N: int, M: int, first_row: list, first_col: list): + """ + Generate a Toeplitz matrix of size N x M using two given list of binary values. + + Args: + N:col num of the Toeplitz matrix. + M:row num of the Toeplitz matrix. + first_row:first row of the Toeplitz matrix. + first_col:first col of the Toeplitz matrix. + """ + N = int(N) + M = int(M) + toeplitz_matrix = [[0] * N for _ in range(M)] + for i in range(N): + toeplitz_matrix[0][i] = first_row[i] + for i in range(M-1): + toeplitz_matrix[i+1][0] = first_col[i] + for i in range(1, M): + for j in range(1, N): + toeplitz_matrix[i][j] = toeplitz_matrix[i-1][j-1] + return toeplitz_matrix
    + + +
    [docs]def pa_randomize_key(original_key: list, toeplitz_matrix): + """ + process the original key through the toeplitz matrix. + + Args: + original_key: the original key. + toeplitz_matrix: the toeplitz matrix. + """ + return np.dot(toeplitz_matrix, original_key) % 2
    diff --git a/docs/build/html/_modules/qns/network/protocol/classicforward.html b/docs/build/html/_modules/qns/network/protocol/classicforward.html index 0b7153f..b630a33 100644 --- a/docs/build/html/_modules/qns/network/protocol/classicforward.html +++ b/docs/build/html/_modules/qns/network/protocol/classicforward.html @@ -40,7 +40,7 @@
  • Install Guide
  • Tutorials
  • Develop Guide
  • -
  • API Reference
  • +
  • qns
  • @@ -94,7 +94,7 @@

    Source code for qns.network.protocol.classicforward

    from qns.simulator.event import Event -
    [docs]class ClassicPacketForwardApp(Application): +
    [docs]class ClassicPacketForwardApp(Application): """ This application will generate routing table for classic networks and allow nodes to forward classic packats to the destination. @@ -109,10 +109,10 @@

    Source code for qns.network.protocol.classicforward

    self.route = route self.add_handler(self.handleClassicPacket, [RecvClassicPacket], []) -
    [docs] def install(self, node: QNode, simulator: Simulator): +
    [docs] def install(self, node: QNode, simulator: Simulator): super().install(node, simulator)
    -
    [docs] def handleClassicPacket(self, node: QNode, event: Event): +
    [docs] def handleClassicPacket(self, node: QNode, event: Event): packet = event.packet self_node: QNode = self.get_node() diff --git a/docs/build/html/_modules/qns/network/protocol/entanglement_distribution.html b/docs/build/html/_modules/qns/network/protocol/entanglement_distribution.html index 3740b89..9153e55 100644 --- a/docs/build/html/_modules/qns/network/protocol/entanglement_distribution.html +++ b/docs/build/html/_modules/qns/network/protocol/entanglement_distribution.html @@ -118,7 +118,7 @@

    Source code for qns.network.protocol.entanglement_distribution

    [docs]class EntanglementDistributionApp(Application): - def __init__(self, send_rate: Optional[int] = None, init_fidelity: int = 0.99): + def __init__(self, send_rate: Optional[int] = None, init_fidelity: float = 0.99): super().__init__() self.init_fidelity = init_fidelity self.net: QuantumNetwork = None @@ -279,6 +279,18 @@

    Source code for qns.network.protocol.entanglement_distribution

    transmit.first_epr_name) second_epr: WernerStateEntanglement = self.memory.read( transmit.second_epr_name) + #change code + #Check fidelitu before swapping + if first_epr.fidelity < 0.7 or second_epr.fidelity < 0.7: + #Inroduce probability of decoherence based on fidelity + print("test") + decoherence_probability = 1 - min(first_epr.fidelity, second_epr.fidelity) / 0.7 + if get_rand() < decoherence_probability: + log.debug(f"{self.own}:Decoherence occurred, revoking entanglement.") + self.revoke_entanglement(transmit, from_node, cchannel) + self.restart_request(transmit) + return + # new_epr = first_epr.swapping(second_epr, name=uuid.uuid4().hex) log.debug( f"{self.own}:perform swap use {first_epr} and {second_epr}") diff --git a/docs/build/html/_modules/qns/network/protocol/node_process_delay.html b/docs/build/html/_modules/qns/network/protocol/node_process_delay.html index 0a3d2b7..76d732e 100644 --- a/docs/build/html/_modules/qns/network/protocol/node_process_delay.html +++ b/docs/build/html/_modules/qns/network/protocol/node_process_delay.html @@ -40,7 +40,7 @@
  • Install Guide
  • Tutorials
  • Develop Guide
  • -
  • API Reference
  • +
  • qns
  • @@ -93,7 +93,7 @@

    Source code for qns.network.protocol.node_process_delay

    from qns.simulator.ts import Time -
    [docs]class NodeProcessDelayApp(Application): +
    [docs]class NodeProcessDelayApp(Application): """ This application will add an addition delay whenever the node received an event. It is used to represent the processing delay on quantum nodes. @@ -111,15 +111,15 @@

    Source code for qns.network.protocol.node_process_delay

    self.delay_event_list = delay_event_list self.wait_rehandle_event_list = [] -
    [docs] def install(self, node: QNode, simulator: Simulator): +
    [docs] def install(self, node: QNode, simulator: Simulator): super().install(node, simulator)
    -
    [docs] def check_in_delay_event_list(self, event) -> bool: +
    [docs] def check_in_delay_event_list(self, event) -> bool: if self.delay_event_list is None: return True return isinstance(event, self.delay_event_list)
    -
    [docs] def handle(self, node: QNode, event: Event) -> bool: +
    [docs] def handle(self, node: QNode, event: Event) -> bool: if not self.check_in_delay_event_list(event): return False diff --git a/docs/build/html/_modules/qns/network/requests.html b/docs/build/html/_modules/qns/network/requests.html index 5ceab53..754dc76 100644 --- a/docs/build/html/_modules/qns/network/requests.html +++ b/docs/build/html/_modules/qns/network/requests.html @@ -1,5 +1,5 @@ - + @@ -40,7 +40,7 @@
  • Install Guide
  • Tutorials
  • Develop Guide
  • -
  • API Reference
  • +
  • qns
  • diff --git a/docs/build/html/_modules/qns/network/route/dijkstra.html b/docs/build/html/_modules/qns/network/route/dijkstra.html index 13a4aef..2425e2a 100644 --- a/docs/build/html/_modules/qns/network/route/dijkstra.html +++ b/docs/build/html/_modules/qns/network/route/dijkstra.html @@ -1,5 +1,5 @@ - + @@ -40,7 +40,7 @@
  • Install Guide
  • Tutorials
  • Develop Guide
  • -
  • API Reference
  • +
  • qns
  • @@ -86,6 +86,7 @@

    Source code for qns.network.route.dijkstra

     #    along with this program.  If not, see <https://www.gnu.org/licenses/>.
     
     from typing import Callable, Dict, List, Tuple, Union
    +import math
     
     from qns.entity.node.node import QNode
     from qns.entity.qchannel.qchannel import QuantumChannel
    @@ -98,6 +99,8 @@ 

    Source code for qns.network.route.dijkstra

         This is the dijkstra route algorithm implement
         """
     
    +    INF = math.inf
    +
         def __init__(self, name: str = "dijkstra",
                      metric_func: Callable[[Union[QuantumChannel, ClassicChannel]], float] = None) -> None:
             """
    @@ -114,7 +117,6 @@ 

    Source code for qns.network.route.dijkstra

                 self.metric_func = metric_func
     
     
    [docs] def build(self, nodes: List[QNode], channels: List[Union[QuantumChannel, ClassicChannel]]): - INF = 999999 for n in nodes: selected = [] @@ -125,7 +127,7 @@

    Source code for qns.network.route.dijkstra

                     if nn == n:
                         d[n] = [0, []]
                     else:
    -                    d[nn] = [INF, [nn]]
    +                    d[nn] = [self.INF, [nn]]
     
                 while len(unselected) != 0:
                     ms = unselected[0]
    @@ -178,8 +180,9 @@ 

    Source code for qns.network.route.dijkstra

                 path: List[QNode] = le[1]
                 path = path.copy()
                 path.reverse()
    -            if len(path) <= 1:
    +            if len(path) <= 1 or metric == self.INF:
                     next_hop = None
    +                return []
                 else:
                     next_hop = path[1]
                     return [(metric, next_hop, path)]
    diff --git a/docs/build/html/_modules/qns/network/route/route.html b/docs/build/html/_modules/qns/network/route/route.html
    index 008f628..260068f 100644
    --- a/docs/build/html/_modules/qns/network/route/route.html
    +++ b/docs/build/html/_modules/qns/network/route/route.html
    @@ -1,5 +1,5 @@
     
    -
    +
     
       
       
    @@ -40,7 +40,7 @@
     
  • Install Guide
  • Tutorials
  • Develop Guide
  • -
  • API Reference
  • +
  • qns
  • diff --git a/docs/build/html/_modules/qns/network/topology/basictopo.html b/docs/build/html/_modules/qns/network/topology/basictopo.html index 4fd90c5..f59b521 100644 --- a/docs/build/html/_modules/qns/network/topology/basictopo.html +++ b/docs/build/html/_modules/qns/network/topology/basictopo.html @@ -1,5 +1,5 @@ - + @@ -40,7 +40,7 @@
  • Install Guide
  • Tutorials
  • Develop Guide
  • -
  • API Reference
  • +
  • qns
  • diff --git a/docs/build/html/_modules/qns/network/topology/gridtopo.html b/docs/build/html/_modules/qns/network/topology/gridtopo.html index 842711f..f6cc784 100644 --- a/docs/build/html/_modules/qns/network/topology/gridtopo.html +++ b/docs/build/html/_modules/qns/network/topology/gridtopo.html @@ -1,5 +1,5 @@ - + @@ -40,7 +40,7 @@
  • Install Guide
  • Tutorials
  • Develop Guide
  • -
  • API Reference
  • +
  • qns
  • @@ -104,7 +104,7 @@

    Source code for qns.network.topology.gridtopo

    super().__init__(nodes_number, nodes_apps, qchannel_args, cchannel_args, memory_args) size = int(math.sqrt(self.nodes_number)) self.size = size - assert(size ** 2 == self.nodes_number) + assert (size ** 2 == self.nodes_number)
    [docs] def build(self) -> Tuple[List[QNode], List[QuantumChannel]]: nl: List[QNode] = [] diff --git a/docs/build/html/_modules/qns/network/topology/linetopo.html b/docs/build/html/_modules/qns/network/topology/linetopo.html index 3b371bd..2c54dab 100644 --- a/docs/build/html/_modules/qns/network/topology/linetopo.html +++ b/docs/build/html/_modules/qns/network/topology/linetopo.html @@ -1,5 +1,5 @@ - + @@ -40,7 +40,7 @@
  • Install Guide
  • Tutorials
  • Develop Guide
  • -
  • API Reference
  • +
  • qns
  • diff --git a/docs/build/html/_modules/qns/network/topology/randomtopo.html b/docs/build/html/_modules/qns/network/topology/randomtopo.html index 5cd33cf..98375f4 100644 --- a/docs/build/html/_modules/qns/network/topology/randomtopo.html +++ b/docs/build/html/_modules/qns/network/topology/randomtopo.html @@ -137,7 +137,7 @@

    Source code for qns.network.topology.randomtopo

    < while True: a = get_randint(0, self.nodes_number - 1) b = get_randint(0, self.nodes_number - 1) - if mat[a][b] == 0: + if a != b and mat[a][b] == 0: break mat[a][b] = 1 mat[b][a] = 1 diff --git a/docs/build/html/_modules/qns/network/topology/topo.html b/docs/build/html/_modules/qns/network/topology/topo.html index 20a2f4f..d4331b8 100644 --- a/docs/build/html/_modules/qns/network/topology/topo.html +++ b/docs/build/html/_modules/qns/network/topology/topo.html @@ -40,7 +40,7 @@
  • Install Guide
  • Tutorials
  • Develop Guide
  • -
  • API Reference
  • +
  • qns
  • diff --git a/docs/build/html/_modules/qns/network/topology/treetopo.html b/docs/build/html/_modules/qns/network/topology/treetopo.html index 27a57a6..be44e98 100644 --- a/docs/build/html/_modules/qns/network/topology/treetopo.html +++ b/docs/build/html/_modules/qns/network/topology/treetopo.html @@ -1,5 +1,5 @@ - + @@ -40,7 +40,7 @@
  • Install Guide
  • Tutorials
  • Develop Guide
  • -
  • API Reference
  • +
  • qns
  • diff --git a/docs/build/html/_modules/qns/simulator/ts.html b/docs/build/html/_modules/qns/simulator/ts.html index c1abcbb..64627a9 100644 --- a/docs/build/html/_modules/qns/simulator/ts.html +++ b/docs/build/html/_modules/qns/simulator/ts.html @@ -40,7 +40,7 @@
  • Install Guide
  • Tutorials
  • Develop Guide
  • -
  • API Reference
  • +
  • qns
  • @@ -91,6 +91,17 @@

    Source code for qns.simulator.ts

     default_accuracy = 1000000  # {default_accuracy} time slots per second
     
     
    +
    [docs]def set_default_accuracy(time_slots: int): + """ + set the default simulation accuracy + + Args: + time_slots (int): the time slots per second. + """ + global default_accuracy + default_accuracy = time_slots
    + +
    [docs]class Time(object): def __init__(self, time_slot: int = 0, sec: float = 0.0, accuracy: int = default_accuracy): ''' @@ -118,22 +129,40 @@

    Source code for qns.simulator.ts

             return self.time_slot / self.accuracy
     
         def __eq__(self, other: object) -> bool:
    -        return self.time_slot == other.time_slot
    +        if isinstance(other, Time):
    +            return self.time_slot == other.time_slot
    +        other_time = Time(src=other)
    +        return self.time_slot == other_time.time_slot
     
         def __lt__(self, other: object) -> bool:
    -        return self.time_slot < other.time_slot
    +        if isinstance(other, Time):
    +            return self.time_slot < other.time_slot
    +        other_time = Time(src=other)
    +        return self.time_slot < other_time.time_slot
     
         def __le__(self, other: object) -> bool:
    -        return self < other or self == other
    +        if isinstance(other, Time):
    +            return self.time_slot <= other.time_slot
    +        other_time = Time(src=other)
    +        return self.time_slot <= other_time.time_slot
     
         def __gt__(self, other: object) -> bool:
    -        return not (self < other or self == other)
    +        if isinstance(other, Time):
    +            return self.time_slot > other.time_slot
    +        other_time = Time(src=other)
    +        return self.time_slot > other_time.time_slot
     
         def __ge__(self, other: object) -> bool:
    -        return not (self < other)
    +        if isinstance(other, Time):
    +            return self.time_slot >= other.time_slot
    +        other_time = Time(src=other)
    +        return self.time_slot >= other_time.time_slot
     
         def __ne__(self, other: object) -> bool:
    -        return not self == other
    +        if isinstance(other, Time):
    +            return self.time_slot != other.time_slot
    +        other_time = Time(src=other)
    +        return self.time_slot != other_time.time_slot
     
         def __add__(self, ts: Union["Time", float]) -> "Time":
             """
    @@ -148,6 +177,19 @@ 

    Source code for qns.simulator.ts

             tn.time_slot += ts.time_slot
             return tn
     
    +    def __sub__(self, ts: Union["Time", float]) -> "Time":
    +        """
    +        Minus an offset to the Time object
    +
    +        Args:
    +            ts (Union["Time", float]): a Time object or a float indicating time in second
    +        """
    +        tn = Time(time_slot=self.time_slot, accuracy=self.accuracy)
    +        if isinstance(ts, float):
    +            ts = Time(sec=ts, accuracy=self.accuracy)
    +        tn.time_slot = tn.time_slot - ts.time_slot
    +        return tn
    +
         def __repr__(self) -> str:
             return str(self.sec)
    diff --git a/docs/build/html/_modules/qns/utils/log.html b/docs/build/html/_modules/qns/utils/log.html index 00dd724..cd6df35 100644 --- a/docs/build/html/_modules/qns/utils/log.html +++ b/docs/build/html/_modules/qns/utils/log.html @@ -1,5 +1,5 @@ - + @@ -40,7 +40,7 @@
  • Install Guide
  • Tutorials
  • Develop Guide
  • -
  • API Reference
  • +
  • qns
  • diff --git a/docs/build/html/_modules/qns/utils/multiprocess.html b/docs/build/html/_modules/qns/utils/multiprocess.html index 2220cbb..f59df34 100644 --- a/docs/build/html/_modules/qns/utils/multiprocess.html +++ b/docs/build/html/_modules/qns/utils/multiprocess.html @@ -91,6 +91,8 @@

    Source code for qns.utils.multiprocess

     import pandas as pd
     from qns.utils.log import logger as log
     
    +import signal
    +
     
     
    [docs]class MPSimulations(): """ @@ -116,7 +118,7 @@

    Source code for qns.utils.multiprocess

             self.cores = cores if cores > 0 else multiprocessing.cpu_count()
     
             self.data = pd.DataFrame()
    -        self.aggregated_date = pd.DataFrame()
    +        self.aggregated_data = pd.DataFrame()
     
             self._setting_list = []
             self._current_simulation_count = 0
    @@ -145,28 +147,39 @@ 

    Source code for qns.utils.multiprocess

             log.info(f"finish simulation [{setting['_id']+1}/{self._total_simulation_count}] {result}")
             return raw
     
    +    def _init_worker(self):
    +        signal.signal(signal.SIGINT, signal.SIG_IGN)
    +
     
    [docs] def start(self): """ Start the multiple process simulation """ self.prepare_setting() - pool = multiprocessing.Pool(processes=self.cores) - result = [] - for setting in self._setting_list: - result.append(pool.apply_async(self._single_run, (setting,))) - pool.close() - pool.join() + pool = multiprocessing.Pool(processes=self.cores, initializer=self._init_worker) + try: + result = [] + for setting in self._setting_list: + result.append(pool.apply_async(self._single_run, (setting,))) + pool.close() + pool.join() + except KeyboardInterrupt: + print("terminating simulation") + pool.terminate() + pool.join() for r in result: - raw_data = r.get() + try: + raw_data = r.get() + except Exception: + print("[simulator] error in simulation") + continue new_result = {} for k, v in raw_data.items(): new_result[k] = [v] result_pd = pd.DataFrame(new_result) self.data = pd.concat([self.data, result_pd], ignore_index=True) - if self.aggregate and self.iter_count > 1: - print(self.data) + if self.aggregate: mean = pd.DataFrame(self.data).drop(columns=["_id", "_group", "_repeat"]) new_name = {} ck = mean.columns diff --git a/docs/build/html/_sources/develop.rst.txt b/docs/build/html/_sources/develop.rst.txt index 64f53a7..e5832d1 100644 --- a/docs/build/html/_sources/develop.rst.txt +++ b/docs/build/html/_sources/develop.rst.txt @@ -23,7 +23,7 @@ SimQN is a Python library for quantum networks evaluation. It requires Python > .. code-block:: bash pip3 install setuptools wheel twine - pip3 install -r requirements + pip3 install -r requirements.txt To setup the development environments, the following command install SimQN into the python library so that we can do `import qns`: @@ -61,6 +61,7 @@ To automatic generate the API documents, use the following command: To build document website, use the command: .. code-block:: bash + cd docs make html diff --git a/docs/build/html/_sources/tutorials.entity.memory.rst.txt b/docs/build/html/_sources/tutorials.entity.memory.rst.txt index 2c85523..3f84c0f 100644 --- a/docs/build/html/_sources/tutorials.entity.memory.rst.txt +++ b/docs/build/html/_sources/tutorials.entity.memory.rst.txt @@ -23,7 +23,7 @@ Quantum memory is an entity that can store qubits. It can be equipped to a quant q1 = Qubit() m.write(q1) - q2 = m.read() + q2 = m.read(q1) The memory can have a limited size. ``is_full`` function returns whether the memory is full: diff --git a/docs/build/html/_sources/tutorials.models.qubit.rst.txt b/docs/build/html/_sources/tutorials.models.qubit.rst.txt index ba5b783..cd1d961 100644 --- a/docs/build/html/_sources/tutorials.models.qubit.rst.txt +++ b/docs/build/html/_sources/tutorials.models.qubit.rst.txt @@ -85,10 +85,10 @@ SimQN also provides some commonly used decoherence models, including dephase mod .. code-block:: python - from qns.models.qubit.decoherence import DepolarStorageErrorModel, DephaseTransmitErrorModel + from qns.models.qubit.decoherence import DepolarStorageErrorModel, DephaseTransferErrorModel from qns.models.qubit.factory import QubitFactory - Qubit = QubitFactory(store_error_model=DepolarStorageErrorModel, transfer_error_model=DephaseTransmitErrorModel) + Qubit = QubitFactory(store_error_model=DepolarStorageErrorModel, transfer_error_model=DephaseTransferErrorModel) q1 = Qubit(name="q1") q2 = Qubit(name="q2") @@ -96,7 +96,7 @@ SimQN also have error models for operating or measuring on qubits, by implementi .. code-block:: python - from qns.models.qubit.decoherence import DepolarStorageErrorModel, DephaseTransmitErrorModel + from qns.models.qubit.decoherence import DepolarStorageErrorModel, DephaseTransferErrorModel from qns.models.qubit.factory import QubitFactory Qubit = QubitFactory(operate_decoherence_rate=0.2, diff --git a/docs/build/html/_sources/tutorials.network.route.rst.txt b/docs/build/html/_sources/tutorials.network.route.rst.txt index 478da33..be34431 100644 --- a/docs/build/html/_sources/tutorials.network.route.rst.txt +++ b/docs/build/html/_sources/tutorials.network.route.rst.txt @@ -30,7 +30,7 @@ An example of using this algorithm is: .. code-block:: python - from qns.network.topology import RandomTopology, ClassicTopology + from qns.network.topology import RandomTopology from qns.network.network import QuantumNetwork from qns.network.route import DijkstraRouteAlgorithm @@ -39,8 +39,8 @@ An example of using this algorithm is: lines_number=10, qchannel_args={"delay": 0.05, "bandwidth": 10}, cchannel_args={"delay": 0.05}, - memory_args=[{"capacity": memory_capacity}], - nodes_apps=[EntanglementDistributionApp(init_fidelity=init_fidelity)]) + memory_args=[{"capacity": 50}], + nodes_apps=[EntanglementDistributionApp(init_fidelity=0.99)]) # use the ``DijkstraRouteAlgorithm``, using the bandwidth as the ``metric_func`` route = DijkstraRouteAlgorithm(metric_func=lambda qchannel: qchannel.bandwidth) diff --git a/docs/build/html/_sources/tutorials.network.topology.rst.txt b/docs/build/html/_sources/tutorials.network.topology.rst.txt index e97e954..ec221ea 100644 --- a/docs/build/html/_sources/tutorials.network.topology.rst.txt +++ b/docs/build/html/_sources/tutorials.network.topology.rst.txt @@ -25,8 +25,8 @@ Topology generators may have more parameters. The following example shows how to lines_number=10, qchannel_args={"delay": 0.05}, cchannel_args={"delay": 0.05}, - memory_args=[{"capacity": memory_capacity}], - nodes_apps=[EntanglementDistributionApp(init_fidelity=init_fidelity)]) + memory_args=[{"capacity": 50}], + nodes_apps=[EntanglementDistributionApp(init_fidelity=0.99)]) # build the network net = QuantumNetwork(topo=topo) @@ -54,16 +54,17 @@ SimQN is able to generate classic topologies as well. The classic topology is in .. code-block:: python - from qns.network.topology import RandomTopology, ClassicTopology + from qns.network.topology import RandomTopology from qns.network.network import QuantumNetwork + from qns.network.topology.topo import ClassicTopology topo = RandomTopology( nodes_number=5, lines_number=10, qchannel_args={"delay": 0.05}, cchannel_args={"delay": 0.05}, - memory_args=[{"capacity": memory_capacity}], - nodes_apps=[EntanglementDistributionApp(init_fidelity=init_fidelity)]) + memory_args=[{"capacity": 50}], + nodes_apps=[EntanglementDistributionApp(init_fidelity=0.99)]) # build the network, classic topology follows the quantum topology net = QuantumNetwork(topo=topo, classic_topo=ClassicTopology.Follow) @@ -91,12 +92,12 @@ The ``QuantumNetwork`` provides the following APIs to get or add nodes, channels n2 = QNode(name="n2") net.add_node(n2) - # get a quantum channel by its name - l1 = net.get_qchannel("l1") + # get a quantum channel by its name + l1 = net.get_qchannel("l1,2") # add a quantum channel l2 = QuantumChannel("l2") - net.add_node(l2) + net.add_qchannel(l2) node_list = net.nodes # get all nodes qchannel_list = net.qchannels # get all quantum channels diff --git a/docs/build/html/_sources/tutorials.quickstart.rst.txt b/docs/build/html/_sources/tutorials.quickstart.rst.txt index 7cf0e02..95a6350 100644 --- a/docs/build/html/_sources/tutorials.quickstart.rst.txt +++ b/docs/build/html/_sources/tutorials.quickstart.rst.txt @@ -24,11 +24,11 @@ The simulation is last for 10 seconds and the ``accuracy`` is 10,000,000,000 slo import numpy as np light_speed = 299791458 - length = 100000 # 100,000 km + length = 100000 # 100,000 m def drop_rate(length): # drop 0.2 db/KM - return 1 - np.exp(- length / 50000) + return 1 - np.exp(- length / 50000) #or 1 - np.power(10, - length / 50000) # generate quantum nodes n1 = QNode(name="n1") @@ -88,6 +88,7 @@ First, we generate the simulator and produce the network produce: from qns.network.route.dijkstra import DijkstraRouteAlgorithm from qns.network.topology.topo import ClassicTopology import qns.utils.log as log + import logging init_fidelity = 0.99 # the initial entanglement's fidelity nodes_number = 150 # the number of nodes @@ -134,7 +135,7 @@ Now, it is possible to run the simulation and get the results: s.run() # count the number of successful entanglement distribution for each session - results = [src.apps[0].success_count for req in net.requests] + results = [req.src.apps[0].success_count for req in net.requests] # log the results log.monitor(requests_number, nodes_number, results, s.time_spend, sep=" ") diff --git a/docs/build/html/_sources/tutorials.util.rst.txt b/docs/build/html/_sources/tutorials.util.rst.txt index 0e4157d..1748335 100644 --- a/docs/build/html/_sources/tutorials.util.rst.txt +++ b/docs/build/html/_sources/tutorials.util.rst.txt @@ -19,12 +19,14 @@ Users can set the logging level and record logs: .. code-block:: Python + import logging + log.logger.setLevel(logging.INFO) a = 1 log.debug("debug message") - log.info("info message", a) - log.warn("warn message", a+1) + log.info("info message %d", a) + log.warn("warn message %d", a + 1) log.error("error message") log.critical("critical message") diff --git a/docs/build/html/develop.html b/docs/build/html/develop.html index f4dcd4f..a6c4cd4 100644 --- a/docs/build/html/develop.html +++ b/docs/build/html/develop.html @@ -92,7 +92,7 @@

    Code requirements

    SimQN is a Python library for quantum networks evaluation. It requires Python > 3.7.0. WE leverage setuptools to build SimQN:

    pip3 install setuptools wheel twine
    -pip3 install -r requirements
    +pip3 install -r requirements.txt
     

    To setup the development environments, the following command install SimQN into the python library so that we can do import qns:

    @@ -119,6 +119,10 @@

    Compile API documents

    To build document website, use the command:

    +
    cd docs
    +make html
    +
    +

    Now, the compiled static website is built. Our documents is hosted on the gh-pages branch. Use the following command to publish new documents:

    git subtree push --prefix docs/build/html origin gh-pages
     
    diff --git a/docs/build/html/genindex.html b/docs/build/html/genindex.html index 891ba5a..ec3f77c 100644 --- a/docs/build/html/genindex.html +++ b/docs/build/html/genindex.html @@ -80,6 +80,7 @@

    Index

    |
    H | I | J + | K | L | M | N @@ -296,6 +297,16 @@

    B

  • (class in qns.models.epr.bell)
  • +
  • BitFilpTransferErrorModel() (in module qns.models.qubit.decoherence) +
  • +
  • BitFlipError() (in module qns.models.qubit.decoherence) +
  • +
  • BitFlipMeasureErrorModel() (in module qns.models.qubit.decoherence) +
  • +
  • BitFlipOperateErrorModel() (in module qns.models.qubit.decoherence) +
  • +
  • BitFlipStorageErrorModel() (in module qns.models.qubit.decoherence) +
  • build() (qns.network.BasicTopology method)
  • +
  • cascade_binary_divide() (in module qns.network.protocol.bb84) +
  • +
  • cascade_key_shuffle() (in module qns.network.protocol.bb84) +
  • +
  • cascade_parity() (in module qns.network.protocol.bb84) +
  • check_basis() (qns.network.protocol.bb84.BB84RecvApp method)
  • + + - - + + -
    • get_normal() (in module qns.utils.rnd)
    • get_qchannel() (qns.entity.node.node.QNode method) @@ -856,6 +899,14 @@

      H

      I

      +

      K

      + + +
      +

      L

        @@ -1419,7 +1478,13 @@

        O

        P

        + - + - + -
        +
      • SingleQubitArbitraryGate (class in qns.models.qubit.gate)
      • +
        • start() (qns.utils.multiprocess.MPSimulations method)
        • state() (qns.models.qubit.QState method) diff --git a/docs/build/html/objects.inv b/docs/build/html/objects.inv index fa8b37b..2f4519a 100644 Binary files a/docs/build/html/objects.inv and b/docs/build/html/objects.inv differ diff --git a/docs/build/html/qns.entity.cchannel.html b/docs/build/html/qns.entity.cchannel.html index 3a2ba8e..920525e 100644 --- a/docs/build/html/qns.entity.cchannel.html +++ b/docs/build/html/qns.entity.cchannel.html @@ -96,7 +96,7 @@

          Submodules

          qns.entity.cchannel.cchannel module

          -class qns.entity.cchannel.cchannel.ClassicChannel(name: Optional[str] = None, node_list: List[qns.entity.node.node.QNode] = [], bandwidth: int = 0, delay: Union[float, qns.models.delay.delay.DelayModel] = 0, drop_rate: float = 0, max_buffer_size: int = 0)[source]
          +class qns.entity.cchannel.cchannel.ClassicChannel(name: Optional[str] = None, node_list: List[qns.entity.node.node.QNode] = [], bandwidth: int = 0, delay: Union[float, qns.models.delay.delay.DelayModel] = 0, length: Optional[float] = 0, drop_rate: float = 0, max_buffer_size: int = 0)[source]

          Bases: qns.entity.entity.Entity

          ClassicChannel is the channel for classic message

          @@ -182,7 +182,7 @@

          Submodules

          Module contents

          -class qns.entity.cchannel.ClassicChannel(name: Optional[str] = None, node_list: List[qns.entity.node.node.QNode] = [], bandwidth: int = 0, delay: Union[float, qns.models.delay.delay.DelayModel] = 0, drop_rate: float = 0, max_buffer_size: int = 0)[source]
          +class qns.entity.cchannel.ClassicChannel(name: Optional[str] = None, node_list: List[qns.entity.node.node.QNode] = [], bandwidth: int = 0, delay: Union[float, qns.models.delay.delay.DelayModel] = 0, length: Optional[float] = 0, drop_rate: float = 0, max_buffer_size: int = 0)[source]

          Bases: qns.entity.entity.Entity

          ClassicChannel is the channel for classic message

          diff --git a/docs/build/html/qns.entity.html b/docs/build/html/qns.entity.html index 6b6801b..c2543a8 100644 --- a/docs/build/html/qns.entity.html +++ b/docs/build/html/qns.entity.html @@ -261,7 +261,7 @@

          Submodules
          -class qns.entity.ClassicChannel(name: Optional[str] = None, node_list: List[qns.entity.node.node.QNode] = [], bandwidth: int = 0, delay: Union[float, qns.models.delay.delay.DelayModel] = 0, drop_rate: float = 0, max_buffer_size: int = 0)[source]
          +class qns.entity.ClassicChannel(name: Optional[str] = None, node_list: List[qns.entity.node.node.QNode] = [], bandwidth: int = 0, delay: Union[float, qns.models.delay.delay.DelayModel] = 0, length: Optional[float] = 0, drop_rate: float = 0, max_buffer_size: int = 0)[source]

          Bases: qns.entity.entity.Entity

          ClassicChannel is the channel for classic message

          @@ -406,11 +406,11 @@

          Submodules
          -class qns.entity.Monitor(name: Optional[str] = None, network: Optional[qns.network.network.QuantumNetwork] = None)[source]
          +class qns.entity.Monitor(name: Optional[str] = None, network=None)[source]

          Bases: qns.entity.entity.Entity

          -add_attribution(name: str, calculate_func: Callable[[qns.simulator.simulator.Simulator, Optional[qns.network.network.QuantumNetwork], Optional[qns.simulator.event.Event]], Any]) None[source]
          +add_attribution(name: str, calculate_func: Callable[[qns.simulator.simulator.Simulator, Any, Optional[qns.simulator.event.Event]], Any]) None[source]

          Set an attribution that will be recorded. For example, an attribution could be the throughput, or the fidelity.

          Parameters
          @@ -672,6 +672,17 @@

          Submodules +
          +get_memory(memory: Union[str, int])[source]
          +

          Get the memory by index (in memories) or its name

          +
          +
          Parameters
          +

          memory (Union[str, int]) – the index or name of the memory

          +
          +
          +

          +
          get_qchannel(dst: qns.entity.node.node.QNode)[source]
          diff --git a/docs/build/html/qns.entity.monitor.html b/docs/build/html/qns.entity.monitor.html index 3e1179f..7702dcc 100644 --- a/docs/build/html/qns.entity.monitor.html +++ b/docs/build/html/qns.entity.monitor.html @@ -96,11 +96,11 @@

          Submodules

          qns.entity.monitor.monitor module

          -class qns.entity.monitor.monitor.Monitor(name: Optional[str] = None, network: Optional[qns.network.network.QuantumNetwork] = None)[source]
          +class qns.entity.monitor.monitor.Monitor(name: Optional[str] = None, network=None)[source]

          Bases: qns.entity.entity.Entity

          -add_attribution(name: str, calculate_func: Callable[[qns.simulator.simulator.Simulator, Optional[qns.network.network.QuantumNetwork], Optional[qns.simulator.event.Event]], Any]) None[source]
          +add_attribution(name: str, calculate_func: Callable[[qns.simulator.simulator.Simulator, Any, Optional[qns.simulator.event.Event]], Any]) None[source]

          Set an attribution that will be recorded. For example, an attribution could be the throughput, or the fidelity.

          Parameters
          @@ -231,11 +231,11 @@

          Submodules

          Module contents

          -class qns.entity.monitor.Monitor(name: Optional[str] = None, network: Optional[qns.network.network.QuantumNetwork] = None)[source]
          +class qns.entity.monitor.Monitor(name: Optional[str] = None, network=None)[source]

          Bases: qns.entity.entity.Entity

          -add_attribution(name: str, calculate_func: Callable[[qns.simulator.simulator.Simulator, Optional[qns.network.network.QuantumNetwork], Optional[qns.simulator.event.Event]], Any]) None[source]
          +add_attribution(name: str, calculate_func: Callable[[qns.simulator.simulator.Simulator, Any, Optional[qns.simulator.event.Event]], Any]) None[source]

          Set an attribution that will be recorded. For example, an attribution could be the throughput, or the fidelity.

          Parameters
          diff --git a/docs/build/html/qns.entity.node.html b/docs/build/html/qns.entity.node.html index 218a50a..ca52bbf 100644 --- a/docs/build/html/qns.entity.node.html +++ b/docs/build/html/qns.entity.node.html @@ -287,6 +287,17 @@

          Submodules +
          +get_memory(memory: Union[str, int])[source]
          +

          Get the memory by index (in memories) or its name

          +
          +
          Parameters
          +

          memory (Union[str, int]) – the index or name of the memory

          +
          +
          +

          +
          get_qchannel(dst: qns.entity.node.node.QNode)[source]
          @@ -516,6 +527,17 @@

          Submodules +
          +get_memory(memory: Union[str, int])[source]
          +

          Get the memory by index (in memories) or its name

          +
          +
          Parameters
          +

          memory (Union[str, int]) – the index or name of the memory

          +
          +
          +

          +
          get_qchannel(dst: qns.entity.node.node.QNode)[source]
          diff --git a/docs/build/html/qns.models.qubit.html b/docs/build/html/qns.models.qubit.html index c0e2958..e5c3563 100644 --- a/docs/build/html/qns.models.qubit.html +++ b/docs/build/html/qns.models.qubit.html @@ -117,41 +117,121 @@

          Submodules

          qns.models.qubit.decoherence module

          +
          +
          +qns.models.qubit.decoherence.BitFilpTransferErrorModel(self, length: Optional[float] = 0, decoherence_rate: Optional[float] = 0, **kwargs)
          +

          The error model with length for this qubit. The error possibility is 1-e^{-decoherence_rate * length}.

          +
          +
          Parameters
          +
            +
          • length (float) – the transmission length in meter.

          • +
          • decoherence_rate (float) – the decoherence rate.

          • +
          +
          +
          +
          + +
          +
          +qns.models.qubit.decoherence.BitFlipError(self, p: Optional[float] = 0, **kwargs)[source]
          +

          The bit flip error model.

          +
          +
          Parameters
          +
            +
          • p (float) – the error possibility, [0, 1]

          • +
          • kwargs – other parameters

          • +
          +
          +
          +
          + +
          +
          +qns.models.qubit.decoherence.BitFlipMeasureErrorModel(self, p: Optional[float] = 0, **kwargs)
          +

          The bit flip error model.

          +
          +
          Parameters
          +
            +
          • p (float) – the error possibility, [0, 1]

          • +
          • kwargs – other parameters

          • +
          +
          +
          +
          + +
          +
          +qns.models.qubit.decoherence.BitFlipOperateErrorModel(self, p: Optional[float] = 0, **kwargs)
          +

          The bit flip error model.

          +
          +
          Parameters
          +
            +
          • p (float) – the error possibility, [0, 1]

          • +
          • kwargs – other parameters

          • +
          +
          +
          +
          + +
          +
          +qns.models.qubit.decoherence.BitFlipStorageErrorModel(self, t: Optional[float] = 0, decoherence_rate: Optional[float] = 0, **kwargs)
          +

          The error model with time for this qubit. The error possibility is 1-e^{-decoherence_rate * t}.

          +
          +
          Parameters
          +
            +
          • t (float) – the during time in second.

          • +
          • decoherence_rate (float) – the decoherence rate.

          • +
          +
          +
          +
          + +
          +
          +qns.models.qubit.decoherence.DephaseError(self, p: Optional[float] = 0, **kwargs)[source]
          +

          The dephase error model. +A random Z gate will be operate on the qubit with possibility p.

          +
          +
          Parameters
          +

          p (float) – the error possibility

          +
          +
          +
          +
          -qns.models.qubit.decoherence.DephaseMeasureErrorModel(self, decoherence_rate: Optional[float] = 0, **kwargs)[source]
          -

          The dephase error model for measuring this qubit, -A random Z gate will be operate on the qubit with possibility: 1-e^(-decoherence_rate)

          +qns.models.qubit.decoherence.DephaseMeasureErrorModel(self, p: Optional[float] = 0, **kwargs) +

          The dephase error model. +A random Z gate will be operate on the qubit with possibility p.

          Parameters
          -

          decoherence_rate (float) – the decoherence rate

          +

          p (float) – the error possibility

          -qns.models.qubit.decoherence.DephaseOperateErrorModel(self, decoherence_rate: Optional[float] = 0, **kwargs)[source]
          -

          The dephase error model for operating this qubit. -A random Z gate will be operate on the qubit with possibility: 1-e^(-decoherence_rate)

          +qns.models.qubit.decoherence.DephaseOperateErrorModel(self, p: Optional[float] = 0, **kwargs) +

          The dephase error model. +A random Z gate will be operate on the qubit with possibility p.

          Parameters
          -

          decoherence_rate (float) – the decoherence rate

          +

          p (float) – the error possibility

          -qns.models.qubit.decoherence.DephaseStorageErrorModel(self, t: Optional[float] = 0, decoherence_rate: Optional[float] = 0, **kwargs)[source]
          -

          The dephase error model for storing a qubit in quantum memory.

          -

          A random Z gate will be operate on the qubit with possibility: 1-e^(-decoherence_rate * t)

          +qns.models.qubit.decoherence.DephaseStorageErrorModel(self, t: Optional[float] = 0, decoherence_rate: Optional[float] = 0, **kwargs) +

          The error model with time for this qubit. The error possibility is 1-e^{-decoherence_rate * t}.

          Parameters
            -
          • t – the time stored in a quantum memory. The unit it second.

          • -
          • decoherence_rate (float) – the decoherence rate

          • -
          • kwargs – other parameters

          • +
          • t (float) – the during time in second.

          • +
          • decoherence_rate (float) – the decoherence rate.

          @@ -159,14 +239,27 @@

          Submodules
          -qns.models.qubit.decoherence.DephaseTransferErrorModel(self, length: Optional[float] = 0, decoherence_rate: Optional[float] = 0, **kwargs)[source]
          -

          The dephase error model for transmitting a qubit in quantum channel.

          -

          A random Z gate will be operate on the qubit with possibility: 1-e^(-decoherence_rate * length)

          +qns.models.qubit.decoherence.DephaseTransferErrorModel(self, length: Optional[float] = 0, decoherence_rate: Optional[float] = 0, **kwargs) +

          The error model with length for this qubit. The error possibility is 1-e^{-decoherence_rate * length}.

          Parameters
            -
          • length – the channel length

          • -
          • decoherence_rate (float) – the decoherence rate

          • +
          • length (float) – the transmission length in meter.

          • +
          • decoherence_rate (float) – the decoherence rate.

          • +
          +
          +
          +

          + +
          +
          +qns.models.qubit.decoherence.DepolarError(self, p: Optional[float] = 0, **kwargs)[source]
          +

          The depolarizing error model.

          +

          One of the random Pauli gate will be operate on the qubit with possibility p :

          +
          +
          Parameters
          +
            +
          • p (float) – the error possibility

          • kwargs – other parameters

          @@ -175,16 +268,28 @@

          Submodules
          -qns.models.qubit.decoherence.DepolarMeasureErrorModel(self, decoherence_rate: Optional[float] = 0, **kwargs)[source]
          -

          The depolar error model for measuring on a qubit.

          -
          -
          One of the random Pauli gate will be operate on the qubit with possibility:

          1-e^(-decoherence_rate * t)

          +qns.models.qubit.decoherence.DepolarMeasureErrorModel(self, p: Optional[float] = 0, **kwargs) +

          The depolarizing error model.

          +

          One of the random Pauli gate will be operate on the qubit with possibility p :

          +
          +
          Parameters
          +
            +
          • p (float) – the error possibility

          • +
          • kwargs – other parameters

          • +
          +
          + +
          +
          +qns.models.qubit.decoherence.DepolarOperateErrorModel(self, p: Optional[float] = 0, **kwargs)
          +

          The depolarizing error model.

          +

          One of the random Pauli gate will be operate on the qubit with possibility p :

          Parameters
            -
          • decoherence_rate (float) – the decoherence rate

          • +
          • p (float) – the error possibility

          • kwargs – other parameters

          @@ -192,17 +297,41 @@

          Submodules -
          -qns.models.qubit.decoherence.DepolarOperateErrorModel(self, decoherence_rate: Optional[float] = 0, **kwargs)[source]
          -

          The depolar error model for operating on a qubit.

          -
          -
          One of the random Pauli gate will be operate on the qubit with possibility:

          1-e^(-decoherence_rate * t)

          +
          +qns.models.qubit.decoherence.DepolarStorageErrorModel(self, t: Optional[float] = 0, decoherence_rate: Optional[float] = 0, **kwargs)
          +

          The error model with time for this qubit. The error possibility is 1-e^{-decoherence_rate * t}.

          +
          +
          Parameters
          +
            +
          • t (float) – the during time in second.

          • +
          • decoherence_rate (float) – the decoherence rate.

          • +
          +
          + +
          +
          +qns.models.qubit.decoherence.DepolarTransferErrorModel(self, length: Optional[float] = 0, decoherence_rate: Optional[float] = 0, **kwargs)
          +

          The error model with length for this qubit. The error possibility is 1-e^{-decoherence_rate * length}.

          Parameters
            -
          • decoherence_rate (float) – the decoherence rate

          • +
          • length (float) – the transmission length in meter.

          • +
          • decoherence_rate (float) – the decoherence rate.

          • +
          +
          +
          +
          + +
          +
          +qns.models.qubit.decoherence.DissipationError(self, p: Optional[float] = 0, **kwargs)[source]
          +

          The dissipation error model.

          +
          +
          Parameters
          +
            +
          • p (float) – the error possibility, [0, 1]

          • kwargs – other parameters

          @@ -210,18 +339,27 @@

          Submodules -
          -qns.models.qubit.decoherence.DepolarStorageErrorModel(self, t: Optional[float] = 0, decoherence_rate: Optional[float] = 0, **kwargs)[source]
          -

          The depolar error model for storing a qubit in quantum memory.

          -
          -
          One of the random Pauli gate will be operate on the qubit with possibility:

          1-e^(-decoherence_rate * t)

          +
          +qns.models.qubit.decoherence.DissipationMeasureErrorModel(self, p: Optional[float] = 0, **kwargs)
          +

          The dissipation error model.

          +
          +
          Parameters
          +
            +
          • p (float) – the error possibility, [0, 1]

          • +
          • kwargs – other parameters

          • +
          +
          + +
          +
          +qns.models.qubit.decoherence.DissipationOperateErrorModel(self, p: Optional[float] = 0, **kwargs)
          +

          The dissipation error model.

          Parameters
            -
          • t – the time stored in a quantum memory. The unit it second.

          • -
          • decoherence_rate (float) – the decoherence rate

          • +
          • p (float) – the error possibility, [0, 1]

          • kwargs – other parameters

          @@ -229,57 +367,87 @@

          Submodules -
          -qns.models.qubit.decoherence.DepolarTransferErrorModel(self, length: Optional[float] = 0, decoherence_rate: Optional[float] = 0, **kwargs)[source]
          -

          The depolar error model for transmitting a qubit in quantum channel.

          -
          -
          One of the random Pauli gate will be operate on the qubit with possibility:

          1-e^(-decoherence_rate * t)

          +
          +qns.models.qubit.decoherence.DissipationStorageErrorModel(self, t: Optional[float] = 0, decoherence_rate: Optional[float] = 0, **kwargs)
          +

          The error model with time for this qubit. The error possibility is 1-e^{-decoherence_rate * t}.

          +
          +
          Parameters
          +
            +
          • t (float) – the during time in second.

          • +
          • decoherence_rate (float) – the decoherence rate.

          • +
          +
          + +
          +
          +qns.models.qubit.decoherence.DissipationTransferErrorModel(self, length: Optional[float] = 0, decoherence_rate: Optional[float] = 0, **kwargs)
          +

          The error model with length for this qubit. The error possibility is 1-e^{-decoherence_rate * length}.

          Parameters
            -
          • length – the channel length

          • -
          • decoherence_rate (float) – the decoherence rate

          • -
          • kwargs – other parameters

          • +
          • length (float) – the transmission length in meter.

          • +
          • decoherence_rate (float) – the decoherence rate.

          +
          +
          +qns.models.qubit.decoherence.ErrorWithLength(ErrorModel)[source]
          +

          generate the error. The error possibility is 1-e^{-decoherence_rate * length}

          +
          + +
          +
          +qns.models.qubit.decoherence.ErrorWithTime(ErrorModel)[source]
          +

          generate the error. The error possibility is 1-e^{-decoherence_rate * t}

          +
          + +
          +
          +qns.models.qubit.decoherence.PrefectError(self, p: Optional[float] = 0, **kwargs)[source]
          +

          The default error model for this qubit.

          +
          +
          Parameters
          +

          p (float) – the error possibility

          +
          +
          +
          +
          -qns.models.qubit.decoherence.PrefectMeasureErrorModel(self, decoherence_rate: Optional[float] = 0, **kwargs)[source]
          -

          The default error model for measuring this qubit.

          +qns.models.qubit.decoherence.PrefectMeasureErrorModel(self, p: Optional[float] = 0, **kwargs) +

          The default error model for this qubit.

          Parameters
          -

          decoherence_rate (float) – the decoherence rate

          +

          p (float) – the error possibility

          -qns.models.qubit.decoherence.PrefectOperateErrorModel(self, decoherence_rate: Optional[float] = 0, **kwargs)[source]
          -

          The default error model for operating this qubit.

          +qns.models.qubit.decoherence.PrefectOperateErrorModel(self, p: Optional[float] = 0, **kwargs) +

          The default error model for this qubit.

          Parameters
          -

          decoherence_rate (float) – the decoherence rate

          +

          p (float) – the error possibility

          -qns.models.qubit.decoherence.PrefectStorageErrorModel(self, t: Optional[float] = 0, decoherence_rate: Optional[float] = 0, **kwargs)[source]
          -

          The default error model for storing a qubit in quantum memory. -The default behavior is doing nothing

          +qns.models.qubit.decoherence.PrefectStorageErrorModel(self, t: Optional[float] = 0, decoherence_rate: Optional[float] = 0, **kwargs) +

          The error model with time for this qubit. The error possibility is 1-e^{-decoherence_rate * t}.

          Parameters
            -
          • t – the time stored in a quantum memory. The unit it second.

          • +
          • t (float) – the during time in second.

          • decoherence_rate (float) – the decoherence rate.

          • -
          • kwargs – other parameters

          @@ -287,15 +455,13 @@

          Submodules
          -qns.models.qubit.decoherence.PrefectTransferErrorModel(self, length: Optional[float] = 0, decoherence_rate: Optional[float] = 0, **kwargs)[source]
          -

          The default error model for transmitting this qubit -The default behavior is doing nothing

          +qns.models.qubit.decoherence.PrefectTransferErrorModel(self, length: Optional[float] = 0, decoherence_rate: Optional[float] = 0, **kwargs) +

          The error model with length for this qubit. The error possibility is 1-e^{-decoherence_rate * length}.

          Parameters
            -
          • length (float) – the length of the channel

          • +
          • length (float) – the transmission length in meter.

          • decoherence_rate (float) – the decoherence rate.

          • -
          • kwargs – other parameters

          @@ -359,7 +525,7 @@

          Submodules

          qns.models.qubit.factory module

          -class qns.models.qubit.factory.QubitFactory(operate_decoherence_rate: float = 0, measure_decoherence_rate: float = 0, store_error_model=<function PrefectStorageErrorModel>, transfer_error_model=<function PrefectTransferErrorModel>, operate_error_model=<function PrefectOperateErrorModel>, measure_error_model=<function PrefectMeasureErrorModel>)[source]
          +class qns.models.qubit.factory.QubitFactory(operate_decoherence_rate: float = 0, measure_decoherence_rate: float = 0, store_error_model=<function ErrorWithTime.<locals>.GeneratedErrorWithTime>, transfer_error_model=<function ErrorWithLength.<locals>.GeneratedErrorWithLength>, operate_error_model=<function PrefectError>, measure_error_model=<function PrefectError>)[source]

          Bases: object

          QubitFactory is the factory class for building qubits with special error models.

          @@ -687,6 +853,11 @@

          Submodulesqns.models.qubit.utils.joint(qubit1, qubit2) None[source]

          +
          +
          +qns.models.qubit.utils.kron(a: numpy.ndarray, b: numpy.ndarray) numpy.ndarray[source]
          +
          +
          qns.models.qubit.utils.partial_trace(rho: numpy.ndarray, idx: int) numpy.ndarray[source]
          @@ -717,39 +888,37 @@

          Submodules

          Module contents

          -qns.models.qubit.DephaseMeasureErrorModel(self, decoherence_rate: Optional[float] = 0, **kwargs)[source]
          -

          The dephase error model for measuring this qubit, -A random Z gate will be operate on the qubit with possibility: 1-e^(-decoherence_rate)

          +qns.models.qubit.DephaseMeasureErrorModel(self, p: Optional[float] = 0, **kwargs) +

          The dephase error model. +A random Z gate will be operate on the qubit with possibility p.

          Parameters
          -

          decoherence_rate (float) – the decoherence rate

          +

          p (float) – the error possibility

          -qns.models.qubit.DephaseOperateErrorModel(self, decoherence_rate: Optional[float] = 0, **kwargs)[source]
          -

          The dephase error model for operating this qubit. -A random Z gate will be operate on the qubit with possibility: 1-e^(-decoherence_rate)

          +qns.models.qubit.DephaseOperateErrorModel(self, p: Optional[float] = 0, **kwargs) +

          The dephase error model. +A random Z gate will be operate on the qubit with possibility p.

          Parameters
          -

          decoherence_rate (float) – the decoherence rate

          +

          p (float) – the error possibility

          -qns.models.qubit.DephaseStorageErrorModel(self, t: Optional[float] = 0, decoherence_rate: Optional[float] = 0, **kwargs)[source]
          -

          The dephase error model for storing a qubit in quantum memory.

          -

          A random Z gate will be operate on the qubit with possibility: 1-e^(-decoherence_rate * t)

          +qns.models.qubit.DephaseStorageErrorModel(self, t: Optional[float] = 0, decoherence_rate: Optional[float] = 0, **kwargs) +

          The error model with time for this qubit. The error possibility is 1-e^{-decoherence_rate * t}.

          Parameters
            -
          • t – the time stored in a quantum memory. The unit it second.

          • -
          • decoherence_rate (float) – the decoherence rate

          • -
          • kwargs – other parameters

          • +
          • t (float) – the during time in second.

          • +
          • decoherence_rate (float) – the decoherence rate.

          @@ -757,15 +926,13 @@

          Submodules
          -qns.models.qubit.DephaseTransferErrorModel(self, length: Optional[float] = 0, decoherence_rate: Optional[float] = 0, **kwargs)[source]
          -

          The dephase error model for transmitting a qubit in quantum channel.

          -

          A random Z gate will be operate on the qubit with possibility: 1-e^(-decoherence_rate * length)

          +qns.models.qubit.DephaseTransferErrorModel(self, length: Optional[float] = 0, decoherence_rate: Optional[float] = 0, **kwargs) +

          The error model with length for this qubit. The error possibility is 1-e^{-decoherence_rate * length}.

          Parameters
            -
          • length – the channel length

          • -
          • decoherence_rate (float) – the decoherence rate

          • -
          • kwargs – other parameters

          • +
          • length (float) – the transmission length in meter.

          • +
          • decoherence_rate (float) – the decoherence rate.

          @@ -773,16 +940,13 @@

          Submodules
          -qns.models.qubit.DepolarMeasureErrorModel(self, decoherence_rate: Optional[float] = 0, **kwargs)[source]
          -

          The depolar error model for measuring on a qubit.

          -
          -
          One of the random Pauli gate will be operate on the qubit with possibility:

          1-e^(-decoherence_rate * t)

          -
          -
          +qns.models.qubit.DepolarMeasureErrorModel(self, p: Optional[float] = 0, **kwargs) +

          The depolarizing error model.

          +

          One of the random Pauli gate will be operate on the qubit with possibility p :

          Parameters
            -
          • decoherence_rate (float) – the decoherence rate

          • +
          • p (float) – the error possibility

          • kwargs – other parameters

          @@ -791,16 +955,13 @@

          Submodules
          -qns.models.qubit.DepolarOperateErrorModel(self, decoherence_rate: Optional[float] = 0, **kwargs)[source]
          -

          The depolar error model for operating on a qubit.

          -
          -
          One of the random Pauli gate will be operate on the qubit with possibility:

          1-e^(-decoherence_rate * t)

          -
          -
          +qns.models.qubit.DepolarOperateErrorModel(self, p: Optional[float] = 0, **kwargs) +

          The depolarizing error model.

          +

          One of the random Pauli gate will be operate on the qubit with possibility p :

          Parameters
            -
          • decoherence_rate (float) – the decoherence rate

          • +
          • p (float) – the error possibility

          • kwargs – other parameters

          @@ -809,18 +970,13 @@

          Submodules
          -qns.models.qubit.DepolarStorageErrorModel(self, t: Optional[float] = 0, decoherence_rate: Optional[float] = 0, **kwargs)[source]
          -

          The depolar error model for storing a qubit in quantum memory.

          -
          -
          One of the random Pauli gate will be operate on the qubit with possibility:

          1-e^(-decoherence_rate * t)

          -
          -
          +qns.models.qubit.DepolarStorageErrorModel(self, t: Optional[float] = 0, decoherence_rate: Optional[float] = 0, **kwargs) +

          The error model with time for this qubit. The error possibility is 1-e^{-decoherence_rate * t}.

          Parameters
            -
          • t – the time stored in a quantum memory. The unit it second.

          • -
          • decoherence_rate (float) – the decoherence rate

          • -
          • kwargs – other parameters

          • +
          • t (float) – the during time in second.

          • +
          • decoherence_rate (float) – the decoherence rate.

          @@ -828,18 +984,13 @@

          Submodules
          -qns.models.qubit.DepolarTransferErrorModel(self, length: Optional[float] = 0, decoherence_rate: Optional[float] = 0, **kwargs)[source]
          -

          The depolar error model for transmitting a qubit in quantum channel.

          -
          -
          One of the random Pauli gate will be operate on the qubit with possibility:

          1-e^(-decoherence_rate * t)

          -
          -
          +qns.models.qubit.DepolarTransferErrorModel(self, length: Optional[float] = 0, decoherence_rate: Optional[float] = 0, **kwargs) +

          The error model with length for this qubit. The error possibility is 1-e^{-decoherence_rate * length}.

          Parameters
            -
          • length – the channel length

          • -
          • decoherence_rate (float) – the decoherence rate

          • -
          • kwargs – other parameters

          • +
          • length (float) – the transmission length in meter.

          • +
          • decoherence_rate (float) – the decoherence rate.

          @@ -847,37 +998,35 @@

          Submodules
          -qns.models.qubit.PrefectMeasureErrorModel(self, decoherence_rate: Optional[float] = 0, **kwargs)[source]
          -

          The default error model for measuring this qubit.

          +qns.models.qubit.PrefectMeasureErrorModel(self, p: Optional[float] = 0, **kwargs) +

          The default error model for this qubit.

          Parameters
          -

          decoherence_rate (float) – the decoherence rate

          +

          p (float) – the error possibility

          -qns.models.qubit.PrefectOperateErrorModel(self, decoherence_rate: Optional[float] = 0, **kwargs)[source]
          -

          The default error model for operating this qubit.

          +qns.models.qubit.PrefectOperateErrorModel(self, p: Optional[float] = 0, **kwargs) +

          The default error model for this qubit.

          Parameters
          -

          decoherence_rate (float) – the decoherence rate

          +

          p (float) – the error possibility

          -qns.models.qubit.PrefectStorageErrorModel(self, t: Optional[float] = 0, decoherence_rate: Optional[float] = 0, **kwargs)[source]
          -

          The default error model for storing a qubit in quantum memory. -The default behavior is doing nothing

          +qns.models.qubit.PrefectStorageErrorModel(self, t: Optional[float] = 0, decoherence_rate: Optional[float] = 0, **kwargs) +

          The error model with time for this qubit. The error possibility is 1-e^{-decoherence_rate * t}.

          Parameters
            -
          • t – the time stored in a quantum memory. The unit it second.

          • +
          • t (float) – the during time in second.

          • decoherence_rate (float) – the decoherence rate.

          • -
          • kwargs – other parameters

          @@ -885,15 +1034,13 @@

          Submodules
          -qns.models.qubit.PrefectTransferErrorModel(self, length: Optional[float] = 0, decoherence_rate: Optional[float] = 0, **kwargs)[source]
          -

          The default error model for transmitting this qubit -The default behavior is doing nothing

          +qns.models.qubit.PrefectTransferErrorModel(self, length: Optional[float] = 0, decoherence_rate: Optional[float] = 0, **kwargs) +

          The error model with length for this qubit. The error possibility is 1-e^{-decoherence_rate * length}.

          Parameters
            -
          • length (float) – the length of the channel

          • +
          • length (float) – the transmission length in meter.

          • decoherence_rate (float) – the decoherence rate.

          • -
          • kwargs – other parameters

          @@ -1150,7 +1297,7 @@

          Submodules
          -class qns.models.qubit.QubitFactory(operate_decoherence_rate: float = 0, measure_decoherence_rate: float = 0, store_error_model=<function PrefectStorageErrorModel>, transfer_error_model=<function PrefectTransferErrorModel>, operate_error_model=<function PrefectOperateErrorModel>, measure_error_model=<function PrefectMeasureErrorModel>)[source]
          +class qns.models.qubit.QubitFactory(operate_decoherence_rate: float = 0, measure_decoherence_rate: float = 0, store_error_model=<function ErrorWithTime.<locals>.GeneratedErrorWithTime>, transfer_error_model=<function ErrorWithLength.<locals>.GeneratedErrorWithLength>, operate_error_model=<function PrefectError>, measure_error_model=<function PrefectError>)[source]

          Bases: object

          QubitFactory is the factory class for building qubits with special error models.

          diff --git a/docs/build/html/qns.network.html b/docs/build/html/qns.network.html index 0d08705..1c58b79 100644 --- a/docs/build/html/qns.network.html +++ b/docs/build/html/qns.network.html @@ -332,6 +332,11 @@

          Submodulesclass qns.network.DijkstraRouteAlgorithm(name: str = 'dijkstra', metric_func: Optional[Callable[[Union[qns.entity.qchannel.qchannel.QuantumChannel, qns.entity.cchannel.cchannel.ClassicChannel]], float]] = None)[source]

          Bases: qns.network.route.route.RouteImpl

          This is the dijkstra route algorithm implement

          +
          +
          +INF = inf
          +
          +
          build(nodes: List[qns.entity.node.node.QNode], channels: List[Union[qns.entity.qchannel.qchannel.QuantumChannel, qns.entity.cchannel.cchannel.ClassicChannel]])[source]
          diff --git a/docs/build/html/qns.network.protocol.html b/docs/build/html/qns.network.protocol.html index 38ef9c2..bb81338 100644 --- a/docs/build/html/qns.network.protocol.html +++ b/docs/build/html/qns.network.protocol.html @@ -96,7 +96,7 @@

          Submodules

          qns.network.protocol.bb84 module

          -class qns.network.protocol.bb84.BB84RecvApp(src: qns.entity.node.node.QNode, qchannel: qns.entity.qchannel.qchannel.QuantumChannel, cchannel: qns.entity.cchannel.cchannel.ClassicChannel)[source]
          +class qns.network.protocol.bb84.BB84RecvApp(src: qns.entity.node.node.QNode, qchannel: qns.entity.qchannel.qchannel.QuantumChannel, cchannel: qns.entity.cchannel.cchannel.ClassicChannel, min_length_for_post_processing=5000, proportion_for_estimating_error=0.4, max_cascade_round=4, cascade_alpha=0.73, cascade_beita=2, init_lower_cascade_key_block_size=5, init_upper_cascade_key_block_size=20, security=0.05)[source]

          Bases: qns.entity.node.app.Application

          @@ -118,11 +118,50 @@

          Submodulesrecv(event: qns.entity.qchannel.qchannel.RecvQubitPacket)[source]

          +
          +
          +recv_cascade_reply_packet(event: qns.entity.cchannel.cchannel.RecvClassicPacket)[source]
          +

          BB84RecvApp recv cascade_reply packet,perform next round of cascade,and send cascade_ask packet.

          +
          +
          Parameters
          +

          event – the cascade_reply packet.

          +
          +
          +
          + +
          +
          +recv_check_error_reply_packet(event: qns.entity.cchannel.cchannel.RecvClassicPacket)[source]
          +

          BB84RecvApp recv check_error_reply packet,perform privacy amplification,and send privacy_amplification_ask packet.

          +
          +
          Parameters
          +

          event – the check_error_reply packet.

          +
          +
          +
          + +
          +
          +recv_error_estimate_reply_packet(event: qns.entity.cchannel.cchannel.RecvClassicPacket)[source]
          +

          BB84RecvApp recv error_estimate_reply packet,perform the first round of cascade,send cascade_ask packet.

          +
          +
          Parameters
          +

          event – the error_estimate_reply packet.

          +
          +
          +
          + +
          +
          +send_error_estimate_packet()[source]
          +

          BB84Recvapp send error estimate ask packet.

          +
          +
          -class qns.network.protocol.bb84.BB84SendApp(dest: qns.entity.node.node.QNode, qchannel: qns.entity.qchannel.qchannel.QuantumChannel, cchannel: qns.entity.cchannel.cchannel.ClassicChannel, send_rate=1000)[source]
          +class qns.network.protocol.bb84.BB84SendApp(dest: qns.entity.node.node.QNode, qchannel: qns.entity.qchannel.qchannel.QuantumChannel, cchannel: qns.entity.cchannel.cchannel.ClassicChannel, send_rate=1000, min_length_for_post_processing=5000, proportion_for_estimating_error=0.4, max_cascade_round=4, cascade_alpha=0.73, cascade_beita=2, init_lower_cascade_key_block_size=5, init_upper_cascade_key_block_size=20, security=0.05)[source]

          Bases: qns.entity.node.app.Application

          @@ -148,6 +187,50 @@

          Submodules +
          +recv_cascade_ask_packet(event: qns.entity.cchannel.cchannel.RecvClassicPacket)[source]
          +

          BB84SendApp recv cascade_ask packet,calculate the parity value of the corresponding block,and send cascade_reply packet.

          +
          +
          Parameters
          +

          event – the cascade_ask packet.

          +
          +
          +

          + +
          +
          +recv_check_error_ask_packet(event: qns.entity.cchannel.cchannel.RecvClassicPacket)[source]
          +

          BB84SendApp recv check_error_ask packet,check error,and send check_error_reply packet.

          +
          +
          Parameters
          +

          event – the check_error_ask packet.

          +
          +
          +
          + +
          +
          +recv_error_estimate_packet(event: qns.entity.cchannel.cchannel.RecvClassicPacket)[source]
          +

          BB84SendApp recv error estimate packet,and send error_estimate_reply packet.

          +
          +
          Parameters
          +

          event – the error estimate packet.

          +
          +
          +
          + +
          +
          +recv_privacy_amplification_ask_packet(event: qns.entity.cchannel.cchannel.RecvClassicPacket)[source]
          +

          BB84SendApp recv privacy_amplification_ask packet,perform privacy amplification.

          +
          +
          Parameters
          +

          event – the privacy_amplification_ask packet.

          +
          +
          +
          +
          send_qubit()[source]
          @@ -177,6 +260,72 @@

          Submodules +
          +qns.network.protocol.bb84.cascade_binary_divide(begin: int, end: int)[source]
          +

          Evenly divided the key block.

          +
          +
          Parameters
          +
            +
          • begin – key block begin index.

          • +
          • end – key block end index.

          • +
          +
          +
          +

          + +
          +
          +qns.network.protocol.bb84.cascade_key_shuffle(index: list)[source]
          +

          Shuffle the index.

          +
          +
          Parameters
          +

          index – the index list.

          +
          +
          +
          + +
          +
          +qns.network.protocol.bb84.cascade_parity(target: list)[source]
          +

          Calculate key block parity.

          +
          +
          Parameters
          +

          target – target key block.

          +
          +
          +
          + +
          +
          +qns.network.protocol.bb84.pa_generate_toeplitz_matrix(N: int, M: int, first_row: list, first_col: list)[source]
          +

          Generate a Toeplitz matrix of size N x M using two given list of binary values.

          +
          +
          Parameters
          +
            +
          • N – col num of the Toeplitz matrix.

          • +
          • M – row num of the Toeplitz matrix.

          • +
          • first_row – first row of the Toeplitz matrix.

          • +
          • first_col – first col of the Toeplitz matrix.

          • +
          +
          +
          +
          + +
          +
          +qns.network.protocol.bb84.pa_randomize_key(original_key: list, toeplitz_matrix)[source]
          +

          process the original key through the toeplitz matrix.

          +
          +
          Parameters
          +
            +
          • original_key – the original key.

          • +
          • toeplitz_matrix – the toeplitz matrix.

          • +
          +
          +
          +
          +

          qns.network.protocol.classicforward module

          @@ -212,7 +361,7 @@

          Submodules

          qns.network.protocol.entanglement_distribution module

          -class qns.network.protocol.entanglement_distribution.EntanglementDistributionApp(send_rate: Optional[int] = None, init_fidelity: int = 0.99)[source]
          +class qns.network.protocol.entanglement_distribution.EntanglementDistributionApp(send_rate: Optional[int] = None, init_fidelity: float = 0.99)[source]

          Bases: qns.entity.node.app.Application

          @@ -336,7 +485,7 @@

          Submodules

          Module contents

          -class qns.network.protocol.BB84RecvApp(src: qns.entity.node.node.QNode, qchannel: qns.entity.qchannel.qchannel.QuantumChannel, cchannel: qns.entity.cchannel.cchannel.ClassicChannel)[source]
          +class qns.network.protocol.BB84RecvApp(src: qns.entity.node.node.QNode, qchannel: qns.entity.qchannel.qchannel.QuantumChannel, cchannel: qns.entity.cchannel.cchannel.ClassicChannel, min_length_for_post_processing=5000, proportion_for_estimating_error=0.4, max_cascade_round=4, cascade_alpha=0.73, cascade_beita=2, init_lower_cascade_key_block_size=5, init_upper_cascade_key_block_size=20, security=0.05)[source]

          Bases: qns.entity.node.app.Application

          @@ -358,11 +507,50 @@

          Submodulesrecv(event: qns.entity.qchannel.qchannel.RecvQubitPacket)[source]

          +
          +
          +recv_cascade_reply_packet(event: qns.entity.cchannel.cchannel.RecvClassicPacket)[source]
          +

          BB84RecvApp recv cascade_reply packet,perform next round of cascade,and send cascade_ask packet.

          +
          +
          Parameters
          +

          event – the cascade_reply packet.

          +
          +
          +
          + +
          +
          +recv_check_error_reply_packet(event: qns.entity.cchannel.cchannel.RecvClassicPacket)[source]
          +

          BB84RecvApp recv check_error_reply packet,perform privacy amplification,and send privacy_amplification_ask packet.

          +
          +
          Parameters
          +

          event – the check_error_reply packet.

          +
          +
          +
          + +
          +
          +recv_error_estimate_reply_packet(event: qns.entity.cchannel.cchannel.RecvClassicPacket)[source]
          +

          BB84RecvApp recv error_estimate_reply packet,perform the first round of cascade,send cascade_ask packet.

          +
          +
          Parameters
          +

          event – the error_estimate_reply packet.

          +
          +
          +
          + +
          +
          +send_error_estimate_packet()[source]
          +

          BB84Recvapp send error estimate ask packet.

          +
          +
          -class qns.network.protocol.BB84SendApp(dest: qns.entity.node.node.QNode, qchannel: qns.entity.qchannel.qchannel.QuantumChannel, cchannel: qns.entity.cchannel.cchannel.ClassicChannel, send_rate=1000)[source]
          +class qns.network.protocol.BB84SendApp(dest: qns.entity.node.node.QNode, qchannel: qns.entity.qchannel.qchannel.QuantumChannel, cchannel: qns.entity.cchannel.cchannel.ClassicChannel, send_rate=1000, min_length_for_post_processing=5000, proportion_for_estimating_error=0.4, max_cascade_round=4, cascade_alpha=0.73, cascade_beita=2, init_lower_cascade_key_block_size=5, init_upper_cascade_key_block_size=20, security=0.05)[source]

          Bases: qns.entity.node.app.Application

          @@ -388,6 +576,50 @@

          Submodules +
          +recv_cascade_ask_packet(event: qns.entity.cchannel.cchannel.RecvClassicPacket)[source]
          +

          BB84SendApp recv cascade_ask packet,calculate the parity value of the corresponding block,and send cascade_reply packet.

          +
          +
          Parameters
          +

          event – the cascade_ask packet.

          +
          +
          +

          + +
          +
          +recv_check_error_ask_packet(event: qns.entity.cchannel.cchannel.RecvClassicPacket)[source]
          +

          BB84SendApp recv check_error_ask packet,check error,and send check_error_reply packet.

          +
          +
          Parameters
          +

          event – the check_error_ask packet.

          +
          +
          +
          + +
          +
          +recv_error_estimate_packet(event: qns.entity.cchannel.cchannel.RecvClassicPacket)[source]
          +

          BB84SendApp recv error estimate packet,and send error_estimate_reply packet.

          +
          +
          Parameters
          +

          event – the error estimate packet.

          +
          +
          +
          + +
          +
          +recv_privacy_amplification_ask_packet(event: qns.entity.cchannel.cchannel.RecvClassicPacket)[source]
          +

          BB84SendApp recv privacy_amplification_ask packet,perform privacy amplification.

          +
          +
          Parameters
          +

          event – the privacy_amplification_ask packet.

          +
          +
          +
          +
          send_qubit()[source]
          @@ -424,7 +656,7 @@

          Submodules
          -class qns.network.protocol.EntanglementDistributionApp(send_rate: Optional[int] = None, init_fidelity: int = 0.99)[source]
          +class qns.network.protocol.EntanglementDistributionApp(send_rate: Optional[int] = None, init_fidelity: float = 0.99)[source]

          Bases: qns.entity.node.app.Application

          diff --git a/docs/build/html/qns.network.route.html b/docs/build/html/qns.network.route.html index 8d8b610..e9905ac 100644 --- a/docs/build/html/qns.network.route.html +++ b/docs/build/html/qns.network.route.html @@ -99,6 +99,11 @@

          Submodulesclass qns.network.route.dijkstra.DijkstraRouteAlgorithm(name: str = 'dijkstra', metric_func: Optional[Callable[[Union[qns.entity.qchannel.qchannel.QuantumChannel, qns.entity.cchannel.cchannel.ClassicChannel]], float]] = None)[source]

          Bases: qns.network.route.route.RouteImpl

          This is the dijkstra route algorithm implement

          +
          +
          +INF = inf
          +
          +
          build(nodes: List[qns.entity.node.node.QNode], channels: List[Union[qns.entity.qchannel.qchannel.QuantumChannel, qns.entity.cchannel.cchannel.ClassicChannel]])[source]
          @@ -183,6 +188,11 @@

          Submodulesclass qns.network.route.DijkstraRouteAlgorithm(name: str = 'dijkstra', metric_func: Optional[Callable[[Union[qns.entity.qchannel.qchannel.QuantumChannel, qns.entity.cchannel.cchannel.ClassicChannel]], float]] = None)[source]

          Bases: qns.network.route.route.RouteImpl

          This is the dijkstra route algorithm implement

          +
          +
          +INF = inf
          +
          +
          build(nodes: List[qns.entity.node.node.QNode], channels: List[Union[qns.entity.qchannel.qchannel.QuantumChannel, qns.entity.cchannel.cchannel.ClassicChannel]])[source]
          diff --git a/docs/build/html/qns.simulator.html b/docs/build/html/qns.simulator.html index 2d9ed62..d5ab1b5 100644 --- a/docs/build/html/qns.simulator.html +++ b/docs/build/html/qns.simulator.html @@ -292,6 +292,17 @@

          qns.simulator.pool module +
          +qns.simulator.ts.set_default_accuracy(time_slots: int)[source]
          +

          set the default simulation accuracy

          +
          +
          Parameters
          +

          time_slots (int) – the time slots per second.

          +
          +
          +

          +

          qns.simulator.ts module

          @@ -308,6 +319,17 @@

          qns.simulator.ts module +
          +qns.simulator.ts.set_default_accuracy(time_slots: int)[source]
          +

          set the default simulation accuracy

          +
          +
          Parameters
          +

          time_slots (int) – the time slots per second.

          +
          +
          +

          +

          Module contents

          @@ -422,6 +444,17 @@

          qns.simulator.ts module +
          +qns.simulator.set_default_accuracy(time_slots: int)[source]
          +

          set the default simulation accuracy

          +
          +
          Parameters
          +

          time_slots (int) – the time slots per second.

          +
          +
          +

          + diff --git a/docs/build/html/searchindex.js b/docs/build/html/searchindex.js index 7a3da50..353f9ae 100644 --- a/docs/build/html/searchindex.js +++ b/docs/build/html/searchindex.js @@ -1 +1 @@ -Search.setIndex({docnames:["develop","index","install","introduction","modules","qns","qns.entity","qns.entity.cchannel","qns.entity.memory","qns.entity.monitor","qns.entity.node","qns.entity.operator","qns.entity.qchannel","qns.entity.timer","qns.models","qns.models.core","qns.models.delay","qns.models.epr","qns.models.qubit","qns.network","qns.network.protocol","qns.network.route","qns.network.topology","qns.simulator","qns.utils","tutorials","tutorials.entity","tutorials.entity.cchannel","tutorials.entity.memory","tutorials.entity.monitor","tutorials.entity.node","tutorials.entity.operator","tutorials.entity.other","tutorials.entity.qchannel","tutorials.models","tutorials.models.delay","tutorials.models.epr","tutorials.models.qubit","tutorials.network","tutorials.network.request","tutorials.network.route","tutorials.network.topology","tutorials.parallel_simulation","tutorials.quickstart","tutorials.simulator","tutorials.util"],envversion:{"sphinx.domains.c":2,"sphinx.domains.changeset":1,"sphinx.domains.citation":1,"sphinx.domains.cpp":5,"sphinx.domains.index":1,"sphinx.domains.javascript":2,"sphinx.domains.math":2,"sphinx.domains.python":3,"sphinx.domains.rst":2,"sphinx.domains.std":2,"sphinx.ext.todo":2,"sphinx.ext.viewcode":1,sphinx:56},filenames:["develop.rst","index.rst","install.rst","introduction.rst","modules.rst","qns.rst","qns.entity.rst","qns.entity.cchannel.rst","qns.entity.memory.rst","qns.entity.monitor.rst","qns.entity.node.rst","qns.entity.operator.rst","qns.entity.qchannel.rst","qns.entity.timer.rst","qns.models.rst","qns.models.core.rst","qns.models.delay.rst","qns.models.epr.rst","qns.models.qubit.rst","qns.network.rst","qns.network.protocol.rst","qns.network.route.rst","qns.network.topology.rst","qns.simulator.rst","qns.utils.rst","tutorials.rst","tutorials.entity.rst","tutorials.entity.cchannel.rst","tutorials.entity.memory.rst","tutorials.entity.monitor.rst","tutorials.entity.node.rst","tutorials.entity.operator.rst","tutorials.entity.other.rst","tutorials.entity.qchannel.rst","tutorials.models.rst","tutorials.models.delay.rst","tutorials.models.epr.rst","tutorials.models.qubit.rst","tutorials.network.rst","tutorials.network.request.rst","tutorials.network.route.rst","tutorials.network.topology.rst","tutorials.parallel_simulation.rst","tutorials.quickstart.rst","tutorials.simulator.rst","tutorials.util.rst"],objects:{"":[[5,0,0,"-","qns"]],"qns.entity":[[6,1,1,"","Application"],[6,1,1,"","ClassicChannel"],[6,1,1,"","ClassicPacket"],[6,1,1,"","Entity"],[6,1,1,"","MemoryReadRequestEvent"],[6,1,1,"","MemoryReadResponseEvent"],[6,1,1,"","MemoryWriteRequestEvent"],[6,1,1,"","MemoryWriteResponseEvent"],[6,1,1,"","Monitor"],[6,1,1,"","MonitorEvent"],[6,1,1,"","OperateRequestEvent"],[6,1,1,"","OperateResponseEvent"],[6,1,1,"","QNode"],[6,1,1,"","QuantumChannel"],[6,1,1,"","QuantumMemory"],[6,1,1,"","QuantumOperator"],[6,1,1,"","RecvClassicPacket"],[6,1,1,"","RecvQubitPacket"],[6,1,1,"","Timer"],[7,0,0,"-","cchannel"],[6,0,0,"-","entity"],[8,0,0,"-","memory"],[9,0,0,"-","monitor"],[10,0,0,"-","node"],[11,0,0,"-","operator"],[12,0,0,"-","qchannel"],[13,0,0,"-","timer"]],"qns.entity.Application":[[6,2,1,"","add_handler"],[6,2,1,"","get_node"],[6,2,1,"","get_simulator"],[6,2,1,"","handle"],[6,2,1,"","install"]],"qns.entity.ClassicChannel":[[6,2,1,"","install"],[6,2,1,"","send"]],"qns.entity.ClassicPacket":[[6,2,1,"","encode"],[6,2,1,"","get"]],"qns.entity.Entity":[[6,2,1,"","handle"],[6,2,1,"","install"]],"qns.entity.MemoryReadRequestEvent":[[6,2,1,"","invoke"]],"qns.entity.MemoryReadResponseEvent":[[6,2,1,"","invoke"]],"qns.entity.MemoryWriteRequestEvent":[[6,2,1,"","invoke"]],"qns.entity.MemoryWriteResponseEvent":[[6,2,1,"","invoke"]],"qns.entity.Monitor":[[6,2,1,"","add_attribution"],[6,2,1,"","at_event"],[6,2,1,"","at_finish"],[6,2,1,"","at_period"],[6,2,1,"","at_start"],[6,2,1,"","calculate_date"],[6,2,1,"","get_date"],[6,2,1,"","handle"],[6,2,1,"","install"]],"qns.entity.MonitorEvent":[[6,2,1,"","invoke"]],"qns.entity.OperateRequestEvent":[[6,2,1,"","invoke"]],"qns.entity.OperateResponseEvent":[[6,2,1,"","invoke"]],"qns.entity.QNode":[[6,2,1,"","add_apps"],[6,2,1,"","add_cchannel"],[6,2,1,"","add_memory"],[6,2,1,"","add_network"],[6,2,1,"","add_operator"],[6,2,1,"","add_qchannel"],[6,2,1,"","add_request"],[6,2,1,"","clear_request"],[6,2,1,"","get_apps"],[6,2,1,"","get_cchannel"],[6,2,1,"","get_qchannel"],[6,2,1,"","handle"],[6,2,1,"","install"]],"qns.entity.QuantumChannel":[[6,2,1,"","install"],[6,2,1,"","send"]],"qns.entity.QuantumMemory":[[6,3,1,"","count"],[6,2,1,"","get"],[6,2,1,"","get_store_time"],[6,2,1,"","handle"],[6,2,1,"","install"],[6,2,1,"","is_full"],[6,2,1,"","read"],[6,2,1,"","write"]],"qns.entity.QuantumOperator":[[6,2,1,"","handle"],[6,2,1,"","install"],[6,2,1,"","operate"],[6,2,1,"","set_own"]],"qns.entity.RecvClassicPacket":[[6,2,1,"","invoke"]],"qns.entity.RecvQubitPacket":[[6,2,1,"","invoke"]],"qns.entity.Timer":[[6,2,1,"","install"],[6,2,1,"","trigger"]],"qns.entity.cchannel":[[7,1,1,"","ClassicChannel"],[7,1,1,"","ClassicPacket"],[7,1,1,"","RecvClassicPacket"],[7,0,0,"-","cchannel"]],"qns.entity.cchannel.ClassicChannel":[[7,2,1,"","install"],[7,2,1,"","send"]],"qns.entity.cchannel.ClassicPacket":[[7,2,1,"","encode"],[7,2,1,"","get"]],"qns.entity.cchannel.RecvClassicPacket":[[7,2,1,"","invoke"]],"qns.entity.cchannel.cchannel":[[7,1,1,"","ClassicChannel"],[7,1,1,"","ClassicPacket"],[7,4,1,"","NextHopNotConnectionException"],[7,1,1,"","RecvClassicPacket"]],"qns.entity.cchannel.cchannel.ClassicChannel":[[7,2,1,"","install"],[7,2,1,"","send"]],"qns.entity.cchannel.cchannel.ClassicPacket":[[7,2,1,"","encode"],[7,2,1,"","get"]],"qns.entity.cchannel.cchannel.RecvClassicPacket":[[7,2,1,"","invoke"]],"qns.entity.entity":[[6,1,1,"","Entity"]],"qns.entity.entity.Entity":[[6,2,1,"","handle"],[6,2,1,"","install"]],"qns.entity.memory":[[8,1,1,"","MemoryReadRequestEvent"],[8,1,1,"","MemoryReadResponseEvent"],[8,1,1,"","MemoryWriteRequestEvent"],[8,1,1,"","MemoryWriteResponseEvent"],[8,1,1,"","QuantumMemory"],[8,0,0,"-","event"],[8,0,0,"-","memory"]],"qns.entity.memory.MemoryReadRequestEvent":[[8,2,1,"","invoke"]],"qns.entity.memory.MemoryReadResponseEvent":[[8,2,1,"","invoke"]],"qns.entity.memory.MemoryWriteRequestEvent":[[8,2,1,"","invoke"]],"qns.entity.memory.MemoryWriteResponseEvent":[[8,2,1,"","invoke"]],"qns.entity.memory.QuantumMemory":[[8,3,1,"","count"],[8,2,1,"","get"],[8,2,1,"","get_store_time"],[8,2,1,"","handle"],[8,2,1,"","install"],[8,2,1,"","is_full"],[8,2,1,"","read"],[8,2,1,"","write"]],"qns.entity.memory.event":[[8,1,1,"","MemoryReadRequestEvent"],[8,1,1,"","MemoryReadResponseEvent"],[8,1,1,"","MemoryWriteRequestEvent"],[8,1,1,"","MemoryWriteResponseEvent"]],"qns.entity.memory.event.MemoryReadRequestEvent":[[8,2,1,"","invoke"]],"qns.entity.memory.event.MemoryReadResponseEvent":[[8,2,1,"","invoke"]],"qns.entity.memory.event.MemoryWriteRequestEvent":[[8,2,1,"","invoke"]],"qns.entity.memory.event.MemoryWriteResponseEvent":[[8,2,1,"","invoke"]],"qns.entity.memory.memory":[[8,4,1,"","OutOfMemoryException"],[8,1,1,"","QuantumMemory"]],"qns.entity.memory.memory.QuantumMemory":[[8,3,1,"","count"],[8,2,1,"","get"],[8,2,1,"","get_store_time"],[8,2,1,"","handle"],[8,2,1,"","install"],[8,2,1,"","is_full"],[8,2,1,"","read"],[8,2,1,"","write"]],"qns.entity.monitor":[[9,1,1,"","Monitor"],[9,1,1,"","MonitorEvent"],[9,0,0,"-","monitor"]],"qns.entity.monitor.Monitor":[[9,2,1,"","add_attribution"],[9,2,1,"","at_event"],[9,2,1,"","at_finish"],[9,2,1,"","at_period"],[9,2,1,"","at_start"],[9,2,1,"","calculate_date"],[9,2,1,"","get_date"],[9,2,1,"","handle"],[9,2,1,"","install"]],"qns.entity.monitor.MonitorEvent":[[9,2,1,"","invoke"]],"qns.entity.monitor.monitor":[[9,1,1,"","Monitor"],[9,1,1,"","MonitorEvent"]],"qns.entity.monitor.monitor.Monitor":[[9,2,1,"","add_attribution"],[9,2,1,"","at_event"],[9,2,1,"","at_finish"],[9,2,1,"","at_period"],[9,2,1,"","at_start"],[9,2,1,"","calculate_date"],[9,2,1,"","get_date"],[9,2,1,"","handle"],[9,2,1,"","install"]],"qns.entity.monitor.monitor.MonitorEvent":[[9,2,1,"","invoke"]],"qns.entity.node":[[10,1,1,"","Application"],[10,1,1,"","QNode"],[10,0,0,"-","app"],[10,0,0,"-","node"]],"qns.entity.node.Application":[[10,2,1,"","add_handler"],[10,2,1,"","get_node"],[10,2,1,"","get_simulator"],[10,2,1,"","handle"],[10,2,1,"","install"]],"qns.entity.node.QNode":[[10,2,1,"","add_apps"],[10,2,1,"","add_cchannel"],[10,2,1,"","add_memory"],[10,2,1,"","add_network"],[10,2,1,"","add_operator"],[10,2,1,"","add_qchannel"],[10,2,1,"","add_request"],[10,2,1,"","clear_request"],[10,2,1,"","get_apps"],[10,2,1,"","get_cchannel"],[10,2,1,"","get_qchannel"],[10,2,1,"","handle"],[10,2,1,"","install"]],"qns.entity.node.app":[[10,1,1,"","Application"]],"qns.entity.node.app.Application":[[10,2,1,"","add_handler"],[10,2,1,"","get_node"],[10,2,1,"","get_simulator"],[10,2,1,"","handle"],[10,2,1,"","install"]],"qns.entity.node.node":[[10,1,1,"","QNode"]],"qns.entity.node.node.QNode":[[10,2,1,"","add_apps"],[10,2,1,"","add_cchannel"],[10,2,1,"","add_memory"],[10,2,1,"","add_network"],[10,2,1,"","add_operator"],[10,2,1,"","add_qchannel"],[10,2,1,"","add_request"],[10,2,1,"","clear_request"],[10,2,1,"","get_apps"],[10,2,1,"","get_cchannel"],[10,2,1,"","get_qchannel"],[10,2,1,"","handle"],[10,2,1,"","install"]],"qns.entity.operator":[[11,1,1,"","OperateRequestEvent"],[11,1,1,"","OperateResponseEvent"],[11,1,1,"","QuantumOperator"],[11,0,0,"-","event"],[11,0,0,"module-0","operator"]],"qns.entity.operator.OperateRequestEvent":[[11,2,1,"","invoke"]],"qns.entity.operator.OperateResponseEvent":[[11,2,1,"","invoke"]],"qns.entity.operator.QuantumOperator":[[11,2,1,"","handle"],[11,2,1,"","install"],[11,2,1,"","operate"],[11,2,1,"","set_own"]],"qns.entity.operator.event":[[11,1,1,"","OperateRequestEvent"],[11,1,1,"","OperateResponseEvent"]],"qns.entity.operator.event.OperateRequestEvent":[[11,2,1,"","invoke"]],"qns.entity.operator.event.OperateResponseEvent":[[11,2,1,"","invoke"]],"qns.entity.operator.operator":[[11,1,1,"id0","QuantumOperator"]],"qns.entity.operator.operator.QuantumOperator":[[11,2,1,"id2","handle"],[11,2,1,"id3","install"],[11,2,1,"id4","operate"],[11,2,1,"id5","set_own"]],"qns.entity.qchannel":[[12,1,1,"","QuantumChannel"],[12,1,1,"","QubitLossChannel"],[12,1,1,"","RecvQubitPacket"],[12,0,0,"-","losschannel"],[12,0,0,"-","qchannel"]],"qns.entity.qchannel.QuantumChannel":[[12,2,1,"","install"],[12,2,1,"","send"]],"qns.entity.qchannel.RecvQubitPacket":[[12,2,1,"","invoke"]],"qns.entity.qchannel.losschannel":[[12,1,1,"","QubitLossChannel"]],"qns.entity.qchannel.qchannel":[[12,4,1,"","NextHopNotConnectionException"],[12,1,1,"","QuantumChannel"],[12,1,1,"","RecvQubitPacket"]],"qns.entity.qchannel.qchannel.QuantumChannel":[[12,2,1,"","install"],[12,2,1,"","send"]],"qns.entity.qchannel.qchannel.RecvQubitPacket":[[12,2,1,"","invoke"]],"qns.entity.timer":[[13,1,1,"","Timer"],[13,0,0,"-","timer"]],"qns.entity.timer.Timer":[[13,2,1,"","install"],[13,2,1,"","trigger"]],"qns.entity.timer.timer":[[13,1,1,"","Timer"],[13,1,1,"","TimerEvent"]],"qns.entity.timer.timer.Timer":[[13,2,1,"","install"],[13,2,1,"","trigger"]],"qns.entity.timer.timer.TimerEvent":[[13,2,1,"","invoke"]],"qns.models":[[14,1,1,"","QuantumModel"],[15,0,0,"-","core"],[16,0,0,"-","delay"],[17,0,0,"-","epr"],[18,0,0,"-","qubit"]],"qns.models.QuantumModel":[[14,2,1,"","measure_error_model"],[14,2,1,"","operate_error_model"],[14,2,1,"","store_error_model"],[14,2,1,"","transfer_error_model"]],"qns.models.core":[[15,1,1,"","QuantumModel"],[15,0,0,"-","backend"]],"qns.models.core.QuantumModel":[[15,2,1,"","measure_error_model"],[15,2,1,"","operate_error_model"],[15,2,1,"","store_error_model"],[15,2,1,"","transfer_error_model"]],"qns.models.core.backend":[[15,1,1,"","QuantumModel"]],"qns.models.core.backend.QuantumModel":[[15,2,1,"","measure_error_model"],[15,2,1,"","operate_error_model"],[15,2,1,"","store_error_model"],[15,2,1,"","transfer_error_model"]],"qns.models.delay":[[16,1,1,"","ConstantDelayModel"],[16,1,1,"","DelayModel"],[16,1,1,"","NormalDelayModel"],[16,1,1,"","UniformDelayModel"],[16,0,0,"-","constdelay"],[16,0,0,"-","delay"],[16,0,0,"-","normaldelay"],[16,0,0,"-","uniformdelay"]],"qns.models.delay.ConstantDelayModel":[[16,2,1,"","calculate"]],"qns.models.delay.DelayModel":[[16,2,1,"","calculate"]],"qns.models.delay.NormalDelayModel":[[16,2,1,"","calculate"]],"qns.models.delay.UniformDelayModel":[[16,2,1,"","calculate"]],"qns.models.delay.constdelay":[[16,1,1,"","ConstantDelayModel"]],"qns.models.delay.constdelay.ConstantDelayModel":[[16,2,1,"","calculate"]],"qns.models.delay.delay":[[16,1,1,"","DelayModel"]],"qns.models.delay.delay.DelayModel":[[16,2,1,"","calculate"]],"qns.models.delay.normaldelay":[[16,1,1,"","NormalDelayModel"]],"qns.models.delay.normaldelay.NormalDelayModel":[[16,2,1,"","calculate"]],"qns.models.delay.uniformdelay":[[16,1,1,"","UniformDelayModel"]],"qns.models.delay.uniformdelay.UniformDelayModel":[[16,2,1,"","calculate"]],"qns.models.epr":[[17,1,1,"","BaseEntanglement"],[17,1,1,"","BellStateEntanglement"],[17,1,1,"","MixedStateEntanglement"],[17,1,1,"","WernerStateEntanglement"],[17,0,0,"-","bell"],[17,0,0,"-","entanglement"],[17,0,0,"-","mixed"],[17,0,0,"-","werner"]],"qns.models.epr.BaseEntanglement":[[17,2,1,"","distillation"],[17,2,1,"","swapping"],[17,2,1,"","teleportion"],[17,2,1,"","to_qubits"]],"qns.models.epr.BellStateEntanglement":[[17,2,1,"","distillation"],[17,2,1,"","store_error_model"],[17,2,1,"","swapping"],[17,2,1,"","transfer_error_model"]],"qns.models.epr.MixedStateEntanglement":[[17,3,1,"","a"],[17,2,1,"","distillation"],[17,2,1,"","normalized"],[17,2,1,"","store_error_model"],[17,2,1,"","swapping"],[17,2,1,"","to_qubits"],[17,2,1,"","transfer_error_model"]],"qns.models.epr.WernerStateEntanglement":[[17,2,1,"","distillation"],[17,3,1,"","fidelity"],[17,2,1,"","store_error_model"],[17,2,1,"","swapping"],[17,2,1,"","to_qubits"],[17,2,1,"","transfer_error_model"]],"qns.models.epr.bell":[[17,1,1,"","BellStateEntanglement"]],"qns.models.epr.bell.BellStateEntanglement":[[17,2,1,"","distillation"],[17,2,1,"","store_error_model"],[17,2,1,"","swapping"],[17,2,1,"","transfer_error_model"]],"qns.models.epr.entanglement":[[17,1,1,"","BaseEntanglement"]],"qns.models.epr.entanglement.BaseEntanglement":[[17,2,1,"","distillation"],[17,2,1,"","swapping"],[17,2,1,"","teleportion"],[17,2,1,"","to_qubits"]],"qns.models.epr.mixed":[[17,1,1,"","MixedStateEntanglement"]],"qns.models.epr.mixed.MixedStateEntanglement":[[17,3,1,"","a"],[17,2,1,"","distillation"],[17,2,1,"","normalized"],[17,2,1,"","store_error_model"],[17,2,1,"","swapping"],[17,2,1,"","to_qubits"],[17,2,1,"","transfer_error_model"]],"qns.models.epr.werner":[[17,1,1,"","WernerStateEntanglement"]],"qns.models.epr.werner.WernerStateEntanglement":[[17,2,1,"","distillation"],[17,3,1,"","fidelity"],[17,2,1,"","store_error_model"],[17,2,1,"","swapping"],[17,2,1,"","to_qubits"],[17,2,1,"","transfer_error_model"]],"qns.models.qubit":[[18,5,1,"","DephaseMeasureErrorModel"],[18,5,1,"","DephaseOperateErrorModel"],[18,5,1,"","DephaseStorageErrorModel"],[18,5,1,"","DephaseTransferErrorModel"],[18,5,1,"","DepolarMeasureErrorModel"],[18,5,1,"","DepolarOperateErrorModel"],[18,5,1,"","DepolarStorageErrorModel"],[18,5,1,"","DepolarTransferErrorModel"],[18,5,1,"","PrefectMeasureErrorModel"],[18,5,1,"","PrefectOperateErrorModel"],[18,5,1,"","PrefectStorageErrorModel"],[18,5,1,"","PrefectTransferErrorModel"],[18,1,1,"","QState"],[18,1,1,"","Qubit"],[18,1,1,"","QubitFactory"],[18,0,0,"-","const"],[18,0,0,"-","decoherence"],[18,0,0,"-","errors"],[18,0,0,"-","factory"],[18,0,0,"-","gate"],[18,5,1,"","joint"],[18,0,0,"-","qubit"],[18,5,1,"","single_gate_expand"],[18,0,0,"-","utils"]],"qns.models.qubit.QState":[[18,2,1,"","equal"],[18,2,1,"","is_pure_state"],[18,2,1,"","measure"],[18,2,1,"","operate"],[18,2,1,"","state"],[18,2,1,"","stochastic_operate"]],"qns.models.qubit.Qubit":[[18,2,1,"","measure"],[18,2,1,"","measureX"],[18,2,1,"","measureY"],[18,2,1,"","measureZ"],[18,2,1,"","measure_error_model"],[18,2,1,"","operate"],[18,2,1,"","operate_error_model"],[18,2,1,"","stochastic_operate"],[18,2,1,"","store_error_model"],[18,2,1,"","transfer_error_model"]],"qns.models.qubit.const":[[18,5,1,"","OPERATOR_PHASE_SHIFT"],[18,5,1,"","OPERATOR_RX"],[18,5,1,"","OPERATOR_RY"],[18,5,1,"","OPERATOR_RZ"]],"qns.models.qubit.decoherence":[[18,5,1,"","DephaseMeasureErrorModel"],[18,5,1,"","DephaseOperateErrorModel"],[18,5,1,"","DephaseStorageErrorModel"],[18,5,1,"","DephaseTransferErrorModel"],[18,5,1,"","DepolarMeasureErrorModel"],[18,5,1,"","DepolarOperateErrorModel"],[18,5,1,"","DepolarStorageErrorModel"],[18,5,1,"","DepolarTransferErrorModel"],[18,5,1,"","PrefectMeasureErrorModel"],[18,5,1,"","PrefectOperateErrorModel"],[18,5,1,"","PrefectStorageErrorModel"],[18,5,1,"","PrefectTransferErrorModel"]],"qns.models.qubit.errors":[[18,4,1,"","OperatorError"],[18,4,1,"","OperatorNotMatchError"],[18,4,1,"","QGateOperatorNotMatchError"],[18,4,1,"","QGateQubitNotInStateError"],[18,4,1,"","QGateStateJointError"],[18,4,1,"","QStateBaseError"],[18,4,1,"","QStateQubitNotInStateError"],[18,4,1,"","QStateSizeNotMatchError"]],"qns.models.qubit.factory":[[18,1,1,"","QubitFactory"]],"qns.models.qubit.gate":[[18,1,1,"","DoubleQubitsControlledGate"],[18,1,1,"","DoubleQubitsRotateGate"],[18,1,1,"","Gate"],[18,1,1,"","SingleQubitArbitraryGate"],[18,1,1,"","SingleQubitGate"],[18,1,1,"","SingleQubitRotateGate"],[18,1,1,"","SwapGate"],[18,1,1,"","ThreeQubitsGate"]],"qns.models.qubit.qubit":[[18,1,1,"","QState"],[18,1,1,"","Qubit"]],"qns.models.qubit.qubit.QState":[[18,2,1,"","equal"],[18,2,1,"","is_pure_state"],[18,2,1,"","measure"],[18,2,1,"","operate"],[18,2,1,"","state"],[18,2,1,"","stochastic_operate"]],"qns.models.qubit.qubit.Qubit":[[18,2,1,"","measure"],[18,2,1,"","measureX"],[18,2,1,"","measureY"],[18,2,1,"","measureZ"],[18,2,1,"","measure_error_model"],[18,2,1,"","operate"],[18,2,1,"","operate_error_model"],[18,2,1,"","stochastic_operate"],[18,2,1,"","store_error_model"],[18,2,1,"","transfer_error_model"]],"qns.models.qubit.utils":[[18,5,1,"","joint"],[18,5,1,"","partial_trace"],[18,5,1,"","single_gate_expand"]],"qns.network":[[19,1,1,"","BasicTopology"],[19,1,1,"","DijkstraRouteAlgorithm"],[19,1,1,"","GridTopology"],[19,1,1,"","LineTopology"],[19,4,1,"","NetworkRouteError"],[19,4,1,"","QNSNetworkError"],[19,1,1,"","QuantumNetwork"],[19,1,1,"","RandomTopology"],[19,1,1,"","Request"],[19,1,1,"","RouteImpl"],[19,1,1,"","Topology"],[19,1,1,"","TreeTopology"],[19,1,1,"","WaxmanTopology"],[19,0,0,"-","network"],[20,0,0,"-","protocol"],[19,0,0,"-","requests"],[21,0,0,"-","route"],[22,0,0,"-","topology"]],"qns.network.BasicTopology":[[19,2,1,"","build"]],"qns.network.DijkstraRouteAlgorithm":[[19,2,1,"","build"],[19,2,1,"","query"]],"qns.network.GridTopology":[[19,2,1,"","build"]],"qns.network.LineTopology":[[19,2,1,"","build"]],"qns.network.QuantumNetwork":[[19,2,1,"","add_cchannel"],[19,2,1,"","add_memories"],[19,2,1,"","add_node"],[19,2,1,"","add_qchannel"],[19,2,1,"","add_request"],[19,2,1,"","build_route"],[19,2,1,"","get_cchannel"],[19,2,1,"","get_node"],[19,2,1,"","get_qchannel"],[19,2,1,"","install"],[19,2,1,"","query_route"],[19,2,1,"","random_requests"]],"qns.network.RandomTopology":[[19,2,1,"","build"]],"qns.network.RouteImpl":[[19,2,1,"","build"],[19,2,1,"","query"]],"qns.network.Topology":[[19,2,1,"","add_cchannels"],[19,2,1,"","build"]],"qns.network.TreeTopology":[[19,2,1,"","build"]],"qns.network.WaxmanTopology":[[19,2,1,"","build"]],"qns.network.network":[[19,4,1,"","QNSNetworkError"],[19,1,1,"","QuantumNetwork"]],"qns.network.network.QuantumNetwork":[[19,2,1,"","add_cchannel"],[19,2,1,"","add_memories"],[19,2,1,"","add_node"],[19,2,1,"","add_qchannel"],[19,2,1,"","add_request"],[19,2,1,"","build_route"],[19,2,1,"","get_cchannel"],[19,2,1,"","get_node"],[19,2,1,"","get_qchannel"],[19,2,1,"","install"],[19,2,1,"","query_route"],[19,2,1,"","random_requests"]],"qns.network.protocol":[[20,1,1,"","BB84RecvApp"],[20,1,1,"","BB84SendApp"],[20,1,1,"","ClassicPacketForwardApp"],[20,1,1,"","EntanglementDistributionApp"],[20,1,1,"","NodeProcessDelayApp"],[20,0,0,"-","bb84"],[20,0,0,"-","classicforward"],[20,0,0,"-","entanglement_distribution"],[20,0,0,"-","node_process_delay"]],"qns.network.protocol.BB84RecvApp":[[20,2,1,"","check_basis"],[20,2,1,"","handleClassicPacket"],[20,2,1,"","handleQuantumPacket"],[20,2,1,"","recv"]],"qns.network.protocol.BB84SendApp":[[20,2,1,"","check_basis"],[20,2,1,"","handleClassicPacket"],[20,2,1,"","install"],[20,2,1,"","send_qubit"]],"qns.network.protocol.ClassicPacketForwardApp":[[20,2,1,"","handleClassicPacket"],[20,2,1,"","install"]],"qns.network.protocol.EntanglementDistributionApp":[[20,2,1,"","RecvClassicPacketHandler"],[20,2,1,"","RecvQubitHandler"],[20,2,1,"","generate_qubit"],[20,2,1,"","handle_response"],[20,2,1,"","install"],[20,2,1,"","new_distribution"],[20,2,1,"","request_distrbution"],[20,2,1,"","response_distribution"],[20,2,1,"","set_first_epr"],[20,2,1,"","set_second_epr"]],"qns.network.protocol.NodeProcessDelayApp":[[20,2,1,"","check_in_delay_event_list"],[20,2,1,"","handle"],[20,2,1,"","install"]],"qns.network.protocol.bb84":[[20,1,1,"","BB84RecvApp"],[20,1,1,"","BB84SendApp"],[20,1,1,"","QubitWithError"]],"qns.network.protocol.bb84.BB84RecvApp":[[20,2,1,"","check_basis"],[20,2,1,"","handleClassicPacket"],[20,2,1,"","handleQuantumPacket"],[20,2,1,"","recv"]],"qns.network.protocol.bb84.BB84SendApp":[[20,2,1,"","check_basis"],[20,2,1,"","handleClassicPacket"],[20,2,1,"","install"],[20,2,1,"","send_qubit"]],"qns.network.protocol.bb84.QubitWithError":[[20,2,1,"","transfer_error_model"]],"qns.network.protocol.classicforward":[[20,1,1,"","ClassicPacketForwardApp"]],"qns.network.protocol.classicforward.ClassicPacketForwardApp":[[20,2,1,"","handleClassicPacket"],[20,2,1,"","install"]],"qns.network.protocol.entanglement_distribution":[[20,1,1,"","EntanglementDistributionApp"],[20,1,1,"","Transmit"]],"qns.network.protocol.entanglement_distribution.EntanglementDistributionApp":[[20,2,1,"","RecvClassicPacketHandler"],[20,2,1,"","RecvQubitHandler"],[20,2,1,"","generate_qubit"],[20,2,1,"","handle_response"],[20,2,1,"","install"],[20,2,1,"","new_distribution"],[20,2,1,"","request_distrbution"],[20,2,1,"","response_distribution"],[20,2,1,"","set_first_epr"],[20,2,1,"","set_second_epr"]],"qns.network.protocol.node_process_delay":[[20,1,1,"","NodeProcessDelayApp"]],"qns.network.protocol.node_process_delay.NodeProcessDelayApp":[[20,2,1,"","check_in_delay_event_list"],[20,2,1,"","handle"],[20,2,1,"","install"]],"qns.network.requests":[[19,1,1,"","Request"]],"qns.network.route":[[21,1,1,"","DijkstraRouteAlgorithm"],[21,4,1,"","NetworkRouteError"],[21,1,1,"","RouteImpl"],[21,0,0,"-","dijkstra"],[21,0,0,"-","route"]],"qns.network.route.DijkstraRouteAlgorithm":[[21,2,1,"","build"],[21,2,1,"","query"]],"qns.network.route.RouteImpl":[[21,2,1,"","build"],[21,2,1,"","query"]],"qns.network.route.dijkstra":[[21,1,1,"","DijkstraRouteAlgorithm"]],"qns.network.route.dijkstra.DijkstraRouteAlgorithm":[[21,2,1,"","build"],[21,2,1,"","query"]],"qns.network.route.route":[[21,4,1,"","NetworkRouteError"],[21,1,1,"","RouteImpl"]],"qns.network.route.route.RouteImpl":[[21,2,1,"","build"],[21,2,1,"","query"]],"qns.network.topology":[[22,1,1,"","BasicTopology"],[22,1,1,"","GridTopology"],[22,1,1,"","LineTopology"],[22,1,1,"","RandomTopology"],[22,1,1,"","Topology"],[22,1,1,"","TreeTopology"],[22,1,1,"","WaxmanTopology"],[22,0,0,"-","basictopo"],[22,0,0,"-","gridtopo"],[22,0,0,"-","linetopo"],[22,0,0,"-","randomtopo"],[22,0,0,"-","topo"],[22,0,0,"-","treetopo"],[22,0,0,"-","waxmantopo"]],"qns.network.topology.BasicTopology":[[22,2,1,"","build"]],"qns.network.topology.GridTopology":[[22,2,1,"","build"]],"qns.network.topology.LineTopology":[[22,2,1,"","build"]],"qns.network.topology.RandomTopology":[[22,2,1,"","build"]],"qns.network.topology.Topology":[[22,2,1,"","add_cchannels"],[22,2,1,"","build"]],"qns.network.topology.TreeTopology":[[22,2,1,"","build"]],"qns.network.topology.WaxmanTopology":[[22,2,1,"","build"]],"qns.network.topology.basictopo":[[22,1,1,"","BasicTopology"]],"qns.network.topology.basictopo.BasicTopology":[[22,2,1,"","build"]],"qns.network.topology.gridtopo":[[22,1,1,"","GridTopology"]],"qns.network.topology.gridtopo.GridTopology":[[22,2,1,"","build"]],"qns.network.topology.linetopo":[[22,1,1,"","LineTopology"]],"qns.network.topology.linetopo.LineTopology":[[22,2,1,"","build"]],"qns.network.topology.randomtopo":[[22,1,1,"","RandomTopology"]],"qns.network.topology.randomtopo.RandomTopology":[[22,2,1,"","build"]],"qns.network.topology.topo":[[22,1,1,"","ClassicTopology"],[22,1,1,"","Topology"]],"qns.network.topology.topo.ClassicTopology":[[22,6,1,"","All"],[22,6,1,"","Empty"],[22,6,1,"","Follow"]],"qns.network.topology.topo.Topology":[[22,2,1,"","add_cchannels"],[22,2,1,"","build"]],"qns.network.topology.treetopo":[[22,1,1,"","TreeTopology"]],"qns.network.topology.treetopo.TreeTopology":[[22,2,1,"","build"]],"qns.network.topology.waxmantopo":[[22,1,1,"","WaxmanTopology"]],"qns.network.topology.waxmantopo.WaxmanTopology":[[22,2,1,"","build"]],"qns.simulator":[[23,1,1,"","Event"],[23,1,1,"","Simulator"],[23,1,1,"","Time"],[23,0,0,"-","event"],[23,5,1,"","func_to_event"],[23,0,0,"module-0","pool"],[23,0,0,"-","simulator"],[23,0,0,"module-1","ts"]],"qns.simulator.Event":[[23,2,1,"","cancel"],[23,2,1,"","invoke"],[23,3,1,"","is_canceled"]],"qns.simulator.Simulator":[[23,2,1,"","add_event"],[23,3,1,"","current_time"],[23,2,1,"","run"],[23,3,1,"","tc"],[23,2,1,"","time"]],"qns.simulator.Time":[[23,3,1,"","sec"]],"qns.simulator.event":[[23,1,1,"","Event"],[23,5,1,"","func_to_event"]],"qns.simulator.event.Event":[[23,2,1,"","cancel"],[23,2,1,"","invoke"],[23,3,1,"","is_canceled"]],"qns.simulator.pool":[[23,1,1,"id0","DefaultEventPool"]],"qns.simulator.pool.DefaultEventPool":[[23,2,1,"id2","add_event"],[23,3,1,"id3","current_time"],[23,2,1,"id4","next_event"]],"qns.simulator.simulator":[[23,1,1,"","Simulator"]],"qns.simulator.simulator.Simulator":[[23,2,1,"","add_event"],[23,3,1,"","current_time"],[23,2,1,"","run"],[23,3,1,"","tc"],[23,2,1,"","time"]],"qns.simulator.ts":[[23,1,1,"id6","Time"]],"qns.simulator.ts.Time":[[23,3,1,"id7","sec"]],"qns.utils":[[24,5,1,"","critical"],[24,5,1,"","debug"],[24,5,1,"","error"],[24,5,1,"","get_choice"],[24,5,1,"","get_rand"],[24,5,1,"","get_randint"],[24,5,1,"","info"],[24,5,1,"","install"],[24,0,0,"-","log"],[24,5,1,"","monitor"],[24,0,0,"-","multiprocess"],[24,0,0,"-","rnd"],[24,5,1,"","set_seed"],[24,5,1,"","warn"]],"qns.utils.log":[[24,5,1,"","critical"],[24,5,1,"","debug"],[24,5,1,"","error"],[24,5,1,"","info"],[24,5,1,"","install"],[24,7,1,"","logger"],[24,5,1,"","monitor"],[24,5,1,"","warn"]],"qns.utils.multiprocess":[[24,1,1,"","MPSimulations"]],"qns.utils.multiprocess.MPSimulations":[[24,2,1,"","get_data"],[24,2,1,"","get_raw_data"],[24,2,1,"","prepare_setting"],[24,2,1,"","run"],[24,2,1,"","start"]],"qns.utils.rnd":[[24,5,1,"","get_choice"],[24,5,1,"","get_normal"],[24,5,1,"","get_rand"],[24,5,1,"","get_randint"],[24,5,1,"","set_seed"]],qns:[[6,0,0,"-","entity"],[14,0,0,"-","models"],[19,0,0,"-","network"],[23,0,0,"-","simulator"],[24,0,0,"-","utils"]]},objnames:{"0":["py","module","Python module"],"1":["py","class","Python class"],"2":["py","method","Python method"],"3":["py","property","Python property"],"4":["py","exception","Python exception"],"5":["py","function","Python function"],"6":["py","attribute","Python attribute"],"7":["py","data","Python data"]},objtypes:{"0":"py:module","1":"py:class","2":"py:method","3":"py:property","4":"py:exception","5":"py:function","6":"py:attribute","7":"py:data"},terms:{"0":[0,6,7,8,11,12,13,14,15,16,17,18,19,20,23,24,27,28,30,31,32,33,35,36,37,40,41,42,43,44,45],"000":[43,44],"05":[40,41,42,43],"06":18,"0s":[27,33],"1":[6,9,12,13,17,18,20,22,24,27,28,29,30,31,32,33,35,36,37,40,41,42,43,44,45],"10":[12,24,27,28,30,31,32,33,35,40,41,42,43,45],"100":[24,43,44],"1000":[20,28,31,32,33,37,43,45],"10000":[27,33],"100000":43,"1000000":[23,43],"10000000":[27,42],"10000000000":43,"15":42,"150":43,"1641801012":45,"1e":[18,44],"1s":30,"2":[17,18,19,22,27,28,30,33,34,36,37,39,42,43,44],"20":42,"25":[17,36],"299791458":43,"2db":33,"3":[0,6,9,18,22,27,30,33,35,36,40,41,42],"30":[30,35],"36":36,"3w":36,"4":[19,22,33,36,37,40,42],"44":35,"450":43,"5":[27,28,30,31,32,33,35,36,39,40,41,42,45],"50":[24,37,43],"50000":43,"5s":[30,31],"6":44,"60":[23,41,44],"7":[0,37],"7777777777777777":2,"8":[0,36],"88":[24,42],"9":36,"95":36,"96":17,"99":[20,42,43],"abstract":34,"boolean":[42,45],"byte":[6,7,27],"case":[25,26,27],"class":[0,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,26,27,28,30,31,32,33,34,35,37,38,41,42,44],"const":[5,14,36,37],"default":[16,17,18,20,23,24,27,32,33,36,40,42,44,45],"do":[0,17,18,20,32,36,42,43],"enum":[22,38,41],"final":[2,6,9,29,32,36,37,42,43,45],"float":[6,7,8,9,11,12,13,14,15,16,17,18,19,20,21,22,23,24,27,28,31,32,33,37,45],"function":[3,6,8,9,10,11,13,14,15,18,23,24,28,29,30,31,32,33,34,37,38,40,44,45],"import":[0,27,28,29,30,32,33,35,36,37,40,41,42,43,44,45],"int":[6,7,8,11,12,18,19,20,22,23,24],"new":[0,17,29,36,39,41,44],"return":[6,7,8,9,10,11,16,17,18,19,20,21,22,23,24,27,28,29,30,31,33,40,42,43],"static":[0,19,21],"super":[27,28,30,31,32,33],"switch":30,"true":[6,10,18,20,24,30,32,39,42,44,45],"try":1,"while":[28,31,32],A:[6,13,17,18,19,21,26,36,37,39],And:[2,37],As:3,But:40,By:[32,34,40,42,44],For:[2,3,6,9,27,30,32,36,37,42],If:[18,27,30,32,33,36,42],In:[27,28,31,36,43,44],It:[0,3,6,8,10,11,18,20,23,27,28,29,30,32,33,34,35,36,37,38,39,40,41,42,44],Its:[17,31,40,41],No:27,On:30,One:[18,37],Or:27,The:[1,2,3,6,7,8,10,12,14,15,16,17,18,19,20,21,22,23,24,25,27,28,29,30,31,32,33,34,35,38,39,41,42,43],Then:[2,43],There:30,To:[0,2,36,37,42,43,44,45],With:45,_4:36,__class__:29,__init__:[27,28,30,31,32,33],_doc:18,_is_instal:32,_simul:[27,28,31,32,33],a1:31,a_1:36,a_2:36,abl:41,about:[3,27],abov:[36,43],acceler:1,accord:[14,15],accordingli:34,accuraci:[18,23,27,42,43,44],activ:31,ad:[27,30,41],add:[6,10,19,20,23,27,29,30,33,39,41,43,44,45],add_app:[6,10,27,28,30,31,33,43],add_attribut:[6,9,29],add_cchannel:[6,10,19,22,27,30,41,43],add_ev:[23,27,28,31,32,33,44],add_handl:[6,10,28,30,31],add_memori:[6,10,19,28,30,41],add_network:[6,10],add_nod:[19,41],add_oper:[6,10,31],add_qchannel:[6,10,19,30,33,41,43],add_request:[6,10,19,39,42],addit:[20,28,41],adopt:[0,36],advantag:36,after:[6,9,28,29,36,39,40,44],aggreg:[24,42],algorithm:[1,3,19,21,25,38,41,43],alia:23,all:[0,3,6,10,19,22,24,26,27,30,32,33,36,37,39,41,42,43],alloc:3,allow:[19,20,39],allow_overlai:[19,39],along:2,alpha:[19,22,36,41],also:[2,28,30,31,33,36,37,40,44],alwai:17,amplif:39,an:[0,6,8,9,10,11,13,18,20,22,23,24,25,26,27,28,31,32,33,34,36,37,38,40,41,42,44,45],analysi:29,ani:[0,2,6,7,8,9,11,12,13,18,23,27,30,36,44],anoth:[17,27,33,37,41,42],answer:1,anther:3,anyth:32,api:[1,3,6,8,32,41],apidoc:0,app:[5,6,19,20,22,27,28,30,33,42,43],app_typ:[6,10],append:[32,33],applic:[6,10,19,20,22,23,25,26,27,28,31,33,38,41,43],ar:[0,3,18,19,22,26,28,29,30,34,36,37,41,42,44],arch:2,architectur:3,area:41,arg:[23,24,32],argument:19,arrai:[18,20,33,37],aspect:3,assert:[27,28,30,31,33,37,44],assum:27,assumpt:3,asynchron:[6,8,11,25,26],at_ev:[6,9,29],at_finish:[6,9,29],at_period:[6,9,29],at_start:[6,9,29],attenu:33,attenuation_r:12,attr:[19,39,42,43],attribut:[6,9,19,27,28,29,33,36,39,41,44],autobuild:0,automat:[0,27,39,43],auxiliari:3,avail:37,b:[17,36],b_1:36,b_2:36,backend:[5,6,8,11,12,14,17,18,20],bandwidth:[6,7,12,27,30,33,35,39,40,41],base:[1,3,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,37,40,41,43,44],baseentangl:[17,36],basi:18,basic:[3,6,23,35,36],basictopo:[5,19],basictopolog:[19,22,41],bb84:[5,19,39,43],bb84recvapp:[20,39,43],bb84sendapp:[20,39,43],bbpssw:17,bdist_wheel:[0,2],been:23,befor:[6,7,8,9,10,11,12,13,27,29,30],begin:30,behavior:[17,18,20,30],believ:3,bell:[5,14,25,34],bellstateentangl:[17,36],bennett96:36,bennett:17,besid:3,beta:[19,22,36],bete:41,better:[3,25,26,42],between:[43,44],bind:30,bit:37,bool:[6,8,10,18,19,20,23,24,28,31],bootstrap:3,both:[3,34,36,37,41,45],bound:[17,24,44],bra:36,branch:0,bring:[3,44],buffer:[27,33],bug:[1,3],build:[0,2,3,18,19,21,22,25,26,27,36,37,38,39,40,42,43,44],build_rout:[19,27,40,42,43],built:[0,34,41],bylist:[6,10,30],bypass:30,c0:37,c1:[37,43],c:[2,17,36],c_1:36,c_2:36,calcul:[6,9,16,18,27,29,32,33,35,42],calculate_d:[6,9],calculate_func:[6,9,29],call:[6,7,8,9,10,11,12,13,23,26,27,28,29,30,32,33,35,44],callabl:[6,9,11,19,21,23],can:[0,1,2,3,6,8,10,11,12,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45],cancel:[23,44],cannel:44,capac:[6,8,19,28,40,41,42,43],carri:43,caus:[23,27,33],cchannel:[5,6,10,19,20,21,27,30,35,41,43],cchannel_arg:[19,22,27,40,41,42,43],cchannel_delai:43,cchannel_list:41,cd:2,cdot:[33,36],central:40,certain:[30,39],chang:[3,14,15,18,33,34,36,37],channel:[3,6,7,10,12,14,15,17,18,19,20,21,22,25,26,30,34,35,36,38,40,41,43],check:[0,6,8,27,28],check_basi:20,check_in_delay_event_list:20,checkout:2,child:[26,34,41],children:[19,22],children_num:[19,22],children_numb:[19,22,41],circuit:31,cl1:30,clang:2,classic:[6,7,10,12,19,20,21,22,25,26,30,35,38,39,40,43],classic_rout:27,classic_topo:[19,22,27,38,41,42,43],classicchannel:[6,7,10,19,20,21,27,30,35,41,43],classicforward:[5,19,27],classicpacket:[6,7,27],classicpacketforwardapp:[20,27,39],classictopolog:[19,22,27,40,41,42,43],clear:[6,10],clear_request:[6,10,39],clink:43,cnot:37,co:[33,37],code:[1,2,24,27,32,36,43],coher:[17,28],collect:[6,9,25,26,28],column:[6,9,29,45],com:2,combin:42,command:[0,2],common:[3,27,32,36,41],commonli:37,commun:3,compar:[18,44],compil:1,complex128:[33,37],complex:[33,37],comput:3,congest:40,connect:[6,7,10,12,19,22,41,43],consist:26,constant:[6,9,35],constantdelaymodel:[16,35],constdelai:[5,14],construct:[1,25],contain:[3,19,21,24,28,42],content:[1,4],contribut:3,control:[18,27,28,31,37],conveni:3,convert:23,core:[3,5,6,8,11,12,14,17,18,20,23,24,42],could:[6,8,9],count:[6,8,9,29,42,43],cpu:[1,25],creat:42,critic:[24,45],csv:45,current:[3,6,8,23,34,35,37,39,44,45],current_tim:[23,27,32,33,44],cython:1,d:[1,17,36],d_1:36,d_2:36,data1:45,data:[6,9,24,29,42,45],datafram:[6,9,24,29],date1:45,date2:45,date3:45,date:45,db:[18,43],debug:[24,45],decai:33,decoher:[5,14,15,17,19,20,28,33,36,37],decoherence_r:[6,8,12,14,15,17,18,19,20,28,33],decoi:36,def:[27,28,29,30,31,32,33,37,42,43,44,45],default_time_accuraci:44,defaulteventpool:23,defin:[36,37],delai:[5,6,7,8,11,12,14,20,25,26,27,28,31,33,34,39,40,41,42,43],delay_event_list:[20,30],delay_model:35,delaymodel:[6,7,8,11,12,16,27,28,31,33,35],deliv:31,demonstr:39,denot:37,densiti:[18,36],depend:32,dephas:[18,37],dephasemeasureerrormodel:18,dephaseoperateerrormodel:18,dephasestorageerrormodel:18,dephasetransfererrormodel:18,dephasetransmiterrormodel:37,deploi:[6,10],depolar:[18,37],depolarmeasureerrormodel:[18,37],depolaroperateerrormodel:18,depolarstorageerrormodel:[18,37],depolartransfererrormodel:18,describ:[28,31,34,35,36,44],design:[1,31],dest:[6,7,12,19,20,21,27,30,33,39,42],destin:[6,10,19,20,21,27,30,33,39],destion:40,detail:[1,27,31,37],detect:39,develop:1,devic:[25,26,30],dict:[6,8,12,19,22,24,27],dictionari:24,differ:[14,15,24,30,33],dijkstra:[5,19,25,27,38,42,43],dijkstraroutealgorithm:[19,21,27,40,42,43],directli:[6,8,11,19,22,28,41],directori:[0,2,25,28,33,41,42],discret:[1,3,23,25],dispath:[6,10],dist:[0,2],distil:[17,36],distribut:[1,3,17,25,35,39],doc:0,docstr:0,document:3,done:44,dot:[33,37],doubl:18,doublequbitscontrolledg:18,doublequbitsrotateg:18,down:[6,9],download:2,drive:44,driven:[3,23,44],drop:[27,28,33,36,43],drop_rat:[6,7,12,27,30,33,35,42,43],dst:[6,10,20,42],dtype:[33,37],dump:27,dure:[27,28,31,32,33,36,37,44],e0:36,e1:36,e2:36,e3:36,e4:36,e5:36,e6:36,e7:36,e:[6,9,17,18,24,29,36,40,42],each:[19,21,22,24,36,41,42,43],earli:3,easi:[27,33,36,37,45],easier:44,easili:3,element:[19,21,24,45],elif:37,els:32,empti:[6,10,19,22,30,41],enabl:[1,3],encod:[6,7,27],encourag:3,end:[25,26,44],end_second:23,end_tim:[6,13,32,44],enough:[0,27,36],ensur:0,entangl:[1,3,5,6,8,14,18,25,28,33,34,39],entanglement_distribut:[5,19,30,42,43],entanglementdistributionapp:[20,30,39,40,41,42,43],entiti:[1,3,4,5,19,20,21,22,23,25,27,28,29,30,31,33,35,43,44,45],enumer:22,environ:0,ep:18,epr1:28,epr2:28,epr:[5,14,15,16,20,28,36],eprdistributionsimul:42,equal:[17,18,27,36],equip:[28,30,31],error:[5,14,15,17,20,24,25,26,27,31,34,36,39,45],errorentangl:28,ertuil:2,especi:45,estim:17,evalu:[0,3,36,39],even:32,event:[1,3,4,5,6,7,9,10,12,13,20,25,26,27,28,29,30,31,32,33,39],event_nam:29,event_typ:[6,9],eventtypelist:[6,10,30],everi:[6,9,10,19,22,29,42,44],exampl:[3,6,9,25,27,28,29,30,31,32,33,34,35,36,38,40,41,42,43],except:[7,8,12,18,19,21],execut:[23,36],exist:30,exp:[28,43],experi:[24,42,43],explain:[0,25],expos:0,express:27,extend:[33,34,36],f:[30,36,42],fact:36,factori:[5,14,19,22,37],fals:[19,24],featur:3,few:43,fiber:33,fidel:[3,6,9,14,15,17,24,28,36,39,42,43],field:[27,33],file:[2,45],finish:[29,44],first:[0,2,17,27,28,29,30,31,32,33,40,43],first_epr_nam:20,firstli:27,fit:36,fix:[29,36,39,45],flake8:0,flexibl:3,flip:37,fn:23,focu:27,follow:[0,2,19,22,27,29,30,31,33,35,36,37,38,39,40,41,42],form:[29,33,37,38,41,42],format:[28,40],forward:[20,25,26,39],found:[30,37],four:42,frac:[36,37],from:[1,6,7,8,24,27,28,29,30,32,33,35,36,37,40,41,42,43,44,45],full:[6,8,27,28,33,34,42],func_to_ev:[23,27,33,44],further:[0,6,10,20,27,33,43],g:[6,9,24,40,42],gate:[5,6,11,14,31,37],gate_z_and_measur:31,gcc:2,gener:[0,1,3,6,10,19,20,22,24,25,26,27,28,30,32,33,34,35,38,39,40,44],generate_qubit:20,get:[6,7,8,9,10,19,23,24,27,28,29,30,31,33,39,41,42,43,44,45],get_app:[6,10,30],get_cchannel:[6,10,19,27,30,41],get_channel:30,get_choic:[24,45],get_dat:[6,9],get_data:[24,29,42],get_nod:[6,10,19,27,30,40,41,42],get_norm:24,get_qchannel:[6,10,19,30,33,41],get_rand:[24,45],get_randint:[24,45],get_raw_data:[24,42],get_simul:[6,10,30],get_store_tim:[6,8],gh:0,git:[0,2],github:[0,1,2],give:[28,43],good:27,googl:0,grid:[19,22,41],gridtopo:[5,19],gridtopolog:[19,22,41],group:31,guid:[3,43],h:[17,31,37],ha:[3,6,8,9,11,19,22,23,26,27,28,31,33,36,40,41,44],hadamard:[31,37],hand:30,handl:[6,8,9,10,11,20,26,27,28,30,31,32,33,44],handle_respons:20,handleclassicpacket:20,handlequantumpacket:20,handler:[6,10,30],happen:[6,9,10,18,26,44],happend:[6,9],have:[0,1,28,30,33,36,37,39,41],heap:44,hello:[27,44],help:[3,24,38,39],here:[27,28,29,30,31,32,33,42],hidden:17,hide:36,high:[3,24,34,36,45],higher:[3,36],hold:36,hook:29,hop:[6,7,12,19,21,39,40,43],host:0,how:[25,26,27,29,36,41,42],howev:[0,28],html:0,http:2,hz:37,i:[36,37],i_2:18,i_6:18,id:20,idea:3,ideal:[17,25,34],idx:18,implement:[6,7,8,9,11,12,13,19,21,23,27,30,32,34,35,36,37,38,39,40,41,43,44],includ:[1,3,6,14,15,18,19,22,26,36,37,39],incom:[27,30],independ:[28,31],index:[1,6,8,18],indic:[36,38,41,42,45],infinit:[27,33],influenc:32,info:[24,43,45],inform:[3,39],inherit:[32,41],init:[30,33],init_fidel:[20,40,41,42,43],initi:[3,6,7,8,9,10,11,12,13,20,26,27,29,30,31,32,33,38,41,42,43,44],inject:40,input:[6,9,28,29,30,31,32,33,34,35,36,40,42],insert:[6,10,19,23,27,33,44],instal:[0,1,6,7,8,9,10,11,12,13,19,20,24,26,27,28,29,30,31,32,33,41,42,43,45],instanti:43,instead:36,instruct:[1,27,29],integ:[24,45],interfac:[14,15,19,21,25,26,34,38,41],intern:[39,45],introduc:[28,33,36,44],introduct:1,investig:[1,3],invok:[6,7,8,9,11,12,13,23,44],is_cancel:[23,44],is_ful:[6,8,28],is_pure_st:18,isinst:[27,33],issu:0,iter:24,iter_count:[24,42],its:[3,6,8,19,27,33,41],itself:30,j:[18,20],joint:18,json:27,just:44,k:44,kei:[6,8,27,28,41,43],ket:[36,37],keyword:28,kind:[3,30,36],km:[33,43],kwarg:[14,15,17,18,20,23,28,33,37],l1:[27,33,35,41,43],l2:41,l:36,lambda:[6,9,29,40],larg:[1,3,25,39,43],larger:44,last:[6,9,43],later:28,layer:3,left:18,len:43,length:[6,12,14,15,17,18,20,27,33,34,36,37,40,43],level:[34,36,43,45],leverag:[0,1,24,25],librari:[0,2,3,45],light_spe:43,like:[1,44,45],limit:28,line:[19,22,41,43],lines_numb:[19,22,40,41,43],linetopo:[5,19,27],linetopolog:[19,22,27,41,42],link:[25,26],linux:2,list:[6,7,10,11,12,17,18,19,21,22,24,30,31,40,41,45],list_oper:18,list_p:18,listen:[28,30,31],lkm:[33,37],ll:[19,22],load:27,locat:2,log:[1,3,4,5,25,32,43],logger:[24,43,45],lose:[27,33],loss:[12,25,26],losschannel:[5,6],low:[24,36,45],lower:17,m1:[28,30],m2:28,m3:28,m:[6,9,28,29,30],machin:42,maco:2,mai:[3,28,30,33,36,39,41],maintain:[36,44],major:43,make:[3,42,44,45],manag:[3,25,38],mani:[1,44],manual:[25,39,44],match:[6,10],math:33,mathbb:36,matric:18,matrix:[18,36,37],matter:[24,30],max:[17,35,36],max_buffer_s:[6,7,12,27,30,33,35],max_delai:[16,35],maximum:[27,33],mean:[3,6,10,24,27,30,33,36,42],mean_delai:[16,35],measur:[6,11,14,15,18,25,26,30,34,36,43,45],measure_decoherence_r:[18,20,37],measure_error_model:[14,15,18,37],measurei:[18,37],measurex:[18,37],measurez:[18,37],meet:44,memori:[3,5,6,10,14,15,17,18,19,25,26,30,34,35,36,41,43],memory_arg:[19,22,40,41,42,43],memory_capac:[40,41,42,43],memory_s:24,memoryreadhandl:28,memoryreadrequestev:[6,8,28],memoryreadresponseapp:28,memoryreadresponseev:[6,8,28],memoryresponseapp:28,memorywritehandl:28,memorywriterequestev:[6,8,28],memorywriteresponseev:[6,8,28],messag:[6,7,27,30,39,44,45],met:0,method:[0,6,10,23,26,27,28,29,30,32,33,35,40,41,42,44],metric:[19,21,40],metric_func:[19,21,40],min:35,min_delai:[16,35],minimum:44,mismatch:18,miu:33,mix:[5,14,18,25,34,37],mixedentangl:17,mixedstateentangl:17,mode:[6,8,11,25,26,30,42],model:[1,3,4,5,6,7,8,11,12,19,20,22,25,26,31],modul:[1,4,25,27,39,40,43,44],monitor:[5,6,24,25,26,32,43,45],monitor_1:29,monitorev:[6,9],more:[3,30,36,37,39,41,44],most:[1,25,27,34,44],moth:34,mpsimul:[24,42],msg1:27,msg2:27,msg:[6,7,24,27,30,44],multipl:[1,3,18,19,24,25,31,34,36,38,39,43],multiprocess:[4,5,42],multiprocesssimul:24,must:[27,30,32],n1:[27,28,30,31,33,39,40,41,42,43],n2:[27,30,33,40,41,43],n3:[30,39,40],n4:40,n5:40,n:[6,9,27,29,35,42],name:[0,2,6,7,8,9,10,11,12,13,16,17,18,19,20,21,23,24,27,28,29,30,31,32,33,34,35,36,37,38,41,42,43,44],ndarrai:[18,20],necessari:2,need:[0,2,27,28,29,33,36,42,44],neighbor:[19,22],net:[27,39,40,41,42,43],network:[0,1,3,4,5,6,9,10,25,27,30,32,36,39,40,42,45],networkrouteerror:[19,21],new_distribut:20,next:[6,7,12,19,21,23,27,33,40],next_ev:23,next_hop:[6,7,12,27,33],nexthop:[19,21],nexthopnotconnectionexcept:[6,7,12],nl:[19,22],node:[3,5,6,7,8,9,11,12,19,20,21,22,25,26,27,28,31,33,36,38,39,40,41,43],node_list:[6,7,12,41],node_num:24,node_process_delai:[5,19,30],nodeprocessdelayapp:[20,30,39],nodes_app:[19,22,40,41,42,43],nodes_numb:[19,22,27,40,41,42,43],none:[0,2,6,7,8,9,10,11,12,13,16,17,18,19,20,21,22,23,24,27,28,29,32,33,44],normal:[17,35],normaldelai:[5,14],normaldelaymodel:[16,35],noth:[17,18,20],notic:[27,33],notifi:[6,9],notimplementederror:32,now:[0,37,42,43],np:[18,28,33,37,43],number:[6,8,19,22,24,33,35,39,41,42,43,44,45],numpi:[18,20,37,43,45],o1:31,o:0,object:[6,7,8,10,14,15,16,17,18,19,20,21,22,23,24,27,29,36,39,44],occur:[18,27,44],onc:[30,32],one:[6,13,18,28,30,31,32,36,41,43],onli:[18,32],oper:[5,6,8,10,14,15,16,18,25,26,28,30,33,34,35,36],operate_decoherence_r:[18,20,37],operate_error_model:[14,15,18,37],operaterequestev:[6,11,31],operateresponseev:[6,11,31],operateresponseeventhandl:31,operator_phase_shift:18,operator_ri:18,operator_rx:18,operator_rz:18,operatorerror:18,operatornotmatcherror:18,optic:33,option:[6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,28,29,30,31,38,40,41,44],order:[6,10,44],organ:44,origin:[0,24,36],os:2,other:[2,3,14,15,17,18,19,20,22,25,26,27,28,30,33,34,36,41],other_st:18,otherwis:[27,32],our:0,out:43,outofmemoryexcept:8,output:[29,35,42,44,45],overal:43,overhead:[3,44],overlai:39,overview:1,overwit:24,overwrit:42,own:[30,36,37,39,40,41],owner:[6,11],p:36,p_:33,p_init:12,p_swap:[17,36],pacif:44,packag:[0,1,2,4,37,45],packat:20,packet1:27,packet2:27,packet:[2,6,7,12,20,25,26,30,33],page:0,pair:[6,8,17,19,43],panda:29,par:43,parallel:[1,25],param:[18,23],paramet:[6,7,8,9,10,11,12,13,14,15,17,18,19,20,21,22,23,24,28,29,30,31,32,33,34,35,36,38,41,42,43],parent:[19,22,41],parti:30,partial:18,partial_trac:18,pass:[0,6,10,30,32],passiv:30,path:[19,21,40],pattern:[19,22],pauli:[18,37],pd:[6,9,24],pep:0,per:[27,32,33,44],perfect:[19,22,41],perform:[3,31,36,42],perfrom:[6,11,17,18,24],period:[3,6,9,13,29,32,45],period_tim:[6,9,29],phase:37,phi:[17,36],physcial:[27,33],physic:[1,3,25],pi:[33,37],pip3:[0,2],pip:[0,1],platform:[1,2,3],point:[25,26],pool:[4,5,44],posit:30,possibl:[2,3,17,18,30,33,36,37,43,44],pre:[36,37],prefectmeasureerrormodel:18,prefectoperateerrormodel:18,prefectstorageerrormodel:18,prefecttransfererrormodel:18,prefer:0,prefix:0,prepare_set:24,present:[14,15,34,36,37,43],print:[27,28,30,32,36,37,43,44,45],print_ev:44,print_msg:44,printapp:30,printev:44,prioriti:[19,21],privaci:39,probabl:[27,33,36],procedur:39,process:[6,8,9,10,11,20,24,25,26,27,33,37,39,42],processev:30,produc:[3,23,36,37,38,41,43],progess:18,programm:30,propag:[27,33],properti:[6,8,17,23],propos:3,protocol:[1,3,5,17,19,21,25,27,30,36,38,42,43],provid:[0,2,3,24,25,27,29,32,34,35,36,37,38,39,40,41,42,43,44,45],psi:[17,36],publish:0,pull:0,pure:[18,37],purif:36,push:0,put:[27,33],py3:[0,2],py:[0,2],pypi:2,pytest:0,python3:[0,2,3],python:[0,2,27,45],q0:[36,37],q1:[28,36,37],q2:[28,36,37],q3:37,qchannel:[5,6,10,19,20,21,22,30,33,40,41,43],qchannel_arg:[19,22,27,40,41,42,43],qchannel_delai:43,qchannel_list:41,qgateoperatornotmatcherror:18,qgatequbitnotinstateerror:18,qgatestatejointerror:18,qkd:[1,3,25,39],ql1:30,qlink:43,qm:[6,8],qn:[0,1,2,3,27,28,29,30,32,33,35,36,37,39,40,41,42,43,44,45],qnode:[6,7,8,10,11,12,19,20,21,22,27,28,30,31,33,41,43],qnsnetworkerror:19,qo:39,qstate:[18,37],qstatebaseerror:18,qstatequbitnotinstateerror:18,qstatesizenotmatcherror:18,quantum:[0,1,3,6,8,10,11,14,15,17,18,19,20,21,22,25,27,34,35,38,39,40,43],quantumchannel:[6,10,12,19,20,21,22,30,33,41,43],quantummemori:[6,8,28,30,41],quantummodel:[6,8,11,12,14,15,17,18,20,33,34],quantumnetwork:[6,9,19,22,27,29,38,39,40,41,42,43],quantumoper:[6,10,11,31],quantunetwork:40,qubit1:18,qubit2:18,qubit:[3,5,6,8,9,11,12,14,15,16,17,20,25,26,34,36,43,45],qubit_state_0:[18,36,37],qubit_state_1:[18,37],qubit_state_l:[18,37],qubit_state_n:[18,37],qubit_state_p:[18,37],qubit_state_r:[18,37],qubitfactori:[18,37],qubitlosschannel:[12,33],qubitwitherror:[20,33,37],queri:[19,21,39,40],query_rout:[19,40],question:1,quick:[1,25],quickli:44,r:0,rais:[6,7,12,18,32],random:[1,3,18,19,22,24,25,33,35,37,39,41,43],random_request:[19,39,43],randomli:[19,22,33,39,43],randomtopo:[5,19],randomtopolog:[19,22,40,41,43],rate:[12,14,15,17,18,19,20,27,28,33,37,39,43],raw:[24,42],reach:[27,33],read:[6,8,28],read_request:28,realist:3,reason:27,receiv:[6,7,8,9,11,12,20,25,26,30,39,43],recent:44,recogn:3,reconcili:39,record:[6,9,45],recoveri:27,recv:[20,30],recv_count:29,recv_tim:[27,33],recvapp:[27,33],recvclassicpacket:[6,7,20,27,30],recvclassicpackethandl:[20,30],recvoperateapp:31,recvqubithandl:20,recvqubitpacket:[6,9,12,20,29,30,33],reduc:[3,28,43],refer:[28,36],referenc:36,relat:[26,27,30,32,33,39],reliabl:27,remot:[39,43],remov:[6,8,18],repeat:[25,26,42],report:[1,3],repres:[18,19,20,31,37,44],reproduc:45,req:43,req_num:24,request:[0,3,4,5,6,8,10,11,25,28,31,38,43],request_distrbut:20,requests_numb:43,requir:[1,2,39],research:[3,25],resourc:3,respect:[2,37],response_distribut:20,result:[3,6,8,11,19,21,24,28,31,40,42,43,45],ret:31,rho:[17,18,20,36],rho_r:18,rnd:[4,5],rotat:37,rout:[1,3,5,19,20,25,27,38,39,42,43],route_t:27,routeimpl:[19,20,21,27,40],router:[25,26],rp:[29,43],rule:0,run:[1,6,7,8,9,10,11,12,13,23,24,25,27,28,29,30,31,32,33,41,43,44,45],s:[0,3,6,9,13,16,19,22,23,24,25,27,28,29,31,32,33,35,37,38,41,42,43,44],same:[6,10,18,36,41,42],save:28,scale:[1,3,25,39,43],scenario:39,schema:3,sd:[19,43],search:28,sec:[23,27,28,31,32,33,44],second:[6,9,14,15,16,17,18,23,27,28,29,30,32,33,40,43,44],second_epr_nam:20,seed:[24,25],select:[39,43,45],self:[6,7,17,18,27,28,30,31,32,33,37,42,44],send:[6,7,8,9,11,12,25,26,28,30,43],send_count:29,send_packet:27,send_qubit:[20,33],send_rat:[20,27,33,42,43],sendapp:[27,33],sender:30,sens:43,sent:33,sep:[24,43,45],separ:45,serial:[29,31],session:[3,38,39,43],set:[6,7,8,9,10,11,12,13,24,28,30,31,33,35,37,42,43,44,45],set_first_epr:20,set_own:[6,11],set_se:[24,45],set_second_epr:20,setlevel:[43,45],setup:[0,2],setuptool:[0,2],sever:[3,19,26,30,38,39,41],share:30,shot:[6,13,32],should:[0,2,6,7,8,9,11,12,13,19,21,22,23,24,29,30,33,41],show:[27,28,33,36,37,41],signatur:[6,10],simpl:[23,39],simpler:36,simplifi:36,simqn:[0,2,3,24,25,26,27,29,34,35,36,37,38,39,40,41,42,43,44,45],simul:[1,2,3,4,5,6,7,8,9,10,11,12,13,19,20,24,25,26,27,28,29,30,31,32,33,41,45],simulation_tim:43,sin:[33,37],sinc:[3,27,36],singl:[18,24,37,42],single_gate_expand:18,singlequbitarbitraryg:18,singlequbitg:18,singlequbitrotateg:18,size:[18,19,22,27,28,33,41,43],skip:[6,10,20],slot:[23,43,44],smallest:44,so:[0,3,27,29,30,42,44],some:[25,29,30,32,37],sort:[19,21],sourc:[0,1,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,30,32,39,40],sp:[29,43],span:41,special:[18,19,22,38],sphinx:0,sphinx_rtd_them:0,sqrt:17,squar:[19,22,41],src:[6,7,19,20,21,27,30,39,42,43],ss:42,stabl:1,stai:3,standand_lkm:37,standard:[0,45],start:[1,6,9,24,25,27,29,32,33,42,44],start_second:23,start_tim:[6,13,32,44],state:[3,14,15,17,18,20,25,33,34,37,45],statu:[1,6,9,25,26,32,45],std:[16,24,35,42],step:41,step_tim:[6,13,32],still:3,stochast:[18,37],stochastic_oper:[18,37],storag:[28,34,36,37],storage_error_model:[28,34,36,37],store:[6,8,14,15,16,17,18,25,26,36],store_error_model:[14,15,17,18,19,37],store_error_model_arg:[6,8,19,28,41,42],str:[6,7,8,9,10,11,12,13,16,17,18,19,20,21,23,24,27,32],string:27,structur:25,studio:2,style:0,sub:42,submodul:[4,5,14],subpackag:4,subtre:0,succ_key_pool:43,success:[17,36,43],success_count:[42,43],successfulli:[6,8,23,28],suffer:37,suggest:3,suppos:17,swap:[17,25,34,36],swapgat:18,synchron:[6,8,11,25,26,31],system:[2,37],t1:[32,44,45],t2:44,t3:44,t:[6,7,8,9,11,12,13,14,15,17,18,23,27,28,31,32,33,34,36,37,44],t_coh:[17,28,41],tabl:[1,3,19,20,21,27,38,39,40,43],take:[28,32,33,34],tc:[23,28,31,44],te2:44,te:[23,44],tediou:27,teleport:[17,25,34],tell:[29,42],test:[0,3,44],text:33,than:36,thei:[18,28,29,30,33,39],them:[19,22,36,43],themselv:36,theta:[18,33,37],thi:[0,1,2,3,6,7,8,9,10,11,12,14,15,17,18,19,20,21,23,24,25,26,27,28,29,30,31,33,36,37,39,40,42,43,44],thing:0,third:[30,36],those:[28,29,33,37,39],though:36,three:[6,9,18,25,30,34,35,41],threequbitsg:18,throughput:[6,9,24,42],thu:[2,30],time:[6,7,8,9,11,12,13,14,15,16,17,18,23,25,27,28,29,31,32,33,34,35,36,42,45],time_list:[32,33],time_slot:23,time_spend:43,timer:[5,6,25,26,45],timerev:[13,32],timestamp:23,to_qubit:[17,36],tool:[2,3,45],topic:3,topo:[5,19,27,38,40,41,42,43],topolog:[3,5,19,25,27,38,40,42,45],total:40,trace:18,transfer:[6,7,33],transfer_error_model:[14,15,17,18,20,33,34,36,37],transfer_error_model_arg:[6,12,33],transform:18,transmiss:[25,26,36,37],transmit:[6,12,14,15,16,17,18,19,20,25,26,36],transmit_id:20,transport:17,tree:[19,22,41],treetopo:[5,19],treetopolog:[19,22,41],trigger:[6,13,29,30,32,45],trigger_func:[6,13,32,45],triggler_func:32,troubl:1,ts:[4,5,6,7,8,9,11,12,13,27,33,44],tupl:[19,20,21,22,29],turn:[18,37],tutori:1,twine:0,two:[6,8,11,17,18,26,28,30,31,34,36,40,43],type:[6,8,10,18,20,24,30],u:[2,35],uniform:35,uniformdelai:[5,14],uniformdelaymodel:[16,35],union:[6,7,8,11,12,18,19,20,21],unit:[14,15,17,18],up:37,upgrad:2,us:[0,1,3,6,8,11,17,18,19,20,22,23,24,25,27,28,29,30,31,32,33,35,36,37,38,39,40,41,42,43,45],usag:[6,8,9,35],user:[3,6,8,11,24,25,26,27,28,29,32,36,37,39,40,41,42,43,45],usual:[2,18,33,37,44],util:[3,4,5,14,42,43,45],valid:3,valu:[6,9,22,27,32],variabl:[0,17,30,41,42,44],vector:[18,33],version:[0,1,3],virtual:[29,32],visual:2,w:[17,28,36],w_1:36,w_2:36,w_3:36,wai:[28,37],wait:30,warn:[24,45],warp:45,watch:[6,9,29],watch_recv_count:29,watch_send_count:29,waxman:[19,22,41],waxmantopo:[5,19],waxmantopolog:[19,22,41],we:[0,1,3,28,32,36,37,43,44],websit:0,welcom:[0,3],well:[3,37,41],werner:[5,14,25,34],wernerentangl:17,wernerstateentangl:[17,28,36],what:29,wheel:[0,2],when:[3,6,9,18,29,30,45],whenev:[6,9,20,29,30],where:[17,19,22,33,36,39,44],whether:[6,8,23,28,42,45],which:[28,30,33,36,37],whl:[0,2],whole:[19,21,40,41],whose:[6,10],window:2,with_dat:45,with_tim:[24,45],without:[6,8,11,39],work:[28,31,39,43],world:[27,44],worri:27,wrap:[23,44],write:[6,8,9,28],write_request:28,x:[18,35,36,37],y:[18,37],you:[0,2],your:36,z:[18,37]},titles:["Develop Guide","Welcome to SimQN\u2019s documentation!","Install Guide","Introduction","qns","qns package","qns.entity package","qns.entity.cchannel package","qns.entity.memory package","qns.entity.monitor package","qns.entity.node package","qns.entity.operator package","qns.entity.qchannel package","qns.entity.timer package","qns.models package","qns.models.core package","qns.models.delay package","qns.models.epr package","qns.models.qubit package","qns.network package","qns.network.protocol package","qns.network.route package","qns.network.topology package","qns.simulator package","qns.utils package","Tutorials","Entities in quantum networks","Classic channel: the link to transmit classic packets","Quantum memory: the device to store qubits","Monitor: for better collecting network status","Quantum node: the end-point users, routers and repeaters","Quantum operator: operating and measuring qubits","Timers and build other entities","Quantum channel: the link to transmit qubits","Physical models","Delay model","The entanglement model","The qubit model","Construct large-scale networks","Request management","Routing algorithm","Topology generator","Parallel Simulation: to run multiple simulations and leverage multiple CPUs","Quick start","The discrete-event simulator","Logging and random generator"],titleterms:{"const":18,The:[36,37,40,44,45],acceler:2,algorithm:40,an:30,api:0,app:10,applic:[30,39],asynchron:[28,31],backend:15,basictopo:22,bb84:20,bell:[17,36],better:29,build:[30,32,41],cchannel:7,channel:[27,33],classic:[27,41],classicforward:20,code:0,collect:29,compil:[0,2],constdelai:16,construct:[38,43],content:[5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24],core:15,cpu:42,cython:2,decoher:18,delai:[16,30,35],design:3,develop:[0,2,3],devic:28,dijkstra:[21,40],discret:44,distribut:43,document:[0,1],end:30,entangl:[17,36,37,43],entanglement_distribut:20,entiti:[6,7,8,9,10,11,12,13,26,32],epr:17,error:[18,28,33,37],event:[8,11,23,44],exampl:[37,39],factori:18,forward:27,from:2,gate:18,gener:[36,41,43,45],get:1,gridtopo:22,guid:[0,1,2],help:1,how:30,ideal:36,instal:2,instruct:0,interfac:40,introduct:3,larg:38,leverag:42,linetopo:22,link:[27,33],log:[24,45],loss:33,losschannel:12,manag:[39,41],manual:43,measur:[31,37],memori:[8,28],mix:[17,36],mode:[28,31],model:[14,15,16,17,18,28,33,34,35,36,37],modul:[3,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,45],monitor:[9,29],most:36,multipl:42,multiprocess:24,network:[19,20,21,22,26,29,38,41,43],node:[10,30],node_process_delai:20,normaldelai:16,oper:[11,31,37],other:32,overview:3,packag:[5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24],packet:27,parallel:42,physic:34,pip:2,point:30,pool:23,process:30,protocol:[20,39],qchannel:12,qkd:43,qn:[4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24],quantum:[26,28,30,31,33,36,37,41],qubit:[18,28,31,33,37],quick:43,random:45,randomtopo:22,receiv:[27,33],repeat:30,request:[19,39],requir:0,rnd:24,rout:[21,40],router:30,run:42,s:[1,40,45],scale:38,seed:45,send:[27,33],simqn:1,simul:[23,42,43,44],sourc:2,stabl:2,start:43,state:36,statu:[3,29],store:28,structur:44,submodul:[6,7,8,9,10,11,12,13,15,16,17,18,19,20,21,22,23,24],subpackag:[5,6,14,19],swap:37,synchron:28,teleport:36,three:36,time:44,timer:[13,32],topo:22,topolog:[22,41,43],transmiss:33,transmit:[27,33],treetopo:22,ts:23,tutori:25,uniformdelai:16,us:2,user:[1,30],util:[18,24],version:2,waxmantopo:22,welcom:1,werner:[17,36]}}) \ No newline at end of file +Search.setIndex({docnames:["develop","index","install","introduction","modules","qns","qns.entity","qns.entity.cchannel","qns.entity.memory","qns.entity.monitor","qns.entity.node","qns.entity.operator","qns.entity.qchannel","qns.entity.timer","qns.models","qns.models.core","qns.models.delay","qns.models.epr","qns.models.qubit","qns.network","qns.network.protocol","qns.network.route","qns.network.topology","qns.simulator","qns.utils","tutorials","tutorials.entity","tutorials.entity.cchannel","tutorials.entity.memory","tutorials.entity.monitor","tutorials.entity.node","tutorials.entity.operator","tutorials.entity.other","tutorials.entity.qchannel","tutorials.models","tutorials.models.delay","tutorials.models.epr","tutorials.models.qubit","tutorials.network","tutorials.network.request","tutorials.network.route","tutorials.network.topology","tutorials.parallel_simulation","tutorials.quickstart","tutorials.simulator","tutorials.util"],envversion:{"sphinx.domains.c":2,"sphinx.domains.changeset":1,"sphinx.domains.citation":1,"sphinx.domains.cpp":5,"sphinx.domains.index":1,"sphinx.domains.javascript":2,"sphinx.domains.math":2,"sphinx.domains.python":3,"sphinx.domains.rst":2,"sphinx.domains.std":2,"sphinx.ext.todo":2,"sphinx.ext.viewcode":1,sphinx:56},filenames:["develop.rst","index.rst","install.rst","introduction.rst","modules.rst","qns.rst","qns.entity.rst","qns.entity.cchannel.rst","qns.entity.memory.rst","qns.entity.monitor.rst","qns.entity.node.rst","qns.entity.operator.rst","qns.entity.qchannel.rst","qns.entity.timer.rst","qns.models.rst","qns.models.core.rst","qns.models.delay.rst","qns.models.epr.rst","qns.models.qubit.rst","qns.network.rst","qns.network.protocol.rst","qns.network.route.rst","qns.network.topology.rst","qns.simulator.rst","qns.utils.rst","tutorials.rst","tutorials.entity.rst","tutorials.entity.cchannel.rst","tutorials.entity.memory.rst","tutorials.entity.monitor.rst","tutorials.entity.node.rst","tutorials.entity.operator.rst","tutorials.entity.other.rst","tutorials.entity.qchannel.rst","tutorials.models.rst","tutorials.models.delay.rst","tutorials.models.epr.rst","tutorials.models.qubit.rst","tutorials.network.rst","tutorials.network.request.rst","tutorials.network.route.rst","tutorials.network.topology.rst","tutorials.parallel_simulation.rst","tutorials.quickstart.rst","tutorials.simulator.rst","tutorials.util.rst"],objects:{"":[[5,0,0,"-","qns"]],"qns.entity":[[6,1,1,"","Application"],[6,1,1,"","ClassicChannel"],[6,1,1,"","ClassicPacket"],[6,1,1,"","Entity"],[6,1,1,"","MemoryReadRequestEvent"],[6,1,1,"","MemoryReadResponseEvent"],[6,1,1,"","MemoryWriteRequestEvent"],[6,1,1,"","MemoryWriteResponseEvent"],[6,1,1,"","Monitor"],[6,1,1,"","MonitorEvent"],[6,1,1,"","OperateRequestEvent"],[6,1,1,"","OperateResponseEvent"],[6,1,1,"","QNode"],[6,1,1,"","QuantumChannel"],[6,1,1,"","QuantumMemory"],[6,1,1,"","QuantumOperator"],[6,1,1,"","RecvClassicPacket"],[6,1,1,"","RecvQubitPacket"],[6,1,1,"","Timer"],[7,0,0,"-","cchannel"],[6,0,0,"-","entity"],[8,0,0,"-","memory"],[9,0,0,"-","monitor"],[10,0,0,"-","node"],[11,0,0,"-","operator"],[12,0,0,"-","qchannel"],[13,0,0,"-","timer"]],"qns.entity.Application":[[6,2,1,"","add_handler"],[6,2,1,"","get_node"],[6,2,1,"","get_simulator"],[6,2,1,"","handle"],[6,2,1,"","install"]],"qns.entity.ClassicChannel":[[6,2,1,"","install"],[6,2,1,"","send"]],"qns.entity.ClassicPacket":[[6,2,1,"","encode"],[6,2,1,"","get"]],"qns.entity.Entity":[[6,2,1,"","handle"],[6,2,1,"","install"]],"qns.entity.MemoryReadRequestEvent":[[6,2,1,"","invoke"]],"qns.entity.MemoryReadResponseEvent":[[6,2,1,"","invoke"]],"qns.entity.MemoryWriteRequestEvent":[[6,2,1,"","invoke"]],"qns.entity.MemoryWriteResponseEvent":[[6,2,1,"","invoke"]],"qns.entity.Monitor":[[6,2,1,"","add_attribution"],[6,2,1,"","at_event"],[6,2,1,"","at_finish"],[6,2,1,"","at_period"],[6,2,1,"","at_start"],[6,2,1,"","calculate_date"],[6,2,1,"","get_date"],[6,2,1,"","handle"],[6,2,1,"","install"]],"qns.entity.MonitorEvent":[[6,2,1,"","invoke"]],"qns.entity.OperateRequestEvent":[[6,2,1,"","invoke"]],"qns.entity.OperateResponseEvent":[[6,2,1,"","invoke"]],"qns.entity.QNode":[[6,2,1,"","add_apps"],[6,2,1,"","add_cchannel"],[6,2,1,"","add_memory"],[6,2,1,"","add_network"],[6,2,1,"","add_operator"],[6,2,1,"","add_qchannel"],[6,2,1,"","add_request"],[6,2,1,"","clear_request"],[6,2,1,"","get_apps"],[6,2,1,"","get_cchannel"],[6,2,1,"","get_memory"],[6,2,1,"","get_qchannel"],[6,2,1,"","handle"],[6,2,1,"","install"]],"qns.entity.QuantumChannel":[[6,2,1,"","install"],[6,2,1,"","send"]],"qns.entity.QuantumMemory":[[6,3,1,"","count"],[6,2,1,"","get"],[6,2,1,"","get_store_time"],[6,2,1,"","handle"],[6,2,1,"","install"],[6,2,1,"","is_full"],[6,2,1,"","read"],[6,2,1,"","write"]],"qns.entity.QuantumOperator":[[6,2,1,"","handle"],[6,2,1,"","install"],[6,2,1,"","operate"],[6,2,1,"","set_own"]],"qns.entity.RecvClassicPacket":[[6,2,1,"","invoke"]],"qns.entity.RecvQubitPacket":[[6,2,1,"","invoke"]],"qns.entity.Timer":[[6,2,1,"","install"],[6,2,1,"","trigger"]],"qns.entity.cchannel":[[7,1,1,"","ClassicChannel"],[7,1,1,"","ClassicPacket"],[7,1,1,"","RecvClassicPacket"],[7,0,0,"-","cchannel"]],"qns.entity.cchannel.ClassicChannel":[[7,2,1,"","install"],[7,2,1,"","send"]],"qns.entity.cchannel.ClassicPacket":[[7,2,1,"","encode"],[7,2,1,"","get"]],"qns.entity.cchannel.RecvClassicPacket":[[7,2,1,"","invoke"]],"qns.entity.cchannel.cchannel":[[7,1,1,"","ClassicChannel"],[7,1,1,"","ClassicPacket"],[7,4,1,"","NextHopNotConnectionException"],[7,1,1,"","RecvClassicPacket"]],"qns.entity.cchannel.cchannel.ClassicChannel":[[7,2,1,"","install"],[7,2,1,"","send"]],"qns.entity.cchannel.cchannel.ClassicPacket":[[7,2,1,"","encode"],[7,2,1,"","get"]],"qns.entity.cchannel.cchannel.RecvClassicPacket":[[7,2,1,"","invoke"]],"qns.entity.entity":[[6,1,1,"","Entity"]],"qns.entity.entity.Entity":[[6,2,1,"","handle"],[6,2,1,"","install"]],"qns.entity.memory":[[8,1,1,"","MemoryReadRequestEvent"],[8,1,1,"","MemoryReadResponseEvent"],[8,1,1,"","MemoryWriteRequestEvent"],[8,1,1,"","MemoryWriteResponseEvent"],[8,1,1,"","QuantumMemory"],[8,0,0,"-","event"],[8,0,0,"-","memory"]],"qns.entity.memory.MemoryReadRequestEvent":[[8,2,1,"","invoke"]],"qns.entity.memory.MemoryReadResponseEvent":[[8,2,1,"","invoke"]],"qns.entity.memory.MemoryWriteRequestEvent":[[8,2,1,"","invoke"]],"qns.entity.memory.MemoryWriteResponseEvent":[[8,2,1,"","invoke"]],"qns.entity.memory.QuantumMemory":[[8,3,1,"","count"],[8,2,1,"","get"],[8,2,1,"","get_store_time"],[8,2,1,"","handle"],[8,2,1,"","install"],[8,2,1,"","is_full"],[8,2,1,"","read"],[8,2,1,"","write"]],"qns.entity.memory.event":[[8,1,1,"","MemoryReadRequestEvent"],[8,1,1,"","MemoryReadResponseEvent"],[8,1,1,"","MemoryWriteRequestEvent"],[8,1,1,"","MemoryWriteResponseEvent"]],"qns.entity.memory.event.MemoryReadRequestEvent":[[8,2,1,"","invoke"]],"qns.entity.memory.event.MemoryReadResponseEvent":[[8,2,1,"","invoke"]],"qns.entity.memory.event.MemoryWriteRequestEvent":[[8,2,1,"","invoke"]],"qns.entity.memory.event.MemoryWriteResponseEvent":[[8,2,1,"","invoke"]],"qns.entity.memory.memory":[[8,4,1,"","OutOfMemoryException"],[8,1,1,"","QuantumMemory"]],"qns.entity.memory.memory.QuantumMemory":[[8,3,1,"","count"],[8,2,1,"","get"],[8,2,1,"","get_store_time"],[8,2,1,"","handle"],[8,2,1,"","install"],[8,2,1,"","is_full"],[8,2,1,"","read"],[8,2,1,"","write"]],"qns.entity.monitor":[[9,1,1,"","Monitor"],[9,1,1,"","MonitorEvent"],[9,0,0,"-","monitor"]],"qns.entity.monitor.Monitor":[[9,2,1,"","add_attribution"],[9,2,1,"","at_event"],[9,2,1,"","at_finish"],[9,2,1,"","at_period"],[9,2,1,"","at_start"],[9,2,1,"","calculate_date"],[9,2,1,"","get_date"],[9,2,1,"","handle"],[9,2,1,"","install"]],"qns.entity.monitor.MonitorEvent":[[9,2,1,"","invoke"]],"qns.entity.monitor.monitor":[[9,1,1,"","Monitor"],[9,1,1,"","MonitorEvent"]],"qns.entity.monitor.monitor.Monitor":[[9,2,1,"","add_attribution"],[9,2,1,"","at_event"],[9,2,1,"","at_finish"],[9,2,1,"","at_period"],[9,2,1,"","at_start"],[9,2,1,"","calculate_date"],[9,2,1,"","get_date"],[9,2,1,"","handle"],[9,2,1,"","install"]],"qns.entity.monitor.monitor.MonitorEvent":[[9,2,1,"","invoke"]],"qns.entity.node":[[10,1,1,"","Application"],[10,1,1,"","QNode"],[10,0,0,"-","app"],[10,0,0,"-","node"]],"qns.entity.node.Application":[[10,2,1,"","add_handler"],[10,2,1,"","get_node"],[10,2,1,"","get_simulator"],[10,2,1,"","handle"],[10,2,1,"","install"]],"qns.entity.node.QNode":[[10,2,1,"","add_apps"],[10,2,1,"","add_cchannel"],[10,2,1,"","add_memory"],[10,2,1,"","add_network"],[10,2,1,"","add_operator"],[10,2,1,"","add_qchannel"],[10,2,1,"","add_request"],[10,2,1,"","clear_request"],[10,2,1,"","get_apps"],[10,2,1,"","get_cchannel"],[10,2,1,"","get_memory"],[10,2,1,"","get_qchannel"],[10,2,1,"","handle"],[10,2,1,"","install"]],"qns.entity.node.app":[[10,1,1,"","Application"]],"qns.entity.node.app.Application":[[10,2,1,"","add_handler"],[10,2,1,"","get_node"],[10,2,1,"","get_simulator"],[10,2,1,"","handle"],[10,2,1,"","install"]],"qns.entity.node.node":[[10,1,1,"","QNode"]],"qns.entity.node.node.QNode":[[10,2,1,"","add_apps"],[10,2,1,"","add_cchannel"],[10,2,1,"","add_memory"],[10,2,1,"","add_network"],[10,2,1,"","add_operator"],[10,2,1,"","add_qchannel"],[10,2,1,"","add_request"],[10,2,1,"","clear_request"],[10,2,1,"","get_apps"],[10,2,1,"","get_cchannel"],[10,2,1,"","get_memory"],[10,2,1,"","get_qchannel"],[10,2,1,"","handle"],[10,2,1,"","install"]],"qns.entity.operator":[[11,1,1,"","OperateRequestEvent"],[11,1,1,"","OperateResponseEvent"],[11,1,1,"","QuantumOperator"],[11,0,0,"-","event"],[11,0,0,"module-0","operator"]],"qns.entity.operator.OperateRequestEvent":[[11,2,1,"","invoke"]],"qns.entity.operator.OperateResponseEvent":[[11,2,1,"","invoke"]],"qns.entity.operator.QuantumOperator":[[11,2,1,"","handle"],[11,2,1,"","install"],[11,2,1,"","operate"],[11,2,1,"","set_own"]],"qns.entity.operator.event":[[11,1,1,"","OperateRequestEvent"],[11,1,1,"","OperateResponseEvent"]],"qns.entity.operator.event.OperateRequestEvent":[[11,2,1,"","invoke"]],"qns.entity.operator.event.OperateResponseEvent":[[11,2,1,"","invoke"]],"qns.entity.operator.operator":[[11,1,1,"id0","QuantumOperator"]],"qns.entity.operator.operator.QuantumOperator":[[11,2,1,"id2","handle"],[11,2,1,"id3","install"],[11,2,1,"id4","operate"],[11,2,1,"id5","set_own"]],"qns.entity.qchannel":[[12,1,1,"","QuantumChannel"],[12,1,1,"","QubitLossChannel"],[12,1,1,"","RecvQubitPacket"],[12,0,0,"-","losschannel"],[12,0,0,"-","qchannel"]],"qns.entity.qchannel.QuantumChannel":[[12,2,1,"","install"],[12,2,1,"","send"]],"qns.entity.qchannel.RecvQubitPacket":[[12,2,1,"","invoke"]],"qns.entity.qchannel.losschannel":[[12,1,1,"","QubitLossChannel"]],"qns.entity.qchannel.qchannel":[[12,4,1,"","NextHopNotConnectionException"],[12,1,1,"","QuantumChannel"],[12,1,1,"","RecvQubitPacket"]],"qns.entity.qchannel.qchannel.QuantumChannel":[[12,2,1,"","install"],[12,2,1,"","send"]],"qns.entity.qchannel.qchannel.RecvQubitPacket":[[12,2,1,"","invoke"]],"qns.entity.timer":[[13,1,1,"","Timer"],[13,0,0,"-","timer"]],"qns.entity.timer.Timer":[[13,2,1,"","install"],[13,2,1,"","trigger"]],"qns.entity.timer.timer":[[13,1,1,"","Timer"],[13,1,1,"","TimerEvent"]],"qns.entity.timer.timer.Timer":[[13,2,1,"","install"],[13,2,1,"","trigger"]],"qns.entity.timer.timer.TimerEvent":[[13,2,1,"","invoke"]],"qns.models":[[14,1,1,"","QuantumModel"],[15,0,0,"-","core"],[16,0,0,"-","delay"],[17,0,0,"-","epr"],[18,0,0,"-","qubit"]],"qns.models.QuantumModel":[[14,2,1,"","measure_error_model"],[14,2,1,"","operate_error_model"],[14,2,1,"","store_error_model"],[14,2,1,"","transfer_error_model"]],"qns.models.core":[[15,1,1,"","QuantumModel"],[15,0,0,"-","backend"]],"qns.models.core.QuantumModel":[[15,2,1,"","measure_error_model"],[15,2,1,"","operate_error_model"],[15,2,1,"","store_error_model"],[15,2,1,"","transfer_error_model"]],"qns.models.core.backend":[[15,1,1,"","QuantumModel"]],"qns.models.core.backend.QuantumModel":[[15,2,1,"","measure_error_model"],[15,2,1,"","operate_error_model"],[15,2,1,"","store_error_model"],[15,2,1,"","transfer_error_model"]],"qns.models.delay":[[16,1,1,"","ConstantDelayModel"],[16,1,1,"","DelayModel"],[16,1,1,"","NormalDelayModel"],[16,1,1,"","UniformDelayModel"],[16,0,0,"-","constdelay"],[16,0,0,"-","delay"],[16,0,0,"-","normaldelay"],[16,0,0,"-","uniformdelay"]],"qns.models.delay.ConstantDelayModel":[[16,2,1,"","calculate"]],"qns.models.delay.DelayModel":[[16,2,1,"","calculate"]],"qns.models.delay.NormalDelayModel":[[16,2,1,"","calculate"]],"qns.models.delay.UniformDelayModel":[[16,2,1,"","calculate"]],"qns.models.delay.constdelay":[[16,1,1,"","ConstantDelayModel"]],"qns.models.delay.constdelay.ConstantDelayModel":[[16,2,1,"","calculate"]],"qns.models.delay.delay":[[16,1,1,"","DelayModel"]],"qns.models.delay.delay.DelayModel":[[16,2,1,"","calculate"]],"qns.models.delay.normaldelay":[[16,1,1,"","NormalDelayModel"]],"qns.models.delay.normaldelay.NormalDelayModel":[[16,2,1,"","calculate"]],"qns.models.delay.uniformdelay":[[16,1,1,"","UniformDelayModel"]],"qns.models.delay.uniformdelay.UniformDelayModel":[[16,2,1,"","calculate"]],"qns.models.epr":[[17,1,1,"","BaseEntanglement"],[17,1,1,"","BellStateEntanglement"],[17,1,1,"","MixedStateEntanglement"],[17,1,1,"","WernerStateEntanglement"],[17,0,0,"-","bell"],[17,0,0,"-","entanglement"],[17,0,0,"-","mixed"],[17,0,0,"-","werner"]],"qns.models.epr.BaseEntanglement":[[17,2,1,"","distillation"],[17,2,1,"","swapping"],[17,2,1,"","teleportion"],[17,2,1,"","to_qubits"]],"qns.models.epr.BellStateEntanglement":[[17,2,1,"","distillation"],[17,2,1,"","store_error_model"],[17,2,1,"","swapping"],[17,2,1,"","transfer_error_model"]],"qns.models.epr.MixedStateEntanglement":[[17,3,1,"","a"],[17,2,1,"","distillation"],[17,2,1,"","normalized"],[17,2,1,"","store_error_model"],[17,2,1,"","swapping"],[17,2,1,"","to_qubits"],[17,2,1,"","transfer_error_model"]],"qns.models.epr.WernerStateEntanglement":[[17,2,1,"","distillation"],[17,3,1,"","fidelity"],[17,2,1,"","store_error_model"],[17,2,1,"","swapping"],[17,2,1,"","to_qubits"],[17,2,1,"","transfer_error_model"]],"qns.models.epr.bell":[[17,1,1,"","BellStateEntanglement"]],"qns.models.epr.bell.BellStateEntanglement":[[17,2,1,"","distillation"],[17,2,1,"","store_error_model"],[17,2,1,"","swapping"],[17,2,1,"","transfer_error_model"]],"qns.models.epr.entanglement":[[17,1,1,"","BaseEntanglement"]],"qns.models.epr.entanglement.BaseEntanglement":[[17,2,1,"","distillation"],[17,2,1,"","swapping"],[17,2,1,"","teleportion"],[17,2,1,"","to_qubits"]],"qns.models.epr.mixed":[[17,1,1,"","MixedStateEntanglement"]],"qns.models.epr.mixed.MixedStateEntanglement":[[17,3,1,"","a"],[17,2,1,"","distillation"],[17,2,1,"","normalized"],[17,2,1,"","store_error_model"],[17,2,1,"","swapping"],[17,2,1,"","to_qubits"],[17,2,1,"","transfer_error_model"]],"qns.models.epr.werner":[[17,1,1,"","WernerStateEntanglement"]],"qns.models.epr.werner.WernerStateEntanglement":[[17,2,1,"","distillation"],[17,3,1,"","fidelity"],[17,2,1,"","store_error_model"],[17,2,1,"","swapping"],[17,2,1,"","to_qubits"],[17,2,1,"","transfer_error_model"]],"qns.models.qubit":[[18,5,1,"","DephaseMeasureErrorModel"],[18,5,1,"","DephaseOperateErrorModel"],[18,5,1,"","DephaseStorageErrorModel"],[18,5,1,"","DephaseTransferErrorModel"],[18,5,1,"","DepolarMeasureErrorModel"],[18,5,1,"","DepolarOperateErrorModel"],[18,5,1,"","DepolarStorageErrorModel"],[18,5,1,"","DepolarTransferErrorModel"],[18,5,1,"","PrefectMeasureErrorModel"],[18,5,1,"","PrefectOperateErrorModel"],[18,5,1,"","PrefectStorageErrorModel"],[18,5,1,"","PrefectTransferErrorModel"],[18,1,1,"","QState"],[18,1,1,"","Qubit"],[18,1,1,"","QubitFactory"],[18,0,0,"-","const"],[18,0,0,"-","decoherence"],[18,0,0,"-","errors"],[18,0,0,"-","factory"],[18,0,0,"-","gate"],[18,5,1,"","joint"],[18,0,0,"-","qubit"],[18,5,1,"","single_gate_expand"],[18,0,0,"-","utils"]],"qns.models.qubit.QState":[[18,2,1,"","equal"],[18,2,1,"","is_pure_state"],[18,2,1,"","measure"],[18,2,1,"","operate"],[18,2,1,"","state"],[18,2,1,"","stochastic_operate"]],"qns.models.qubit.Qubit":[[18,2,1,"","measure"],[18,2,1,"","measureX"],[18,2,1,"","measureY"],[18,2,1,"","measureZ"],[18,2,1,"","measure_error_model"],[18,2,1,"","operate"],[18,2,1,"","operate_error_model"],[18,2,1,"","stochastic_operate"],[18,2,1,"","store_error_model"],[18,2,1,"","transfer_error_model"]],"qns.models.qubit.const":[[18,5,1,"","OPERATOR_PHASE_SHIFT"],[18,5,1,"","OPERATOR_RX"],[18,5,1,"","OPERATOR_RY"],[18,5,1,"","OPERATOR_RZ"]],"qns.models.qubit.decoherence":[[18,5,1,"","BitFilpTransferErrorModel"],[18,5,1,"","BitFlipError"],[18,5,1,"","BitFlipMeasureErrorModel"],[18,5,1,"","BitFlipOperateErrorModel"],[18,5,1,"","BitFlipStorageErrorModel"],[18,5,1,"","DephaseError"],[18,5,1,"","DephaseMeasureErrorModel"],[18,5,1,"","DephaseOperateErrorModel"],[18,5,1,"","DephaseStorageErrorModel"],[18,5,1,"","DephaseTransferErrorModel"],[18,5,1,"","DepolarError"],[18,5,1,"","DepolarMeasureErrorModel"],[18,5,1,"","DepolarOperateErrorModel"],[18,5,1,"","DepolarStorageErrorModel"],[18,5,1,"","DepolarTransferErrorModel"],[18,5,1,"","DissipationError"],[18,5,1,"","DissipationMeasureErrorModel"],[18,5,1,"","DissipationOperateErrorModel"],[18,5,1,"","DissipationStorageErrorModel"],[18,5,1,"","DissipationTransferErrorModel"],[18,5,1,"","ErrorWithLength"],[18,5,1,"","ErrorWithTime"],[18,5,1,"","PrefectError"],[18,5,1,"","PrefectMeasureErrorModel"],[18,5,1,"","PrefectOperateErrorModel"],[18,5,1,"","PrefectStorageErrorModel"],[18,5,1,"","PrefectTransferErrorModel"]],"qns.models.qubit.errors":[[18,4,1,"","OperatorError"],[18,4,1,"","OperatorNotMatchError"],[18,4,1,"","QGateOperatorNotMatchError"],[18,4,1,"","QGateQubitNotInStateError"],[18,4,1,"","QGateStateJointError"],[18,4,1,"","QStateBaseError"],[18,4,1,"","QStateQubitNotInStateError"],[18,4,1,"","QStateSizeNotMatchError"]],"qns.models.qubit.factory":[[18,1,1,"","QubitFactory"]],"qns.models.qubit.gate":[[18,1,1,"","DoubleQubitsControlledGate"],[18,1,1,"","DoubleQubitsRotateGate"],[18,1,1,"","Gate"],[18,1,1,"","SingleQubitArbitraryGate"],[18,1,1,"","SingleQubitGate"],[18,1,1,"","SingleQubitRotateGate"],[18,1,1,"","SwapGate"],[18,1,1,"","ThreeQubitsGate"]],"qns.models.qubit.qubit":[[18,1,1,"","QState"],[18,1,1,"","Qubit"]],"qns.models.qubit.qubit.QState":[[18,2,1,"","equal"],[18,2,1,"","is_pure_state"],[18,2,1,"","measure"],[18,2,1,"","operate"],[18,2,1,"","state"],[18,2,1,"","stochastic_operate"]],"qns.models.qubit.qubit.Qubit":[[18,2,1,"","measure"],[18,2,1,"","measureX"],[18,2,1,"","measureY"],[18,2,1,"","measureZ"],[18,2,1,"","measure_error_model"],[18,2,1,"","operate"],[18,2,1,"","operate_error_model"],[18,2,1,"","stochastic_operate"],[18,2,1,"","store_error_model"],[18,2,1,"","transfer_error_model"]],"qns.models.qubit.utils":[[18,5,1,"","joint"],[18,5,1,"","kron"],[18,5,1,"","partial_trace"],[18,5,1,"","single_gate_expand"]],"qns.network":[[19,1,1,"","BasicTopology"],[19,1,1,"","DijkstraRouteAlgorithm"],[19,1,1,"","GridTopology"],[19,1,1,"","LineTopology"],[19,4,1,"","NetworkRouteError"],[19,4,1,"","QNSNetworkError"],[19,1,1,"","QuantumNetwork"],[19,1,1,"","RandomTopology"],[19,1,1,"","Request"],[19,1,1,"","RouteImpl"],[19,1,1,"","Topology"],[19,1,1,"","TreeTopology"],[19,1,1,"","WaxmanTopology"],[19,0,0,"-","network"],[20,0,0,"-","protocol"],[19,0,0,"-","requests"],[21,0,0,"-","route"],[22,0,0,"-","topology"]],"qns.network.BasicTopology":[[19,2,1,"","build"]],"qns.network.DijkstraRouteAlgorithm":[[19,6,1,"","INF"],[19,2,1,"","build"],[19,2,1,"","query"]],"qns.network.GridTopology":[[19,2,1,"","build"]],"qns.network.LineTopology":[[19,2,1,"","build"]],"qns.network.QuantumNetwork":[[19,2,1,"","add_cchannel"],[19,2,1,"","add_memories"],[19,2,1,"","add_node"],[19,2,1,"","add_qchannel"],[19,2,1,"","add_request"],[19,2,1,"","build_route"],[19,2,1,"","get_cchannel"],[19,2,1,"","get_node"],[19,2,1,"","get_qchannel"],[19,2,1,"","install"],[19,2,1,"","query_route"],[19,2,1,"","random_requests"]],"qns.network.RandomTopology":[[19,2,1,"","build"]],"qns.network.RouteImpl":[[19,2,1,"","build"],[19,2,1,"","query"]],"qns.network.Topology":[[19,2,1,"","add_cchannels"],[19,2,1,"","build"]],"qns.network.TreeTopology":[[19,2,1,"","build"]],"qns.network.WaxmanTopology":[[19,2,1,"","build"]],"qns.network.network":[[19,4,1,"","QNSNetworkError"],[19,1,1,"","QuantumNetwork"]],"qns.network.network.QuantumNetwork":[[19,2,1,"","add_cchannel"],[19,2,1,"","add_memories"],[19,2,1,"","add_node"],[19,2,1,"","add_qchannel"],[19,2,1,"","add_request"],[19,2,1,"","build_route"],[19,2,1,"","get_cchannel"],[19,2,1,"","get_node"],[19,2,1,"","get_qchannel"],[19,2,1,"","install"],[19,2,1,"","query_route"],[19,2,1,"","random_requests"]],"qns.network.protocol":[[20,1,1,"","BB84RecvApp"],[20,1,1,"","BB84SendApp"],[20,1,1,"","ClassicPacketForwardApp"],[20,1,1,"","EntanglementDistributionApp"],[20,1,1,"","NodeProcessDelayApp"],[20,0,0,"-","bb84"],[20,0,0,"-","classicforward"],[20,0,0,"-","entanglement_distribution"],[20,0,0,"-","node_process_delay"]],"qns.network.protocol.BB84RecvApp":[[20,2,1,"","check_basis"],[20,2,1,"","handleClassicPacket"],[20,2,1,"","handleQuantumPacket"],[20,2,1,"","recv"],[20,2,1,"","recv_cascade_reply_packet"],[20,2,1,"","recv_check_error_reply_packet"],[20,2,1,"","recv_error_estimate_reply_packet"],[20,2,1,"","send_error_estimate_packet"]],"qns.network.protocol.BB84SendApp":[[20,2,1,"","check_basis"],[20,2,1,"","handleClassicPacket"],[20,2,1,"","install"],[20,2,1,"","recv_cascade_ask_packet"],[20,2,1,"","recv_check_error_ask_packet"],[20,2,1,"","recv_error_estimate_packet"],[20,2,1,"","recv_privacy_amplification_ask_packet"],[20,2,1,"","send_qubit"]],"qns.network.protocol.ClassicPacketForwardApp":[[20,2,1,"","handleClassicPacket"],[20,2,1,"","install"]],"qns.network.protocol.EntanglementDistributionApp":[[20,2,1,"","RecvClassicPacketHandler"],[20,2,1,"","RecvQubitHandler"],[20,2,1,"","generate_qubit"],[20,2,1,"","handle_response"],[20,2,1,"","install"],[20,2,1,"","new_distribution"],[20,2,1,"","request_distrbution"],[20,2,1,"","response_distribution"],[20,2,1,"","set_first_epr"],[20,2,1,"","set_second_epr"]],"qns.network.protocol.NodeProcessDelayApp":[[20,2,1,"","check_in_delay_event_list"],[20,2,1,"","handle"],[20,2,1,"","install"]],"qns.network.protocol.bb84":[[20,1,1,"","BB84RecvApp"],[20,1,1,"","BB84SendApp"],[20,1,1,"","QubitWithError"],[20,5,1,"","cascade_binary_divide"],[20,5,1,"","cascade_key_shuffle"],[20,5,1,"","cascade_parity"],[20,5,1,"","pa_generate_toeplitz_matrix"],[20,5,1,"","pa_randomize_key"]],"qns.network.protocol.bb84.BB84RecvApp":[[20,2,1,"","check_basis"],[20,2,1,"","handleClassicPacket"],[20,2,1,"","handleQuantumPacket"],[20,2,1,"","recv"],[20,2,1,"","recv_cascade_reply_packet"],[20,2,1,"","recv_check_error_reply_packet"],[20,2,1,"","recv_error_estimate_reply_packet"],[20,2,1,"","send_error_estimate_packet"]],"qns.network.protocol.bb84.BB84SendApp":[[20,2,1,"","check_basis"],[20,2,1,"","handleClassicPacket"],[20,2,1,"","install"],[20,2,1,"","recv_cascade_ask_packet"],[20,2,1,"","recv_check_error_ask_packet"],[20,2,1,"","recv_error_estimate_packet"],[20,2,1,"","recv_privacy_amplification_ask_packet"],[20,2,1,"","send_qubit"]],"qns.network.protocol.bb84.QubitWithError":[[20,2,1,"","transfer_error_model"]],"qns.network.protocol.classicforward":[[20,1,1,"","ClassicPacketForwardApp"]],"qns.network.protocol.classicforward.ClassicPacketForwardApp":[[20,2,1,"","handleClassicPacket"],[20,2,1,"","install"]],"qns.network.protocol.entanglement_distribution":[[20,1,1,"","EntanglementDistributionApp"],[20,1,1,"","Transmit"]],"qns.network.protocol.entanglement_distribution.EntanglementDistributionApp":[[20,2,1,"","RecvClassicPacketHandler"],[20,2,1,"","RecvQubitHandler"],[20,2,1,"","generate_qubit"],[20,2,1,"","handle_response"],[20,2,1,"","install"],[20,2,1,"","new_distribution"],[20,2,1,"","request_distrbution"],[20,2,1,"","response_distribution"],[20,2,1,"","set_first_epr"],[20,2,1,"","set_second_epr"]],"qns.network.protocol.node_process_delay":[[20,1,1,"","NodeProcessDelayApp"]],"qns.network.protocol.node_process_delay.NodeProcessDelayApp":[[20,2,1,"","check_in_delay_event_list"],[20,2,1,"","handle"],[20,2,1,"","install"]],"qns.network.requests":[[19,1,1,"","Request"]],"qns.network.route":[[21,1,1,"","DijkstraRouteAlgorithm"],[21,4,1,"","NetworkRouteError"],[21,1,1,"","RouteImpl"],[21,0,0,"-","dijkstra"],[21,0,0,"-","route"]],"qns.network.route.DijkstraRouteAlgorithm":[[21,6,1,"","INF"],[21,2,1,"","build"],[21,2,1,"","query"]],"qns.network.route.RouteImpl":[[21,2,1,"","build"],[21,2,1,"","query"]],"qns.network.route.dijkstra":[[21,1,1,"","DijkstraRouteAlgorithm"]],"qns.network.route.dijkstra.DijkstraRouteAlgorithm":[[21,6,1,"","INF"],[21,2,1,"","build"],[21,2,1,"","query"]],"qns.network.route.route":[[21,4,1,"","NetworkRouteError"],[21,1,1,"","RouteImpl"]],"qns.network.route.route.RouteImpl":[[21,2,1,"","build"],[21,2,1,"","query"]],"qns.network.topology":[[22,1,1,"","BasicTopology"],[22,1,1,"","GridTopology"],[22,1,1,"","LineTopology"],[22,1,1,"","RandomTopology"],[22,1,1,"","Topology"],[22,1,1,"","TreeTopology"],[22,1,1,"","WaxmanTopology"],[22,0,0,"-","basictopo"],[22,0,0,"-","gridtopo"],[22,0,0,"-","linetopo"],[22,0,0,"-","randomtopo"],[22,0,0,"-","topo"],[22,0,0,"-","treetopo"],[22,0,0,"-","waxmantopo"]],"qns.network.topology.BasicTopology":[[22,2,1,"","build"]],"qns.network.topology.GridTopology":[[22,2,1,"","build"]],"qns.network.topology.LineTopology":[[22,2,1,"","build"]],"qns.network.topology.RandomTopology":[[22,2,1,"","build"]],"qns.network.topology.Topology":[[22,2,1,"","add_cchannels"],[22,2,1,"","build"]],"qns.network.topology.TreeTopology":[[22,2,1,"","build"]],"qns.network.topology.WaxmanTopology":[[22,2,1,"","build"]],"qns.network.topology.basictopo":[[22,1,1,"","BasicTopology"]],"qns.network.topology.basictopo.BasicTopology":[[22,2,1,"","build"]],"qns.network.topology.gridtopo":[[22,1,1,"","GridTopology"]],"qns.network.topology.gridtopo.GridTopology":[[22,2,1,"","build"]],"qns.network.topology.linetopo":[[22,1,1,"","LineTopology"]],"qns.network.topology.linetopo.LineTopology":[[22,2,1,"","build"]],"qns.network.topology.randomtopo":[[22,1,1,"","RandomTopology"]],"qns.network.topology.randomtopo.RandomTopology":[[22,2,1,"","build"]],"qns.network.topology.topo":[[22,1,1,"","ClassicTopology"],[22,1,1,"","Topology"]],"qns.network.topology.topo.ClassicTopology":[[22,6,1,"","All"],[22,6,1,"","Empty"],[22,6,1,"","Follow"]],"qns.network.topology.topo.Topology":[[22,2,1,"","add_cchannels"],[22,2,1,"","build"]],"qns.network.topology.treetopo":[[22,1,1,"","TreeTopology"]],"qns.network.topology.treetopo.TreeTopology":[[22,2,1,"","build"]],"qns.network.topology.waxmantopo":[[22,1,1,"","WaxmanTopology"]],"qns.network.topology.waxmantopo.WaxmanTopology":[[22,2,1,"","build"]],"qns.simulator":[[23,1,1,"","Event"],[23,1,1,"","Simulator"],[23,1,1,"","Time"],[23,0,0,"-","event"],[23,5,1,"","func_to_event"],[23,0,0,"module-0","pool"],[23,5,1,"","set_default_accuracy"],[23,0,0,"-","simulator"],[23,0,0,"module-1","ts"]],"qns.simulator.Event":[[23,2,1,"","cancel"],[23,2,1,"","invoke"],[23,3,1,"","is_canceled"]],"qns.simulator.Simulator":[[23,2,1,"","add_event"],[23,3,1,"","current_time"],[23,2,1,"","run"],[23,3,1,"","tc"],[23,2,1,"","time"]],"qns.simulator.Time":[[23,3,1,"","sec"]],"qns.simulator.event":[[23,1,1,"","Event"],[23,5,1,"","func_to_event"]],"qns.simulator.event.Event":[[23,2,1,"","cancel"],[23,2,1,"","invoke"],[23,3,1,"","is_canceled"]],"qns.simulator.pool":[[23,1,1,"id0","DefaultEventPool"]],"qns.simulator.pool.DefaultEventPool":[[23,2,1,"id2","add_event"],[23,3,1,"id3","current_time"],[23,2,1,"id4","next_event"]],"qns.simulator.simulator":[[23,1,1,"","Simulator"]],"qns.simulator.simulator.Simulator":[[23,2,1,"","add_event"],[23,3,1,"","current_time"],[23,2,1,"","run"],[23,3,1,"","tc"],[23,2,1,"","time"]],"qns.simulator.ts":[[23,1,1,"id6","Time"],[23,5,1,"id8","set_default_accuracy"]],"qns.simulator.ts.Time":[[23,3,1,"id7","sec"]],"qns.utils":[[24,5,1,"","critical"],[24,5,1,"","debug"],[24,5,1,"","error"],[24,5,1,"","get_choice"],[24,5,1,"","get_rand"],[24,5,1,"","get_randint"],[24,5,1,"","info"],[24,5,1,"","install"],[24,0,0,"-","log"],[24,5,1,"","monitor"],[24,0,0,"-","multiprocess"],[24,0,0,"-","rnd"],[24,5,1,"","set_seed"],[24,5,1,"","warn"]],"qns.utils.log":[[24,5,1,"","critical"],[24,5,1,"","debug"],[24,5,1,"","error"],[24,5,1,"","info"],[24,5,1,"","install"],[24,7,1,"","logger"],[24,5,1,"","monitor"],[24,5,1,"","warn"]],"qns.utils.multiprocess":[[24,1,1,"","MPSimulations"]],"qns.utils.multiprocess.MPSimulations":[[24,2,1,"","get_data"],[24,2,1,"","get_raw_data"],[24,2,1,"","prepare_setting"],[24,2,1,"","run"],[24,2,1,"","start"]],"qns.utils.rnd":[[24,5,1,"","get_choice"],[24,5,1,"","get_normal"],[24,5,1,"","get_rand"],[24,5,1,"","get_randint"],[24,5,1,"","set_seed"]],qns:[[6,0,0,"-","entity"],[14,0,0,"-","models"],[19,0,0,"-","network"],[23,0,0,"-","simulator"],[24,0,0,"-","utils"]]},objnames:{"0":["py","module","Python module"],"1":["py","class","Python class"],"2":["py","method","Python method"],"3":["py","property","Python property"],"4":["py","exception","Python exception"],"5":["py","function","Python function"],"6":["py","attribute","Python attribute"],"7":["py","data","Python data"]},objtypes:{"0":"py:module","1":"py:class","2":"py:method","3":"py:property","4":"py:exception","5":"py:function","6":"py:attribute","7":"py:data"},terms:{"0":[0,6,7,8,11,12,13,14,15,16,17,18,19,20,23,24,27,28,30,31,32,33,35,36,37,40,41,42,43,44,45],"000":[43,44],"05":[20,40,41,42,43],"06":18,"0s":[27,33],"1":[6,9,12,13,17,18,20,22,24,27,28,29,30,31,32,33,35,36,37,40,41,42,43,44,45],"10":[12,24,27,28,30,31,32,33,35,40,41,42,43,45],"100":[24,43,44],"1000":[20,28,31,32,33,37,43,45],"10000":[27,33],"100000":43,"1000000":[23,43],"10000000":[27,42],"10000000000":43,"15":42,"150":43,"1641801012":45,"1e":[18,44],"1s":30,"2":[17,18,19,20,22,27,28,30,33,34,36,37,39,41,42,43,44],"20":[20,42],"25":[17,36],"299791458":43,"2db":33,"3":[0,6,9,18,22,27,30,33,35,36,40,41,42],"30":[30,35],"36":36,"3w":36,"4":[19,20,22,33,36,37,40,42],"44":35,"450":43,"5":[20,27,28,30,31,32,33,35,36,39,40,41,42,45],"50":[24,37,40,41,43],"5000":20,"50000":43,"5s":[30,31],"6":44,"60":[23,41,44],"7":[0,37],"73":20,"7777777777777777":2,"8":[0,36],"88":[24,42],"9":36,"95":36,"96":17,"99":[20,40,41,42,43],"abstract":34,"boolean":[42,45],"byte":[6,7,27],"case":[25,26,27],"class":[0,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,26,27,28,30,31,32,33,34,35,37,38,41,42,44],"const":[5,14,36,37],"default":[16,17,18,20,23,24,27,32,33,36,40,42,44,45],"do":[0,17,18,20,32,36,42,43],"enum":[22,38,41],"final":[2,6,9,29,32,36,37,42,43,45],"float":[6,7,8,9,11,12,13,14,15,16,17,18,19,20,21,22,23,24,27,28,31,32,33,37,45],"function":[3,6,8,9,10,11,13,14,15,18,23,24,28,29,30,31,32,33,34,37,38,40,44,45],"import":[0,27,28,29,30,32,33,35,36,37,40,41,42,43,44,45],"int":[6,7,8,10,11,12,18,19,20,22,23,24],"new":[0,17,29,36,39,41,44],"return":[6,7,8,9,10,11,16,17,18,19,20,21,22,23,24,27,28,29,30,31,33,40,42,43],"static":[0,19,21],"super":[27,28,30,31,32,33],"switch":30,"true":[6,10,18,20,24,30,32,39,42,44,45],"try":1,"while":[28,31,32],A:[6,13,17,18,19,21,26,36,37,39],And:[2,37],As:3,But:40,By:[32,34,40,42,44],For:[2,3,6,9,27,30,32,36,37,42],If:[18,27,30,32,33,36,42],In:[27,28,31,36,43,44],It:[0,3,6,8,10,11,18,20,23,27,28,29,30,32,33,34,35,36,37,38,39,40,41,42,44],Its:[17,31,40,41],No:27,On:30,One:[18,37],Or:27,The:[1,2,3,6,7,8,10,12,14,15,16,17,18,19,20,21,22,23,24,25,27,28,29,30,31,32,33,34,35,38,39,41,42,43],Then:[2,43],There:30,To:[0,2,36,37,42,43,44,45],With:45,_4:36,__class__:29,__init__:[27,28,30,31,32,33],_doc:18,_is_instal:32,_simul:[27,28,31,32,33],a1:31,a_1:36,a_2:36,abl:41,about:[3,27],abov:[36,43],acceler:1,accord:[14,15],accordingli:34,accuraci:[18,23,27,42,43,44],activ:31,ad:[27,30,41],add:[6,10,19,20,23,27,29,30,33,39,41,43,44,45],add_app:[6,10,27,28,30,31,33,43],add_attribut:[6,9,29],add_cchannel:[6,10,19,22,27,30,41,43],add_ev:[23,27,28,31,32,33,44],add_handl:[6,10,28,30,31],add_memori:[6,10,19,28,30,41],add_network:[6,10],add_nod:[19,41],add_oper:[6,10,31],add_qchannel:[6,10,19,30,33,41,43],add_request:[6,10,19,39,42],addit:[20,28,41],adopt:[0,36],advantag:36,after:[6,9,28,29,36,39,40,44],aggreg:[24,42],algorithm:[1,3,19,21,25,38,41,43],alia:23,all:[0,3,6,10,19,22,24,26,27,30,32,33,36,37,39,41,42,43],alloc:3,allow:[19,20,39],allow_overlai:[19,39],along:2,alpha:[19,22,36,41],also:[2,28,30,31,33,36,37,40,44],alwai:17,amplif:[20,39],an:[0,6,8,9,10,11,13,18,20,22,23,24,25,26,27,28,31,32,33,34,36,37,38,40,41,42,44,45],analysi:29,ani:[0,2,6,7,8,9,11,12,13,18,23,27,30,36,44],anoth:[17,27,33,37,41,42],answer:1,anther:3,anyth:32,api:[1,3,6,8,32,41],apidoc:0,app:[5,6,19,20,22,27,28,30,33,42,43],app_typ:[6,10],append:[32,33],applic:[6,10,19,20,22,23,25,26,27,28,31,33,38,41,43],ar:[0,3,18,19,22,26,28,29,30,34,36,37,41,42,44],arch:2,architectur:3,area:41,arg:[23,24,32],argument:19,arrai:[18,20,33,37],ask:20,aspect:3,assert:[27,28,30,31,33,37,44],assum:27,assumpt:3,asynchron:[6,8,11,25,26],at_ev:[6,9,29],at_finish:[6,9,29],at_period:[6,9,29],at_start:[6,9,29],attenu:33,attenuation_r:12,attr:[19,39,42,43],attribut:[6,9,19,27,28,29,33,36,39,41,44],autobuild:0,automat:[0,27,39,43],auxiliari:3,avail:37,b:[17,18,36],b_1:36,b_2:36,backend:[5,6,8,11,12,14,17,18,20],bandwidth:[6,7,12,27,30,33,35,39,40,41],base:[1,3,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,37,40,41,43,44],baseentangl:[17,36],basi:18,basic:[3,6,23,35,36],basictopo:[5,19],basictopolog:[19,22,41],bb84:[5,19,39,43],bb84recvapp:[20,39,43],bb84sendapp:[20,39,43],bbpssw:17,bdist_wheel:[0,2],been:23,befor:[6,7,8,9,10,11,12,13,27,29,30],begin:[20,30],behavior:[17,18,20,30],believ:3,bell:[5,14,25,34],bellstateentangl:[17,36],bennett96:36,bennett:17,besid:3,beta:[19,22,36],bete:41,better:[3,25,26,42],between:[43,44],binari:20,bind:30,bit:[18,37],bitfilptransfererrormodel:18,bitfliperror:18,bitflipmeasureerrormodel:18,bitflipoperateerrormodel:18,bitflipstorageerrormodel:18,block:20,bool:[6,8,10,18,19,20,23,24,28,31],bootstrap:3,both:[3,34,36,37,41,45],bound:[17,24,44],bra:36,branch:0,bring:[3,44],buffer:[27,33],bug:[1,3],build:[0,2,3,18,19,21,22,25,26,27,36,37,38,39,40,42,43,44],build_rout:[19,27,40,42,43],built:[0,34,41],bylist:[6,10,30],bypass:30,c0:37,c1:[37,43],c:[2,17,36],c_1:36,c_2:36,calcul:[6,9,16,18,20,27,29,32,33,35,42],calculate_d:[6,9],calculate_func:[6,9,29],call:[6,7,8,9,10,11,12,13,23,26,27,28,29,30,32,33,35,44],callabl:[6,9,11,19,21,23],can:[0,1,2,3,6,8,10,11,12,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45],cancel:[23,44],cannel:44,capac:[6,8,19,28,40,41,42,43],carri:43,cascad:20,cascade_alpha:20,cascade_ask:20,cascade_beita:20,cascade_binary_divid:20,cascade_key_shuffl:20,cascade_par:20,cascade_repli:20,caus:[23,27,33],cchannel:[5,6,10,19,20,21,27,30,35,41,43],cchannel_arg:[19,22,27,40,41,42,43],cchannel_delai:43,cchannel_list:41,cd:[0,2],cdot:[33,36],central:40,certain:[30,39],chang:[3,14,15,18,33,34,36,37],channel:[3,6,7,10,12,14,15,17,18,19,20,21,22,25,26,30,34,35,36,38,40,41,43],check:[0,6,8,20,27,28],check_basi:20,check_error_ask:20,check_error_repli:20,check_in_delay_event_list:20,checkout:2,child:[26,34,41],children:[19,22],children_num:[19,22],children_numb:[19,22,41],circuit:31,cl1:30,clang:2,classic:[6,7,10,12,19,20,21,22,25,26,30,35,38,39,40,43],classic_rout:27,classic_topo:[19,22,27,38,41,42,43],classicchannel:[6,7,10,19,20,21,27,30,35,41,43],classicforward:[5,19,27],classicpacket:[6,7,27],classicpacketforwardapp:[20,27,39],classictopolog:[19,22,27,41,42,43],clear:[6,10],clear_request:[6,10,39],clink:43,cnot:37,co:[33,37],code:[1,2,24,27,32,36,43],coher:[17,28],col:20,collect:[6,9,25,26,28],column:[6,9,29,45],com:2,combin:42,command:[0,2],common:[3,27,32,36,41],commonli:37,commun:3,compar:[18,44],compil:1,complex128:[33,37],complex:[33,37],comput:3,congest:40,connect:[6,7,10,12,19,22,41,43],consist:26,constant:[6,9,35],constantdelaymodel:[16,35],constdelai:[5,14],construct:[1,25],contain:[3,19,21,24,28,42],content:[1,4],contribut:3,control:[18,27,28,31,37],conveni:3,convert:23,core:[3,5,6,8,11,12,14,17,18,20,23,24,42],correspond:20,could:[6,8,9],count:[6,8,9,29,42,43],cpu:[1,25],creat:42,critic:[24,45],csv:45,current:[3,6,8,23,34,35,37,39,44,45],current_tim:[23,27,32,33,44],cython:1,d:[1,17,36,45],d_1:36,d_2:36,data1:45,data:[6,9,24,29,42,45],datafram:[6,9,24,29],date1:45,date2:45,date3:45,date:45,db:[18,43],debug:[24,45],decai:33,decoher:[5,14,15,17,19,20,28,33,36,37],decoherence_r:[6,8,12,14,15,17,18,19,20,28,33],decoi:36,def:[27,28,29,30,31,32,33,37,42,43,44,45],default_time_accuraci:44,defaulteventpool:23,defin:[36,37],delai:[5,6,7,8,11,12,14,20,25,26,27,28,31,33,34,39,40,41,42,43],delay_event_list:[20,30],delay_model:35,delaymodel:[6,7,8,11,12,16,27,28,31,33,35],deliv:31,demonstr:39,denot:37,densiti:[18,36],depend:32,dephas:[18,37],dephaseerror:18,dephasemeasureerrormodel:18,dephaseoperateerrormodel:18,dephasestorageerrormodel:18,dephasetransfererrormodel:[18,37],dephasetransmiterrormodel:[],deploi:[6,10],depolar:[18,37],depolarerror:18,depolarmeasureerrormodel:[18,37],depolaroperateerrormodel:18,depolarstorageerrormodel:[18,37],depolartransfererrormodel:18,describ:[28,31,34,35,36,44],design:[1,31],dest:[6,7,12,19,20,21,27,30,33,39,42],destin:[6,10,19,20,21,27,30,33,39],destion:40,detail:[1,27,31,37],detect:39,develop:1,devic:[25,26,30],dict:[6,8,12,19,22,24,27],dictionari:24,differ:[14,15,24,30,33],dijkstra:[5,19,25,27,38,42,43],dijkstraroutealgorithm:[19,21,27,40,42,43],directli:[6,8,11,19,22,28,41],directori:[0,2,25,28,33,41,42],discret:[1,3,23,25],dispath:[6,10],dissip:18,dissipationerror:18,dissipationmeasureerrormodel:18,dissipationoperateerrormodel:18,dissipationstorageerrormodel:18,dissipationtransfererrormodel:18,dist:[0,2],distil:[17,36],distribut:[1,3,17,25,35,39],divid:20,doc:0,docstr:0,document:3,done:44,dot:[33,37],doubl:18,doublequbitscontrolledg:18,doublequbitsrotateg:18,down:[6,9],download:2,drive:44,driven:[3,23,44],drop:[27,28,33,36,43],drop_rat:[6,7,12,27,30,33,35,42,43],dst:[6,10,20,42],dtype:[33,37],dump:27,dure:[18,27,28,31,32,33,36,37,44],e0:36,e1:36,e2:36,e3:36,e4:36,e5:36,e6:36,e7:36,e:[6,9,17,18,24,29,36,40,42],each:[19,21,22,24,36,41,42,43],earli:3,easi:[27,33,36,37,45],easier:44,easili:3,element:[19,21,24,45],elif:37,els:32,empti:[6,10,19,22,30,41],enabl:[1,3],encod:[6,7,27],encourag:3,end:[20,25,26,44],end_second:23,end_tim:[6,13,32,44],enough:[0,27,36],ensur:0,entangl:[1,3,5,6,8,14,18,25,28,33,34,39],entanglement_distribut:[5,19,30,42,43],entanglementdistributionapp:[20,30,39,40,41,42,43],entiti:[1,3,4,5,19,20,21,22,23,25,27,28,29,30,31,33,35,43,44,45],enumer:22,environ:0,ep:18,epr1:28,epr2:28,epr:[5,14,15,16,20,28,36],eprdistributionsimul:42,equal:[17,18,27,36],equip:[28,30,31],error:[5,14,15,17,20,24,25,26,27,31,34,36,39,45],error_estimate_repli:20,errorentangl:28,errormodel:18,errorwithlength:18,errorwithtim:18,ertuil:2,especi:45,estim:[17,20],evalu:[0,3,36,39],even:32,evenli:20,event:[1,3,4,5,6,7,9,10,12,13,20,25,26,27,28,29,30,31,32,33,39],event_nam:29,event_typ:[6,9],eventtypelist:[6,10,30],everi:[6,9,10,19,22,29,42,44],exampl:[3,6,9,25,27,28,29,30,31,32,33,34,35,36,38,40,41,42,43],except:[7,8,12,18,19,21],execut:[23,36],exist:30,exp:[28,43],experi:[24,42,43],explain:[0,25],expos:0,express:27,extend:[33,34,36],f:[30,36,42],fact:36,factori:[5,14,19,22,37],fals:[19,24],featur:3,few:43,fiber:33,fidel:[3,6,9,14,15,17,24,28,36,39,42,43],field:[27,33],file:[2,45],finish:[29,44],first:[0,2,17,20,27,28,29,30,31,32,33,40,43],first_col:20,first_epr_nam:20,first_row:20,firstli:27,fit:36,fix:[29,36,39,45],flake8:0,flexibl:3,flip:[18,37],fn:23,focu:27,follow:[0,2,19,22,27,29,30,31,33,35,36,37,38,39,40,41,42],form:[29,33,37,38,41,42],format:[28,40],forward:[20,25,26,39],found:[30,37],four:42,frac:[36,37],from:[1,6,7,8,24,27,28,29,30,32,33,35,36,37,40,41,42,43,44,45],full:[6,8,27,28,33,34,42],func_to_ev:[23,27,33,44],further:[0,6,10,20,27,33,43],g:[6,9,24,40,42],gate:[5,6,11,14,31,37],gate_z_and_measur:31,gcc:2,gener:[0,1,3,6,10,18,19,20,22,24,25,26,27,28,30,32,33,34,35,38,39,40,44],generate_qubit:20,generatederrorwithlength:18,generatederrorwithtim:18,get:[6,7,8,9,10,19,23,24,27,28,29,30,31,33,39,41,42,43,44,45],get_app:[6,10,30],get_cchannel:[6,10,19,27,30,41],get_channel:30,get_choic:[24,45],get_dat:[6,9],get_data:[24,29,42],get_memori:[6,10],get_nod:[6,10,19,27,30,40,41,42],get_norm:24,get_qchannel:[6,10,19,30,33,41],get_rand:[24,45],get_randint:[24,45],get_raw_data:[24,42],get_simul:[6,10,30],get_store_tim:[6,8],gh:0,git:[0,2],github:[0,1,2],give:[28,43],given:20,good:27,googl:0,grid:[19,22,41],gridtopo:[5,19],gridtopolog:[19,22,41],group:31,guid:[3,43],h:[17,31,37],ha:[3,6,8,9,11,19,22,23,26,27,28,31,33,36,40,41,44],hadamard:[31,37],hand:30,handl:[6,8,9,10,11,20,26,27,28,30,31,32,33,44],handle_respons:20,handleclassicpacket:20,handlequantumpacket:20,handler:[6,10,30],happen:[6,9,10,18,26,44],happend:[6,9],have:[0,1,28,30,33,36,37,39,41],heap:44,hello:[27,44],help:[3,24,38,39],here:[27,28,29,30,31,32,33,42],hidden:17,hide:36,high:[3,24,34,36,45],higher:[3,36],hold:36,hook:29,hop:[6,7,12,19,21,39,40,43],host:0,how:[25,26,27,29,36,41,42],howev:[0,28],html:0,http:2,hz:37,i:[36,37],i_2:18,i_6:18,id:20,idea:3,ideal:[17,25,34],idx:18,implement:[6,7,8,9,11,12,13,19,21,23,27,30,32,34,35,36,37,38,39,40,41,43,44],includ:[1,3,6,14,15,18,19,22,26,36,37,39],incom:[27,30],independ:[28,31],index:[1,6,8,10,18,20],indic:[36,38,41,42,45],inf:[19,21],infinit:[27,33],influenc:32,info:[24,43,45],inform:[3,39],inherit:[32,41],init:[30,33],init_fidel:[20,40,41,42,43],init_lower_cascade_key_block_s:20,init_upper_cascade_key_block_s:20,initi:[3,6,7,8,9,10,11,12,13,20,26,27,29,30,31,32,33,38,41,42,43,44],inject:40,input:[6,9,28,29,30,31,32,33,34,35,36,40,42],insert:[6,10,19,23,27,33,44],instal:[0,1,6,7,8,9,10,11,12,13,19,20,24,26,27,28,29,30,31,32,33,41,42,43,45],instanti:43,instead:36,instruct:[1,27,29],integ:[24,45],interfac:[14,15,19,21,25,26,34,38,41],intern:[39,45],introduc:[28,33,36,44],introduct:1,investig:[1,3],invok:[6,7,8,9,11,12,13,23,44],is_cancel:[23,44],is_ful:[6,8,28],is_pure_st:18,isinst:[27,33],issu:0,iter:24,iter_count:[24,42],its:[3,6,8,10,19,27,33,41],itself:30,j:[18,20],joint:18,json:27,just:44,k:44,kei:[6,8,20,27,28,41,43],ket:[36,37],keyword:28,kind:[3,30,36],km:[33,43],kron:18,kwarg:[14,15,17,18,20,23,28,33,37],l1:[27,33,35,41,43],l2:41,l:36,lambda:[6,9,29,40],larg:[1,3,25,39,43],larger:44,last:[6,9,43],later:28,layer:3,left:18,len:43,length:[6,7,12,14,15,17,18,20,27,33,34,36,37,40,43],level:[34,36,43,45],leverag:[0,1,24,25],librari:[0,2,3,45],light_spe:43,like:[1,44,45],limit:28,line:[19,22,41,43],lines_numb:[19,22,40,41,43],linetopo:[5,19,27],linetopolog:[19,22,27,41,42],link:[25,26],linux:2,list:[6,7,10,11,12,17,18,19,20,21,22,24,30,31,40,41,45],list_oper:18,list_p:18,listen:[28,30,31],lkm:[33,37],ll:[19,22],load:27,local:18,locat:2,log:[1,3,4,5,25,32,43],logger:[24,43,45],lose:[27,33],loss:[12,25,26],losschannel:[5,6],low:[24,36,45],lower:17,m1:[28,30],m2:28,m3:28,m:[6,9,20,28,29,30,43],machin:42,maco:2,mai:[3,28,30,33,36,39,41],maintain:[36,44],major:43,make:[0,3,42,44,45],manag:[3,25,38],mani:[1,44],manual:[25,39,44],match:[6,10],math:33,mathbb:36,matric:18,matrix:[18,20,36,37],matter:[24,30],max:[17,35,36],max_buffer_s:[6,7,12,27,30,33,35],max_cascade_round:20,max_delai:[16,35],maximum:[27,33],mean:[3,6,10,24,27,30,33,36,42],mean_delai:[16,35],measur:[6,11,14,15,18,25,26,30,34,36,43,45],measure_decoherence_r:[18,20,37],measure_error_model:[14,15,18,37],measurei:[18,37],measurex:[18,37],measurez:[18,37],meet:44,memori:[3,5,6,10,14,15,17,18,19,25,26,30,34,35,36,41,43],memory_arg:[19,22,40,41,42,43],memory_capac:[42,43],memory_s:24,memoryreadhandl:28,memoryreadrequestev:[6,8,28],memoryreadresponseapp:28,memoryreadresponseev:[6,8,28],memoryresponseapp:28,memorywritehandl:28,memorywriterequestev:[6,8,28],memorywriteresponseev:[6,8,28],messag:[6,7,27,30,39,44,45],met:0,meter:18,method:[0,6,10,23,26,27,28,29,30,32,33,35,40,41,42,44],metric:[19,21,40],metric_func:[19,21,40],min:35,min_delai:[16,35],min_length_for_post_process:20,minimum:44,mismatch:18,miu:33,mix:[5,14,18,25,34,37],mixedentangl:17,mixedstateentangl:17,mode:[6,8,11,25,26,30,42],model:[1,3,4,5,6,7,8,11,12,19,20,22,25,26,31],modul:[1,4,25,27,39,40,43,44],monitor:[5,6,24,25,26,32,43,45],monitor_1:29,monitorev:[6,9],more:[3,30,36,37,39,41,44],most:[1,25,27,34,44],moth:34,mpsimul:[24,42],msg1:27,msg2:27,msg:[6,7,24,27,30,44],multipl:[1,3,18,19,24,25,31,34,36,38,39,43],multiprocess:[4,5,42],multiprocesssimul:24,must:[27,30,32],n1:[27,28,30,31,33,39,40,41,42,43],n2:[27,30,33,40,41,43],n3:[30,39,40],n4:40,n5:40,n:[6,9,20,27,29,35,42],name:[0,2,6,7,8,9,10,11,12,13,16,17,18,19,20,21,23,24,27,28,29,30,31,32,33,34,35,36,37,38,41,42,43,44],ndarrai:[18,20],necessari:2,need:[0,2,27,28,29,33,36,42,44],neighbor:[19,22],net:[27,39,40,41,42,43],network:[0,1,3,4,5,6,9,10,25,27,30,32,36,39,40,42,45],networkrouteerror:[19,21],new_distribut:20,next:[6,7,12,19,20,21,23,27,33,40],next_ev:23,next_hop:[6,7,12,27,33],nexthop:[19,21],nexthopnotconnectionexcept:[6,7,12],nl:[19,22],node:[3,5,6,7,8,9,11,12,19,20,21,22,25,26,27,28,31,33,36,38,39,40,41,43],node_list:[6,7,12,41],node_num:24,node_process_delai:[5,19,30],nodeprocessdelayapp:[20,30,39],nodes_app:[19,22,40,41,42,43],nodes_numb:[19,22,27,40,41,42,43],none:[0,2,6,7,8,9,10,11,12,13,16,17,18,19,20,21,22,23,24,27,28,29,32,33,44],normal:[17,35],normaldelai:[5,14],normaldelaymodel:[16,35],noth:[17,18,20],notic:[27,33],notifi:[6,9],notimplementederror:32,now:[0,37,42,43],np:[18,28,33,37,43],num:20,number:[6,8,19,22,24,33,35,39,41,42,43,44,45],numpi:[18,20,37,43,45],o1:31,o:0,object:[6,7,8,10,14,15,16,17,18,19,20,21,22,23,24,27,29,36,39,44],occur:[18,27,44],onc:[30,32],one:[6,13,18,28,30,31,32,36,41,43],onli:[18,32],oper:[5,6,8,10,14,15,16,18,25,26,28,30,33,34,35,36],operate_decoherence_r:[18,20,37],operate_error_model:[14,15,18,37],operaterequestev:[6,11,31],operateresponseev:[6,11,31],operateresponseeventhandl:31,operator_phase_shift:18,operator_ri:18,operator_rx:18,operator_rz:18,operatorerror:18,operatornotmatcherror:18,optic:33,option:[6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,28,29,30,31,38,40,41,44],order:[6,10,44],organ:44,origin:[0,20,24,36],original_kei:20,os:2,other:[2,3,14,15,17,18,19,20,22,25,26,27,28,30,33,34,36,41],other_st:18,otherwis:[27,32],our:0,out:43,outofmemoryexcept:8,output:[29,35,42,44,45],overal:43,overhead:[3,44],overlai:39,overview:1,overwit:24,overwrit:42,own:[30,36,37,39,40,41],owner:[6,11],p:[18,36],p_:33,p_init:12,p_swap:[17,36],pa_generate_toeplitz_matrix:20,pa_randomize_kei:20,pacif:44,packag:[0,1,2,4,37,45],packat:20,packet1:27,packet2:27,packet:[2,6,7,12,20,25,26,30,33],page:0,pair:[6,8,17,19,43],panda:29,par:43,parallel:[1,25],param:[18,23],paramet:[6,7,8,9,10,11,12,13,14,15,17,18,19,20,21,22,23,24,28,29,30,31,32,33,34,35,36,38,41,42,43],parent:[19,22,41],pariti:20,parti:30,partial:18,partial_trac:18,pass:[0,6,10,30,32],passiv:30,path:[19,21,40],pattern:[19,22],pauli:[18,37],pd:[6,9,24],pep:0,per:[23,27,32,33,44],perfect:[19,22,41],perform:[3,20,31,36,42],perfrom:[6,11,17,18,24],period:[3,6,9,13,29,32,45],period_tim:[6,9,29],phase:37,phi:[17,36],physcial:[27,33],physic:[1,3,25],pi:[33,37],pip3:[0,2],pip:[0,1],platform:[1,2,3],point:[25,26],pool:[4,5,44],posit:30,possibl:[2,3,17,18,30,33,36,37,43,44],power:43,pre:[36,37],prefecterror:18,prefectmeasureerrormodel:18,prefectoperateerrormodel:18,prefectstorageerrormodel:18,prefecttransfererrormodel:18,prefer:0,prefix:0,prepare_set:24,present:[14,15,34,36,37,43],print:[27,28,30,32,36,37,43,44,45],print_ev:44,print_msg:44,printapp:30,printev:44,prioriti:[19,21],privaci:[20,39],privacy_amplification_ask:20,probabl:[27,33,36],procedur:39,process:[6,8,9,10,11,20,24,25,26,27,33,37,39,42],processev:30,produc:[3,23,36,37,38,41,43],progess:18,programm:30,propag:[27,33],properti:[6,8,17,23],proportion_for_estimating_error:20,propos:3,protocol:[1,3,5,17,19,21,25,27,30,36,38,42,43],provid:[0,2,3,24,25,27,29,32,34,35,36,37,38,39,40,41,42,43,44,45],psi:[17,36],publish:0,pull:0,pure:[18,37],purif:36,push:0,put:[27,33],py3:[0,2],py:[0,2],pypi:2,pytest:0,python3:[0,2,3],python:[0,2,27,45],q0:[36,37],q1:[28,36,37],q2:[28,36,37],q3:37,qchannel:[5,6,10,19,20,21,22,30,33,40,41,43],qchannel_arg:[19,22,27,40,41,42,43],qchannel_delai:43,qchannel_list:41,qgateoperatornotmatcherror:18,qgatequbitnotinstateerror:18,qgatestatejointerror:18,qkd:[1,3,25,39],ql1:30,qlink:43,qm:[6,8],qn:[0,1,2,3,27,28,29,30,32,33,35,36,37,39,40,41,42,43,44,45],qnode:[6,7,8,10,11,12,19,20,21,22,27,28,30,31,33,41,43],qnsnetworkerror:19,qo:39,qstate:[18,37],qstatebaseerror:18,qstatequbitnotinstateerror:18,qstatesizenotmatcherror:18,quantum:[0,1,3,6,8,10,11,14,15,17,18,19,20,21,22,25,27,34,35,38,39,40,43],quantumchannel:[6,10,12,19,20,21,22,30,33,41,43],quantummemori:[6,8,28,30,41],quantummodel:[6,8,11,12,14,15,17,18,20,33,34],quantumnetwork:[6,9,19,22,27,29,38,39,40,41,42,43],quantumoper:[6,10,11,31],quantunetwork:40,qubit1:18,qubit2:18,qubit:[3,5,6,8,9,11,12,14,15,16,17,20,25,26,34,36,43,45],qubit_state_0:[18,36,37],qubit_state_1:[18,37],qubit_state_l:[18,37],qubit_state_n:[18,37],qubit_state_p:[18,37],qubit_state_r:[18,37],qubitfactori:[18,37],qubitlosschannel:[12,33],qubitwitherror:[20,33,37],queri:[19,21,39,40],query_rout:[19,40],question:1,quick:[1,25],quickli:44,r:0,rais:[6,7,12,18,32],random:[1,3,18,19,22,24,25,33,35,37,39,41,43],random_request:[19,39,43],randomli:[19,22,33,39,43],randomtopo:[5,19],randomtopolog:[19,22,40,41,43],rate:[12,14,15,17,18,19,20,27,28,33,37,39,43],raw:[24,42],reach:[27,33],read:[6,8,28],read_request:28,realist:3,reason:27,receiv:[6,7,8,9,11,12,20,25,26,30,39,43],recent:44,recogn:3,reconcili:39,record:[6,9,45],recoveri:27,recv:[20,30],recv_cascade_ask_packet:20,recv_cascade_reply_packet:20,recv_check_error_ask_packet:20,recv_check_error_reply_packet:20,recv_count:29,recv_error_estimate_packet:20,recv_error_estimate_reply_packet:20,recv_privacy_amplification_ask_packet:20,recv_tim:[27,33],recvapp:[27,33],recvclassicpacket:[6,7,20,27,30],recvclassicpackethandl:[20,30],recvoperateapp:31,recvqubithandl:20,recvqubitpacket:[6,9,12,20,29,30,33],reduc:[3,28,43],refer:[28,36],referenc:36,relat:[26,27,30,32,33,39],reliabl:27,remot:[39,43],remov:[6,8,18],repeat:[25,26,42],report:[1,3],repres:[18,19,20,31,37,44],reproduc:45,req:43,req_num:24,request:[0,3,4,5,6,8,10,11,25,28,31,38,43],request_distrbut:20,requests_numb:43,requir:[1,2,39],research:[3,25],resourc:3,respect:[2,37],response_distribut:20,result:[3,6,8,11,19,21,24,28,31,40,42,43,45],ret:31,rho:[17,18,20,36],rho_r:18,rnd:[4,5],rotat:37,round:20,rout:[1,3,5,19,20,25,27,38,39,42,43],route_t:27,routeimpl:[19,20,21,27,40],router:[25,26],row:20,rp:[29,43],rule:0,run:[1,6,7,8,9,10,11,12,13,23,24,25,27,28,29,30,31,32,33,41,43,44,45],s:[0,3,6,9,13,16,19,22,23,24,25,27,28,29,31,32,33,35,37,38,41,42,43,44],same:[6,10,18,36,41,42],save:28,scale:[1,3,25,39,43],scenario:39,schema:3,sd:[19,43],search:28,sec:[23,27,28,31,32,33,44],second:[6,9,14,15,16,17,18,23,27,28,29,30,32,33,40,43,44],second_epr_nam:20,secur:20,seed:[24,25],select:[39,43,45],self:[6,7,17,18,27,28,30,31,32,33,37,42,44],send:[6,7,8,9,11,12,20,25,26,28,30,43],send_count:29,send_error_estimate_packet:20,send_packet:27,send_qubit:[20,33],send_rat:[20,27,33,42,43],sendapp:[27,33],sender:30,sens:43,sent:33,sep:[24,43,45],separ:45,serial:[29,31],session:[3,38,39,43],set:[6,7,8,9,10,11,12,13,23,24,28,30,31,33,35,37,42,43,44,45],set_default_accuraci:23,set_first_epr:20,set_own:[6,11],set_se:[24,45],set_second_epr:20,setlevel:[43,45],setup:[0,2],setuptool:[0,2],sever:[3,19,26,30,38,39,41],share:30,shot:[6,13,32],should:[0,2,6,7,8,9,11,12,13,19,21,22,23,24,29,30,33,41],show:[27,28,33,36,37,41],shuffl:20,signatur:[6,10],simpl:[23,39],simpler:36,simplifi:36,simqn:[0,2,3,24,25,26,27,29,34,35,36,37,38,39,40,41,42,43,44,45],simul:[1,2,3,4,5,6,7,8,9,10,11,12,13,19,20,24,25,26,27,28,29,30,31,32,33,41,45],simulation_tim:43,sin:[33,37],sinc:[3,27,36],singl:[18,24,37,42],single_gate_expand:18,singlequbitarbitraryg:18,singlequbitg:18,singlequbitrotateg:18,size:[18,19,20,22,27,28,33,41,43],skip:[6,10,20],slot:[23,43,44],smallest:44,so:[0,3,27,29,30,42,44],some:[25,29,30,32,37],sort:[19,21],sourc:[0,1,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,30,32,39,40],sp:[29,43],span:41,special:[18,19,22,38],sphinx:0,sphinx_rtd_them:0,sqrt:17,squar:[19,22,41],src:[6,7,19,20,21,27,30,39,42,43],ss:42,stabl:1,stai:3,standand_lkm:37,standard:[0,45],start:[1,6,9,24,25,27,29,32,33,42,44],start_second:23,start_tim:[6,13,32,44],state:[3,14,15,17,18,20,25,33,34,37,45],statu:[1,6,9,25,26,32,45],std:[16,24,35,42],step:41,step_tim:[6,13,32],still:3,stochast:[18,37],stochastic_oper:[18,37],storag:[28,34,36,37],storage_error_model:[28,34,36,37],store:[6,8,14,15,16,17,18,25,26,36],store_error_model:[14,15,17,18,19,37],store_error_model_arg:[6,8,19,28,41,42],str:[6,7,8,9,10,11,12,13,16,17,18,19,20,21,23,24,27,32],string:27,structur:25,studio:2,style:0,sub:42,submodul:[4,5,14],subpackag:4,subtre:0,succ_key_pool:43,success:[17,36,43],success_count:[42,43],successfulli:[6,8,23,28],suffer:37,suggest:3,suppos:17,swap:[17,25,34,36],swapgat:18,synchron:[6,8,11,25,26,31],system:[2,37],t1:[32,44,45],t2:44,t3:44,t:[6,7,8,9,11,12,13,14,15,17,18,23,27,28,31,32,33,34,36,37,44],t_coh:[17,28,41],tabl:[1,3,19,20,21,27,38,39,40,43],take:[28,32,33,34],target:20,tc:[23,28,31,44],te2:44,te:[23,44],tediou:27,teleport:[17,25,34],tell:[29,42],test:[0,3,44],text:33,than:36,thei:[18,28,29,30,33,39],them:[19,22,36,43],themselv:36,theta:[18,33,37],thi:[0,1,2,3,6,7,8,9,10,11,12,14,15,17,18,19,20,21,23,24,25,26,27,28,29,30,31,33,36,37,39,40,42,43,44],thing:0,third:[30,36],those:[28,29,33,37,39],though:36,three:[6,9,18,25,30,34,35,41],threequbitsg:18,through:20,throughput:[6,9,24,42],thu:[2,30],time:[6,7,8,9,11,12,13,14,15,16,17,18,23,25,27,28,29,31,32,33,34,35,36,42,45],time_list:[32,33],time_slot:23,time_spend:43,timer:[5,6,25,26,45],timerev:[13,32],timestamp:23,to_qubit:[17,36],toeplitz:20,toeplitz_matrix:20,tool:[2,3,45],topic:3,topo:[5,19,27,38,40,41,42,43],topolog:[3,5,19,25,27,38,40,42,45],total:40,trace:18,transfer:[6,7,33],transfer_error_model:[14,15,17,18,20,33,34,36,37],transfer_error_model_arg:[6,12,33],transform:18,transmiss:[18,25,26,36,37],transmit:[6,12,14,15,16,17,18,19,20,25,26,36],transmit_id:20,transport:17,tree:[19,22,41],treetopo:[5,19],treetopolog:[19,22,41],trigger:[6,13,29,30,32,45],trigger_func:[6,13,32,45],triggler_func:32,troubl:1,ts:[4,5,6,7,8,9,11,12,13,27,33,44],tupl:[19,20,21,22,29],turn:[18,37],tutori:1,twine:0,two:[6,8,11,17,18,20,26,28,30,31,34,36,40,43],txt:0,type:[6,8,10,18,20,24,30],u:[2,35],uniform:35,uniformdelai:[5,14],uniformdelaymodel:[16,35],union:[6,7,8,10,11,12,18,19,20,21],unit:[14,15,17,18],up:37,upgrad:2,us:[0,1,3,6,8,11,17,18,19,20,22,23,24,25,27,28,29,30,31,32,33,35,36,37,38,39,40,41,42,43,45],usag:[6,8,9,35],user:[3,6,8,11,24,25,26,27,28,29,32,36,37,39,40,41,42,43,45],usual:[2,18,33,37,44],util:[3,4,5,14,42,43,45],valid:3,valu:[6,9,20,22,27,32],variabl:[0,17,30,41,42,44],vector:[18,33],version:[0,1,3],virtual:[29,32],visual:2,w:[17,28,36],w_1:36,w_2:36,w_3:36,wai:[28,37],wait:30,warn:[24,45],warp:45,watch:[6,9,29],watch_recv_count:29,watch_send_count:29,waxman:[19,22,41],waxmantopo:[5,19],waxmantopolog:[19,22,41],we:[0,1,3,28,32,36,37,43,44],websit:0,welcom:[0,3],well:[3,37,41],werner:[5,14,25,34],wernerentangl:17,wernerstateentangl:[17,28,36],what:29,wheel:[0,2],when:[3,6,9,18,29,30,45],whenev:[6,9,20,29,30],where:[17,19,22,33,36,39,44],whether:[6,8,23,28,42,45],which:[28,30,33,36,37],whl:[0,2],whole:[19,21,40,41],whose:[6,10],window:2,with_dat:45,with_tim:[24,45],without:[6,8,11,39],work:[28,31,39,43],world:[27,44],worri:27,wrap:[23,44],write:[6,8,9,28],write_request:28,x:[18,20,35,36,37],y:[18,37],you:[0,2],your:36,z:[18,37]},titles:["Develop Guide","Welcome to SimQN\u2019s documentation!","Install Guide","Introduction","qns","qns package","qns.entity package","qns.entity.cchannel package","qns.entity.memory package","qns.entity.monitor package","qns.entity.node package","qns.entity.operator package","qns.entity.qchannel package","qns.entity.timer package","qns.models package","qns.models.core package","qns.models.delay package","qns.models.epr package","qns.models.qubit package","qns.network package","qns.network.protocol package","qns.network.route package","qns.network.topology package","qns.simulator package","qns.utils package","Tutorials","Entities in quantum networks","Classic channel: the link to transmit classic packets","Quantum memory: the device to store qubits","Monitor: for better collecting network status","Quantum node: the end-point users, routers and repeaters","Quantum operator: operating and measuring qubits","Timers and build other entities","Quantum channel: the link to transmit qubits","Physical models","Delay model","The entanglement model","The qubit model","Construct large-scale networks","Request management","Routing algorithm","Topology generator","Parallel Simulation: to run multiple simulations and leverage multiple CPUs","Quick start","The discrete-event simulator","Logging and random generator"],titleterms:{"const":18,The:[36,37,40,44,45],acceler:2,algorithm:40,an:30,api:0,app:10,applic:[30,39],asynchron:[28,31],backend:15,basictopo:22,bb84:20,bell:[17,36],better:29,build:[30,32,41],cchannel:7,channel:[27,33],classic:[27,41],classicforward:20,code:0,collect:29,compil:[0,2],constdelai:16,construct:[38,43],content:[5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24],core:15,cpu:42,cython:2,decoher:18,delai:[16,30,35],design:3,develop:[0,2,3],devic:28,dijkstra:[21,40],discret:44,distribut:43,document:[0,1],end:30,entangl:[17,36,37,43],entanglement_distribut:20,entiti:[6,7,8,9,10,11,12,13,26,32],epr:17,error:[18,28,33,37],event:[8,11,23,44],exampl:[37,39],factori:18,forward:27,from:2,gate:18,gener:[36,41,43,45],get:1,gridtopo:22,guid:[0,1,2],help:1,how:30,ideal:36,instal:2,instruct:0,interfac:40,introduct:3,larg:38,leverag:42,linetopo:22,link:[27,33],log:[24,45],loss:33,losschannel:12,manag:[39,41],manual:43,measur:[31,37],memori:[8,28],mix:[17,36],mode:[28,31],model:[14,15,16,17,18,28,33,34,35,36,37],modul:[3,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,45],monitor:[9,29],most:36,multipl:42,multiprocess:24,network:[19,20,21,22,26,29,38,41,43],node:[10,30],node_process_delai:20,normaldelai:16,oper:[11,31,37],other:32,overview:3,packag:[5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24],packet:27,parallel:42,physic:34,pip:2,point:30,pool:23,process:30,protocol:[20,39],qchannel:12,qkd:43,qn:[4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24],quantum:[26,28,30,31,33,36,37,41],qubit:[18,28,31,33,37],quick:43,random:45,randomtopo:22,receiv:[27,33],repeat:30,request:[19,39],requir:0,rnd:24,rout:[21,40],router:30,run:42,s:[1,40,45],scale:38,seed:45,send:[27,33],simqn:1,simul:[23,42,43,44],sourc:2,stabl:2,start:43,state:36,statu:[3,29],store:28,structur:44,submodul:[6,7,8,9,10,11,12,13,15,16,17,18,19,20,21,22,23,24],subpackag:[5,6,14,19],swap:37,synchron:28,teleport:36,three:36,time:44,timer:[13,32],topo:22,topolog:[22,41,43],transmiss:33,transmit:[27,33],treetopo:22,ts:23,tutori:25,uniformdelai:16,us:2,user:[1,30],util:[18,24],version:2,waxmantopo:22,welcom:1,werner:[17,36]}}) \ No newline at end of file diff --git a/docs/build/html/tutorials.entity.memory.html b/docs/build/html/tutorials.entity.memory.html index d633f1b..fdea9d2 100644 --- a/docs/build/html/tutorials.entity.memory.html +++ b/docs/build/html/tutorials.entity.memory.html @@ -112,7 +112,7 @@

          Synchronous moderead and write methods are used to store and get a qubit. The read methods will use the qubit’s name or reference as the keyword to search the qubit.

          q1 = Qubit()
           m.write(q1)
          -q2 = m.read()
          +q2 = m.read(q1)
           

          The memory can have a limited size. is_full function returns whether the memory is full:

          diff --git a/docs/build/html/tutorials.models.qubit.html b/docs/build/html/tutorials.models.qubit.html index 97d8968..7b52afb 100644 --- a/docs/build/html/tutorials.models.qubit.html +++ b/docs/build/html/tutorials.models.qubit.html @@ -161,16 +161,16 @@

          Error modelsqns.model.qubit.decoherence. Users can use the qns.model.qubit.factory to set up the models:

          -
          from qns.models.qubit.decoherence import DepolarStorageErrorModel, DephaseTransmitErrorModel
          +
          from qns.models.qubit.decoherence import DepolarStorageErrorModel, DephaseTransferErrorModel
           from qns.models.qubit.factory import QubitFactory
           
          -Qubit = QubitFactory(store_error_model=DepolarStorageErrorModel, transfer_error_model=DephaseTransmitErrorModel)
          +Qubit = QubitFactory(store_error_model=DepolarStorageErrorModel, transfer_error_model=DephaseTransferErrorModel)
           q1 = Qubit(name="q1")
           q2 = Qubit(name="q2")
           

          SimQN also have error models for operating or measuring on qubits, by implementing the operate_error_model and measure_error_model:

          -
          from qns.models.qubit.decoherence import DepolarStorageErrorModel, DephaseTransmitErrorModel
          +
          from qns.models.qubit.decoherence import DepolarStorageErrorModel, DephaseTransferErrorModel
           from qns.models.qubit.factory import QubitFactory
           
           Qubit = QubitFactory(operate_decoherence_rate=0.2,
          diff --git a/docs/build/html/tutorials.network.route.html b/docs/build/html/tutorials.network.route.html
          index 62d91e1..f37a3f9 100644
          --- a/docs/build/html/tutorials.network.route.html
          +++ b/docs/build/html/tutorials.network.route.html
          @@ -120,7 +120,7 @@ 

          The routing algorithm interface

          The DijkstraRouteAlgorithm implements the RouteImpl based on the Dijkstra’s algorithm. It has a optional injectable metric function metric_func. Its input is the quantum channel and returns the channels’ metric. By default, the metric_func returns 1. But users can provide their own metric_func, such as the bandwidth or the congestion of the channel.

          An example of using this algorithm is:

          -

        • ClassicTopology.Follow, the classic topology will be the same to the quantum topology

        -
        from qns.network.topology import RandomTopology, ClassicTopology
        +
        from qns.network.topology import RandomTopology
         from qns.network.network import QuantumNetwork
        +from qns.network.topology.topo import ClassicTopology
         
         topo = RandomTopology(
             nodes_number=5,
             lines_number=10,
             qchannel_args={"delay": 0.05},
             cchannel_args={"delay": 0.05},
        -    memory_args=[{"capacity": memory_capacity}],
        -    nodes_apps=[EntanglementDistributionApp(init_fidelity=init_fidelity)])
        +    memory_args=[{"capacity": 50}],
        +    nodes_apps=[EntanglementDistributionApp(init_fidelity=0.99)])
         
         # build the network, classic topology follows the quantum topology
         net = QuantumNetwork(topo=topo, classic_topo=ClassicTopology.Follow)
        @@ -176,12 +177,12 @@ 

        Manage the networkn2 = QNode(name="n2") net.add_node(n2) -# get a quantum channel by its name -l1 = net.get_qchannel("l1") + # get a quantum channel by its name +l1 = net.get_qchannel("l1,2") # add a quantum channel l2 = QuantumChannel("l2") -net.add_node(l2) +net.add_qchannel(l2) node_list = net.nodes # get all nodes qchannel_list = net.qchannels # get all quantum channels diff --git a/docs/build/html/tutorials.quickstart.html b/docs/build/html/tutorials.quickstart.html index 41e9033..51291b1 100644 --- a/docs/build/html/tutorials.quickstart.html +++ b/docs/build/html/tutorials.quickstart.html @@ -102,11 +102,11 @@

        QKD simulation with manual network constructionimport numpy as np light_speed = 299791458 -length = 100000 # 100,000 km +length = 100000 # 100,000 m def drop_rate(length): # drop 0.2 db/KM - return 1 - np.exp(- length / 50000) + return 1 - np.exp(- length / 50000) #or 1 - np.power(10, - length / 50000) # generate quantum nodes n1 = QNode(name="n1") @@ -159,6 +159,7 @@

        Entanglement distribution with topology generatorfrom qns.network.route.dijkstra import DijkstraRouteAlgorithm from qns.network.topology.topo import ClassicTopology import qns.utils.log as log +import logging init_fidelity = 0.99 # the initial entanglement's fidelity nodes_number = 150 # the number of nodes @@ -203,7 +204,7 @@

        Entanglement distribution with topology generators.run() # count the number of successful entanglement distribution for each session -results = [src.apps[0].success_count for req in net.requests] +results = [req.src.apps[0].success_count for req in net.requests] # log the results log.monitor(requests_number, nodes_number, results, s.time_spend, sep=" ") diff --git a/docs/build/html/tutorials.util.html b/docs/build/html/tutorials.util.html index 3b683a7..1fc81cb 100644 --- a/docs/build/html/tutorials.util.html +++ b/docs/build/html/tutorials.util.html @@ -98,12 +98,14 @@

        The logging module
        log.logger.setLevel(logging.INFO)
        +
        import logging
        +
        +log.logger.setLevel(logging.INFO)
         a = 1
         
         log.debug("debug message")
        -log.info("info message", a)
        -log.warn("warn message", a+1)
        +log.info("info message %d", a)
        +log.warn("warn message %d", a + 1)
         log.error("error message")
         log.critical("critical message")
         
        diff --git a/docs/source/develop.rst b/docs/source/develop.rst index 13b9663..e5832d1 100644 --- a/docs/source/develop.rst +++ b/docs/source/develop.rst @@ -61,6 +61,7 @@ To automatic generate the API documents, use the following command: To build document website, use the command: .. code-block:: bash + cd docs make html diff --git a/docs/source/tutorials.network.topology.rst b/docs/source/tutorials.network.topology.rst index 5474560..ec221ea 100644 --- a/docs/source/tutorials.network.topology.rst +++ b/docs/source/tutorials.network.topology.rst @@ -92,12 +92,12 @@ The ``QuantumNetwork`` provides the following APIs to get or add nodes, channels n2 = QNode(name="n2") net.add_node(n2) - # get a quantum channel by its name - l1 = net.get_qchannel("l1") + # get a quantum channel by its name + l1 = net.get_qchannel("l1,2") # add a quantum channel l2 = QuantumChannel("l2") - net.add_node(l2) + net.add_qchannel(l2) node_list = net.nodes # get all nodes qchannel_list = net.qchannels # get all quantum channels diff --git a/qns/network/protocol/entanglement_distribution.py b/qns/network/protocol/entanglement_distribution.py index c539143..3d324ef 100644 --- a/qns/network/protocol/entanglement_distribution.py +++ b/qns/network/protocol/entanglement_distribution.py @@ -48,7 +48,7 @@ def __repr__(self) -> str: class EntanglementDistributionApp(Application): - def __init__(self, send_rate: Optional[int] = None, init_fidelity: int = 0.99): + def __init__(self, send_rate: Optional[int] = None, init_fidelity: float = 0.99): super().__init__() self.init_fidelity = init_fidelity self.net: QuantumNetwork = None