-
Notifications
You must be signed in to change notification settings - Fork 1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make
OpIdentifier
serializable for all inputs (#6295)
- Loading branch information
Showing
5 changed files
with
69 additions
and
16 deletions.
There are no files selected for viewing
This file contains 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 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 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 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 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) | ||
) | ||
] |