-
-
Notifications
You must be signed in to change notification settings - Fork 32
🎨 [NA] Add Dummy Decomposer to Zoned NA Compiler #902
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
Merged
Merged
Changes from 12 commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
6133b01
✨ Add dummy decomposer
ystade 36e2388
🎨 Clean up
ystade 491dadf
🎨 Make some cosmetic changes
ystade 55458e4
Apply suggestions from code review
ystade cb00d34
🎨 Apply suggestions from code review
ystade 42f6436
Merge remote-tracking branch 'origin/main' into ystade/add-dummy-deco…
ystade 06ad105
🎨 Apply suggestions from code reivew
ystade fe75dbd
🐛 Fix bug
ystade 4d9852e
🎨 Add missing header
ystade 4df676b
Merge branch 'main' into ystade/add-dummy-decomposer
ystade 88a472e
🎨 Apply suggestion from code review
ystade 0f3fb1e
📝 Add changelog entry
ystade 350452e
📝 Update changelog
ystade b00a142
Merge remote-tracking branch 'origin/main' into ystade/add-dummy-deco…
ystade 14993f7
📝 Fix changelog
ystade bc6b510
📝 Add missing link
ystade 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
Some comments aren't visible on the classic Files Changed page.
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,35 @@ | ||
| /* | ||
| * 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 "na/zoned/Types.hpp" | ||
|
|
||
| #include <vector> | ||
|
|
||
| namespace na::zoned { | ||
| /** | ||
| * The Abstract Base Class for the Decomposer of the MQT's Zoned Neutral Atom | ||
| * Compiler. | ||
| */ | ||
| class DecomposerBase { | ||
| public: | ||
| virtual ~DecomposerBase() = default; | ||
| /** | ||
| * This function defines the interface of the decomposer. | ||
| * @param singleQubitGateLayers are the layers of single-qubit gates that are | ||
| * meant to be first decomposed into the native gate set. | ||
| * @return the new single-qubit gate layers | ||
| */ | ||
| [[nodiscard]] virtual auto decompose( | ||
| const std::vector<SingleQubitGateRefLayer>& singleQubitGateLayers) const | ||
| -> std::vector<SingleQubitGateLayer> = 0; | ||
| }; | ||
| } // namespace na::zoned |
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,55 @@ | ||
| /* | ||
| * 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 "na/zoned/Architecture.hpp" | ||
| #include "na/zoned/Types.hpp" | ||
| #include "na/zoned/decomposer/DecomposerBase.hpp" | ||
|
|
||
| #include <nlohmann/json.hpp> | ||
| #include <vector> | ||
|
|
||
| namespace na::zoned { | ||
| /** | ||
| * The class NoOpDecomposer implements a dummy no-op decomposer that just copies | ||
| * every operation. | ||
| */ | ||
| class NoOpDecomposer : public DecomposerBase { | ||
|
|
||
| public: | ||
| /// The configuration of the NoOpDecomposer | ||
| struct Config { | ||
| template < | ||
| typename BasicJsonType, | ||
| nlohmann::detail::enable_if_t< | ||
| nlohmann::detail::is_basic_json<BasicJsonType>::value, int> = 0> | ||
| friend void to_json(BasicJsonType& /* unused */, | ||
| const Config& /* unused */) {} | ||
|
|
||
| template < | ||
| typename BasicJsonType, | ||
| nlohmann::detail::enable_if_t< | ||
| nlohmann::detail::is_basic_json<BasicJsonType>::value, int> = 0> | ||
| friend void from_json(const BasicJsonType& /* unused */, | ||
| Config& /* unused */) {} | ||
| }; | ||
|
|
||
| /** | ||
| * Create a new NoOpDecomposer. | ||
| */ | ||
| NoOpDecomposer(const Architecture& /* unused */, const Config& /* unused */) { | ||
| } | ||
|
|
||
| [[nodiscard]] auto decompose( | ||
| const std::vector<SingleQubitGateRefLayer>& singleQubitGateLayers) const | ||
| -> std::vector<SingleQubitGateLayer> override; | ||
| }; | ||
| } // namespace na::zoned |
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
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.