Skip to content

Commit 8699caf

Browse files
📝 Update templated files (#848)
This pull request updates the files in this repository with the latest changes from the MQT Templates repository. For details on the respective changes, see the [changelog](https://github.com/munich-quantum-toolkit/templates/blob/main/CHANGELOG.md) as well as the [upgrade guide](https://github.com/munich-quantum-toolkit/templates/blob/main/UPGRADING.md). --------- Co-authored-by: mqt-app[bot] <219534693+mqt-app[bot]@users.noreply.github.com> Co-authored-by: Daniel Haag <121057143+denialhaag@users.noreply.github.com>
1 parent 73417a8 commit 8699caf

File tree

6 files changed

+240
-30
lines changed

6 files changed

+240
-30
lines changed

.github/pull_request_template.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ List any dependencies that are required for this change.
66

77
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. -->
88

9-
## Checklist:
9+
## Checklist
1010

1111
<!---
1212
This checklist serves as a reminder of a couple of things that ensure your pull request will be merged swiftly.
@@ -20,3 +20,9 @@ This checklist serves as a reminder of a couple of things that ensure your pull
2020
- [ ] The changes follow the project's style guidelines and introduce no new warnings.
2121
- [ ] The changes are fully tested and pass the CI checks.
2222
- [ ] I have reviewed my own code changes.
23+
24+
**If PR contains AI-assisted content:**
25+
26+
- [ ] I have disclosed the use of AI tools in the PR description as per our [AI Usage Guidelines](https://github.com/munich-quantum-toolkit/bench/blob/main/docs/ai_usage.md).
27+
- [ ] AI-assisted commits include an `Assisted-by: [Model Name] via [Tool Name]` footer.
28+
- [ ] I confirm that I have personally reviewed and understood all AI-generated content, and accept full responsibility for it.

.github/renovate.json5

Lines changed: 30 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
$schema: "https://docs.renovatebot.com/renovate-schema.json",
33
suppressNotifications: ["prEditedNotification"],
4-
minimumReleaseAge: '7 days',
4+
minimumReleaseAge: "7 days",
55
extends: [
66
"config:recommended",
77
":gitSignOff",
@@ -14,78 +14,86 @@
1414
":prConcurrentLimitNone",
1515
":prHourlyLimitNone",
1616
],
17-
enabledManagers: ["cargo", "github-actions", "npm", "pep621", "pre-commit"],
17+
enabledManagers: [
18+
"cargo",
19+
"github-actions",
20+
"npm",
21+
"pep621",
22+
"pip_requirements",
23+
"pre-commit",
24+
],
1825
lockFileMaintenance: {
1926
enabled: true,
20-
automerge: true
27+
automerge: true,
2128
},
2229
labels: ["dependencies"],
2330
schedule: ["every weekend"],
2431
packageRules: [
2532
{
2633
matchManagers: ["cargo"],
2734
addLabels: ["rust"],
28-
commitMessagePrefix: "⬆\uFE0F\uD83E\uDD80"
35+
commitMessagePrefix: "⬆\uFE0F\uD83E\uDD80",
2936
},
3037
{
3138
matchManagers: ["github-actions"],
3239
addLabels: ["github-actions"],
33-
commitMessagePrefix: "⬆\uFE0F\uD83D\uDC68\u200D\uD83D\uDCBB"
40+
commitMessagePrefix: "⬆\uFE0F\uD83D\uDC68\u200D\uD83D\uDCBB",
3441
},
3542
{
3643
matchManagers: ["npm"],
3744
addLabels: ["javascript"],
38-
commitMessagePrefix: "⬆\uFE0F\uD83D\uDCDC"
45+
commitMessagePrefix: "⬆\uFE0F\uD83D\uDCDC",
3946
},
4047
{
41-
matchManagers: ["pep621"],
48+
matchManagers: ["pep621", "pip_requirements"],
4249
addLabels: ["python"],
43-
commitMessagePrefix: "⬆\uFE0F\uD83D\uDC0D"
50+
commitMessagePrefix: "⬆\uFE0F\uD83D\uDC0D",
4451
},
4552
{
4653
matchManagers: ["pre-commit"],
4754
addLabels: ["pre-commit"],
4855
commitMessagePrefix: "⬆\uFE0F\uD83E\uDE9D",
49-
versioning: "pep440"
56+
versioning: "pep440",
5057
},
5158
{
5259
matchUpdateTypes: ["lockFileMaintenance"],
5360
commitMessagePrefix: "⬆\uFE0F\uD83D\uDD12\uFE0F",
5461
},
5562
{
56-
description: "Group and automerge all patch updates",
63+
description: "Group and auto-merge all patch updates",
5764
groupName: "patch updates",
5865
matchUpdateTypes: ["patch"],
5966
matchCurrentVersion: "!/^0\.0/",
6067
commitMessagePrefix: "⬆\uFE0F\uD83E\uDE79",
61-
automerge: true
68+
automerge: true,
6269
},
6370
{
64-
description: "Group and automerge all minor updates of stable dependencies (except our own packages)",
71+
description: "Group and auto-merge minor updates of stable dependencies",
6572
groupName: "minor stable updates",
6673
matchUpdateTypes: ["minor"],
6774
matchCurrentVersion: "!/^0\./",
6875
matchPackageNames: [
6976
"!munich-quantum-toolkit/*",
7077
"!munich-quantum-software/*",
78+
"!nanobind",
7179
],
7280
commitMessagePrefix: "⬆\uFE0F\uD83E\uDE79",
73-
automerge: true
81+
automerge: true,
7482
},
7583
{
76-
description: 'Disable minimum release age checks for our own GitHub Actions',
77-
matchManagers: ['github-actions'],
84+
description: "Disable minimum release age checks for our own GitHub Actions",
85+
matchManagers: ["github-actions"],
7886
matchPackageNames: [
79-
'munich-quantum-toolkit/*',
80-
'munich-quantum-software/*',
87+
"munich-quantum-toolkit/*",
88+
"munich-quantum-software/*",
8189
],
8290
minimumReleaseAge: null,
8391
},
8492
{
85-
description: 'Disable minimum release age checks for our own Python packages',
86-
matchDatasources: ['pypi'],
87-
matchPackageNames: ['mqt*'],
93+
description: "Disable minimum release age checks for our own Python packages",
94+
matchDatasources: ["pypi"],
95+
matchPackageNames: ["mqt*"],
8896
minimumReleaseAge: null,
89-
}
90-
]
97+
},
98+
],
9199
}

AGENTS.md

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
<!--- This file has been generated from an external template. Please do not modify it directly. -->
2+
<!--- Changes should be contributed to https://github.com/munich-quantum-toolkit/templates. -->
3+
4+
# MQT Bench
5+
6+
## Python
7+
8+
- Install package: `uv sync`
9+
- Run tests: `uv run pytest`
10+
- Nox test shortcuts: `uvx nox -s tests`, `uvx nox -s minimums`
11+
- Python 3.14 variants: `uvx nox -s tests-3.14`, `uvx nox -s minimums-3.14`
12+
13+
## Documentation
14+
15+
- Sources: `docs/`
16+
- Build docs locally: `uvx nox --non-interactive -s docs`
17+
- Link check: `uvx nox -s docs -- -b linkcheck`
18+
19+
## Tech Stack
20+
21+
### General
22+
23+
- `prek` for pre-commit hooks
24+
25+
### Python
26+
27+
- Python 3.10+
28+
- `uv` for installation, packaging, and tooling
29+
- `ruff` for formatting/linting (configured in `pyproject.toml`)
30+
- `ty` for type checking
31+
- `pytest` for unit tests (located in `test/python/`)
32+
- `nox` for task orchestration (tests, linting, docs)
33+
34+
### Documentation
35+
36+
- `sphinx`
37+
- MyST (Markdown)
38+
- Furo theme
39+
40+
## Development Guidelines
41+
42+
### General
43+
44+
- MUST run `uvx nox -s lint` after every batch of changes.
45+
This runs the full `prek` hook set from `.pre-commit-config.yaml` (including `ruff`, `typos`, `ty`, formatting, and metadata checks).
46+
All hooks must pass before submitting.
47+
- MUST add or update tests for every code change, even if not explicitly requested.
48+
- MUST follow existing code style by checking neighboring files for patterns.
49+
- MUST update `CHANGELOG.md` and `UPGRADING.md` when changes are user-facing, breaking, or otherwise noteworthy.
50+
- 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.
51+
- NEVER modify files that start with "This file has been generated from an external template. Please do not modify it directly."
52+
These files are managed by [the MQT templates action](https://github.com/munich-quantum-toolkit/templates) and changes will be overwritten.
53+
- PREFER running targeted tests over the full test suite during development.
54+
55+
### Python
56+
57+
- MUST use Google-style docstrings
58+
- PREFER running a single Python version over the full test suite during development.
59+
- PREFER fixing reported warnings over suppressing them (e.g., with `# noqa` comments for ruff); only add ignore rules when necessary and document why.
60+
- 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).
61+
62+
## Self-Review Checklist
63+
64+
- Did `uvx nox -s lint` pass without errors?
65+
- Are all changes covered by at least one automated test?
66+
- Are `CHANGELOG.md` and `UPGRADING.md` updated when changes are user-facing, breaking, or otherwise noteworthy?

docs/ai_usage.md

Lines changed: 113 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,113 @@
1+
<!--- This file has been generated from an external template. Please do not modify it directly. -->
2+
<!--- Changes should be contributed to https://github.com/munich-quantum-toolkit/templates. -->
3+
4+
# AI Usage Guidelines
5+
6+
We acknowledge that AI tools (Large Language Models, code completion engines like GitHub Copilot, etc.) have become helpful assistants for many developers.
7+
We allow the use of these tools to assist with contributions, provided that their use is transparent, responsible, and that a **human remains in the loop** at all times.
8+
9+
This guide outlines our policy on AI-assisted contributions to ensure code quality, maintainability, and legal compliance.
10+
11+
## Core Principles
12+
13+
### 1. You are Responsible
14+
15+
**You are responsible for every line of code you submit.**
16+
17+
Regardless of whether code was written by you or generated by an AI tool, you are the author and are fully accountable for the contribution. You must:
18+
19+
- Fully understand the code you are submitting.
20+
- Be able to explain the reasoning behind the code and how it interacts with the rest of the codebase.
21+
- Verify that the code is correct, efficient, and follows our coding standards.
22+
23+
**Do not blindly copy-paste AI-generated code.** If you cannot explain it, do not submit it.
24+
25+
### 2. Human in the Loop
26+
27+
> **Autonomous contributions from AI agents are not allowed.**
28+
29+
When using AI tools, you must be the driver.
30+
The AI is the assistant.
31+
32+
- **Review:** You must read and review all AI-generated code or text before submitting it.
33+
- **Edit:** AI-generated code often requires significant editing to meet project standards and correctness.
34+
- **Verify:** Ensure the code actually solves the problem and doesn't introduce subtle bugs or security vulnerabilities.
35+
36+
### 3. Communication
37+
38+
**Do not use AI tools to generate issue descriptions, pull request comments, or code reviews.**
39+
40+
We value your personal input and communication.
41+
LLMs are notoriously unreliable and can produce "smart-sounding" but incorrect or irrelevant claims ("hallucinations").
42+
Phrase your communications in your own words.
43+
It is more important that we can follow your reasoning than that the text sounds "perfect".
44+
45+
### 4. Transparency and Disclosure
46+
47+
Transparency helps the community understand the role of these tools and develop best practices.
48+
49+
**We encourage you to disclose any AI assistance.**
50+
This helps us understand how these tools are being used and identify potential issues.
51+
You can disclose this information in the following ways:
52+
53+
- **Commit Messages**: Add a trailer to your commit message in the form `Assisted-by: [Model Name] via [Tool Name]` (example: `Assisted-by: Claude Sonnet 4.6 via GitHub Copilot`)
54+
- **PR Description**: Mention the tool (name and version) and how it was used in the PR description.
55+
56+
### 5. Licensing and Copyright
57+
58+
You are responsible for ensuring that your contribution does not violate any third-party licenses or copyrights.
59+
60+
- **Originality**: Your submission must be your own original work of authorship.
61+
- **Training Data**: Be aware that some AI tools may generate code that is substantially similar to their training data. You must ensure that you have the right to contribute the generated code under [our license](https://github.com/munich-quantum-toolkit/bench/blob/main/LICENSE.md).
62+
63+
## Extractive Contributions
64+
65+
Processing pull requests and comments for MQT Bench requires significant maintainer time and energy.
66+
Sending unreviewed AI output to open-source projects shifts the burden of verifying correctness from the contributor to the maintainer.
67+
We classify such contributions as "extractive" because they consume more community resources than they provide in value.
68+
69+
Our **golden rule** is that a contribution should be valuable enough to justify the review effort.
70+
Nadia Eghbal captures this concept in her book _[Working in Public](https://press.stripe.com/working-in-public)_:
71+
72+
> "When attention is being appropriated, producers need to weigh the costs and benefits of the transaction. To assess whether the appropriation of attention is net-positive, it's useful to distinguish between _extractive_ and _non-extractive_ contributions. Extractive contributions are those where the marginal cost of reviewing and merging that contribution is greater than the marginal benefit to the project's producers. In the case of a code contribution, it might be a pull request that's too complex or unwieldy to review, given the potential upside." — Nadia Eghbal
73+
74+
Before AI tools became widespread, open-source project maintainers would often review all changes sent to the project simply because submitting a pull request was a sign of interest from a potential long-term contributor.
75+
However, AI tools now allow the rapid generation of large volumes of code, which can easily overwhelm maintainers if submitted without careful review.
76+
Our policy exists to ensure that maintainer time is spent on high-quality interactions rather than debugging AI-generated code.
77+
78+
### Sustainable Open Source
79+
80+
The Munich Quantum Toolkit (MQT) is committed to remaining free, open-source, and permissively licensed.
81+
We want to build a welcoming community where aspiring quantum software engineers can learn and grow.
82+
Reviewing contributions is a key part of this mentorship.
83+
84+
However, to keep the project sustainable, we must prioritize non-extractive contributions.
85+
By thoroughly reviewing and understanding your AI-assisted code before submission, you ensure that your contribution is a net positive for the project.
86+
This helps us maintain a healthy ecosystem where both the software and its contributors can thrive.
87+
88+
## Prohibited Uses
89+
90+
- **"Good First Issues"**: Do not use AI tools to solve issues labeled as "good first issue". These are intended as learning opportunities for new contributors. Automating them defeats the purpose.
91+
- **Spam**: Do not use AI to generate low-quality or repetitive comments/reviews ("AI Slop").
92+
- **Unreviewed Code**: Submitting code that you, as a human, have not reviewed and tested yourself.
93+
94+
## Summary
95+
96+
We want to foster a welcoming community where developers can learn and grow. AI tools can be great for productivity, but they should not replace critical thinking or the learning process.
97+
If a maintainer judges that a contribution relies too heavily on unverified AI generation or lacks sufficient human understanding ("extractive contribution"), we may request that you revise it or close the PR.
98+
99+
---
100+
101+
Parts of this guide were inspired by or adapted from the contribution guidelines of
102+
103+
- [Astral],
104+
- [Qiskit],
105+
- [LLVM], including the sources therein, such as [Fedora Council Policy Proposal: Policy on AI-Assisted Contributions (fetched 2026-03-12)][fedora], which is licensed under the [Creative Commons Attribution 4.0 International License][cca].
106+
107+
with the help of Gemini 3 Pro (Preview). The links above serve as attribution.
108+
109+
[Astral]: https://github.com/astral-sh/uv/blob/c89a78ec085077f6344b0439ddf07fdad7336310/CONTRIBUTING.md
110+
[Qiskit]: https://github.com/Qiskit/qiskit/blob/cd8701690723d3d9602fac63fe0bd7ea618799be/CONTRIBUTING.md#use-of-ai-tools
111+
[LLVM]: https://github.com/llvm/llvm-project/blob/9b6391f9c439c9926e8587b7b940e9a1e98a7819/llvm/docs/AIToolPolicy.md
112+
[fedora]: https://communityblog.fedoraproject.org/council-policy-proposal-policy-on-ai-assisted-contributions/
113+
[cca]: https://creativecommons.org/licenses/by/4.0/

docs/contributing.md

Lines changed: 23 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ Pick the path that fits your time and interests:
5555
## Guidelines
5656

5757
Please adhere to the following guidelines to help the project grow sustainably.
58+
Contributions that do not comply with these guidelines or violate our {doc}`AI Usage Guidelines <ai_usage>` may be rejected without further review.
5859

5960
### Core Guidelines
6061

@@ -73,6 +74,15 @@ Please adhere to the following guidelines to help the project grow sustainably.
7374
- Follow the project's coding standards and conventions.
7475
- Be open to feedback and willing to make necessary changes based on code reviews.
7576

77+
### AI-assisted contributions
78+
79+
We acknowledge the utility of AI-based coding assistants (e.g., GitHub Copilot, ChatGPT) in modern software development.
80+
However, their use requires a high degree of responsibility and transparency to maintain code quality and licensing compliance.
81+
82+
Please carefully read and follow our dedicated {doc}`AI Usage Guidelines <ai_usage>` before submitting any AI-assisted contribution.
83+
In short: **You are responsible for every line of code you submit**, and a **human must always be in the loop**.
84+
We require disclosure of AI tool usage in your PR description.
85+
7686
### Pull Request Workflow
7787

7888
- Create PRs early.
@@ -88,15 +98,28 @@ Please adhere to the following guidelines to help the project grow sustainably.
8898
Do not close and reopen a new PR.
8999
Respond to comments to signal that you have addressed the feedback.
90100
Do not resolve review comments yourself; the reviewer will do so once satisfied.
101+
- If the reviewer suggested changes with explicit code suggestions as part of the comments, apply these directly using the GitHub UI.
102+
This attributes the changes to the reviewer and automatically resolves the respective comments (this is an exception to the rule above).
103+
If there are multiple suggestions that you want to apply at once, you can batch them into a single commit.
104+
Go to the "Files changed" tab of the PR, and then click "Add suggestion to batch" for each suggestion you want to include.
105+
Once you are done selecting suggestions, click "Commit suggestions".
106+
Only apply suggestions manually if using the GitHub UI is not feasible.
91107
- Re-request a review after pushing changes that address feedback.
92108
- Do not squash commits locally; maintainers typically squash on merge.
93109
Avoid rebasing or force-pushing before reviews; you may rebase after addressing feedback if desired.
94110

95111
### Working with CodeRabbit
96112

97113
We use [CodeRabbit](https://www.coderabbit.ai/) for automated code review on pull requests.
114+
We use this tool to ease the workload on our maintainers and to counteract the trend of sloppy AI-assisted contributions.
115+
Note that having your PR reviewed by CodeRabbit does **not** count as an AI-assisted contribution for the purpose of the disclosure requirement mentioned above.
116+
98117
To get the most out of it and help the project maintain its high ambitions for code quality, please follow these practices:
99118

119+
- **Review the review**:
120+
Do not take CodeRabbit's suggestions as absolute truth.
121+
LLMs can be overly defensive and conservative, leading to overcomplicated code.
122+
Treat its comments as suggestions: consider them, but feel free to disagree and explain why.
100123
- **Draft PRs**:
101124
CodeRabbit runs on every push to non-draft PRs.
102125
If you are still experimenting, mark your PR as a draft so that the automated review only runs when you are ready for feedback.
@@ -123,13 +146,6 @@ To get the most out of it and help the project maintain its high ambitions for c
123146
If you want to resume reviews, you can ask CodeRabbit to resume by commenting with {code}`@coderabbitai resume`.
124147
Note that this will not trigger a review immediately; it will just allow CodeRabbit to perform reviews on the next push or manual trigger.
125148

126-
### Use of AI and LLMs
127-
128-
Contributions may be prepared with the help of AI or LLM tools.
129-
However, [AI Slop](https://en.wikipedia.org/wiki/AI_slop)—generic, low-value, or clearly machine-generated content that does not meet our standards for clarity, accuracy, or usefulness—is not acceptable.
130-
Ensure that all text, code, and documentation you submit are accurate, relevant, and consistent with the project's style and guidelines.
131-
Please be mindful of the maintainers' time and consider the impact of your contributions on the project's long-term success.
132-
133149
## Get Started 🎉
134150

135151
Ready to contribute?

docs/index.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ UPGRADING
4646
:maxdepth: 1
4747
4848
contributing
49+
ai_usage
4950
tooling
5051
support
5152
```

0 commit comments

Comments
 (0)