|
| 1 | +# Correlated Random Number Generator |
| 2 | + |
| 3 | +In this example, we have only two nodes: Alice and Bob. |
| 4 | + |
| 5 | +Alice and Bob will locally connect to their virtual nodes. The classical control communication is done by |
| 6 | +letting Alice run a client and Bob a server. Alice generates the EPR pair, and sends half to Bob. She subsequently |
| 7 | +performs the teleportation operation. She informs Bob of the outcome of the teleportation measurement, as well as the |
| 8 | +identity of the virtual qubit he received (assumed to be unknown to Bob here). |
| 9 | + |
| 10 | +Bob proceeds to recover the teleported qubit. |
| 11 | + |
| 12 | +In this example, we simply print out the initial state to be teleported, as well as the final state received by |
| 13 | +Bob to check whether the teleportation worked correctly. |
| 14 | + |
| 15 | + |
| 16 | +# How to run |
| 17 | + |
| 18 | +To run this example, first make sure that the python virtual environment is activated. You can easily check this |
| 19 | +with the terminal command prompt, which shows the active python virtual environment in parentheses: |
| 20 | +``` |
| 21 | +(simulaqron) user@machine_name:~$ |
| 22 | +``` |
| 23 | +If you don't see the name of the virtual environment, please check the SimulaQron README file to know how to |
| 24 | +create and activate it. |
| 25 | + |
| 26 | +Once the environment is active, we need to start the simulaqron network: |
| 27 | +```bash |
| 28 | +simulaqron start --nodes=Alice,Bob --network-config-file classicalNet.json |
| 29 | +``` |
| 30 | + |
| 31 | +This will read the JSON configuration files and start the SimulaQron virtual nodes for nodes `Alice` and `Bob`. |
| 32 | + |
| 33 | +After this, you can simply run the example by using the `run` script: |
| 34 | +```bash |
| 35 | +./run.sh |
| 36 | +``` |
| 37 | + |
| 38 | +# How to stop the execution in case the test execution stalls. |
| 39 | + |
| 40 | +To fully stop the execution, you can use the `terninate` script: |
| 41 | +```bash |
| 42 | +./terminate.sh |
| 43 | +``` |
| 44 | + |
| 45 | +Us you want to terminate the current execution and start a new one, you can use the `doNew` script. This will stop |
| 46 | +the current execution and run the example once again: |
| 47 | +```bash |
| 48 | +./doNew.sh |
| 49 | +``` |
| 50 | + |
| 51 | + |
| 52 | +# Troubleshooting |
| 53 | + |
| 54 | +## Trying to start the network gives "Network with name <name> is already running" message |
| 55 | + |
| 56 | +This usually happens when you stopped the network "manually" by killing processes (`kill -9`). If this happens, |
| 57 | +please make sure that you kill all related processes (use `ps aux | grep python` to search) and then delete the |
| 58 | +PID file for the running network. This file is located in `~/simulaqron_pids` and it is called |
| 59 | +`simulaqron_network_<network_name>.pid`: |
| 60 | +```bash |
| 61 | +rm ~/simulaqron_pids/simulaqron_network_<network_name>.pid |
| 62 | +``` |
| 63 | + |
| 64 | +After this, you can try to start the network again. |
0 commit comments