Skip to content

Commit 333595a

Browse files
committed
Fix slow basis properties test
opt_einsum is much smarter in calculating this contraction
1 parent c882d24 commit 333595a

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

tests/test_basis.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626

2727
import numpy as np
2828
import pytest
29+
from opt_einsum import contract
2930
from sparse import COO
3031

3132
import filter_functions as ff
@@ -142,7 +143,7 @@ def test_basis_properties(self):
142143

143144
if base.d < 8:
144145
# Test very resource intense
145-
ref = np.einsum('iab,jbc,kcd,lda', *(base,)*4)
146+
ref = contract('iab,jbc,kcd,lda', *(base,)*4)
146147
self.assertArrayAlmostEqual(base.four_element_traces.todense(), ref, atol=1e-16)
147148

148149
# Test setter

0 commit comments

Comments
 (0)