Skip to content
Merged
Show file tree
Hide file tree
Changes from 40 commits
Commits
Show all changes
54 commits
Select commit Hold shift + click to select a range
35c240a
✨ Add translation for QASM3 -> QC
J4MMlE Apr 27, 2026
dac020c
Fix build error
denialhaag Apr 29, 2026
8036f1f
Adapt to new include style
denialhaag Apr 29, 2026
ad156d3
Begin to fix linter errors
denialhaag May 21, 2026
a22ab4f
Remove explicit namespace specifier
denialhaag May 21, 2026
71c4bcd
Drop support for legacy loader
denialhaag May 21, 2026
e99fcca
Add first test
denialhaag May 21, 2026
f6d248c
Fix some more linter errors
denialhaag May 21, 2026
5aa5f74
Add more test cases
denialhaag May 21, 2026
987f667
Fix some more linter errors
denialhaag May 21, 2026
16a3da7
Replace .qasm files with in-source strings
denialhaag May 21, 2026
24dccde
Fix some more linter errors
denialhaag May 21, 2026
9c4aaa0
Slightly improve doctrings
denialhaag May 21, 2026
10ddff2
Drop support for register comparisons for now
denialhaag May 21, 2026
27f59a6
Fix remaining linter errors
denialhaag May 21, 2026
286accf
Address the Rabbit's comments
denialhaag May 21, 2026
1953fff
Drop support for compound gates for now
denialhaag May 21, 2026
6e356ae
Adapt implementation to more-control
denialhaag Jun 2, 2026
3260e76
Remove TODO comments
denialhaag Jun 2, 2026
5f6e5c9
Revert "Drop support for compound gates for now"
denialhaag Jun 2, 2026
8e73857
Adapt conversion of compound gates
denialhaag Jun 2, 2026
fc7fa5b
Streamline docstrings
denialhaag Jun 2, 2026
36dd8d3
Fix linter errors
denialhaag Jun 2, 2026
b9a1be8
Fix linter error
denialhaag Jun 9, 2026
c216c15
Merge remote-tracking branch 'origin/main' into open-qasm
denialhaag Jun 12, 2026
d9ada9c
Address the Rabbit's comments from #1671
denialhaag Jun 12, 2026
0ef19d9
Improve coverage a bit
denialhaag Jun 12, 2026
e0d2781
Clean up and simplify
denialhaag Jun 12, 2026
a630133
Test broadcasting
denialhaag Jun 12, 2026
301f23f
Test translation of OpenQASM 2 program
denialhaag Jun 12, 2026
29b7e0d
Fix linter errors
denialhaag Jun 12, 2026
39142e9
Merge remote-tracking branch 'origin/main' into open-qasm
denialhaag Jun 12, 2026
ac413ba
Address the Rabbit's comments
denialhaag Jun 12, 2026
e7ed9bd
Simplify IfStement helpers and improve coverage
denialhaag Jun 12, 2026
ebafce2
Merge remote-tracking branch 'origin/main' into open-qasm
denialhaag Jun 12, 2026
6a11e8f
Improve documentation
denialhaag Jun 12, 2026
198b77f
Address the Rabbit's out-of-diff comments
denialhaag Jun 14, 2026
40e31f7
Fix broadcasting
denialhaag Jun 14, 2026
89da071
Merge branch 'main' into open-qasm
denialhaag Jun 17, 2026
238e2b7
Merge branch 'main' into open-qasm
burgholzer Jun 17, 2026
e8133ce
Skip InitialLayout and OutputPermutation pragmas
denialhaag Jun 17, 2026
a7a81b9
Use llvm::SourceMgr
denialhaag Jun 17, 2026
cce8134
Support if operations with empty then branches
denialhaag Jun 17, 2026
77043ba
Fix linter errors
denialhaag Jun 18, 2026
86bbf4b
Stop linking against MQT::CoreIR
denialhaag Jun 18, 2026
c06be11
Address the Rabbit's comment
denialhaag Jun 18, 2026
8e6dd84
Remove 3
denialhaag Jun 18, 2026
05727e5
Simplify link libraries
denialhaag Jun 18, 2026
5882949
Update changelog
denialhaag Jun 18, 2026
c2ebdc6
Merge branch 'main' into open-qasm
denialhaag Jun 18, 2026
19f5d95
Add overload that accepts a StringRef
denialhaag Jun 18, 2026
683f558
Add mqt-cc-translate tool
denialhaag Jun 18, 2026
d0590fd
Fix linter errors
denialhaag Jun 18, 2026
719764a
Remove mqt-cc-translate tool again
denialhaag Jun 18, 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
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);
Comment thread
burgholzer marked this conversation as resolved.
Outdated

} // 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