How munich-quantum-software-stack/qdmi works
Project Overview and Type
• QDMI is a C-based library that provides a standardized interface for communicating with quantum hardware.
• It is one of the core components of the Munich Quantum Software Stack (MQSS), designed to allow seamless integration between software tools and quantum devices.
• The project is not a full-stack application but a hardware interface library accompanied by examples, tests, and extensive documentation.
Analyzing the File Structure
• Core API – The “include/qdmi” directory contains the main C header files (client.h, device.h, constants.h, types.h) that define the interface.
• Build System – Files like “CMakeLists.txt” at the top level and the “cmake” directory indicate that CMake is used to manage builds, external dependencies, and compiler configurations.
• Examples – The “examples” folder is subdivided into various implementation scenarios like ‘device’, ‘driver’, ‘fomac’, and ‘tool’. These serve as real-world usage demos of the QDMI API.
• Templates – The “templates” directory provides scaffolding (including device-specific CMake setups and source files) for developing new devices or integrations.
• Testing – The “test” directory, together with “test/utils”, hosts unit tests and integration testing code to ensure the API functions as expected.
• Documentation – The “docs” folder contains Markdown and Doxygen configuration files, CSS, and supporting assets for generating project documentation.
• CI/CD – The presence of GitHub Actions workflows under “.github/workflows” shows automated testing, documentation, and release management processes.
Main Components
• QDMI Core Library:
– Represent the core C header files (API) in a clearly marked block.
• Build & Configuration:
– A block representing the CMake build system (CMakeLists.txt, cmake/ modules) used to compile the core library, examples, tests, and templates.
• Examples & Integration:
– Separate blocks for different example scenarios (device, driver, etc.) to illustrate how the QDMI core is used.
• Testing Framework:
– A block for the unit/integration tests that ensures the interface meets performance and reliability requirements.
• Documentation:
– A module that covers the auto-generated documentation (via Doxygen and Markdown files).
• CI/CD Pipeline:
– A component outlining how GitHub workflows (CI, test automation, release drafts) integrate and support the development process.
• Templates:
– A module for developer templates that assists in creating new device instances or integrating QDMI into other systems.
• External Interactions:
– Optionally, add a block for the MQSS ecosystem to show QDMI’s role in the overall quantum software stack, emphasizing its integration into HPC environments and as an interface for various quantum platforms.
Relationships and Data Flow
• The QDMI Core Library is central and provides the API that several other components interact with.
• The build system (CMake) is connected to every component since it manages compilation and dependency resolution.
• Documentation generation sources from the whole codebase (especially the core API and examples) and should have bi-directional relationships with both code and tests.
• CI/CD is linked to the build system, tests, and documentation components, automating their processes.
Important Architectural Patterns and Design Principles
• Modularity – The separation between the API, examples, tests, and documentation emphasizes a modular design.
• Layered Approach – Think of QDMI as having a “core” layer that provides low-level C interfaces and multiple “usage layers” (examples, integrations, tests).
• Separation of Concerns – The build system, testing framework, and documentation are distinct components that support and interact with the core libraries but remain decoupled.
• Continuous Integration/Delivery – GitHub workflows and CI pipelines ensure code quality and systematic deployment routines.