You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Additionally, you will need the `build-essential` package, to install tools used when building some SimulaQron dependencies::
29
+
30
+
sudo apt-get install build-essential cmake vim linux-headers-generic
31
+
32
+
To install SimulaQron, start by creating and activating a python virtual environment::
17
33
18
34
python3.12 -m venv simulaqron-venv
19
35
source simulaqron-venv/bin/activate
@@ -22,6 +38,10 @@ Now, we can install SimulaQron by simply typing::
22
38
23
39
pip3 install simulaqron
24
40
41
+
It is also recommended that you can also install optional dependencies to enable full support of qubit engines::
42
+
43
+
pip3 install simulaqron\[opt\]
44
+
25
45
You can then make use of SimulaQron using the command ``simulaqron`` in the terminal. For more information on how
26
46
to use this command see below or type::
27
47
@@ -31,12 +51,6 @@ To make sure you have the version compatible with this documentation type::
31
51
32
52
simulaqron version
33
53
34
-
If you want to make sure that everything has been installed properly you can start run the unittests. Open an
35
-
interactive python console by typing `python3` and the::
36
-
37
-
import simulaqron
38
-
simulaqron.tests()
39
-
40
54
------------------------
41
55
Testing a simple example
42
56
------------------------
@@ -52,20 +66,21 @@ We will here illustrate how to use SimulaQron with the NetQASM library.
52
66
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
53
67
Starting the SimulaQron backend
54
68
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
69
+
55
70
By default SimulaQron uses the five nodes Alice, Bob, Charlie, David and Eve on your local computers. In this example
56
71
there will be three processes for each node listening to incoming messages on a certain port number. These make up
57
72
the simulation backend, the NetQASM server and the classical communication server. To start the processes and thus
58
73
the backend of SimulaQron simply type::
59
74
60
75
simulaqron start
61
76
62
-
.. warning:: Running ``simulaqron start`` will be default start up servers on localhost (i.e., your own computer),
77
+
.. warning:: Running ``simulaqron start`` will by default start up servers on localhost (i.e., your own computer),
63
78
using port numbers between 8000 and 9000, to form the simulated quantum internet hardware. SimulaQron does not
64
79
provide any access control to its simulated hardware, so you are responsible to securing access should this be
65
80
relevant for you. You can also run the different simulated nodes on different computers. We do not take any
66
81
responsibility for problems caused by SimulaQron.
67
82
68
-
For more information on what ``./cli/SimulaQron start`` does, how to change the nodes and the ports of the network,
83
+
For more information on what ``simulaqron start`` does, how to change the nodes and the ports of the network,
69
84
the topology etc, see `Configuring the Network <ConfNodes.rst>`_.
70
85
71
86
To stop the backend, simply type::
@@ -77,7 +92,7 @@ makes SimulaQron think that the network is still running. To reset this you can
77
92
78
93
simulaqron reset
79
94
80
-
Note that this also kills any currently running network and resets any settings or configurations.
95
+
Note that this also kills any currently running network and resets any local settings or configurations.
81
96
82
97
^^^^^^^^^^^^^^^^^^^
83
98
Running a protocol
@@ -117,9 +132,12 @@ going on here? Let us first look at how we will realize the example by making an
117
132
While the task we want to realize here is completely trivial, the addition of step 3 does however already highlight a
118
133
range of choices on how to realize step 3 and the need to find good abstractions to allow easy application development.
119
134
One way to realize step 3 would be to hardwire Alice's and Bob's measurements: if the hardware can identify the
120
-
correct qubits from the entanglement generation, then we could instruct it to measure it immediately without asking for a notification from the entanglement generation process. It is clear that in a network that is a bit larger than our tiny three node setup, identifying the right setup requires a link between the underlying qubits and classical control information: this is the objective of the classical/quantum combiner.
135
+
correct qubits from the entanglement generation, then we could instruct it to measure it immediately without asking
136
+
for a notification from the entanglement generation process. It is clear that in a network that is a bit larger than
137
+
our tiny three node setup, identifying the right setup requires a link between the underlying qubits and classical
138
+
control information: this is the objective of the classical/quantum combiner.
121
139
122
-
The script run.sh executes the following two python scripts::
140
+
The script ``run.sh`` executes the following two python scripts::
123
141
124
142
#!/bin/sh
125
143
@@ -132,7 +150,7 @@ We first create a ``NetQASMConnection`` which handles all communication with the
132
150
An ``EPRSocket`` is used to create or receive entangled qubit pairs with a remote node.
133
151
The key pattern is: queue operations, call ``flush()`` to execute them, then read results with ``int(m)``.
134
152
135
-
The core of aliceTest.py is::
153
+
The core of ``aliceTest.py`` is::
136
154
137
155
epr_socket = EPRSocket("Bob")
138
156
@@ -153,7 +171,7 @@ The core of aliceTest.py is::
153
171
m1_val = int(m1)
154
172
sim_conn.close()
155
173
156
-
Similarly the core of bobTest.py is::
174
+
Similarly the core of ``bobTest.py`` is::
157
175
158
176
epr_socket = EPRSocket("Alice")
159
177
@@ -189,15 +207,14 @@ To set a setting, for example to use the projectQ backend, type::
189
207
This will create a file named ``simulaqron_settings.json`` in the current folder. This new file contains a full set of
190
208
simulaqron configuration, including the setting that was just configured (using the `projectq` backend, in the example).
191
209
192
-
It is also possible to manually create thisfile::
210
+
It is also possible to manually create this` `simulaqron_settings.json`` file with any text editor::
193
211
194
212
{
195
213
"backend": "projectq",
196
214
"log_level": 10
197
215
}
198
216
199
-
which would set the backend to be use ProjectQ and the log-level to be debug (10). Any setting in this file will
200
-
override the settings set in the CLI.
217
+
which would set the backend to be use ProjectQ and the log-level to be debug (10).
201
218
202
219
Is is also possible to create a configuration file that contains all the default configurations::
203
220
@@ -214,7 +231,7 @@ This command will create a file with the following configuration::
0 commit comments