-
-
Notifications
You must be signed in to change notification settings - Fork 57
✨ Add OpenQASM-to-QC translation #1671
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
J4MMlE
wants to merge
23
commits into
munich-quantum-toolkit:more-control
Choose a base branch
from
J4MMlE:open-qasm
base: more-control
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+2,547
−83
Open
Changes from all commits
Commits
Show all changes
23 commits
Select commit
Hold shift + click to select a range
e1d75db
✨ Add translation for QASM3 -> QC
J4MMlE 227b588
Fix build error
denialhaag 393df6c
Adapt to new include style
denialhaag d8a5654
Begin to fix linter errors
denialhaag e52ece9
Remove explicit namespace specifier
denialhaag 2042521
Drop support for legacy loader
denialhaag 0ef727a
Add first test
denialhaag e3477d1
Fix some more linter errors
denialhaag a3f82da
Add more test cases
denialhaag d891994
Fix some more linter errors
denialhaag ad225f1
Replace .qasm files with in-source strings
denialhaag 7656778
Fix some more linter errors
denialhaag 1d70c3a
Slightly improve doctrings
denialhaag cba7339
Drop support for register comparisons for now
denialhaag d13f45a
Fix remaining linter errors
denialhaag 48ad107
Address the Rabbit's comments
denialhaag 00835a8
Drop support for compound gates for now
denialhaag 16f4007
Adapt implementation to more-control
denialhaag c897962
Remove TODO comments
denialhaag 9043ac3
Revert "Drop support for compound gates for now"
denialhaag 95ff384
Adapt conversion of compound gates
denialhaag d4d352d
Streamline docstrings
denialhaag 9a04b30
Fix linter errors
denialhaag File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
39 changes: 39 additions & 0 deletions
39
mlir/include/mlir/Dialect/QC/Translation/TranslateQASM3ToQC.h
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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); | ||
|
|
||
| } // namespace mlir::qc | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.