-
-
Notifications
You must be signed in to change notification settings - Fork 53
docs: Add AGENTS.md with repository instructions for AI tooling #1516
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
a6ddd09
5c81c47
93c50b0
74502e8
7fb71ea
f02775e
bd40091
2b05fd6
8552272
cc042d0
39e27cf
0b96a4a
74cd62b
7c3827d
26e041e
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,102 @@ | ||||||||||||||
| # MQT Core | ||||||||||||||
|
|
||||||||||||||
| - Acts as the high-performance backbone for the [Munich Quantum Toolkit (MQT)](https://mqt.readthedocs.io/). | ||||||||||||||
| - Provides core data structures and algorithms (IR, DD, ZX, QASM 3.0, MLIR) for quantum design automation. | ||||||||||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
Trying to rephrase this a little. |
||||||||||||||
| - Distinguishes between **circuit qubits** (logical/virtual) and **device qubits** (physical) to avoid ambiguity. | ||||||||||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
Feels overly detailed and not too important for most day to day use. |
||||||||||||||
| - Maintains a C++20 core with an architecturally separate Python extension layer. | ||||||||||||||
| - Locates C++ sources in `src/` and `include/`, Python bindings in `python/`, tests in `test/`, and documentation in `docs/`. | ||||||||||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is not fully correct and complete. |
||||||||||||||
| - Refer to [index.md](docs/index.md) for the complete documentation entry point. | ||||||||||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Given how an LLM won't be able to access a built version of the docs, this feels slightly unnecessary.
Suggested change
|
||||||||||||||
|
|
||||||||||||||
| ## Environment & Capabilities | ||||||||||||||
|
|
||||||||||||||
| - **Platform**: Operating in a Linux environment with support for x86_64 (amd64) and arm64. | ||||||||||||||
| - **Python Context**: Version 3.10+ managed via **uv** for strict isolation. | ||||||||||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
I don't particularly know what the "strict isolation" part means here. |
||||||||||||||
| - **C++ Context**: C++20 standard required; **LLVM 21.1+** mandatory for MLIR dialects. | ||||||||||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||||||||
| - **Tooling Access**: Full access to `cmake`, `ctest`, `pytest`, `ruff`, and `nox`. | ||||||||||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
Pytest is only available if the project is synced, and ruff is part of the linting setup and not available explicitly. In contrast, |
||||||||||||||
| - **Constraint**: Avoid network-dependent tasks during builds; rely on `uv` lockfiles and pre-synced dependencies. | ||||||||||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This one is very hard to enforce. Since we use FetchContent, any CMake build will most likely try to fetch some of the dependencies. |
||||||||||||||
|
|
||||||||||||||
| ## Repository Mapping | ||||||||||||||
|
|
||||||||||||||
| - `include/mqt/core/`: C++ header files (Internal & Public interfaces). | ||||||||||||||
| - `src/mqt/core/`: C++ implementation logic. | ||||||||||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this is not correct. the corresponding directory does not even exist. |
||||||||||||||
| - `python/mqt/core/`: Python package foundation. | ||||||||||||||
| - `python/mqt/core/ir/`: Public Python bindings package for Circuit IR. | ||||||||||||||
| - `python/mqt/core/dd.pyi`: Public Python bindings module for Decision Diagrams. | ||||||||||||||
| - `python/mqt/core/na/`: Public Python bindings package for Neutral Atom logic. | ||||||||||||||
|
Comment on lines
+22
to
+25
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is wildly different in granularity than the rest. The C++ part also does not show any modules for example. |
||||||||||||||
| - `test/`: Comprehensive test suites (C++ and Python). | ||||||||||||||
| - `docs/`: Knowledge base for installation, contribution, and technical references. | ||||||||||||||
|
|
||||||||||||||
| ## Tasks | ||||||||||||||
|
|
||||||||||||||
| ### C++ Workflows | ||||||||||||||
|
|
||||||||||||||
| - Configure Release build: `cmake -S . -B build -DCMAKE_BUILD_TYPE=Release -DBUILD_MQT_CORE_TESTS=ON`. | ||||||||||||||
| - Configure Debug build: `cmake -S . -B build -DCMAKE_BUILD_TYPE=Debug -DBUILD_MQT_CORE_TESTS=ON`. | ||||||||||||||
|
Comment on lines
+33
to
+34
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧹 Nitpick | 🔵 Trivial Optional: Em dash style for consistency. The static analysis tool suggests using em dashes (—) instead of colons for enumeration consistency. This is purely a stylistic preference and the current format is perfectly clear. ✍️ Optional style improvement-- Configure Release build: `cmake -S . -B build -DCMAKE_BUILD_TYPE=Release -DBUILD_MQT_CORE_TESTS=ON`.
-- Configure Debug build: `cmake -S . -B build -DCMAKE_BUILD_TYPE=Debug -DBUILD_MQT_CORE_TESTS=ON`.
+- Configure Release build — `cmake -S . -B build -DCMAKE_BUILD_TYPE=Release -DBUILD_MQT_CORE_TESTS=ON`.
+- Configure Debug build — `cmake -S . -B build -DCMAKE_BUILD_TYPE=Debug -DBUILD_MQT_CORE_TESTS=ON`.🧰 Tools🪛 LanguageTool[typographical] ~33-~33: Consider using an em dash and a white space in dialogues and enumerations. (DASH_RULE) [typographical] ~34-~34: Consider using an em dash and a white space in dialogues and enumerations. (DASH_RULE) 🤖 Prompt for AI Agents
Comment on lines
+33
to
+34
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. the |
||||||||||||||
| - Build the library: `cmake --build build --parallel`. | ||||||||||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. IIRC, this is not correct as-is and needs an integer after the |
||||||||||||||
| - Run C++ tests: `ctest --test-dir build -C Release --output-on-failure`. | ||||||||||||||
| - Run a single C++ test: `ctest --test-dir build -C Release -R <test_name>`. | ||||||||||||||
|
Comment on lines
+36
to
+37
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It would probably be good to also highlight the new label for running the MLIR tests introduced in #1513 ( |
||||||||||||||
| - Locate C++ artifacts in `build/src/` (libraries) and `build/test/` (test executables). | ||||||||||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is not particularly complete. All the MLIR build output will be in |
||||||||||||||
|
|
||||||||||||||
| ### Python Workflows | ||||||||||||||
|
|
||||||||||||||
| - Build the Python package: `uv build`. | ||||||||||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This does not locally build the Python package; it builds an sdist and a wheel. |
||||||||||||||
| - Locate Python build artifacts in `build/{wheel_tag}/{build_type}` or the project `build/` folder. | ||||||||||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This feels redundant as one includes the other. |
||||||||||||||
| - Execute full test suite: `uvx nox -s tests`. | ||||||||||||||
| - Run targeted tests: `uv run pytest test/python/dd/`. | ||||||||||||||
| - Filter Python tests: `uvx nox -s tests -- -k "<test_name>"`. | ||||||||||||||
| - Test minimum dependency versions: `uvx nox -s minimums`. | ||||||||||||||
| - Verify Qiskit compatibility: `uvx nox -s qiskit`. | ||||||||||||||
|
Comment on lines
+44
to
+48
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This should probably also show the versions that run a single python version, e.g., |
||||||||||||||
|
|
||||||||||||||
| ### Quality, Docs & Stubs | ||||||||||||||
|
|
||||||||||||||
| - Run pre-commit checks: `uvx prek run -a` or `uvx nox -s lint`. | ||||||||||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
probably best to not list too many alternatives. |
||||||||||||||
| - Build documentation (Doxygen + Sphinx + MLIR): `uvx nox -s docs`. | ||||||||||||||
| - Locate documentation output in `docs/_build/html`. | ||||||||||||||
| - Generate type stubs: `uvx nox -s stubs`. | ||||||||||||||
| - Note: Stub files (`.pyi`) must **never** be edited manually. | ||||||||||||||
| - Check [contributing.md](docs/contributing.md) for comprehensive PR workflows and testing philosophies. | ||||||||||||||
|
|
||||||||||||||
| ## Tools | ||||||||||||||
|
|
||||||||||||||
| - Use **C++20** and **Python 3.10+** as the strict minimum language versions. | ||||||||||||||
| - Use **CMake 3.24+** and **scikit-build-core** for the build system. | ||||||||||||||
| - Use **uv** as the mandatory package manager; never use `pip` or manual `venv`. | ||||||||||||||
| - Use **nanobind** (~2.11.0) for Python bindings; do not use `pybind11`. | ||||||||||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
Feels like information that quickly becomes outdated. |
||||||||||||||
| - Use **ruff** for linting and formatting, with `ALL` rules enabled by default. | ||||||||||||||
| - Use **ty** for static type checking as the mandatory replacement for `mypy`. | ||||||||||||||
| - Use **LLVM 21.1+** for MLIR-based compilation dialects. | ||||||||||||||
| - Use **clang-format** and **typos** for C++ style and project-wide spell checking. | ||||||||||||||
|
Comment on lines
+61
to
+68
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. These all sound like orders, while they should probably be descriptions of what the repository is using in terms of tooling. |
||||||||||||||
|
|
||||||||||||||
| ## Development Guidelines | ||||||||||||||
|
|
||||||||||||||
| - Always prioritize C++20 `std::` features over custom implementations. | ||||||||||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
It might be worth mentioning that within the MLIR part of the codebase ( |
||||||||||||||
| - Use Google-style docstrings for Python and Doxygen comments for C++. | ||||||||||||||
| - Ensure Python code is fully typed and passes `ty` static analysis. | ||||||||||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is okay as a general statement, but I think the agent file itself needs to provide some more actionable advice that is to the point. Something like |
||||||||||||||
| - Follow existing code style by checking neighboring files for patterns. | ||||||||||||||
| - Add or update tests for every code change, even if not explicitly requested. | ||||||||||||||
| - Review [CHANGELOG.md](docs/CHANGELOG.md) and [UPGRADING.md](docs/UPGRADING.md) before making breaking changes. | ||||||||||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same as above also holds here. This needs to be actionable. The agent shall review the guides... and then what? |
||||||||||||||
|
|
||||||||||||||
| ## Documentation Reference | ||||||||||||||
|
|
||||||||||||||
| - Deep dive into the Internal Representation: [mqt_core_ir.md](docs/mqt_core_ir.md). | ||||||||||||||
| - Understand Decision Diagram internals: [dd_package.md](docs/dd_package.md). | ||||||||||||||
| - Explore ZX-calculus algorithms: [zx_package.md](docs/zx_package.md). | ||||||||||||||
| - Access the online API reference: [MQT Core Docs](https://mqt.readthedocs.io/projects/core/en/latest/). | ||||||||||||||
|
Comment on lines
+79
to
+84
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
Does not feel too useful for day to day use. |
||||||||||||||
|
|
||||||||||||||
| ## Self-Review Checklist | ||||||||||||||
|
|
||||||||||||||
| - Did you run `uvx nox -s lint` and ensure all checks (ruff, typos, ty) pass? | ||||||||||||||
| - Did you verify all your changes with at least one automated test (pytest or ctest)? | ||||||||||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
ctest is only the test runner. googletest is the framework we use for testing |
||||||||||||||
| - Did you update/add tests for new functionality to maintain coverage? | ||||||||||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Feels redundant with the point above. |
||||||||||||||
| - Did you use exact terminology (**circuit qubits** vs **device qubits**)? | ||||||||||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
Not needed based on the comment at the very top. |
||||||||||||||
| - Did you regenerate Python stubs via `uvx nox -s stubs` if bindings were modified? | ||||||||||||||
| - Did you check for manual changes to `.pyi` files (which are forbidden)? | ||||||||||||||
| - Did you include the correct license headers and SPDX identifiers? | ||||||||||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is automatically handled by prek. no need to state this here
Suggested change
|
||||||||||||||
|
|
||||||||||||||
| ## Rules | ||||||||||||||
|
|
||||||||||||||
| - Adhere to the ruff philosophy: Start with `ALL` rules and selectively disable in `pyproject.toml`. | ||||||||||||||
| - Enforce term capitalization: `nanobind`, `CMake`, `ccache`, `GitHub`, `NumPy`, `pytest`, `MQT`, and `TUM`. | ||||||||||||||
| - Include MIT license and SPDX headers in every source file. | ||||||||||||||
| - Avoid modifying templated files locally; contribute to [MQT templates](https://github.com/munich-quantum-toolkit/templates). | ||||||||||||||
| - Verify all CI checks locally; if `uvx nox -s lint` fails, the code is not ready for PR. | ||||||||||||||
|
Comment on lines
+96
to
+102
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This feels like it is repeating some information from above incompletely. |
||||||||||||||
Uh oh!
There was an error while loading. Please reload this page.