Partly fix #1008 and #1024: adjust files to support NumPy 2#1057
Merged
Partly fix #1008 and #1024: adjust files to support NumPy 2#1057
Conversation
Update some files to use constructs compatible with NumPy 2.
dstrain115
reviewed
Jun 2, 2025
|
Finally we are going to have |
Per review comments by @dstrain115.
SciPy 1.15 warns that the `kron` method is going away and that people should use the NumPy version of `kron`.
In function `get_tensors_from_integrals`, the call to `numpy.zeros` didn't supply data type information. This resulted in the type defaulting to a float type, which then led to warnings about losing precision in the multiplications later in the method. The solution is to match the types of the values in the call to `zeros` to the types of other arrays.
dstrain115
approved these changes
Jun 4, 2025
This was referenced Jun 4, 2025
Closed
mhucka
added a commit
to mhucka/OpenFermion
that referenced
this pull request
Sep 25, 2025
…rt NumPy 2 (quantumlib#1057) Update some files to use constructs compatible with NumPy 2. A separate PR (quantumlib#1055) updates the requirements files & dependencies for NumPy 2.
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Update some files to use constructs compatible with NumPy 2.
A separate PR (#1055) updates the requirements files & dependencies for NumPy 2.