Skip to content

Commit

Permalink
Update NumPy APIs that will be removed in numpy-2.0 (#364)
Browse files Browse the repository at this point in the history
Executed  ruff check --select NPY201 --fix ./

Ref: https://numpy.org/doc/stable/numpy_2_0_migration_guide.html
  • Loading branch information
pavoljuhas authored Jul 31, 2024
1 parent 1e0e2ce commit 07da5b1
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion recirq/hfvqe/analysis.py
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,7 @@ def mcweeny_purification(rho: np.ndarray,
Returns:
Purified density matrix.
"""
error = np.infty
error = np.inf
new_rho = rho.copy()
while error > threshold:
new_rho = 3 * (new_rho @ new_rho) - 2 * (new_rho @ new_rho @ new_rho)
Expand Down
2 changes: 1 addition & 1 deletion recirq/qcqmc/hamiltonian.py
Original file line number Diff line number Diff line change
Expand Up @@ -394,6 +394,6 @@ def spinorb_from_spatial(
return one_body_coefficients, two_body_coefficients


def _cast_to_float(x: np.complex_, tol=1e-8) -> float:
def _cast_to_float(x: np.complex128, tol=1e-8) -> float:
assert np.abs(x.imag) < tol, "Large imaginary component found."
return float(x.real)

0 comments on commit 07da5b1

Please sign in to comment.