-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix the calculation for identity operator's expectation value (#13345) (
#13436) * Fix the calculation for identity operator's expectation value * Add release note and test * reformatted `test_statevector.py` with black * Update releasenotes/notes/fix_identity_operator_9e2ec9770ac046a6.yaml Co-authored-by: Julien Gacon <[email protected]> * add a docstring to pass the pylint test * Fix leading `.` --------- Co-authored-by: Julien Gacon <[email protected]> (cherry picked from commit edad499) Co-authored-by: Jinghong Yang <[email protected]>
- Loading branch information
1 parent
2bf578e
commit 27d753a
Showing
3 changed files
with
31 additions
and
1 deletion.
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
5 changes: 5 additions & 0 deletions
5
releasenotes/notes/fix_identity_operator_9e2ec9770ac046a6.yaml
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,5 @@ | ||
--- | ||
fixes: | ||
- | | ||
Fixed a bug that caused :meth:`.Statevector.expectation_value` to yield incorrect results | ||
for the identity operator when the statevector was not normalized. |
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