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 "memref_explicit"
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)")
# 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)

# 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