Skip to content
Draft
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
4 changes: 2 additions & 2 deletions cmake/ExternalDependencies.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ set(MQT_CORE_MINIMUM_VERSION 3.4.0
CACHE STRING "MQT Core minimum version")
set(MQT_CORE_VERSION 3.4.0
CACHE STRING "MQT Core version")
set(MQT_CORE_REV "6bcc01e7d135058c6439c64fdd5f14b65ab88816"
set(MQT_CORE_REV "test_Memref_explicit" # fix clang-tidy warnings 7d1d7fb
CACHE STRING "MQT Core identifier (tag, branch or commit hash)")
set(MQT_CORE_REPO_OWNER "munich-quantum-toolkit"
set(MQT_CORE_REPO_OWNER "NiklasKostrzewa"
CACHE STRING "MQT Core repository owner (change when using a fork)")
Comment on lines +18 to 21
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

Personal fork and branch reference must be reverted before merging.

The external dependency now points to a personal fork (NiklasKostrzewa/core) with a branch name (test_Memref_explicit) instead of the official munich-quantum-toolkit/core repository with a pinned commit hash.

Issues:

  1. Non-reproducible builds: Using a branch name instead of a commit hash means the build target can change over time.
  2. Personal fork dependency: Production code should not depend on personal forks.
  3. Inconsistent comment: The inline comment references commit 7d1d7fb but the REV is set to a branch name.

This is acceptable for a draft PR during development, but ensure these values are reverted to the official repository with a stable commit hash before merging.

Suggested values for merge readiness
-set(MQT_CORE_REV "test_Memref_explicit" # fix clang-tidy warnings 7d1d7fb
+set(MQT_CORE_REV "<pinned-commit-hash-from-main>"
     CACHE STRING "MQT Core identifier (tag, branch or commit hash)")
-set(MQT_CORE_REPO_OWNER "NiklasKostrzewa"
+set(MQT_CORE_REPO_OWNER "munich-quantum-toolkit"
     CACHE STRING "MQT Core repository owner (change when using a fork)")
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@cmake/ExternalDependencies.cmake` around lines 18 - 21, Replace the temporary
fork/branch references in the external dependency variables: set
MQT_CORE_REPO_OWNER back to the official owner ("munich-quantum-toolkit") and
change MQT_CORE_REV from the branch name ("test_Memref_explicit") to a stable
pinned commit hash (replace the branch with the specific commit hash you intend
to use), and update/remove the inconsistent inline comment referencing 7d1d7fb
so the REV and comment match; these changes are located where MQT_CORE_REV and
MQT_CORE_REPO_OWNER are defined.

# cmake-format: on

Expand Down
4 changes: 2 additions & 2 deletions include/mlir/Conversion/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@
#
# Licensed under the MIT License

add_subdirectory(MQTOptToCatalystQuantum)
add_subdirectory(CatalystQuantumToMQTOpt)
add_subdirectory(QCToCatalystQuantum)
add_subdirectory(CatalystQuantumToQC)
13 changes: 0 additions & 13 deletions include/mlir/Conversion/CatalystQuantumToMQTOpt/CMakeLists.txt

This file was deleted.

13 changes: 13 additions & 0 deletions include/mlir/Conversion/CatalystQuantumToQC/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Copyright (c) 2025 - 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

set(LLVM_TARGET_DEFINITIONS CatalystQuantumToQC.td)
mlir_tablegen(CatalystQuantumToQC.h.inc -gen-pass-decls -name CatalystQuantumToQC)
add_public_tablegen_target(CatalystQuantumToQCIncGen)

add_mlir_doc(CatalystQuantumToQC CatalystQuantumToQC ./ -gen-pass-doc)
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@
namespace mqt::ir::conversions {

#define GEN_PASS_DECL
#include "mlir/Conversion/MQTOptToCatalystQuantum/MQTOptToCatalystQuantum.h.inc"
#include "mlir/Conversion/CatalystQuantumToQC/CatalystQuantumToQC.h.inc"

#define GEN_PASS_REGISTRATION
#include "mlir/Conversion/MQTOptToCatalystQuantum/MQTOptToCatalystQuantum.h.inc"
#include "mlir/Conversion/CatalystQuantumToQC/CatalystQuantumToQC.h.inc"

} // namespace mqt::ir::conversions
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@

include "mlir/Pass/PassBase.td"

def CatalystQuantumToMQTOpt : Pass<"catalystquantum-to-mqtopt"> {
let summary = "Convert Catalyst's `Quantum` to MQT's `MQTOpt` dialect.";
def CatalystQuantumToQC : Pass<"catalystquantum-to-qc"> {
let summary = "Convert Catalyst's `Quantum` to MQT's `QC` dialect.";

let description = [{
This pass converts Catalyst's `Quantum` to MQT's `MQTOpt` dialect.
This pass converts Catalyst's `Quantum` to MQT's `QC` dialect.
The following operations are currently NOT converted (and instead marked legal):
- DeviceInitOp
- DeviceReleaseOp
Expand All @@ -27,6 +27,6 @@ def CatalystQuantumToMQTOpt : Pass<"catalystquantum-to-mqtopt"> {
// Define dependent dialects
let dependentDialects = [
"catalyst::quantum::QuantumDialect",
"::mqt::ir::opt::MQTOptDialect"
"mlir::qc::QCDialect"
];
}
13 changes: 0 additions & 13 deletions include/mlir/Conversion/MQTOptToCatalystQuantum/CMakeLists.txt

This file was deleted.

13 changes: 13 additions & 0 deletions include/mlir/Conversion/QCToCatalystQuantum/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Copyright (c) 2025 - 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

set(LLVM_TARGET_DEFINITIONS QCToCatalystQuantum.td)
mlir_tablegen(QCToCatalystQuantum.h.inc -gen-pass-decls -name QCToCatalystQuantum)
add_public_tablegen_target(QCToCatalystQuantumIncGen)

add_mlir_doc(QCToCatalystQuantum QCToCatalystQuantum ./ -gen-pass-doc)
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@
namespace mqt::ir::conversions {

#define GEN_PASS_DECL
#include "mlir/Conversion/CatalystQuantumToMQTOpt/CatalystQuantumToMQTOpt.h.inc"
#include "mlir/Conversion/QCToCatalystQuantum/QCToCatalystQuantum.h.inc"

#define GEN_PASS_REGISTRATION
#include "mlir/Conversion/CatalystQuantumToMQTOpt/CatalystQuantumToMQTOpt.h.inc"
#include "mlir/Conversion/QCToCatalystQuantum/QCToCatalystQuantum.h.inc"
Comment on lines 17 to +21
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🔴 Critical

Generate QCToCatalystQuantum.h.inc before including it here.

CI already fails because this renamed header is not being produced. Please add or fix the matching include-side TableGen wiring for QCToCatalystQuantum before merging; otherwise every translation unit that includes this header will fail to compile.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@include/mlir/Conversion/QCToCatalystQuantum/QCToCatalystQuantum.h` around
lines 17 - 21, The generated header QCToCatalystQuantum.h.inc is missing from
the build, so update the TableGen/include-side wiring for the
QCToCatalystQuantum pass: add the TableGen rule to emit
QCToCatalystQuantum.h.inc (or restore its name) and ensure the build target that
produces it is run before compiling code that includes it; specifically ensure
the pass name QCToCatalystQuantum is registered in your TableGen input and that
the GEN_PASS_DECL / GEN_PASS_REGISTRATION expansion for QCToCatalystQuantum is
being generated by the TableGen backend so the include
"QCToCatalystQuantum.h.inc" is produced for downstream translation units (update
build files or CMake target dependencies as needed).


} // namespace mqt::ir::conversions
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,17 @@

include "mlir/Pass/PassBase.td"

def MQTOptToCatalystQuantum : Pass<"mqtopt-to-catalystquantum"> {
let summary = "Convert MQT's `MQTOpt` to Catalyst's `Quantum` dialect.";
def QCToCatalystQuantum : Pass<"qc-to-catalystquantum"> {
let summary = "Convert MQT's `QC` to Catalyst's `Quantum` dialect.";

let description = [{
This pass converts MQT's `MQTOpt` to Catalyst's `Quantum` dialect.
This pass converts MQT's `QC` to Catalyst's `Quantum` dialect.
}];
let dependentDialects = [
"::catalyst::quantum::QuantumDialect",
"::mlir::arith::ArithDialect",
"::mlir::func::FuncDialect",
"::mlir::memref::MemRefDialect",
"::mqt::ir::opt::MQTOptDialect"
"::mlir::qc::QCDialect"
Comment on lines +11 to +22
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Pass defined but registration is commented out.

The qc-to-catalystquantum pass is correctly defined here, but registerQCToCatalystQuantumPasses() is commented out in lib/mqt-plugin.cpp (line 47). This means:

  1. The pass will not be available at runtime.
  2. Tests using @apply_pass("mqt.qc-to-catalystquantum") or the DEFAULT_PIPELINE (which includes "qc-to-catalystquantum") will fail.

Per the PR description, this is intentional for the draft state since back-conversion is incomplete. Ensure the registration is uncommented when the implementation is ready.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@include/mlir/Conversion/QCToCatalystQuantum/QCToCatalystQuantum.td` around
lines 11 - 22, The QCToCatalystQuantum pass (QCToCatalystQuantum) is defined but
not registered because registerQCToCatalystQuantumPasses() is commented out in
lib/mqt-plugin.cpp, so runtime lookups (e.g.
`@apply_pass`("mqt.qc-to-catalystquantum") and DEFAULT_PIPELINE referencing
"qc-to-catalystquantum") fail; to fix, uncomment and enable the call to
registerQCToCatalystQuantumPasses() in lib/mqt-plugin.cpp (or add conditional
registration gated by a readiness flag) so that the pass is registered with MLIR
when the implementation/back-conversion is complete and tests can find
mqt.qc-to-catalystquantum.

];
}
4 changes: 2 additions & 2 deletions lib/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ add_subdirectory(Conversion)

set(TARGET_NAME mqt-core-plugins-catalyst)

add_llvm_library(${TARGET_NAME} MODULE mqt-plugin.cpp LINK_LIBS CatalystQuantumToMQTOpt
MQTOptToCatalystQuantum)
add_llvm_library(${TARGET_NAME} MODULE mqt-plugin.cpp LINK_LIBS CatalystQuantumToQC)
# QCToCatalystQuantum)
Comment on lines +25 to +26
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🔴 Critical

Link QCToCatalystQuantum into the plugin module.

The plugin now expects both QC passes, but this target only links CatalystQuantumToQC. QCToCatalystQuantum is a separate library, so the back-conversion pass will not be exported from the plugin unless it is linked here.

🔧 Suggested linkage fix
-add_llvm_library(${TARGET_NAME} MODULE mqt-plugin.cpp LINK_LIBS CatalystQuantumToQC)
-# QCToCatalystQuantum)
+add_llvm_library(
+  ${TARGET_NAME}
+  MODULE
+  mqt-plugin.cpp
+  LINK_LIBS
+  CatalystQuantumToQC
+  QCToCatalystQuantum)
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@lib/CMakeLists.txt` around lines 25 - 26, The plugin module currently links
only CatalystQuantumToQC via the add_llvm_library(${TARGET_NAME} MODULE
mqt-plugin.cpp LINK_LIBS CatalystQuantumToQC) invocation; update that
add_llvm_library call to also link QCToCatalystQuantum so the back-conversion
pass is exported by the plugin. Locate the add_llvm_library line (with
TARGET_NAME and mqt-plugin.cpp) and add QCToCatalystQuantum to the LINK_LIBS
list alongside CatalystQuantumToQC.


# set required C++ standard
target_compile_features(${TARGET_NAME} PUBLIC cxx_std_20)
Expand Down
4 changes: 2 additions & 2 deletions lib/Conversion/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@
#
# Licensed under the MIT License

add_subdirectory(MQTOptToCatalystQuantum)
add_subdirectory(CatalystQuantumToMQTOpt)
add_subdirectory(QCToCatalystQuantum)
add_subdirectory(CatalystQuantumToQC)
Loading
Loading