Skip to content

Commit ef940b9

Browse files
committed
Typos fix
1 parent 65e75aa commit ef940b9

2 files changed

Lines changed: 54 additions & 52 deletions

File tree

docs/AppsArch.rst

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -25,14 +25,14 @@ When Alice needs to run a *local* quantum operation, it needs follow the process
2525
#. The QNodeOS layer receives the NetQASM subroutine, parses it and executes the quantum operations.
2626
#. To execute the quantum operations, the QNodeOS layer communicates with the Virtual Node layer, which is in charge
2727
of the final simulation of the quantum hardware.
28-
#. The execution is done using SimulaQron's *native interface*, transforming the QNodeOS server as a translation layer
28+
#. The execution is done using SimulaQron's *native interface*. This makes the QNodeOS server a translation layer
2929
between NetQASM and SimulaQron's native interface.
3030

3131
In a scenario where more than one node is involved, it is required that the simulated quantum hardware to communicate
3232
with other node's quantum hardware (for example, to create EPR pairs). This is done at Virtual Node level; each Virtual
33-
Node instance keeps an open communication channel with its neighbours, so it can send signals and information to
34-
"remote" nodes. Additionally, this open communication channel is also required due to SimulaQron's distributed simulation
35-
nature. In this case, the general architecture can be seen in the following figure.
33+
Node instance keeps an open communication channel with its Virtual Node neighbours, so it can send signals and
34+
information to "remote" nodes. Additionally, this open communication channel is also required due to SimulaQron's
35+
distributed simulation nature. In this case, the general architecture can be seen in the following figure.
3636

3737
.. image:: figs/general-arch-2-nodes.png
3838
:width: 700px
@@ -44,9 +44,10 @@ Backend Processes Interactions
4444
------------------------------
4545

4646
As explained in the previous section, SimulaQron requires a *backend* to be running when you are using quantum operations.
47-
Ths is done using the ``simulaqron`` CLI tool (in particular, the ``simulaqron start`` subcommand).
47+
The SimulaQron backend can be started by using the ``simulaqron`` CLI tool - in particular, the ``simulaqron start``
48+
subcommand.
4849

49-
The ``simulaqron start`` subcommand makes the CLI tool to act as a *driver* whose only task is to spawn the backend
50+
The ``simulaqron start`` subcommand makes the CLI tool act as a *driver* whose only task is to spawn the backend
5051
processes. SimulaQron uses *2 backend processes per node*:
5152

5253
* QNodeOS process: A server process that implements :doc:`the NetQASM Interface <NetQASM>`. The main purpose of this
@@ -65,7 +66,7 @@ the settings files are present in the current folder):
6566
The startup of the backend perform the following operations:
6667

6768
#. The CLI tool (``simulaqron``) is invoked with the ``start`` subcommand. In this sense, the CLI tool becomes
68-
the driver of the whole simulaqron network backend.
69+
the driver of the whole SimulaQron network backend.
6970
#. The driver spawns the *virtual node* process for both Alice and Bob, and then it sleeps for a while to allow them
7071
to correctly initialize.
7172
#. When spawned, the virtual node processes setup the internals, and create a connection to *all* the quantum nodes
@@ -80,8 +81,8 @@ The startup of the backend perform the following operations:
8081
processes. This is needed since the QNodeOS processes will later send messages to the Virtual Node processes to
8182
execute the quantum operations contained in a NetQASM subroutine. Please note that QNodeOS processes *only* connect
8283
to their respective Virtual Node (Alice QNodeOS connect to and only to Alice Virtual Node process), so quantum
83-
operations that will require update a qubit hosted by Alice will trigger a message between Virtual Nodes (i.e. the
84-
underlying Virtual Node connection is transparent for QNodeOS processes).
84+
operations that will require update a qubit hosted by a remote node will trigger a message between Virtual Nodes
85+
(i.e. the underlying Virtual Node connection is transparent for QNodeOS processes).
8586
#. Once that each QNodeOS process is connected to their Virtual Node, they start listening to connections from the
8687
application layer.
8788
#. At this stage, the driver and all the spawned processes become daemons, and simply wait for activities in their
@@ -109,19 +110,18 @@ When the application process performs quantum operations, this is how they get e
109110
required argument (EPR Sockets, for example). By creating this object, the application process creates a TCP
110111
connection with the respective QNodeOS process.
111112
#. The application uses the ``connection`` object to create qubits, and apply quantum operations on the qubits.
112-
#. The application process *buffers* (stage) all these operations locally. This means that the quantum operations *are
113-
not executed* immediately.
113+
#. The application process automatically *buffers* (stages) all these operations locally. This means that the
114+
quantum operations *are not executed* immediately.
114115
#. At some point, the application process invokes ``connection.flush()`` method, signaling the NetQASM library to
115116
commit all the staged operations and send them for execution. To this end, the NetQASM library crates a *NetQASM
116117
subroutine* which contains all the staged operations. The subroutine is then serialized, and sent over the TCP
117118
connection to the QNodeOS process.
118-
#. After this, the NetQASM subroutine get deserialized in the QNodeOS process. This step allows the QNodeOS process
119-
to understand all the involved operations.
119+
#. Once the QNodeOS process receives the NetQASM subroutine, the NetQASM subroutine get deserialized in the QNodeOS
120+
process. This step allows the QNodeOS process to understand all the involved operations.
120121
#. For each quantum operation, the QNodeOS process proceeds with its execution. This step involves invoking the right
121122
remote calls on the Virtual Node process. Subsequentially (and due to SimulaQron distributed nature), executing one
122123
quantum operation might trigger executing other operation on remote quantum nodes. This makes the "local" Virtual
123124
Node process (the one that is executing the subroutine) to trigger other remote calls on remote nodes.
124125
#. Once that all the quantum operations have been executed, the QNodeOS process determines the execution result of the
125126
whole subroutine, and report it back to the application layer.
126-
#. With this result, the application process continues execuing the application program.
127-
127+
#. With this result, the application process continues executing the application program.

docs/Troubleshooting.rst

Lines changed: 39 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Troubleshooting SimulaQron
22
==========================
33

4-
This document aims to help you troubleshooting some situations that can arise while running simulaqron applications.
4+
This document aims to help you troubleshooting some situations that can arise while running SimulaQron applications.
55
This documents assumes that you have read the :doc:`SimulaQron Overview <Overview>` and
66
:doc:`SimulaQron Application Architecture <AppsArch>` before you proceed.
77

@@ -15,11 +15,11 @@ cannot be changed.
1515

1616
Under this folder you will find:
1717

18-
* *Driver log file*: Each time that you invoke que driver (``simulaqron start``), the driver will create a general log.
19-
This file will be called ``simulaqron-driver-<pid>.log``, where "``<pid>``" is a number corresponding to the process
18+
* *Driver log file*: Each time that you invoke the driver (``simulaqron start``), it will create a general log. This
19+
file will be called ``simulaqron-driver-<pid>.log``, where "``<pid>``" is a number corresponding to the process
2020
ID as reported by the OS.
2121
* *SimulaQron's QNodeOS and Virtual Node log files*: Once that the backend is running, the spawned QNodeOS and Virtual
22-
Node processes will create a logs file named ``simulaqron-<qnos/vnode>-<node_name>-<pid>.log``. From the file name
22+
Node processes will create logs file named ``simulaqron-<qnos/vnode>-<node_name>-<pid>.log``. From the file name
2323
you'll be able to identify if the log file corresponds to QNodeOS or Virtual Node process, the node name, and the
2424
process ID as reported by the OS.
2525

@@ -31,7 +31,7 @@ How can I increase/decrease the verbosity of the log files?
3131
-----------------------------------------------------------
3232

3333
By default, the log verbosity level is set to "warning". This means that the information shown in the logs only
34-
contains lines that are logged with severity "warning" or higher. YOu can increase the verbosity to see more debugging
34+
contains lines that are logged with severity "warning" or higher. You can increase the verbosity to see more debugging
3535
messages. To do so, edit your ``simulaqron_config.json`` file and change the "log_level" line from::
3636

3737
"log_level": 30,
@@ -46,21 +46,21 @@ valid values of the log level that you can use in this field.
4646

4747
.. warning:: **Do not forget** to change the log level back to the default value (30) **before** submitting your solution.
4848

49-
After changing the log configuration, stop your application, stop SimulaQron backend, start SimulaQron backend and then
50-
start your application again.
49+
After changing the log configuration, stop your application, stop SimulaQron backend, and then start SimulaQron backend
50+
and your application again.
5151

5252

5353
How can I "follow" the log files on real time?
5454
----------------------------------------------
5555

56-
Unix systems (Linux and macOS) embed the ``tail`` tool that allows you to follow a file as it grows. This is useful to
57-
print a log file on the terminal, and keep "listening to" new updates as they are written on the file. To do so, run
56+
Unix systems (Linux and macOS) embed the ``tail`` tool that allows you to follow a text file as it grows. This is useful
57+
to print a log file on the terminal, and keep "listening to" new updates as they are written on the file. To do so, run
5858
the following command on a separate terminal::
5959

6060
tail -f /my/log/file.log
6161

6262
Adjust the ``/my/log/file.log`` path to match the file you want to follow on real time. This command will print on the
63-
terminal the last 10 lines of the file, and the will keep waiting for new lines to arrive. As soon as they arrive, they
63+
terminal the last 10 lines of the file, and it will keep waiting for new lines to arrive. As soon as they arrive, they
6464
will also be printed don the terminal.
6565

6666

@@ -73,27 +73,27 @@ This can happen for multiple reasons. We will try to address a few of them here.
7373
Another instance of the backend is still running
7474
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
7575

76-
The most common scenario arises when you are trying to run the application layer using a backend from "another version".
77-
This can happen when you update the port numbers in the ``simulaqron_networks.json`` file and you did not restart the
78-
backend after that.
76+
The most common scenario arises when you are trying to run the application layer using a backend from "another version"
77+
(or even another application). This can happen when you update the port numbers in the ``simulaqron_networks.json``
78+
file and you did not restart the backend after that.
7979

80-
In this case try restarting simulaqron backend by running::
80+
In this case try restarting SimulaQron backend by running::
8181

8282
simulaqron stop
8383

84-
and then running the ``simulaqron start`` command as per the example or step of the lab you are currently following.
84+
and then run the ``simulaqron start`` command as per the example or step of the lab you are currently following.
8585

86-
If after this the error persist, check the code of the application (usually alice and/or bob) and make sure that these
87-
file load the same ``simulaqron_settings.json`` and ``simulaqron_config.json`` files as the ```simulaqron start``
88-
command.
86+
If after this the error persist, check the code of the application (usually alice and/or bob implementations) and
87+
make sure that these file load the same ``simulaqron_settings.json`` and ``simulaqron_config.json`` files as the
88+
ones passed to the ``simulaqron start`` command.
8989

9090
.. _exception-in-backend:
9191

9292
Exceptions on the backend
9393
^^^^^^^^^^^^^^^^^^^^^^^^^
9494

9595
When running the backend, the spawned processes are daemonized, meaning that if an exception happens there, it is not
96-
possible to see that on the terminal. When an exception happened in the backend, some of the TCP ports used to execute
96+
possible to see that on the terminal. When an exception happens in the backend, some of the TCP ports used to execute
9797
quantum operations are not properly open, and your application might be waiting for a connection or message that will
9898
never arrive.
9999

@@ -107,16 +107,17 @@ more clues about what is happening.
107107
Protocol not implemented properly
108108
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
109109

110-
Another usual scenario where your application looks stalled is because of error when implementing classical messages
110+
Another usual scenario where your application looks stalled is because of errors when implementing classical messages
111111
interchange. In some cases, your client or server side application is waiting for the arrival of a message. Once it
112112
arrived, it reads the characters from the classical socket, and check if it the expected message or not.
113113

114114
In this case, make sure that you properly check the expected string, and raise and exception or fail the execution if
115-
something unexpected happen. To this last end, you can use python asserts to aid you in that::
115+
something unexpected happen. In this last case, you can use python asserts to aid you in that::
116116

117117
assert message == "expected"
118118

119-
The line above will make whole program fail if ``message`` is not exactly the string ``expected``.
119+
The line above will make whole program fail if the variable ``message`` does not contain the exact the string
120+
``expected``.
120121

121122
.. caution:: Killing a single process might leave some other processes (application nodes) still running in the
122123
background. This might lead to scenarios where subsequent execution might fail with connection errors. To fully
@@ -169,17 +170,17 @@ in their command line.
169170
In the example above, it is important to identify some information. The ``PID`` and ``COMMAND`` columns are the most
170171
important ones. We will use them to identify which processes can be terminated:
171172

172-
* Processes that contain ``simulaqron start`` in their commandline, they are *SimulaQron backend-related processes*.
173+
* Processes that contain ``simulaqron start`` in their command line, they are *SimulaQron backend-related processes*.
173174
* Processes that are simply ``python myTest.py`` *are usually SimulaQron application processes*. Try to remember
174175
if you manually started these processes (or via the ``run.sh`` script) to correctly identify it.
175-
* All other processes on the list *are usually system processes*. **These processes need to left untouched**.
176+
* All other processes on the list *are usually system processes*. **These processes need to be left untouched**.
176177

177-
Once that you have identified that you have some leftover processes from old executions, you can try two ways to stop
178-
these processes:
178+
Once that you have identified the processes that you want to terminate (usually leftover processes from old executions),
179+
you can try two ways to stop these processes:
179180

180181
* Run ``simulaqron reset processes``. As explained in the :ref:`starting backend section <starting-backend>`, this
181-
command can be used to forcefully stop any backend-related processes. If you run this command and run get the list
182-
of python processes, you'll see that some of them are not there anymore::
182+
command can be used to forcefully stop any backend-related processes. If you run this command and later run
183+
``ps aux | awk 'NR==1 || /python/'`` to get the list of python processes, you'll see that some of them disappear::
183184

184185
$ simulaqron reset processes
185186
Are you sure you want to forcefully stop all the `simulaqron` processes? [y/N]: y
@@ -212,7 +213,8 @@ these processes:
212213
root 1723 0.0 0.0 114868 23364 ? Ssl 08:15 0:00 /usr/bin/python3 /usr/share/unattended-upgrades/unattended-upgrade-shutdown --wait-for-signal
213214
user 12561 0.0 0.0 11764 2360 pts/1 S+ 11:26 0:00 awk NR==1 || /python/
214215

215-
You can see that we were able to kill the leftover SimulaQron application process (``python bobTest.py``).
216+
You can see that we were able to kill the leftover SimulaQron application process (``python bobTest.py``), but also
217+
the processes from the SimulaQron backend.
216218

217219
.. note:: When running ``kill``, if you get errors like "kill: (<PID>) - No such process", you can safely ignore them.
218220
This error means that you specified a PID that was not valid. Recheck the process list ans try again.
@@ -223,7 +225,7 @@ How can I check if a port is taken or not?
223225
------------------------------------------
224226

225227
First of all, a running system is dynamic, so there's no guarantee that a port available now will still be available
226-
in 5 minutes more. Despite this, if you pick a port number (ranging from :math:`1` to :math:`65535`) cleverly enough,
228+
in in the future. Despite this, if you pick a port number (which range from :math:`1` to :math:`65535`) cleverly enough,
227229
it will most likely be available whenever you need it.
228230

229231
In Linux, port numbers under :math:`1000` need sudo permissions to be used, so we highly recommend *not* to use them.
@@ -341,13 +343,13 @@ After installing this, try creating your virtual environment again.
341343
error: command 'x86_64-linux-gnu-g++' failed: No such file or directory
342344
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
343345

344-
This usually happens when installing simulaqron using pip *with the optional dependencies* (i.e.
346+
This usually happens when installing SimulaQron using pip *with the optional dependencies* (i.e.
345347
``pip install "simulaqron[opt]"``), on a machine that does not have a C++ compiler. Please make sure that you install
346348
all the requirements by running::
347349

348350
$ sudo apt-get install build-essential cmake vim git linux-headers-generic
349351

350-
Then try to install simulaqron with the optional dependencies again.
352+
Then try to install SimulaQron with the optional dependencies again.
351353

352354

353355
macOS-specific errors
@@ -357,7 +359,7 @@ macOS-specific errors
357359
error: command 'x86_64-linux-gnu-g++' failed: No such file or directory
358360
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
359361

360-
This usually happens when installing simulaqron using pip *with the optional dependencies* (i.e.
362+
This usually happens when installing SimulaQron using pip *with the optional dependencies* (i.e.
361363
``pip install "simulaqron[opt]"``), on a machine that does not have a C++ compiler. Please make sure that you install
362364
all the requirements by running::
363365

@@ -381,13 +383,13 @@ On macOS, brew should install the development dependencies. You can always try t
381383

382384
% brew reinstall python@3.12
383385

384-
After this, try installing simulaqron again.
386+
After this, try installing SimulaQron again.
385387

386388

387389
'Compiler' object has no attribute 'dry_run'
388390
""""""""""""""""""""""""""""""""""""""""""""
389391

390-
This error arises when trying to install simulaqron with the optional dependencies. One of them is
392+
This error arises when trying to install SimulaQron with the optional dependencies. One of them is
391393
`ProjectQ <https://projectq.ch/>`_, which is a rather old software, written in C++. Considering this, ProjectQ
392394
*needs to be compiled by pip* before installing it. Since ProjectQ is an old software, it relies on compilation
393395
tools that nowadays are not part of the pip compilation toolchain.
@@ -399,7 +401,7 @@ not create an isolated environment for compiling ProjectQ::
399401
$ pip install "git+https://github.com/ProjectQ-Framework/ProjectQ.git@v0.8.0" --no-build-isolation
400402

401403
*On macOS systems*, we have also observed this error when compiling `QuTip <http://qutip.org/>`_. In this case, you
402-
can also instruct pip to compile Qutip with the older toolchain::
404+
can also instruct pip to compile Qutip and ProjectQ with the older toolchain::
403405

404406
% pip install "setuptools<81" pybind11 Cython
405407
% pip install "git+https://github.com/ProjectQ-Framework/ProjectQ.git@v0.8.0" --no-build-isolation
@@ -414,4 +416,4 @@ can also instruct pip to compile Qutip with the older toolchain::
414416
**In macOS, these packages are compiled only for macOS 26 (Tahoe)**. Additionally, they require installing "libomp"
415417
from homebrew: ``brew install libomp``.
416418

417-
Then you can try to install simulaqron with optional dependencies again.
419+
Then you can try to install SimulaQron with optional dependencies again.

0 commit comments

Comments
 (0)