Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adding dimension property to comparison of XPowGate and ZPowGate (#6005)
* adding methods so that dimension is included in _value_equality_values_ and _json_dict_ * quick fix to use canonical exponent in added methods * needed to update the json for unit tests as well * fix code style * updating last jsons to include dimension * Revert "updating last jsons to include dimension" This reverts commit 7387710. * Revert "needed to update the json for unit tests as well" This reverts commit 473c99e. * adding dimension to json dict only if dimension is not the default * adding json and repr files to test XPowGate and ZPowGate dimension * updating json and repr files to test XPowGate and ZPowGate dimension and removing individual files * updating _value_equality_values_ function after review and adding _value_equality_approximate_values_ For X and Z PowGates * removing redundant test for read_json --------- Co-authored-by: Tanuj Khattar <tanujkhattar@google.com>
- Loading branch information
1 parent
a827583
commit f6a92a0
Showing
6 changed files
with
64 additions
and
12 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 |
---|---|---|
@@ -1,5 +1,13 @@ | ||
{ | ||
"cirq_type": "XPowGate", | ||
"exponent": 0.123, | ||
"global_shift": 0.0 | ||
} | ||
[ | ||
{ | ||
"cirq_type": "XPowGate", | ||
"exponent": 0.123, | ||
"global_shift": 0.0 | ||
}, | ||
{ | ||
"cirq_type": "XPowGate", | ||
"exponent": 0.123, | ||
"global_shift": 0.0, | ||
"dimension": 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 |
---|---|---|
@@ -1 +1 @@ | ||
(cirq.X**0.123) | ||
[(cirq.X**0.123), cirq.XPowGate(exponent=0.123, dimension=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 |
---|---|---|
@@ -1,5 +1,13 @@ | ||
{ | ||
"cirq_type": "ZPowGate", | ||
"exponent": 0.789, | ||
"global_shift": 0.0 | ||
} | ||
[ | ||
{ | ||
"cirq_type": "ZPowGate", | ||
"exponent": 0.789, | ||
"global_shift": 0.0 | ||
}, | ||
{ | ||
"cirq_type": "ZPowGate", | ||
"exponent": 0.789, | ||
"global_shift": 0.0, | ||
"dimension": 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 |
---|---|---|
@@ -1 +1 @@ | ||
(cirq.Z**0.789) | ||
[(cirq.Z**0.789), cirq.ZPowGate(exponent=0.789, dimension=3)] |