-
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.
Add JSON serialization support for QasmUGate (#4750)
This PR provides the serialization support for the `QasmUGate` class following [serialization.md](https://github.com/quantumlib/Cirq/blob/master/docs/dev/serialization.md). Without this support, `QasmUGate` cannot be properly serialized and deserialized, which causes issue #4728. The test of serialization ability is done through the .repr and .json files under json_test_data folder. These files are also added for `QasmUGate`. close #4728
- Loading branch information
Showing
4 changed files
with
46 additions
and
27 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{ | ||
"cirq_type": "QasmUGate", | ||
"theta": 0.1, | ||
"phi": 0.2, | ||
"lmda": 0.3 | ||
} |
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 |
---|---|---|
@@ -0,0 +1 @@ | ||
cirq.circuits.qasm_output.QasmUGate(0.1, 0.2, 0.3) |