forked from quantumlib/Cirq
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Code Quality Fixes in StatePreparationChannel (quantumlib#4503)
* Fixing Minor Errors Fixed many of the nits mentioned in quantumlib#4482, value-equality not a part of this commit. * Approx Equality support added State Preparation Channel got equality comparison similar to that of Matrix Gate. * Added name parameter to state preparation channel name parameter added to constructor, JSON, and repr serialization as well as test data. * Custom names in serialization tests The name has been changed in the JSON and repr protocol tests to make the older version fail. * Format and Lint Fix Had to run pylint. * Adding tests to ignore name Two gates with different names are still equal, added tests for that.
- Loading branch information
1 parent
52bf065
commit 24308de
Showing
4 changed files
with
58 additions
and
20 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 |
---|---|---|
|
@@ -21,5 +21,6 @@ | |
"real": 0.0, | ||
"imag": 0.0 | ||
} | ||
] | ||
], | ||
"name": "StatePrepare" | ||
} |
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.StatePreparationChannel(np.array([(1+0j), 0j, 0j, 0j], dtype=np.complex128)) | ||
cirq.StatePreparationChannel(target_state=np.array([(1+0j), 0j, 0j, 0j], dtype=np.complex128), name="StatePrepare") |