Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
e12e978
Merge branch 'main' into more-control
denialhaag Jun 9, 2026
2ebf121
✨ Add translation for QASM3 -> QC
J4MMlE Apr 27, 2026
173d0d0
Fix build error
denialhaag Apr 29, 2026
02710d0
Adapt to new include style
denialhaag Apr 29, 2026
b51a714
Begin to fix linter errors
denialhaag May 21, 2026
7261c50
Remove explicit namespace specifier
denialhaag May 21, 2026
8ce0a0a
Drop support for legacy loader
denialhaag May 21, 2026
2a0868e
Add first test
denialhaag May 21, 2026
1bd6990
Fix some more linter errors
denialhaag May 21, 2026
e3f805f
Add more test cases
denialhaag May 21, 2026
82ee827
Fix some more linter errors
denialhaag May 21, 2026
e3dad6e
Replace .qasm files with in-source strings
denialhaag May 21, 2026
9ee57b3
Fix some more linter errors
denialhaag May 21, 2026
bb010d6
Slightly improve doctrings
denialhaag May 21, 2026
f16e056
Drop support for register comparisons for now
denialhaag May 21, 2026
d352b1c
Fix remaining linter errors
denialhaag May 21, 2026
b39378b
Address the Rabbit's comments
denialhaag May 21, 2026
a2a636c
Drop support for compound gates for now
denialhaag May 21, 2026
5474404
Adapt implementation to more-control
denialhaag Jun 2, 2026
037147c
Remove TODO comments
denialhaag Jun 2, 2026
c87cbe9
Revert "Drop support for compound gates for now"
denialhaag Jun 2, 2026
31a282f
Adapt conversion of compound gates
denialhaag Jun 2, 2026
dd07d4a
Streamline docstrings
denialhaag Jun 2, 2026
8bc15a5
Fix linter errors
denialhaag Jun 2, 2026
934b22e
Fix linter error
denialhaag Jun 9, 2026
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
4 changes: 2 additions & 2 deletions .github/workflows/cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ permissions:
jobs:
build-sdist:
name: 🐍 Packaging
uses: munich-quantum-toolkit/workflows/.github/workflows/reusable-python-packaging-sdist.yml@143bf51e7192c31e76abafe58e3732c5aff9c69b # v2.0.1
uses: munich-quantum-toolkit/workflows/.github/workflows/reusable-python-packaging-sdist.yml@e227ce742023e2e600d7fab6dfcebbf8b4b36614 # v2.0.3

# Builds wheels on all supported platforms using cibuildwheel.
# The wheels are uploaded as GitHub artifacts `dev-cibw-*` or `cibw-*`, depending on whether the workflow is triggered from a PR or a release.
Expand All @@ -30,7 +30,7 @@ jobs:
windows-2025,
windows-11-arm,
]
uses: munich-quantum-toolkit/workflows/.github/workflows/reusable-python-packaging-wheel-cibuildwheel.yml@143bf51e7192c31e76abafe58e3732c5aff9c69b # v2.0.1
uses: munich-quantum-toolkit/workflows/.github/workflows/reusable-python-packaging-wheel-cibuildwheel.yml@e227ce742023e2e600d7fab6dfcebbf8b4b36614 # v2.0.3
with:
runs-on: ${{ matrix.runs-on }}

Expand Down
30 changes: 15 additions & 15 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ concurrency:
jobs:
change-detection:
name: 🔍 Change
uses: munich-quantum-toolkit/workflows/.github/workflows/reusable-change-detection.yml@143bf51e7192c31e76abafe58e3732c5aff9c69b # v2.0.1
uses: munich-quantum-toolkit/workflows/.github/workflows/reusable-change-detection.yml@e227ce742023e2e600d7fab6dfcebbf8b4b36614 # v2.0.3

cpp-tests-ubuntu:
name: 🇨‌ Test 🐧
Expand All @@ -30,7 +30,7 @@ jobs:
- runs-on: ubuntu-24.04
compiler: gcc
preset: debug
uses: munich-quantum-toolkit/workflows/.github/workflows/reusable-cpp-tests-ubuntu.yml@143bf51e7192c31e76abafe58e3732c5aff9c69b # v2.0.1
uses: munich-quantum-toolkit/workflows/.github/workflows/reusable-cpp-tests-ubuntu.yml@e227ce742023e2e600d7fab6dfcebbf8b4b36614 # v2.0.3
with:
runs-on: ${{ matrix.runs-on }}
compiler: ${{ matrix.compiler }}
Expand All @@ -52,7 +52,7 @@ jobs:
- runs-on: macos-26
compiler: clang
preset: debug
uses: munich-quantum-toolkit/workflows/.github/workflows/reusable-cpp-tests-macos.yml@143bf51e7192c31e76abafe58e3732c5aff9c69b # v2.0.1
uses: munich-quantum-toolkit/workflows/.github/workflows/reusable-cpp-tests-macos.yml@e227ce742023e2e600d7fab6dfcebbf8b4b36614 # v2.0.3
with:
runs-on: ${{ matrix.runs-on }}
compiler: ${{ matrix.compiler }}
Expand All @@ -74,7 +74,7 @@ jobs:
- runs-on: windows-2025
compiler: msvc
preset: debug-windows
uses: munich-quantum-toolkit/workflows/.github/workflows/reusable-cpp-tests-windows.yml@143bf51e7192c31e76abafe58e3732c5aff9c69b # v2.0.1
uses: munich-quantum-toolkit/workflows/.github/workflows/reusable-cpp-tests-windows.yml@e227ce742023e2e600d7fab6dfcebbf8b4b36614 # v2.0.3
with:
runs-on: ${{ matrix.runs-on }}
compiler: ${{ matrix.compiler }}
Expand All @@ -94,7 +94,7 @@ jobs:
runs-on: [ubuntu-24.04, ubuntu-24.04-arm]
compiler: [gcc, clang, clang-20, clang-21]
preset: [release, debug]
uses: munich-quantum-toolkit/workflows/.github/workflows/reusable-cpp-tests-ubuntu.yml@143bf51e7192c31e76abafe58e3732c5aff9c69b # v2.0.1
uses: munich-quantum-toolkit/workflows/.github/workflows/reusable-cpp-tests-ubuntu.yml@e227ce742023e2e600d7fab6dfcebbf8b4b36614 # v2.0.3
with:
runs-on: ${{ matrix.runs-on }}
compiler: ${{ matrix.compiler }}
Expand All @@ -113,7 +113,7 @@ jobs:
runs-on: [macos-15, macos-15-intel, macos-26, macos-26-intel]
compiler: [clang, clang-20, clang-21, gcc-14, gcc-15]
preset: [release, debug]
uses: munich-quantum-toolkit/workflows/.github/workflows/reusable-cpp-tests-macos.yml@143bf51e7192c31e76abafe58e3732c5aff9c69b # v2.0.1
uses: munich-quantum-toolkit/workflows/.github/workflows/reusable-cpp-tests-macos.yml@e227ce742023e2e600d7fab6dfcebbf8b4b36614 # v2.0.3
with:
runs-on: ${{ matrix.runs-on }}
compiler: ${{ matrix.compiler }}
Expand All @@ -132,7 +132,7 @@ jobs:
runs-on: [windows-2022, windows-2025, windows-11-arm]
compiler: [msvc, clang]
preset: [release-windows, debug-windows]
uses: munich-quantum-toolkit/workflows/.github/workflows/reusable-cpp-tests-windows.yml@143bf51e7192c31e76abafe58e3732c5aff9c69b # v2.0.1
uses: munich-quantum-toolkit/workflows/.github/workflows/reusable-cpp-tests-windows.yml@e227ce742023e2e600d7fab6dfcebbf8b4b36614 # v2.0.3
with:
runs-on: ${{ matrix.runs-on }}
compiler: ${{ matrix.compiler }}
Expand All @@ -145,7 +145,7 @@ jobs:
name: 🇨‌ Coverage
needs: change-detection
if: fromJSON(needs.change-detection.outputs.run-cpp-tests)
uses: munich-quantum-toolkit/workflows/.github/workflows/reusable-cpp-coverage.yml@143bf51e7192c31e76abafe58e3732c5aff9c69b # v2.0.1
uses: munich-quantum-toolkit/workflows/.github/workflows/reusable-cpp-coverage.yml@e227ce742023e2e600d7fab6dfcebbf8b4b36614 # v2.0.3
with:
setup-mlir: true
llvm-version: 22.1.0
Expand All @@ -157,7 +157,7 @@ jobs:
name: 🇨‌ Lint
needs: change-detection
if: fromJSON(needs.change-detection.outputs.run-cpp-linter)
uses: munich-quantum-toolkit/workflows/.github/workflows/reusable-cpp-linter.yml@143bf51e7192c31e76abafe58e3732c5aff9c69b # v2.0.1
uses: munich-quantum-toolkit/workflows/.github/workflows/reusable-cpp-linter.yml@e227ce742023e2e600d7fab6dfcebbf8b4b36614 # v2.0.3
with:
clang-version: 22
build-project: true
Expand All @@ -183,15 +183,15 @@ jobs:
macos-26-intel,
windows-2025,
]
uses: munich-quantum-toolkit/workflows/.github/workflows/reusable-python-tests.yml@143bf51e7192c31e76abafe58e3732c5aff9c69b # v2.0.1
uses: munich-quantum-toolkit/workflows/.github/workflows/reusable-python-tests.yml@e227ce742023e2e600d7fab6dfcebbf8b4b36614 # v2.0.3
with:
runs-on: ${{ matrix.runs-on }}

python-coverage:
name: 🐍 Coverage
needs: [change-detection, python-tests]
if: fromJSON(needs.change-detection.outputs.run-python-tests)
uses: munich-quantum-toolkit/workflows/.github/workflows/reusable-python-coverage.yml@143bf51e7192c31e76abafe58e3732c5aff9c69b # v2.0.1
uses: munich-quantum-toolkit/workflows/.github/workflows/reusable-python-coverage.yml@e227ce742023e2e600d7fab6dfcebbf8b4b36614 # v2.0.3
permissions:
contents: read
id-token: write
Expand All @@ -205,15 +205,15 @@ jobs:
fail-fast: false
matrix:
runs-on: [macos-15, macos-15-intel, windows-2022]
uses: munich-quantum-toolkit/workflows/.github/workflows/reusable-python-tests.yml@143bf51e7192c31e76abafe58e3732c5aff9c69b # v2.0.1
uses: munich-quantum-toolkit/workflows/.github/workflows/reusable-python-tests.yml@e227ce742023e2e600d7fab6dfcebbf8b4b36614 # v2.0.3
with:
runs-on: ${{ matrix.runs-on }}

python-linter:
name: 🐍 Lint
needs: change-detection
if: fromJSON(needs.change-detection.outputs.run-python-tests)
uses: munich-quantum-toolkit/workflows/.github/workflows/reusable-python-linter.yml@143bf51e7192c31e76abafe58e3732c5aff9c69b # v2.0.1
uses: munich-quantum-toolkit/workflows/.github/workflows/reusable-python-linter.yml@e227ce742023e2e600d7fab6dfcebbf8b4b36614 # v2.0.3
with:
check-stubs: true
enable-ty: true
Expand All @@ -223,7 +223,7 @@ jobs:
name: 🚀 CD
needs: change-detection
if: fromJSON(needs.change-detection.outputs.run-cd)
uses: munich-quantum-toolkit/workflows/.github/workflows/reusable-python-packaging-sdist.yml@143bf51e7192c31e76abafe58e3732c5aff9c69b # v2.0.1
uses: munich-quantum-toolkit/workflows/.github/workflows/reusable-python-packaging-sdist.yml@e227ce742023e2e600d7fab6dfcebbf8b4b36614 # v2.0.3

build-wheel:
name: 🚀 CD
Expand All @@ -241,7 +241,7 @@ jobs:
windows-2025,
windows-11-arm,
]
uses: munich-quantum-toolkit/workflows/.github/workflows/reusable-python-packaging-wheel-cibuildwheel.yml@143bf51e7192c31e76abafe58e3732c5aff9c69b # v2.0.1
uses: munich-quantum-toolkit/workflows/.github/workflows/reusable-python-packaging-wheel-cibuildwheel.yml@e227ce742023e2e600d7fab6dfcebbf8b4b36614 # v2.0.3
with:
runs-on: ${{ matrix.runs-on }}

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release-drafter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,4 @@ jobs:
contents: write
runs-on: ubuntu-slim
steps:
- uses: release-drafter/release-drafter@c2e2804cc59f45f57076a99af580d0fedb697927 # v7.3.0
- uses: release-drafter/release-drafter@693d20e7c1ce1a81d3a41962f85914253b518449 # v7.3.1
4 changes: 2 additions & 2 deletions .github/workflows/upstream.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
fail-fast: false
matrix:
runs-on: [ubuntu-24.04, macos-14, windows-2022]
uses: munich-quantum-toolkit/workflows/.github/workflows/reusable-qiskit-upstream-tests.yml@143bf51e7192c31e76abafe58e3732c5aff9c69b # v2.0.1
uses: munich-quantum-toolkit/workflows/.github/workflows/reusable-qiskit-upstream-tests.yml@e227ce742023e2e600d7fab6dfcebbf8b4b36614 # v2.0.3
with:
runs-on: ${{ matrix.runs-on }}
setup-z3: true
Expand All @@ -28,7 +28,7 @@ jobs:
name: Create issue on failure
needs: qiskit-upstream-tests
if: ${{ always() }}
uses: munich-quantum-toolkit/workflows/.github/workflows/reusable-qiskit-upstream-issue.yml@143bf51e7192c31e76abafe58e3732c5aff9c69b # v2.0.1
uses: munich-quantum-toolkit/workflows/.github/workflows/reusable-qiskit-upstream-issue.yml@e227ce742023e2e600d7fab6dfcebbf8b4b36614 # v2.0.3
with:
tests-result: ${{ needs.qiskit-upstream-tests.result }}
permissions:
Expand Down
8 changes: 4 additions & 4 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -47,14 +47,14 @@ repos:

## Check pyproject.toml file
- repo: https://github.com/henryiii/validate-pyproject-schema-store
rev: 2026.05.24
rev: 2026.05.28
hooks:
- id: validate-pyproject
priority: 0

## Ensure uv.lock is up to date
- repo: https://github.com/astral-sh/uv-pre-commit
rev: 0.11.16
rev: 0.11.18
hooks:
- id: uv-lock
priority: 0
Expand All @@ -71,7 +71,7 @@ repos:

## Check for typos
- repo: https://github.com/adhtruong/mirrors-typos
rev: v1.46.3
rev: v1.47.0
hooks:
- id: typos
priority: 3
Expand Down Expand Up @@ -135,7 +135,7 @@ repos:

## Format and lint Python files with ruff
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.15.14
rev: v0.15.15
hooks:
- id: ruff-format
types_or: [python, pyi, jupyter, markdown]
Expand Down
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ This project adheres to [Semantic Versioning], with the exception that minor rel
- ✨ Add conversions between `jeff` and QCO ([#1479], [#1548], [#1565], [#1637], [#1676], [#1706]) ([**@denialhaag**], [**@burgholzer**])
- ✨ Add a `place-and-route` pass for mapping circuits to architectures with restricted topologies ([#1537], [#1547], [#1568], [#1581], [#1583], [#1588], [#1600], [#1664], [#1709], [#1716], [#1748]) ([**@MatthiasReumann**], [**@burgholzer**])
- ✨ Add initial infrastructure for new QC and QCO MLIR dialects
([#1264], [#1330], [#1402], [#1428], [#1430], [#1436], [#1443], [#1446], [#1464], [#1465], [#1470], [#1471], [#1472], [#1474], [#1475], [#1506], [#1510], [#1513], [#1521], [#1542], [#1548], [#1550], [#1554], [#1567], [#1569], [#1570], [#1572], [#1573], [#1580], [#1602], [#1620], [#1623], [#1624], [#1626], [#1627], [#1635], [#1638], [#1673], [#1675], [#1700], [#1717], [#1728], [#1730], [#1749], [#1762])
([#1264], [#1330], [#1402], [#1428], [#1430], [#1436], [#1443], [#1446], [#1464], [#1465], [#1470], [#1471], [#1472], [#1474], [#1475], [#1506], [#1510], [#1513], [#1521], [#1542], [#1548], [#1550], [#1554], [#1567], [#1569], [#1570], [#1572], [#1573], [#1580], [#1602], [#1620], [#1623], [#1624], [#1626], [#1627], [#1635], [#1638], [#1673], [#1675], [#1700], [#1717], [#1728], [#1730], [#1749], [#1762], [#1765])
([**@burgholzer**], [**@denialhaag**], [**@taminob**], [**@DRovara**], [**@li-mingbao**], [**@Ectras**], [**@MatthiasReumann**], [**@simon1hofmann**])

### Changed
Expand Down Expand Up @@ -402,6 +402,7 @@ _📚 Refer to the [GitHub Release Notes](https://github.com/munich-quantum-tool

<!-- PR links -->

[#1765]: https://github.com/munich-quantum-toolkit/core/pull/1765
[#1762]: https://github.com/munich-quantum-toolkit/core/pull/1762
[#1749]: https://github.com/munich-quantum-toolkit/core/pull/1749
[#1748]: https://github.com/munich-quantum-toolkit/core/pull/1748
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,7 @@ When citing the compilation framework built on MLIR, cite the MQT Compiler Colle
author = {Burgholzer, Lukas and Haag, Daniel and Stade, Yannick and Rovara, Damian and Hopf, Patrick and Wille, Robert},
year = {2026},
booktitle = {Design, Automation and Test in Europe},
doi = {10.23919/DATE69613.2026.11539504},
eprint = {2604.08674},
eprinttype = {arxiv},
}
Expand Down
1 change: 1 addition & 0 deletions docs/references.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ If you want to cite the MQT Compiler Collection, please use the following BibTeX
author = {Burgholzer, Lukas and Haag, Daniel and Stade, Yannick and Rovara, Damian and Hopf, Patrick and Wille, Robert},
year = {2026},
booktitle = {Design, Automation and Test in Europe},
doi = {10.23919/DATE69613.2026.11539504},
eprint = {2604.08674},
eprinttype = {arxiv},
}
Expand Down
1 change: 1 addition & 0 deletions docs/refs.bib
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,7 @@ @inproceedings{MQTCompilerCollection2026
author = {Burgholzer, Lukas and Haag, Daniel and Stade, Yannick and Rovara, Damian and Hopf, Patrick and Wille, Robert},
year = {2026},
booktitle = date,
doi = {10.23919/DATE69613.2026.11539504},
eprint = {2604.08674},
eprinttype = {arxiv},
}
Expand Down
39 changes: 39 additions & 0 deletions mlir/include/mlir/Dialect/QC/Translation/TranslateQASM3ToQC.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
/*
* Copyright (c) 2023 - 2026 Chair for Design Automation, TUM
* Copyright (c) 2025 - 2026 Munich Quantum Software Company GmbH
* All rights reserved.
*
* SPDX-License-Identifier: MIT
*
* Licensed under the MIT License
*/

#pragma once

#include <mlir/IR/BuiltinOps.h>
#include <mlir/IR/MLIRContext.h>

#include <iosfwd>
#include <string>

namespace mlir::qc {

/**
* @brief Translate an OpenQASM3 program to the QC dialect.
*
* @param context MLIRContext to create the module in.
* @param filename Path to the input OpenQASM3 file.
*/
[[nodiscard]] OwningOpRef<ModuleOp>
translateQASM3ToQC(MLIRContext* context, const std::string& filename);

/**
* @brief Translate an OpenQASM3 program to the QC dialect.
*
* @param context MLIRContext to create the module in.
* @param input Stream containing the OpenQASM3 program.
*/
[[nodiscard]] OwningOpRef<ModuleOp> translateQASM3ToQC(MLIRContext* context,
std::istream& input);

} // namespace mlir::qc
4 changes: 3 additions & 1 deletion mlir/lib/Dialect/QC/Translation/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,15 @@
add_mlir_library(
MLIRQCTranslation
TranslateQuantumComputationToQC.cpp
TranslateQASM3ToQC.cpp
LINK_LIBS
MLIRArithDialect
MLIRFuncDialect
MLIRSCFDialect
MLIRQCDialect
MLIRQCProgramBuilder
MQT::CoreIR)
MQT::CoreIR
MQT::CoreQASM)

mqt_mlir_target_use_project_options(MLIRQCTranslation)

Expand Down
Loading
Loading