forked from Qiskit/qiskit
-
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.
Added argsort and sort method to SparsePauliOp (Qiskit#8016)
* first share * Remove reverse option * Apply Lint * Modify wording * add release note * Correct the text * Correct the text * Delete words * Added description of arguments * Fix typos & update reno Co-authored-by: Julien Gacon <[email protected]>
- Loading branch information
Showing
3 changed files
with
252 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
15 changes: 15 additions & 0 deletions
15
releasenotes/notes/0.21/add-sparsepauliop-methods-00a7e6cc7055e1d0.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,15 @@ | ||
features: | ||
- | | ||
Added a new method :meth:`.SparsePauliOp.argsort`, which | ||
returns the composition of permutations in the order of sorting | ||
by coefficient and sorting by Pauli. By using the `weight` kwarg | ||
the output can additionally be sorted | ||
by the number of non-identity terms in the Pauli, where the set of | ||
all Pauli's of a given weight are still ordered lexicographically. | ||
- | | ||
Added a new method :meth:`.SparsePauliOp.sort`. | ||
After sorting the coefficients using numpy's argsort, sort by Pauli. | ||
Pauli sort takes precedence. If Pauli is the same, it will be sorted | ||
by coefficient. By using the `weight` kwarg the output can additionally | ||
be sorted by the number of non-identity terms in the Pauli, where the | ||
set ofall Pauli's of a given weight are still ordered lexicographically. |
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