-
Notifications
You must be signed in to change notification settings - Fork 1.1k
cirq-core target gatesets: accept additional gates to keep untouched. #5445
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
CirqBot
merged 12 commits into
quantumlib:master
from
verult:cg-device-refactor/target-gateset-additional-gates
Jun 17, 2022
Merged
Changes from 6 commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
034b3b5
Draft to update cirq-core target gatesets to accept additional_gates …
tanujkhattar 98a75b6
Uses GateFamily in target gateset equality and json; assert_optimizes…
verult 2589225
Fixed test failures
verult 2be2980
Addressed Tanuj's comments
verult d233203
Do not serialize additional_gates if it's missing
verult cb34171
CZTargetGateset repr test
verult 4d30541
Merge branch 'master' of github.com:quantumlib/Cirq into cg-device-re…
verult 872ef34
Merge branch 'master' of github.com:quantumlib/Cirq into cg-device-re…
verult e4716a0
Merge branch 'master' of github.com:quantumlib/Cirq into cg-device-re…
verult 91023bb
Temporary fix optimize_test failure by changing the expected string
verult 965e917
Merge branch 'master' into cg-device-refactor/target-gateset-addition…
CirqBot 0fd4781
Merge branch 'master' into cg-device-refactor/target-gateset-addition…
CirqBot 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
18 changes: 16 additions & 2 deletions
18
cirq-core/cirq/protocols/json_test_data/CZTargetGateset.repr
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 |
---|---|---|
@@ -1,4 +1,18 @@ | ||
[ | ||
cirq.CZTargetGateset(atol=1e-06, allow_partial_czs=False), | ||
cirq.CZTargetGateset(atol=1e-08, allow_partial_czs=True), | ||
cirq.CZTargetGateset(atol=1e-06, allow_partial_czs=False, additional_gates=[]), | ||
cirq.CZTargetGateset(atol=1e-08, allow_partial_czs=True, additional_gates=[]), | ||
cirq.CZTargetGateset( | ||
atol=1e-06, | ||
allow_partial_czs=True, | ||
additional_gates=[ | ||
(cirq.ISWAP**0.5), | ||
cirq.ops.common_gates.XPowGate, | ||
cirq.GateFamily( | ||
gate=cirq.ops.common_gates.ZPowGate, | ||
ignore_global_phase=True, | ||
tags_to_accept=frozenset(), | ||
tags_to_ignore=frozenset(), | ||
), | ||
], | ||
), | ||
] |
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
25 changes: 22 additions & 3 deletions
25
cirq-core/cirq/protocols/json_test_data/SqrtIswapTargetGateset.repr
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 |
---|---|---|
@@ -1,7 +1,26 @@ | ||
[ | ||
cirq.SqrtIswapTargetGateset( | ||
atol=1e-08, required_sqrt_iswap_count=None, use_sqrt_iswap_inv=False | ||
atol=1e-08, required_sqrt_iswap_count=None, use_sqrt_iswap_inv=False, additional_gates=[] | ||
), | ||
cirq.SqrtIswapTargetGateset( | ||
atol=1e-08, required_sqrt_iswap_count=1, use_sqrt_iswap_inv=False, additional_gates=[] | ||
), | ||
cirq.SqrtIswapTargetGateset( | ||
atol=1e-06, required_sqrt_iswap_count=2, use_sqrt_iswap_inv=True, additional_gates=[] | ||
), | ||
cirq.SqrtIswapTargetGateset( | ||
atol=1e-08, | ||
required_sqrt_iswap_count=None, | ||
use_sqrt_iswap_inv=False, | ||
additional_gates=[ | ||
cirq.CZ, | ||
cirq.ops.common_gates.XPowGate, | ||
cirq.GateFamily( | ||
gate=cirq.ops.common_gates.ZPowGate, | ||
ignore_global_phase=True, | ||
tags_to_accept=frozenset(), | ||
tags_to_ignore=frozenset(), | ||
), | ||
], | ||
), | ||
cirq.SqrtIswapTargetGateset(atol=1e-08, required_sqrt_iswap_count=1, use_sqrt_iswap_inv=False), | ||
cirq.SqrtIswapTargetGateset(atol=1e-06, required_sqrt_iswap_count=2, use_sqrt_iswap_inv=True), | ||
] |
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.