-
-
Notifications
You must be signed in to change notification settings - Fork 53
✨ Add conversions for Jeff dialect #1479
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
Draft
denialhaag
wants to merge
23
commits into
main
Choose a base branch
from
jeff
base: main
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.
Draft
Changes from 20 commits
Commits
Show all changes
23 commits
Select commit
Hold shift + click to select a range
8b4dd69
Add initial infrastructure for Jeff conversions
denialhaag 1607156
Fix linter errors
denialhaag f4f0bd4
Rename test classes
denialhaag 42b42d2
Fix conversion of XOp
denialhaag 7501ff0
Link against MLIRArithDialect again
denialhaag c35f075
Fix remaining linter error
denialhaag 262f5dd
Add support for controlled operations
denialhaag 5ba8f3b
Convert all supported one-target zero-parameter operations
denialhaag 79afcbb
Convert all one-target one-parameter operations
denialhaag 1d15b35
Convert measure operation
denialhaag bed14e0
Convert reset operation
denialhaag f540de8
Convert swap operation
denialhaag c72f7fb
Convert U operation
denialhaag 84ec3d2
Add more tests
denialhaag 268338f
Fix linter errors
denialhaag c660e10
Convert GPhase operation
denialhaag 968fb79
Add some docstrings
denialhaag fc4e21e
Fail if operation is adjoint
denialhaag f6b8777
Update after rebase
denialhaag 7cbe74b
Rewrite tests to perform QC-Jeff-QC round trip
denialhaag c98a22d
Fix linter errors
denialhaag 9d0c9aa
Fix conversion of jeff.qubit_free
denialhaag 0df198e
Convert jeff.qubit_measure
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
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
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
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
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,13 @@ | ||
| # 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 | ||
|
|
||
| set(LLVM_TARGET_DEFINITIONS JeffToQC.td) | ||
| mlir_tablegen(JeffToQC.h.inc -gen-pass-decls -name JeffToQC) | ||
| add_public_tablegen_target(JeffToQCIncGen) | ||
|
|
||
| add_mlir_doc(JeffToQC MLIRJeffToQC Conversions/ -gen-pass-doc) |
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,21 @@ | ||
| /* | ||
| * 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/Pass/Pass.h> | ||
|
|
||
| namespace mlir { | ||
| #define GEN_PASS_DECL_JEFFTOQC | ||
| #include "mlir/Conversion/JeffToQC/JeffToQC.h.inc" | ||
|
|
||
| #define GEN_PASS_REGISTRATION | ||
| #include "mlir/Conversion/JeffToQC/JeffToQC.h.inc" | ||
| } // namespace mlir |
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,22 @@ | ||
| // 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 | ||
|
|
||
| include "mlir/Pass/PassBase.td" | ||
|
|
||
| def JeffToQC : Pass<"jeff-to-qc"> { | ||
| let summary = "Convert Jeff operations to QC operations"; | ||
|
|
||
| let description = [{ | ||
| TODO | ||
| }]; | ||
|
|
||
| let dependentDialects = [ | ||
| "jeff::JeffDialect", | ||
| "mlir::QCDialect", | ||
| ]; | ||
| } |
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,13 @@ | ||
| # 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 | ||
|
|
||
| set(LLVM_TARGET_DEFINITIONS QCToJeff.td) | ||
| mlir_tablegen(QCToJeff.h.inc -gen-pass-decls -name QCToJeff) | ||
| add_public_tablegen_target(QCToJeffIncGen) | ||
|
|
||
| add_mlir_doc(QCToJeff MLIRQCToJeff Conversions/ -gen-pass-doc) |
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,21 @@ | ||
| /* | ||
| * 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/Pass/Pass.h> | ||
|
|
||
| namespace mlir { | ||
| #define GEN_PASS_DECL_QCTOJEFF | ||
| #include "mlir/Conversion/QCToJeff/QCToJeff.h.inc" | ||
|
|
||
| #define GEN_PASS_REGISTRATION | ||
| #include "mlir/Conversion/QCToJeff/QCToJeff.h.inc" | ||
| } // namespace mlir |
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,22 @@ | ||
| // 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 | ||
|
|
||
| include "mlir/Pass/PassBase.td" | ||
|
|
||
| def QCToJeff : Pass<"qc-to-jeff"> { | ||
| let summary = "Convert QC operations to Jeff operations"; | ||
|
|
||
| let description = [{ | ||
| TODO | ||
| }]; | ||
|
|
||
| let dependentDialects = [ | ||
| "jeff::JeffDialect", | ||
| "mlir::QCDialect", | ||
| ]; | ||
| } |
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
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,20 @@ | ||
| # 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 | ||
|
|
||
| file(GLOB CONVERSION_SOURCES *.cpp) | ||
|
|
||
| add_mlir_library( | ||
| JeffToQC | ||
| ${CONVERSION_SOURCES} | ||
| DEPENDS | ||
| JeffToQCIncGen | ||
| LINK_LIBS | ||
| MLIRJeff | ||
| MLIRQCDialect | ||
| MLIRTransforms | ||
| DISABLE_INSTALL) |
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This currently makes the configuration fail. I don't exactly understand what's going on, but it looks like the
mlir-doctarget is also being created byjeff-mlir, leading to interference.Another problem seems to be that calling
mlir-docalso triggers the generation of the Jeff documentation in the_depsdirectory.Maybe it's possible to add flags to
jeff-mlirto toggle the documentation generation. 🤔There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I haven't quite managed to work around this for now. Will have to reinvestigate at a later point.