|
QDMI v1.3.0
Quantum Device Management Interface
|
Thank you for your interest in contributing to QDMI. We value contributions from people with all levels of experience.
We use GitHub to host code, to track issues and feature requests, as well as accept pull requests. See https://docs.github.com/en/get-started/quickstart for a general introduction to working with GitHub and contributing to projects.
Pick the path that fits your time and interests:
🐛 Report bugs:
Use the 🐛 Bug report template at https://github.com/Munich-Quantum-Software-Stack/QDMI/issues. Include steps to reproduce, expected vs. actual behavior, environment, and a minimal example.
🛠️ Fix bugs:
Browse issues, especially those labeled "bug", "help wanted", or "good first issue". Open a draft PR early to get feedback.
💡 Propose features:
Use the ✨ Feature request template at https://github.com/Munich-Quantum-Software-Stack/QDMI/issues. Describe the motivation, alternatives considered, and (optionally) a small API sketch.
✨ Implement features:
Pick items labeled "feature" or "enhancement". Coordinate in the issue first if the change is substantial; start with a draft PR.
📝 Improve documentation:
Add or refine docstrings, tutorials, and examples; fix typos; clarify explanations. Small documentation-only PRs are very welcome.
⚡️ Performance and reliability:
Profile hot paths, add benchmarks, reduce allocations, deflake tests, and improve error messages.
📦 Packaging and tooling:
Improve build configuration, type hints/stubs, CI workflows, and platform wheels. Incremental tooling fixes have a big impact.
🙌 Community support:
Triage issues, reproduce reports, and answer questions in Discussions: https://github.com/Munich-Quantum-Software-Stack/QDMI/discussions.
Please adhere to the following guidelines to help the project grow sustainably. Contributions that do not comply with these guidelines or violate our AI Usage Guidelines may be rejected without further review.
We acknowledge the utility of AI-based coding assistants (e.g., GitHub Copilot, ChatGPT) in modern software development. However, their use requires a high degree of responsibility and transparency to maintain code quality and licensing compliance.
Please carefully read and follow our dedicated AI Usage Guidelines before submitting any AI-assisted contribution. In short: You are responsible for every line of code you submit, and a human must always be in the loop. We require disclosure of AI tool usage in your PR description.
Ready to contribute? We value contributions from people with all levels of experience. In particular, if this is your first PR, not everything has to be perfect. We will guide you through the process.
Clone your fork locally
Change into the project directory
Create a branch for local development
Now you can make your changes locally.
(Optional, highly recommended) Install prek to automatically run a set of checks before each commit.
via uv The easiest way to install prek is via uv.
via brew If you use macOS, then prek is in Homebrew, use
Afterward, you can install the prek hooks with
Building the project requires a C compiler supporting C11 and a minimum CMake version of 3.24. The example devices and the tests require a C++ compiler supporting C++20.
Our projects use CMake as the main build configuration tool. Building a project using CMake is a two-stage process. First, CMake needs to be configured by calling:
This tells CMake to
After configuring CMake, the project can be built by calling:
This builds the project in the build directory (passed via --build). Some operating systems and development environments explicitly require a configuration to be set, which is why the --config flag is also passed to the build command. The flag --parallel <NUMBER_OF_THREADS> may be added to trigger a parallel build.
Building the project this way generates
This project uses CMake's FetchContent module to download and build its dependencies. Because of this, the first time you configure the project, you will need an active internet connection to fetch the required libraries.
However, there are several ways to bypass these downloads:
We use the GoogleTest framework for unit testing of the C++ library. All tests are contained in the test directory, which is further divided into subdirectories for different parts of the library. You are expected to write tests for any new features you implement and ensure that all tests pass. Our CI pipeline on GitHub will also run the tests and check for any failures. It will also collect code coverage information and upload it to Codecov. Our goal is to have new contributions at least maintain the current code coverage level, while striving for covering as much of the code as possible. Try to write meaningful tests that actually test the correctness of the code and not just exercise the code paths.
Most IDEs like CLion or Visual Studio Code provide a convenient way to run the tests directly from the IDE. If you prefer to run the tests from the command line, you can use CMake's test runner CTest. To run the tests, run the following command from the main project directory after building the project as described above:
This project mostly follows the LLVM Coding Standard, a set of guidelines for writing C/C++ code. To ensure the quality of the code and that it conforms to these guidelines, we use
Common IDEs like CLion or Visual Studio Code have plugins that can automatically run clang-tidy on the code and automatically format it with clang-format.
They will automatically execute clang-tidy on your code and highlight any issues. In many cases, they also provide quick-fixes for these issues. Furthermore, they provide a command to automatically format your code according to the given style.
Our pre-commit hook configuration also includes clang-format. If you have installed prek, it will automatically run clang-format on your code before each commit. If you do not have prek set up, the pre-commit.ci bot will run clang-format on your code and automatically format it according to the style guide.
Our CI pipeline will also run clang-tidy over the changes in your PR and report any issues it finds. Due to technical limitations, the workflow can only post PR comments if the changes are not coming from a fork. If you are working on a fork, you can still see the clang-tidy results either in the GitHub Actions logs, on the workflow summary page, or in the "Files changed" tab of the PR.
For the information to be displayed correctly in the documentation, the comments need to follow the format required by Doxygen. Below you find some tags that are commonly used within the documentation of a function:
The documentation is generated using Doxygen and its configuration is seamlessly integrated into the CMake build system.
The documentation can be built with the CMake target qdmi-docs via
The generated web page can be inspected by opening the file in docs/html/index.html in the CMake build directory.
The generated web page also contains a couple of static sites, including the main page, the support page, the FAQ page, and this development guide. The respective Markdown files that serve as the source for those sites are contained in docs/ where index.md contains the content of the main page.
To include source files to be listed among the menu item API Reference/Files, these files must be marked as documented by adding a comment like the following to the top of the file. Right now, this is done for all files in the include directory.
/** @file * @brief A brief description of the file. * @details Some details about the file. */
QDMI adheres to Semantic Versioning, with the exception that minor releases may include breaking changes. To inform users about changes to the project, we maintain a {doc}changelog <CHANGELOG> and an {doc}upgrade guide <UPGRADING>.
If your PR includes noteworthy changes, please update the changelog. The format is based on a mixture of Keep a Changelog and Common Changelog. There are the following categories:
When updating the changelog, follow these guidelines:
If your PR introduces major or breaking changes, or if you think additional context would help users, please also add a section to the upgrade guide. The upgrade guide is intended to provide a general overview of significant changes in a more descriptive and prose-oriented form than the changelog. Use it to explain how users may need to adapt their usage of QDMI, highlight new workflows, or clarify the impact of important updates. Feel free to write in a style that is helpful and accessible for users seeking to understand the broader implications of recent changes.
This document was inspired by and partially adapted from