QBKAT is a tool for analyzing the behavior of quantum network protocols. It captures both probabilistic behavior arising from quantum mechanics and non-deterministic behavior arising from resource contention.
QBKAT Visualizer provides a web-based interface for working with QBKAT. It allows you to write QBKAT protocols, visually construct quantum networks, configure their parameters, and execute the resulting simulations.
Live application: qbkat.swys.site
- Overview
- Features
- Architecture
- Tech Stack
- Prerequisites
- Getting Started
- Using the Visualizer
- Project Structure
- Environment Variables
- Deployment
- Troubleshooting
- Documentation
QBKAT Visualizer provides three main components:
-
Haskell Protocol Editor — Write QBKAT protocols directly in the browser using a Monaco-based editor with Haskell language-server support.
-
Quantum Network Editor — Visually construct a quantum network using nodes and connections and configure network constraints and probabilities.
-
QBKAT Runner — Execute the configured protocol and network using the QBKAT engine and view the resulting analysis.
The application includes a Monaco Editor, the code editor that powers Visual Studio Code.
The editor is integrated with a Haskell language server and provides:
-
Syntax highlighting
-
Real-time diagnostics
-
Error reporting
-
Autocompletion
-
Language-server features
This allows QBKAT protocols to be written and validated directly in the browser.
The network editor uses React Flow to provide an interactive node-based interface.
It allows you to:
-
Create and remove nodes
-
Connect nodes with links
-
Configure network parameters
-
Specify constraints
-
Define probabilities
-
Visually inspect the network topology
The resulting network configuration is sent to the backend when a QBKAT execution is started.
After defining a protocol and configuring a quantum network, you can execute the analysis using the QBKAT engine.
The backend handles the execution and returns the results to the frontend for visualization.
The backend uses Docker to provide a reproducible environment for running QBKAT and its required dependencies.
The application consists of four main parts:
Frontend: React │ Monaco Editor │ React Flow
Backend: Node.js | Express
JobQueue & Caching: BullMQ | Redis
QBKAT Engine: prob-bellkat
The frontend is responsible for:
-
Rendering the user interface
-
Providing the Haskell editor
-
Providing the quantum network editor
-
Managing protocol and network configuration
-
Communicating with the backend
-
Displaying execution results
The backend is responsible for:
-
Receiving requests from the frontend
-
Managing QBKAT executions
-
Creating jobs
-
Processing queued jobs
-
Starting QBKAT processes
-
Returning execution results
-
Managing communication with the frontend
Redis provides the data store used by BullMQ.
BullMQ manages QBKAT execution jobs so that expensive processes can be handled asynchronously and concurrently.
The actual protocol analysis is performed by QBKAT.
The QBKAT repository is included in this project as a Git submodule.
| Category | Technology | Purpose |
|---|---|---|
| Frontend | React | Builds the user interface |
| Frontend | Tailwind CSS | Provides styling |
| Code Editor | Monaco Editor | Enables in-browser Haskell code editing |
| Node Editor | React Flow | Provides interactive quantum network visualization |
| Backend | Node.js | Runs the backend services |
| API Server | Express | Provides the backend HTTP API |
| Job Queue | BullMQ | Manages asynchronous QBKAT execution jobs |
| Queue & Caching | Redis | Stores BullMQ queues, job data and caches |
| QBKAT Engine | QBKAT | Performs quantum network protocol analysis |
| Containers | Docker | Provides a reproducible runtime environment |
| CI/CD | GitHub Actions | Automates builds and deployment |
Before running the project locally, make sure you have the following installed:
Note: If Redis is started through your Docker environment, you do not need a separate local Redis installation.
If you just want a local running instance without development abilities, download the docker compose in a folder and open a terminal in that folder.
docker compose pull
docker compose up -dThe server will start in 1-2 minutes and will be available at
http://localhost:3000
If you also want development environment then follow the next steps.
The QBKAT engine is included as a Git submodule, so the repository should be cloned recursively:
git clone --recurse-submodules https://github.com/Andrei-Carabiber/PBKAT-Visualizer.git
cd PBKAT-VisualizerIf you have already cloned the repository without its submodules, run:
git submodule update --init --recursiveOpen a terminal and navigate to the frontend:
cd frontend
npm install
npm run devThe development server will display the local URL in the terminal, usually:
http://localhost:3000
Keep this terminal running.
Open a second terminal from the project root.
Navigate to the backend:
cd prob-bellkat-with-server/editor-webserverInstall the backend dependencies:
npm installReturn to the backend project root:
cd ..Start the development web server:
make dev-webserverImportant: Docker and Redis must be available before starting the backend.
The Makefile uses $(PWD) when mounting the project directory into Docker.
On some Windows environments, you may need to replace:
$(PWD)with:
$(CURDIR)Once both the frontend and backend are running:
Open the local frontend URL shown by the development server.
Use the Haskell editor to write your QBKAT protocol.
You can use some of the included tutorials to understand how to write the protocol.
The editor provides language-server functionality such as:
-
Autocompletion
-
Diagnostics
-
Syntax highlighting
-
Error reporting
Use the network editor to visually construct the network.
Add the required nodes and connections and configure their parameters.
Start a QBKAT execution from the interface.
The frontend sends the protocol and network configuration to the backend. The backend then creates an execution job and processes it using the QBKAT engine.
After the QBKAT execution finishes, if the protocol was written correctly, the results are returned to the frontend and displayed in the visualizer.
PBKAT-Visualizer/
│
├── frontend/
│ ├── src/
│ │ ├── components/
│ │ ├── ...
│ │ └── ...
│ ├── package.json
│ └── ...
│
├── prob-bellkat-with-server/
│ ├── editor-webserver/
│ │ ├── src/
│ │ ├── package.json
│ │ └── ...
│ │
│ ├── Makefile
| ├── Dockerfile
│ └── ...
│
│
├── Dockerfile
├── .compose.yml.prod
├── .gitmodules
└── README.md
Contains the React application.
This includes:
-
User interface
-
Haskell editor
-
Quantum network editor
-
QBKAT configuration
-
Result visualization
-
Frontend/backend communication
Contains the backend environment and QBKAT server integration.
Contains the Node.js/Express web server.
Defines the QBKAT repository used as a Git submodule.
The application currently does not require environment variables for local development. The only variables needed are included in the Makefile.
The production application is available at:
The project uses Docker and GitHub Actions as part of its deployment infrastructure.
Check that:
-
The backend is running.
-
The Frontend connected to backend via web-socket.
-
Some time has passed after start (2-3 minutes) so that the Haskell Language Server can start
If you are using Windows, check whether the Makefile uses:
$(PWD)If necessary, replace it with:
$(CURDIR)Make sure Redis is running and accessible.
You can test a local Redis instance with:
redis-cli pingA working Redis instance should return:
PONG
If the application starts correctly but QBKAT executions fail, check:
-
The Docker backend is running
-
Redis is running.
-
The QBKAT protocol was written correctly.
-
Backend logs for process or permission errors.
The underlying QBKAT project is available at:
github.com/swystems/prob-bellkat
Production application: