Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@
# Contributing

Thank you for your interest in contributing to MQT Core!
An extensive contribution guide is available in our [documentation](https://mqt.readthedocs.io/projects/core/en/latest/contributing.html).
An extensive contribution guide is available in our
[documentation](https://mqt.readthedocs.io/projects/core/en/latest/contributing.html).
10 changes: 6 additions & 4 deletions .github/SECURITY.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,16 @@ Security updates are applied only to the most recent releases.

## Reporting a Vulnerability

To report vulnerabilities, you can privately report a potential security issue
via the GitHub security vulnerabilities feature. This can be done here:
To report vulnerabilities,
you can privately report a potential security issue via the GitHub security
vulnerabilities feature.
This can be done here:

https://github.com/munich-quantum-toolkit/core/security/advisories
<https://github.com/munich-quantum-toolkit/core/security/advisories>

Please do **not** open a public issue about a potential security vulnerability.

You can find more details on the security vulnerability feature in the GitHub
documentation here:

https://docs.github.com/en/code-security/security-advisories/guidance-on-reporting-and-writing/privately-reporting-a-security-vulnerability
<https://docs.github.com/en/code-security/security-advisories/guidance-on-reporting-and-writing/privately-reporting-a-security-vulnerability>
16 changes: 11 additions & 5 deletions .github/SUPPORT.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,23 @@

# Support

If you are stuck with a problem using MQT Core or have questions, please get in touch at our [Issues] or [Discussions].
If you are stuck with a problem using MQT Core or have questions,
please get in touch at our [Issues] or [Discussions].
We'd love to help.

You can save time by following this procedure when reporting a problem:

- Do try to solve the problem on your own first.
- Search through past [Issues] and [Discussions] to see if someone else already had the same problem.
- Before filing a bug report, try to create a minimal reproducible example (MRE) that reproduces the problem.
It is much easier to identify the cause for the problem if a handful of lines suffice to show that something is not working.
- Search through past [Issues] and [Discussions] to see
if someone else already had the same problem.
- Before filing a bug report,
try to create a minimal reproducible example (MRE)
that reproduces the problem.
It is much easier to identify the cause for the problem
if a handful of lines suffice to show that something is not working.

You can also always reach us at [quantum.cda@xcit.tum.de](mailto:quantum.cda@xcit.tum.de).
You can also always reach us at
[quantum.cda@xcit.tum.de](mailto:quantum.cda@xcit.tum.de).

[Issues]: https://github.com/munich-quantum-toolkit/core/issues
[Discussions]: https://github.com/munich-quantum-toolkit/core/discussions
6 changes: 5 additions & 1 deletion .github/pull_request_template.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,11 @@ Please include a summary of the change and, if applicable, which issue is fixed.
Please also include relevant motivation and context.
List any dependencies that are required for this change.

Fixes #(issue) <!--- Replace `(issue)` with the issue number fixed by this pull request. If this PR does not fix an issue, please remove this line. -->
<!---
Replace `(issue)` with the issue number fixed by this pull request.
If this PR does not fix an issue, please remove the line.
-->
Fixes #(issue)

## Checklist

Expand Down
2 changes: 1 addition & 1 deletion .github/release-drafter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ categories:
- "github-actions"
- "pre-commit"
- "submodules"
change-template: "- $TITLE ([#$NUMBER]($URL)) ([**@$AUTHOR**](https://github.com/$AUTHOR))"
change-template: "- $TITLE ([#$NUMBER]($URL)) (**@$AUTHOR**)"
change-title-escapes: '\<*_&'
exclude-labels:
- "skip-changelog"
Expand Down
12 changes: 11 additions & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -107,9 +107,19 @@ repos:
rev: v3.8.3
hooks:
- id: prettier
types_or: [yaml, markdown, html, css, scss, javascript, json, json5]
types_or: [yaml, html, css, scss, javascript, json, json5]
priority: 5

## Format Markdown files with rumdl
- repo: https://github.com/rvben/rumdl-pre-commit
rev: v0.2.18
hooks:
- id: rumdl
args: [--fix]
priority: 5
- id: rumdl-fmt
priority: 6

## Format CMake files with cmake-format
- repo: https://github.com/cheshirekow/cmake-format-precommit
rev: v0.6.13
Expand Down
18 changes: 18 additions & 0 deletions .rumdl.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
[per-file-ignores]
# The PR template is not a Markdown document in that sense
"**/pull_request_template.md" = ["MD013", "MD041"]
# The docs files do not necessarily need to start with a top-level heading
"docs/**" = ["MD041"]
# The README starts with an image and may include HTML tags
"README.md" = ["MD033", "MD041"]

[per-file-flavor]
"docs/**" = "myst"

[MD013]
line-length = 80
reflow = true
reflow-mode = "semantic-line-breaks"

[MD060]
enabled = true
78 changes: 53 additions & 25 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,24 +5,27 @@

## C++

- Configure: `cmake -S . -B build_cpp -DCMAKE_BUILD_TYPE=Release`
- Build: `cmake --build build_cpp --config Release`
- Test: `ctest --test-dir build_cpp -C Release`
- Single test binary: `./build_cpp/test/path/to/binary`
- For debug builds, replace `Release` with `Debug`.
- Configure: `cmake --preset release`
- Build: `cmake --build --preset release`
- Test: `ctest --preset release`
- Single test binary: `./build/release/test/path/to/binary`
- For debug builds, replace `release` with `debug`.
- For more presets, see `CMakePresets.json`.

## Python

- Set up build and test dependencies: `uv sync --inexact --only-group build --only-group test`
- Install package without build isolation (fast rebuilds): `uv sync --inexact --no-dev --no-build-isolation-package mqt-core`
- Set up build and test dependencies:
`uv sync --inexact --only-group build --only-group test`
- Install package without build isolation (fast rebuilds):
`uv sync --inexact --no-dev --no-build-isolation-package mqt-core`
- Run tests: `uv run --no-sync pytest`
- Nox test shortcuts: `uvx nox -s tests`, `uvx nox -s minimums`
- Python 3.14 variants: `uvx nox -s tests-3.14`, `uvx nox -s minimums-3.14`

## Documentation

- Sources: `docs/`
- Build MLIR docs: `cmake --build build_cpp --target mlir-doc --config Release`
- Build MLIR docs: `cmake --build --preset release --target mlir-doc`
- Build docs locally: `uvx nox --non-interactive -s docs`
- Link check: `uvx nox -s docs -- -b linkcheck`

Expand All @@ -34,11 +37,14 @@

### C++

- Targets Linux (glibc 2.28+), macOS (11.0+), and Windows on x86_64 and arm64 architectures
- Targets Linux (glibc 2.28+), macOS (11.0+),
and Windows on x86_64 and arm64 architectures
- C++20
- CMake 3.24+
- `FetchContent` for dependency management (configured in `cmake/ExternalDependencies.cmake`)
- `clang-format` and `clang-tidy` for formatting/linting (see `.clang-format` and `.clang-tidy`)
- `FetchContent` for dependency management
(configured in `cmake/ExternalDependencies.cmake`)
- `clang-format` and `clang-tidy` for formatting/linting
(see `.clang-format` and `.clang-tidy`)
- LLVM 22.1+ for building MLIR code
- GoogleTest for unit tests (located in `test/` and `mlir/unittests/`)

Expand Down Expand Up @@ -66,35 +72,57 @@
### General

- MUST run `uvx nox -s lint` after every batch of changes.
This runs the full `prek` hook set from `.pre-commit-config.yaml` (including `ruff`, `typos`, `ty`, formatting, and metadata checks).
This runs the full `prek` hook set from `.pre-commit-config.yaml`
(including `ruff`, `typos`, `ty`, formatting, and metadata checks).
All hooks must pass before submitting.
- MUST add or update tests for every code change, even if not explicitly requested.
- MUST add or update tests for every code change,
even if not explicitly requested.
- MUST follow existing code style by checking neighboring files for patterns.
- MUST update `CHANGELOG.md` and `UPGRADING.md` when changes are user-facing, breaking, or otherwise noteworthy.
- MUST include a commit footer attribution in the form `Assisted-by: [Model Name] via [Tool Name]` (example: `Assisted-by: Claude Sonnet 4.6 via GitHub Copilot`) if AI tools are used to prepare a commit.
- NEVER modify files that start with "This file has been generated from an external template. Please do not modify it directly."
These files are managed by [the MQT templates action](https://github.com/munich-quantum-toolkit/templates) and changes will be overwritten.
- MUST update `CHANGELOG.md` and `UPGRADING.md` when changes are user-facing,
breaking, or otherwise noteworthy.
- MUST include a commit footer attribution in the form
`Assisted-by: [Model Name] via [Tool Name]` (example:
`Assisted-by: Claude Sonnet 4.6 via GitHub Copilot`) if AI tools are used to
prepare a commit.
- NEVER modify files that start with "This file has been generated from an
external template.
Please do not modify it directly."
These files are managed by
[the MQT templates action](https://github.com/munich-quantum-toolkit/templates)
and changes will be overwritten.
- PREFER running targeted tests over the full test suite during development.

### C++

- MUST use Doxygen-style comments.
- MUST use `#pragma once` for header guards.
- MUST regenerate stubs via `uvx nox -s stubs` when files in `bindings/` are added or modified.
- NEVER edit `.pyi` files in `python/mqt/core/` manually; they are auto-generated by nanobind stubgen.
- MUST regenerate stubs via `uvx nox -s stubs`
when files in `bindings/` are added or modified.
- NEVER edit `.pyi` files in `python/mqt/core/` manually;
they are auto-generated by nanobind stubgen.
- PREFER C++20 STL features over custom implementations.
- PREFER LLVM data structures and methods in `mlir/` (`llvm::SmallVector`, `llvm::function_ref`, etc.) over the STL.
- PREFER LLVM data structures and methods in `mlir/`
(`llvm::SmallVector`, `llvm::function_ref`, etc.) over the STL.

### Python

- MUST use Google-style docstrings
- PREFER running a single Python version over the full test suite during development.
- PREFER fixing reported warnings over suppressing them (e.g., with `# noqa` comments for ruff); only add ignore rules when necessary and document why.
- PREFER fixing typing issues reported by `ty` before adding suppression comments (`# ty: ignore[code]`); suppressions are sometimes necessary for incompletely typed libraries (e.g., Qiskit).
- PREFER running a single Python version over the full test suite during
development.
- PREFER fixing reported warnings over suppressing them
(e.g., with `# noqa` comments for ruff);
only add ignore rules when necessary and document why.
- PREFER fixing typing issues reported by `ty`
before adding suppression comments
(`# ty: ignore[code]`);
suppressions are sometimes necessary for incompletely typed libraries
(e.g., Qiskit).

## Self-Review Checklist

- Did `uvx nox -s lint` pass without errors?
- Are all changes covered by at least one automated test?
- Were Python stubs regenerated via `uvx nox -s stubs` if bindings were modified?
- Are `CHANGELOG.md` and `UPGRADING.md` updated when changes are user-facing, breaking, or otherwise noteworthy?
- Were Python stubs regenerated via `uvx nox -s stubs`
if bindings were modified?
- Are `CHANGELOG.md` and `UPGRADING.md` updated when changes are user-facing,
breaking, or otherwise noteworthy?
Loading
Loading