From 333595ae5095a42a9023d42b07ee0447c23b8286 Mon Sep 17 00:00:00 2001 From: Tobias Hangleiter Date: Fri, 1 Nov 2024 16:21:34 +0100 Subject: [PATCH] Fix slow basis properties test opt_einsum is much smarter in calculating this contraction --- tests/test_basis.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/test_basis.py b/tests/test_basis.py index 9f5d3e4..dab2f41 100644 --- a/tests/test_basis.py +++ b/tests/test_basis.py @@ -26,6 +26,7 @@ import numpy as np import pytest +from opt_einsum import contract from sparse import COO import filter_functions as ff @@ -142,7 +143,7 @@ def test_basis_properties(self): if base.d < 8: # Test very resource intense - ref = np.einsum('iab,jbc,kcd,lda', *(base,)*4) + ref = contract('iab,jbc,kcd,lda', *(base,)*4) self.assertArrayAlmostEqual(base.four_element_traces.todense(), ref, atol=1e-16) # Test setter