-
Notifications
You must be signed in to change notification settings - Fork 35
✨ Collect clifford blocks #885
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
jannikpflieger
wants to merge
29
commits into
munich-quantum-toolkit:main
Choose a base branch
from
jannikpflieger:collectCliffordBlocks
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.
Open
Changes from all commits
Commits
Show all changes
29 commits
Select commit
Hold shift + click to select a range
212533c
isCliffordCheck
jannikpflieger 3f64b2f
added isCliffordOperation
jannikpflieger 5db7ac5
edited collectBlocks to handle CliffordBlocks
jannikpflieger 4995e47
Added Tests and redefined if statements in opertaon
jannikpflieger 62004e5
fixed Testcases
jannikpflieger 1656046
Update ci.yml
jannikpflieger 8c811bd
Update ci.yaml again
jannikpflieger 5812c72
Merge branch 'cda-tum:main' into collectCliffordBlocks
jannikpflieger d9d2132
🎨 pre-commit fixes
pre-commit-ci[bot] 3282c67
more Test Coverage and fix linting errors
jannikpflieger 43d18ae
Merge branch 'cda-tum:main' into collectCliffordBlocks
jannikpflieger 088ada5
removed outcommented code
jannikpflieger 486e225
Added import and fixed variable const
jannikpflieger 66ed0fc
Merge branch 'munich-quantum-toolkit:main' into collectCliffordBlocks
jannikpflieger e1ffb25
changed parameter name and added docstring
jannikpflieger 0ae9525
Merge branch 'collectCliffordBlocks' of github.com:jannikpflieger/mqt…
jannikpflieger d7264a0
🎨 pre-commit fixes
pre-commit-ci[bot] a12f11a
reverted original tests back to normal, changed function header of co…
jannikpflieger 7eb95fc
Merge branch 'collectCliffordBlocks' of github.com:jannikpflieger/mqt…
jannikpflieger 5555b8e
🎨 pre-commit fixes
pre-commit-ci[bot] e5de02d
Moved IsCliffordfunction to StandardOperation and CompoundOperation
jannikpflieger 6e728cb
Merge branch 'collectCliffordBlocks' of github.com:jannikpflieger/mqt…
jannikpflieger 71e8bc6
🎨 pre-commit fixes
pre-commit-ci[bot] f771766
Corrected Test for isClifford operations
jannikpflieger d97eef5
Merge branch 'collectCliffordBlocks' of github.com:jannikpflieger/mqt…
jannikpflieger 227d2ec
🎨 pre-commit fixes
pre-commit-ci[bot] 5ce85b4
Removed usless test added more meanigful ones
jannikpflieger 326c5b9
Merge branch 'collectCliffordBlocks' of github.com:jannikpflieger/mqt…
jannikpflieger ace9eaf
🎨 pre-commit fixes
pre-commit-ci[bot] 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
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
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 |
---|---|---|
|
@@ -14,6 +14,7 @@ | |
#include "ir/Register.hpp" | ||
#include "ir/operations/AodOperation.hpp" | ||
#include "ir/operations/CompoundOperation.hpp" | ||
#include "ir/operations/Control.hpp" | ||
#include "ir/operations/Expression.hpp" | ||
#include "ir/operations/NonUnitaryOperation.hpp" | ||
#include "ir/operations/OpType.hpp" | ||
|
@@ -148,6 +149,44 @@ TEST(Operation, IsIndividualGate) { | |
EXPECT_FALSE(op3.isSingleQubitGate()); | ||
} | ||
|
||
TEST(Operation, IsClifford) { | ||
const qc::StandardOperation x(0, qc::X); | ||
EXPECT_TRUE(x.isClifford()); | ||
const qc::StandardOperation cx(0, 1, qc::X); | ||
EXPECT_TRUE(cx.isClifford()); | ||
const qc::StandardOperation y(0, 1, qc::Y); | ||
EXPECT_TRUE(y.isClifford()); | ||
const qc::StandardOperation z(0, 1, qc::Z); | ||
EXPECT_TRUE(z.isClifford()); | ||
const qc::StandardOperation t(0, qc::T); | ||
EXPECT_FALSE(t.isClifford()); | ||
const qc::Controls controls = {qc::Control(0), qc::Control(1)}; | ||
const qc::StandardOperation ccx(controls, 2, qc::X); | ||
EXPECT_FALSE(ccx.isClifford()); | ||
const qc::StandardOperation ccy(controls, 2, qc::Y); | ||
EXPECT_FALSE(ccy.isClifford()); | ||
const qc::StandardOperation ccz(controls, 2, qc::Z); | ||
EXPECT_FALSE(ccz.isClifford()); | ||
const qc::StandardOperation h(0, qc::H); | ||
EXPECT_TRUE(h.isClifford()); | ||
const qc::StandardOperation s(0, qc::S); | ||
EXPECT_TRUE(s.isClifford()); | ||
const qc::StandardOperation sdg(0, qc::Sdg); | ||
EXPECT_TRUE(sdg.isClifford()); | ||
const qc::StandardOperation sx(0, qc::SX); | ||
EXPECT_TRUE(sx.isClifford()); | ||
const qc::StandardOperation sxdg(0, qc::SXdg); | ||
EXPECT_TRUE(sxdg.isClifford()); | ||
const qc::StandardOperation dcx(0, 1, qc::DCX); | ||
EXPECT_TRUE(dcx.isClifford()); | ||
const qc::StandardOperation swap(0, 1, qc::SWAP); | ||
EXPECT_TRUE(swap.isClifford()); | ||
const qc::StandardOperation iswap(0, 1, qc::iSWAP); | ||
EXPECT_TRUE(iswap.isClifford()); | ||
const qc::StandardOperation ecr(0, 1, qc::ECR); | ||
EXPECT_TRUE(ecr.isClifford()); | ||
} | ||
Comment on lines
+152
to
+188
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. These are not really conclusive (see comment where the function is defined). |
||
|
||
TEST(Operation, IsDiagonalGate) { | ||
const qc::StandardOperation op1(0, qc::X); | ||
EXPECT_FALSE(op1.isDiagonalGate()); | ||
|
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.
All the changes in this file where
Should be reverted to remain unchanged by this PR based on the default argument for the pass.