Skip to content

Commit

Permalink
Fix slow basis properties test
Browse files Browse the repository at this point in the history
opt_einsum is much smarter in calculating this contraction
  • Loading branch information
thangleiter committed Nov 1, 2024
1 parent 2750848 commit 290f37b
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion tests/test_basis.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@

import numpy as np
import pytest
from opt_einsum import contract
from sparse import COO

import filter_functions as ff
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 290f37b

Please sign in to comment.