Skip to content

Commit

Permalink
Replace np.alltrue() with np.all()
Browse files Browse the repository at this point in the history
numpy.alltrue() was deprecated in NumPy 1.25.0 and removed in NumPy 2.0.
Because of this, test_h2 fails on recent versions of NumPy.

Fixes: #1370
  • Loading branch information
iyanmv committed Dec 22, 2024
1 parent 3221b5c commit cc75121
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions test/second_q/mappers/test_bksf_mapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ def test_bksf_edge_op_aij(self):
def test_h2(self):
"""Test H2 molecule"""
with self.subTest("Excitation edges 1"):
assert np.alltrue(
assert np.all(
_bksf_edge_list_fermionic_op(
FermionicOp({"+_0 -_1 +_2 -_3": 1}, num_spin_orbitals=4),
4,
Expand All @@ -109,7 +109,7 @@ def test_h2(self):
)

with self.subTest("Excitation edges 2"):
assert np.alltrue(
assert np.all(
_bksf_edge_list_fermionic_op(
FermionicOp({"+_0 -_1 -_2 +_3": 1}, num_spin_orbitals=4),
4,
Expand Down

0 comments on commit cc75121

Please sign in to comment.