Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cache cg coefficients 2 #73

Merged
merged 3 commits into from
Jun 24, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions e3nn_jax/_src/so3.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import numpy as np
import functools

from e3nn_jax._src.su2 import su2_clebsch_gordan, su2_generators

Expand All @@ -19,6 +20,11 @@ def change_basis_real_to_complex(l: int) -> np.ndarray:


def clebsch_gordan(l1: int, l2: int, l3: int) -> np.ndarray:
return _clebsch_gordan(l1, l2, l3).copy()


@functools.cache
def _clebsch_gordan(l1: int, l2: int, l3: int) -> np.ndarray:
r"""The Clebsch-Gordan coefficients of the real irreducible representations of :math:`SO(3)`.

Args:
Expand Down
Loading