Skip to content

Commit

Permalink
mod: zero small values in cart2sph conversion
Browse files Browse the repository at this point in the history
  • Loading branch information
Johannes Steinmetzer authored and sumpfaffe committed Dec 14, 2022
1 parent ccfd0f0 commit 2bc9c77
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion pysisyphus/wavefunction/cart2sph.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,8 +99,12 @@ def cart2sph_coeffs_for(l: int, real: bool = True) -> NDArray:
return C.T # Return w/ shape (sph., cart.)


def cart2sph_coeffs(l_max: int, **kwargs) -> Dict[int, NDArray]:
def cart2sph_coeffs(l_max: int, zero_small=False, zero_thresh=1e-14, **kwargs) -> Dict[int, NDArray]:
coeffs = {l: cart2sph_coeffs_for(l, **kwargs) for l in range(l_max + 1)}
if zero_small:
for c in coeffs.values():
mask = np.abs(c) <= zero_thresh
c[mask] = 0.0
return coeffs


Expand Down

0 comments on commit 2bc9c77

Please sign in to comment.