From 3f1b6850bdae7b02e809baec82fa48f8f3d961ae Mon Sep 17 00:00:00 2001 From: Fionn Malone Date: Wed, 19 Apr 2023 22:19:26 +0000 Subject: [PATCH] Change two_body.dtype comparison from numpy.float to numpy.float64. numpy.float was deprecated in v1.24.0. --- .../ops/representations/diagonal_coulomb_hamiltonian.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/openfermion/ops/representations/diagonal_coulomb_hamiltonian.py b/src/openfermion/ops/representations/diagonal_coulomb_hamiltonian.py index 3ccad8e81..52de901b4 100644 --- a/src/openfermion/ops/representations/diagonal_coulomb_hamiltonian.py +++ b/src/openfermion/ops/representations/diagonal_coulomb_hamiltonian.py @@ -37,9 +37,9 @@ class DiagonalCoulombHamiltonian: """ def __init__(self, one_body, two_body, constant=0.): - if two_body.dtype != numpy.float: + if two_body.dtype != numpy.float64: raise ValueError('Two-body tensor has invalid dtype. Expected {} ' - 'but was {}'.format(numpy.float, two_body.dtype)) + 'but was {}'.format(numpy.float64, two_body.dtype)) if not numpy.allclose(two_body, two_body.T): raise ValueError('Two-body tensor must be symmetric.') if not numpy.allclose(one_body, one_body.T.conj()):