-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Make OpIdentifier
serializable for all inputs
#6295
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 5 commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
d46cdfc
make OpIdentifier serializable for all inputs
epelaaez c78bbe5
use assert_equivalent_repr
epelaaez 39adc1a
Merge branch 'master' into issue-6292
epelaaez 86152af
type checking
epelaaez a551d0b
Merge remote-tracking branch 'refs/remotes/origin/issue-6292' into is…
epelaaez 04f7365
add proper repr for classes
epelaaez f1ee162
use internal vars
epelaaez 6e4876f
Merge branch 'master' into issue-6292
epelaaez 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
55 changes: 45 additions & 10 deletions
55
cirq-core/cirq/protocols/json_test_data/OpIdentifier.json
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,10 +1,45 @@ | ||
{ | ||
"cirq_type": "OpIdentifier", | ||
"gate_type": "XPowGate", | ||
"qubits": [ | ||
{ | ||
"cirq_type": "LineQubit", | ||
"x": 1 | ||
} | ||
] | ||
} | ||
[ | ||
{ | ||
"cirq_type": "OpIdentifier", | ||
"gate_type": "XPowGate", | ||
"qubits": [ | ||
{ | ||
"cirq_type": "LineQubit", | ||
"x": 1 | ||
} | ||
] | ||
}, | ||
{ | ||
"cirq_type": "OpIdentifier", | ||
"gate_type": { | ||
"cirq_type": "CliffordGate", | ||
"n": 1, | ||
"rs": [ | ||
false, | ||
false | ||
], | ||
"xs": [ | ||
[ | ||
true | ||
], | ||
[ | ||
false | ||
] | ||
], | ||
"zs": [ | ||
[ | ||
false | ||
], | ||
[ | ||
true | ||
] | ||
] | ||
}, | ||
"qubits": [ | ||
{ | ||
"cirq_type": "LineQubit", | ||
"x": 0 | ||
} | ||
] | ||
} | ||
] |
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,10 @@ | ||
[ | ||
cirq.devices.noise_utils.OpIdentifier( | ||
cirq.ops.common_gates.XPowGate, | ||
cirq.LineQubit(1) | ||
) | ||
), | ||
cirq.devices.noise_utils.OpIdentifier( | ||
cirq.CliffordGate.from_clifford_tableau(cirq.CliffordTableau(1,rs=np.array([False, False],dtype=np.dtype('bool')), xs=np.array([[True], [False]], dtype=np.dtype('bool')),zs=np.array([[False], [True]], dtype=np.dtype('bool')), initial_state=0)), | ||
cirq.LineQubit(0) | ||
) | ||
] |
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.