forked from Qiskit/qiskit
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix zero-qubit
Pauli
label strings (Qiskit#9726)
It was previously possible to construct a zero-qubit Pauli operator using the array form (`Pauli(([], []))`), or by empty-slicing an existing Pauli (`Pauli("IXZ")[[]]`). This commit completes the set by making labels with no qubits work as well, for consistency. Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
- Loading branch information
1 parent
3284ea0
commit 332f4b2
Showing
5 changed files
with
40 additions
and
43 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
7 changes: 7 additions & 0 deletions
7
releasenotes/notes/fix-empty-pauli-label-ce2580584db67a4d.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,7 @@ | ||
--- | ||
fixes: | ||
- | | ||
Fixed an edge case in the construction of :class:`.Pauli` instances; a string with an optional | ||
phase and no qubits is now a valid label, making an operator with no qubits (such as | ||
``Pauli("-i")``). This was already possible when using the array forms, or empty slices. | ||
Fixed `#9720 <https://github.com/Qiskit/qiskit-terra/issues/9720>`__. |
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