forked from Qiskit/qiskit
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Enable proper iteration over
Statevector
(Qiskit#8062)
* Enable proper iteration over Statevector * Add Statevector.__len__ and add a release note * Simplify release note * Update test_statevctor_iter Co-authored-by: Jake Lishman <[email protected]> Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
- Loading branch information
Showing
3 changed files
with
37 additions
and
0 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
8 changes: 8 additions & 0 deletions
8
releasenotes/notes/statevector-enable-iter-4652d7ce87f4d459.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,8 @@ | ||
--- | ||
fixes: | ||
- | | ||
:class:`.Statevector` will now allow direct iteration through its values | ||
(such as ``for coefficient in statevector``) and | ||
correctly report its length under ``len``. Previously it would try and | ||
and access out-of-bounds data and raise a :class:`.QiskitError`. See | ||
`#8039 <https://github.com/Qiskit/qiskit-terra/issues/8039>`__. |
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