Skip to content

Commit

Permalink
test for valid input
Browse files Browse the repository at this point in the history
  • Loading branch information
Moritz Gubler committed Jul 12, 2024
1 parent 9d97a19 commit f14d792
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions pyqint/cgf.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,8 @@ def add_spherical_gto(self, c, alpha, l, m):
l and m are the coefficients of the requested spherical harmonic function.
l must be <= 6 and -l <= m <= l.
"""
if not l <= 6 or not abs(m) <=l:
raise ValueError("l must be <= 6 and -l <= m <= l")
for gto in sh.spherical_harmonics[l][m]:
self.add_gto(gto[0] * c, alpha, gto[1][0], gto[1][1], gto[1][2])

Expand Down

0 comments on commit f14d792

Please sign in to comment.