Skip to content
This repository was archived by the owner on Nov 10, 2025. It is now read-only.

Commit 9c36bc2

Browse files
fixup radial state n
1 parent 5df8b60 commit 9c36bc2

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

src/ryd_numerov/radial/radial_state.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,9 @@ def set_n_for_sanity_check(self, n: int) -> None:
6363
if not (n.is_integer() and n >= 1):
6464
raise ValueError(f"n must be an integer, and larger or equal 1, but {n=}")
6565

66-
if n < (self.nu - 1e-2): # avoid issues due to numerical precision and due to NIST data
66+
if n > 10 and n < (self.nu - 1e-5):
67+
# if n <= 10, we use NIST energy data for low n, which sometimes results in nu > n
68+
# -1e-5: avoid issues due to numerical precision and due to NIST data
6769
raise ValueError(f"n must be larger or equal to nu, but {n=}, nu={self.nu} for {self}")
6870
if n <= self.l_r:
6971
raise ValueError(f"n must be larger than l_r, but {n=}, l_r={self.l_r} for {self}")

0 commit comments

Comments
 (0)