-
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.
Reject bad values in
SparsePauliOp.paulis
setter (#10437)
* Fix Sparse pauli setter to update dimension info * Fix Sparse pauli setter to verify dimension info Value error will be raised if: 1. Number of qubits are not equal 2. Number of elements in PauliList are not equal * Add tests * Add release note --------- Co-authored-by: Jake Lishman <jake.lishman@ibm.com> Co-authored-by: Ikko Hamamura <ikkoham@users.noreply.github.com> (cherry picked from commit fe87015)
- Loading branch information
1 parent
91ca2c4
commit fcdc130
Showing
3 changed files
with
22 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
6 changes: 6 additions & 0 deletions
6
releasenotes/notes/sparse-pauli-op-constraint-pauli-setter-52f6f89627d1937c.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,6 @@ | ||
--- | ||
fixes: | ||
- | | ||
The setter for :attr:`.SparsePauliOp.paulis` will now correctly reject attempts to set the | ||
attribute with incorrectly shaped data, rather than silently allowing an invalid object to be | ||
created. See `#10384 <https://github.com/Qiskit/qiskit-terra/issues/10384>`__. |
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