Skip to content
Open
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
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
coderabbitai[bot] marked this conversation as resolved.

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