QRM Workflow Example
This example demonstrates a simple Quantum Resource Manager (QRM) workflow built on top of MQSS and RabbitMQ.
Communication between the components is performed through RabbitMQ using MQSS messaging abstractions.
Workflow
Daemon -> Scheduler -> Compiler -> Submitter -> Simulator -> Submitter -> Daemon
The daemon creates a QuantumTask and submits it to the scheduler.
The scheduler forwards the task to the compiler. The compiler processes the task, converts to
an appropriate exchange format (OpenQasm2) which it then forwards to the Submitter. the Submitter
creates a QDMI job using the QDMI client APIs and submits the job to a QDMI device for execution.
Currently as an example, MQT Core's DDSIM QDMI device is used to simulate the circuit and generate
results. The generated results are sent back to the Submitter which returns the results to the Daemon.
Configuration
The example uses a centralized configuration system supporting:
- compile-time defaults generated by CMake;
- environment variable overrides;
- process-wide configuration access through
getConfig().
Configuration includes:
- RabbitMQ connection settings;
- queue names;
- logging paths;
- benchmark paths;
- compiler toolchain paths.
Logging
Each process creates its own spdlog logger and installs it as the default logger. This keeps logging available throughout the application without passing logger objects explicitly, while still producing component-specific log output.
Log files are written to the configured log directory.
Benchmarks
Example benchmark circuits (in MLIR dialect representation) are provided in:
benchmarks/
Note: The bell_state.mlir example is used for demonstration purposes.
Path to this circuit is hard-coded within the Daemon.
RabbitMQ Setup
RabbitMQ installation and configuration are described in:
docs/rabbitmq.md
Build
This example is built as an external consumer of an installed MQSS package.
cmake -S . -B build -DCMAKE_PREFIX_PATH=/tmp/mqss-install
cmake --build build
Run
Start the workflow:
./start.sh
The script launches the daemon, scheduler, submitter, compiler processes and terminates them when interrupted.
Automated Check
Perform an end-to-end build and execution check:
scripts/check_qrm_workflow.sh
The script builds MQSS, installs it, builds the QRM workflow example, and starts the workflow.
To build the example without starting the workflow:
RUN_WORKFLOW=0 scripts/check_qrm_workflow.sh
Optional environment overrides:
CLEAN=1 \
BUILD_TYPE=Debug \
BUILD_DIR=build-debug \
INSTALL_DIR=/tmp/mqss-debug-install \
RUN_WORKFLOW=0 \
scripts/check_qrm_workflow.sh
Docker Environment
Start the RabbitMQ-backed workflow development environment:
scripts/docker_workflow.sh
Within the container, build and run the workflow:
scripts/check_qrm_workflow.sh
Alternatively, build the workflow without running it:
RUN_WORKFLOW=0 scripts/check_qrm_workflow.sh
and start it manually:
cd examples/qrm_workflow
./start.sh