Skip to content
Open
Show file tree
Hide file tree
Changes from 28 commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
b566c21
✨ Add quaternion rotation merging pass with core algorithm
J4MMlE Dec 28, 2025
34a9e7c
✅ Add tests for quaternion merging and simplify pattern matching
J4MMlE Jan 15, 2026
6749f3c
🐛 Fix u-gate combination and improve test infrastructure
J4MMlE Jan 22, 2026
f8aaa9d
♻️ Refine pass implementation, error handling, and documentation
J4MMlE Jan 22, 2026
44c3c62
🐛 Handle gimbal lock and add edge case tests
J4MMlE Jan 23, 2026
aa8caf4
♻️ Final improvements: type checks, parameter ordering, pipeline test
J4MMlE Feb 4, 2026
9f468aa
Merge branch 'main' into merge-main
MatthiasReumann Mar 10, 2026
f75edf8
Fix compiler pipeline test
MatthiasReumann Mar 10, 2026
cfe9eda
Add RotationGateMergingPass test
MatthiasReumann Mar 10, 2026
1a22b2b
Fix test
MatthiasReumann Mar 10, 2026
54e612b
🔀 Merge with main
burgholzer Mar 12, 2026
c11e856
📝 Split off merge-rotation-gates pass changelog entry
burgholzer Mar 12, 2026
05d5fdc
✅ refine compiler pipeline test
burgholzer Mar 12, 2026
22d17ad
🚨 fix clang-tidy warning
burgholzer Mar 12, 2026
1ee703b
🎨 remove most of the redundant `mlir::` namespace specifiers
burgholzer Mar 12, 2026
fb0d8cb
✏️ Fix typo in changelog entry
burgholzer Mar 12, 2026
abdacce
🚨 Use `OpType::create` methods
burgholzer Mar 12, 2026
b267779
♻️ Rename compiler flag and clean up docstrings
J4MMlE Mar 17, 2026
409f94d
♻️ Remove single-use constraint on rotation gate
J4MMlE Mar 17, 2026
e707dc5
♻️ Refactor operation replacement
J4MMlE Mar 18, 2026
e506cec
♻️ Consolidate constants into shared Constants struc
J4MMlE Mar 18, 2026
7e6299b
🔀 Merge with main
J4MMlE Mar 21, 2026
40b697d
✨ Add support for POp, ROp, U2Op
J4MMlE Mar 19, 2026
7198eb3
🐛 Normalize UOp alpha/gamma angles after quaternion-to-Euler conversion
J4MMlE Mar 19, 2026
e7b8da6
♻️ Refactor from pairwise to chain-based merging
J4MMlE Mar 21, 2026
e16f12d
🔀 Merge with main
J4MMlE Mar 21, 2026
b2a7d4b
🐛 fix collectChain UB, linter warnings, and inaccurate test and comment
J4MMlE Mar 21, 2026
f889a11
🔥 remove dead pairwise gate merge
J4MMlE Mar 22, 2026
114392b
🚨 fix linter warnings
J4MMlE Mar 22, 2026
3bf55ff
🩹 fix linter warnings and emit merged op at chain tail
J4MMlE Mar 22, 2026
212605a
📝 add note for discarding of global phase
J4MMlE Mar 22, 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
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ This project adheres to [Semantic Versioning], with the exception that minor rel

### Added

- ✨ Add a `mlir-merge-single-qubit-rotation-gates` pass for merging consecutive rotation gates using quaternions ([#1407]) ([**@J4MMlE**])
- ✨ Add Sampler and Estimator Primitives to the QDMI-Qiskit Interface ([#1507]) ([**@marcelwa**])
- ✨ Add conversions between Jeff and QCO ([#1479], [#1548], [#1565]) ([**@denialhaag**])
- ✨ Add a `place-and-route` pass for mapping circuits to architectures with restricted topologies ([#1537], [#1547], [#1568]) ([**@MatthiasReumann**])
Expand Down Expand Up @@ -377,6 +378,7 @@ _📚 Refer to the [GitHub Release Notes](https://github.com/munich-quantum-tool
[#1413]: https://github.com/munich-quantum-toolkit/core/pull/1413
[#1412]: https://github.com/munich-quantum-toolkit/core/pull/1412
[#1411]: https://github.com/munich-quantum-toolkit/core/pull/1411
[#1407]: https://github.com/munich-quantum-toolkit/core/pull/1407
[#1406]: https://github.com/munich-quantum-toolkit/core/pull/1406
[#1403]: https://github.com/munich-quantum-toolkit/core/pull/1403
[#1402]: https://github.com/munich-quantum-toolkit/core/pull/1402
Expand Down Expand Up @@ -533,6 +535,7 @@ _📚 Refer to the [GitHub Release Notes](https://github.com/munich-quantum-tool
[**@lirem101**]: https://github.com/lirem101
[**@Ectras**]: https://github.com/Ectras
[**@simon1hofmann**]: https://github.com/simon1hofmann
[**@J4MMlE**]: https://github.com/J4MMlE

<!-- General links -->

Expand Down
3 changes: 3 additions & 0 deletions mlir/include/mlir/Compiler/CompilerPipeline.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,9 @@ struct QuantumCompilerConfig {

/// Print IR after each stage
bool printIRAfterAllStages = false;

/// Enable quaternion-based rotation gate merging
bool mergeSingleQubitRotationGates = false;
};

/**
Expand Down
5 changes: 0 additions & 5 deletions mlir/include/mlir/Dialect/QCO/Transforms/Passes.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,6 @@ namespace mlir::qco {
#define GEN_PASS_DECL
#include "mlir/Dialect/QCO/Transforms/Passes.h.inc" // IWYU pragma: export

//===----------------------------------------------------------------------===//
// Registration
//===----------------------------------------------------------------------===//

/// Generate the code for registering passes.
#define GEN_PASS_REGISTRATION
#include "mlir/Dialect/QCO/Transforms/Passes.h.inc" // IWYU pragma: export

Expand Down
11 changes: 11 additions & 0 deletions mlir/include/mlir/Dialect/QCO/Transforms/Passes.td
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,17 @@

include "mlir/Pass/PassBase.td"

def MergeRotationGates : Pass<"merge-rotation-gates", "mlir::ModuleOp"> {
let dependentDialects = ["mlir::qco::QCODialect",
"::mlir::arith::ArithDialect",
"::mlir::math::MathDialect"];
let summary = "Merge rotation gates using quaternion-based fusion";
let description = [{
Merges consecutive rotation gates of different types (rx, ry, rz, p, r, u2, u)
using quaternion representation and the Hamilton product.
}];
}

//===----------------------------------------------------------------------===//
// Transpilation Passes
//===----------------------------------------------------------------------===//
Expand Down
1 change: 1 addition & 0 deletions mlir/lib/Compiler/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ add_mlir_library(
MLIRQCToQCO
MLIRQCOToQC
MLIRQCToQIR
MLIRQCOTransforms
MQT::MLIRSupport
DISABLE_INSTALL)

Expand Down
8 changes: 6 additions & 2 deletions mlir/lib/Compiler/CompilerPipeline.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
#include "mlir/Conversion/QCOToQC/QCOToQC.h"
#include "mlir/Conversion/QCToQCO/QCToQCO.h"
#include "mlir/Conversion/QCToQIR/QCToQIR.h"
#include "mlir/Dialect/QCO/Transforms/Passes.h"
#include "mlir/Support/PrettyPrinting.h"

#include <llvm/ADT/StringRef.h>
Expand Down Expand Up @@ -140,8 +141,11 @@ QuantumCompilerPipeline::runPipeline(ModuleOp module,
}
}
// Stage 5: Optimization passes
// TODO: Add optimization passes
if (failed(runStage([&](PassManager& pm) { addCleanupPasses(pm); }))) {
if (failed(runStage([&](PassManager& pm) {
if (config_.mergeSingleQubitRotationGates) {
pm.addPass(mlir::qco::createMergeRotationGates());
}
}))) {
return failure();
}
if (record != nullptr && config_.recordIntermediates) {
Expand Down
3 changes: 2 additions & 1 deletion mlir/lib/Dialect/QCO/Transforms/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ add_mlir_library(
PRIVATE
MLIRQCODialect
MLIRQCOUtils
${dialect_libs}
MLIRArithDialect
MLIRMathDialect
DEPENDS
MLIRQCOTransformsIncGen)

Expand Down
Loading
Loading