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.
Use hash of numeric value for bound parameter expressions (Qiskit#12488)
* Use hash of numeric value for bound parameter expressions If a `ParameterExpression` has no unbound parameters, the underlying bound value can be hashed instead of the tuple that accounts for the symbolic expression. Doing this allows for the `ParameterExpression` to match the hash for the numeric value it compares equal to. Closes Qiskit#12487 * Add release note
- Loading branch information
Showing
3 changed files
with
12 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/parameterexpression-hash-d2593ab1715aa42c.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:`.ParameterExpression` was updated so that fully bound instances | ||
that compare equal to instances of Python's built-in numeric types (like | ||
``float`` and ``int``) also have hash values that match those of the other | ||
instances. This change ensures that these types can be used interchangeably | ||
as dictionary keys. See `#12488 <https://github.com/Qiskit/qiskit/pull/12488>`__. |
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