Skip to content

Commit 07da5b1

Browse files
authored
Update NumPy APIs that will be removed in numpy-2.0 (#364)
Executed ruff check --select NPY201 --fix ./ Ref: https://numpy.org/doc/stable/numpy_2_0_migration_guide.html
1 parent 1e0e2ce commit 07da5b1

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

recirq/hfvqe/analysis.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -284,7 +284,7 @@ def mcweeny_purification(rho: np.ndarray,
284284
Returns:
285285
Purified density matrix.
286286
"""
287-
error = np.infty
287+
error = np.inf
288288
new_rho = rho.copy()
289289
while error > threshold:
290290
new_rho = 3 * (new_rho @ new_rho) - 2 * (new_rho @ new_rho @ new_rho)

recirq/qcqmc/hamiltonian.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -394,6 +394,6 @@ def spinorb_from_spatial(
394394
return one_body_coefficients, two_body_coefficients
395395

396396

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

0 commit comments

Comments
 (0)