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
A distributed node based approach to quantum networks. This repository hosts all the code necessary to make nodes of the PQN function (except for the frontend located[here](https://github.com/PublicQuantumNetwork/pqn-gui)).
8
+
A distributed node based approach to quantum networks. This repository hosts all the code necessary to make the backend of nodes of the PQN function. For the frontend, see[here](https://github.com/PublicQuantumNetwork/pqn-gui).
9
9
10
10
11
11
<palign="center">
@@ -27,7 +27,7 @@ A distributed node based approach to quantum networks. This repository hosts all
27
27
28
28
Our Node is composed of multiple components. All components inside a node are part of an in internal intranet with no external world access except for quantum links to other hardware or the _Node API_.
29
29
30
-
***Node API**: FastAPI based, handles communications with web-ui as well as Node to Node communication. Only component in a Node than can talk to other components and the outside world. Resides in [src/pqnstack/app/main.py](https://github.com/PublicQuantumNetwork/pqn-stack/blob/master/src/pqnstack/app/main.py).
30
+
***Node API**: FastAPI based, handles communications with web-ui as well as Node to Node communication. Only component in a Node than can talk to other components and the outside world. Resides in [src/pqnstack/app/main.py](https://github.com/PublicQuantumNetwork/pqn-stack/blob/master/src/pqnstack/app/main.py). See the [FastAPI docs](https://fastapi.tiangolo.com/deployment/) for more options on how to run the API.
31
31
***Lightweight Web UI**: Designed for the general public to be able to interact with quantum networks. Resides in its own repository [here](https://github.com/PublicQuantumNetwork/pqn-gui).
32
32
***Router**: Routes messages between _Hardware Providers_, PQN developers and _Node APIs_. Uses ZMQ sockets to communicate between machines. Resides in [src/pqnstack/network/router.py](https://github.com/PublicQuantumNetwork/pqn-stack/blob/master/src/pqnstack/network/router.py).
33
33
***Hardware Provider**: Hosts hardware resources that are provided to whoever needs them inside a Node through the use of ProxyInstruments. Resides in [src/pqnstack/network/instrument_provider.py](https://github.com/PublicQuantumNetwork/pqn-stack/blob/master/src/pqnstack/network/instrument_provider.py).
@@ -54,88 +54,93 @@ Our Node is composed of multiple components. All components inside a node are pa
54
54
55
55
2.**Install dependencies**
56
56
57
-
```bash
58
-
uv sync
59
-
60
-
# Or sync with the --extra flag to run the full node
57
+
To run the fastapi backend for node operations, use:
58
+
```bash
61
59
uv sync --extra webapp
62
60
```
63
61
64
-
### Starting a Node
62
+
### Start a Node
65
63
66
64
To fully start a PQN Node, you need to initialize 4 different processes:
67
65
68
-
***Node API**
66
+
***PQN API**
69
67
***Router**
70
68
***Hardware provider** (optional)
71
69
***Web GUI** (optional)
72
70
73
-
### Node API
71
+
### Set up the PQN API
72
+
73
+
74
74
75
75
#### Config file
76
76
77
-
Before starting a Node API, you need to set up a configuration file:
77
+
Before starting a Node API, you need to set up a configuration file for the Node:
78
78
79
79
1.**Copy the example configuration:**
80
80
```bash
81
81
cp configs/config_app_example.toml config.toml
82
82
```
83
83
84
-
2.**Edit the configuration:**
85
-
Open `config.toml` in your editor and replace the placeholder values with your actual settings (router addresses, instrument names, etc.).
86
-
87
84
> [!IMPORTANT]
88
85
> The configuration file **must** be named `config.toml` and placed at the root of the repository. If you use a different name or location, the API will not be able to find it.
89
86
90
-
#### Run the FastAPI instance
91
-
For a quick run you can simply run to get started:
92
-
93
-
```bash
94
-
uv run fastapi run src/pqnstack/app/main.py
95
-
```
87
+
2.**Edit the configuration:**
88
+
Open `config.toml` in your editor and replace the placeholder values with your actual settings (router addresses, instrument names, etc.).
96
89
97
-
Please take a look at the [FastAPI docs](https://fastapi.tiangolo.com/deployment/) for more options on how to run the API
98
90
99
-
### Router and Hardware Provider
91
+
### Configure Router and Hardware Provider
100
92
101
-
Both the Router and Hardware Provider can be configured in two ways:
93
+
For the first computer on the PQN, both a router and hardware provider are needed. For subsequent computers added to the same node, only a hardware provider is needed.
102
94
103
-
1.**Using CLI flags** - Pass configuration directly as command-line arguments
104
-
2.**Using a config file** - Use the `--config` flag with a path to a TOML configuration file (see example in [configs/config_messaging_example.toml](https://github.com/PublicQuantumNetwork/pqn-stack/blob/master/configs/config_messaging_example.toml))
95
+
Both the Router and Hardware Provider can be configured using a config file. (Alternatively you could use CLI flags for quick tests.)
105
96
106
-
The config file can contain settings for both router and provider:
97
+
Create a TOML configuration file for the router and hardware provider (see example in [configs/config_messaging_example.toml](https://github.com/PublicQuantumNetwork/pqn-stack/blob/master/configs/config_messaging_example.toml)). The config file can contain settings for both router and provider:
107
98
- Router settings go under `[router]`
108
99
- Provider settings go under `[provider]` with instruments defined as `[[provider.instruments]]`
To see the list of all the protocols that can be run, go to http://127.0.0.1:8000/docs.
135
+
136
+
### Install the Web GUI
136
137
137
138
For instructions on how install and start the web GUI please see the repo where it lives at [https://github.com/PublicQuantumNetwork/pqn-gui](https://github.com/PublicQuantumNetwork/pqn-gui)
138
139
139
140
## Acknowledgements
140
141
141
142
The Public Quantum Network is supported in part by NSF Quantum Leap Challenge Institute HQAN under Award No. 2016136, Illinois Computes, and by the DOE Grant No. 712869, "Advanced Quantum Networks for Science Discovery."
143
+
144
+
## Have questions?
145
+
146
+
Feel free to contact the PQN team at publicquantumnetwork@gmail.com.
0 commit comments