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

Commit 3a387f5

Browse files
varios small fixes:
- fix angular state warn if not normalized - relax sanity_check wavefunction divalent atoms
1 parent a53340d commit 3a387f5

3 files changed

Lines changed: 7 additions & 2 deletions

File tree

src/ryd_numerov/angular/angular_ket.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -364,7 +364,7 @@ def calc_reduced_overlap(self, other: AngularKetBase) -> float:
364364
ov: float = 0
365365
for coeff, jj_ket in fj.to_state("JJ"):
366366
ov += coeff * ls.calc_reduced_overlap(jj_ket)
367-
return ov
367+
return float(ov)
368368

369369
raise NotImplementedError(f"This method is not yet implemented for {self!r} and {other!r}.")
370370

src/ryd_numerov/angular/angular_state.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ def to(self, coupling_scheme: CouplingScheme) -> AngularState[Any]:
9595
else:
9696
kets.append(scheme_ket)
9797
coefficients.append(coeff * scheme_coeff)
98-
return AngularState(coefficients, kets)
98+
return AngularState(coefficients, kets, warn_if_not_normalized=abs(self.norm - 1) < 1e-10)
9999

100100
def calc_exp_qn(self, q: AngularMomentumQuantumNumbers) -> float:
101101
"""Calculate the expectation value of a quantum number q.

src/ryd_numerov/radial/wavefunction.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -283,6 +283,11 @@ def sanity_check(self, z_stop: float, run_backward: bool) -> bool: # noqa: C901
283283
elif n <= 16:
284284
tol = 2e-3
285285

286+
species = self.radial_state.species
287+
if species.number_valence_electrons == 2:
288+
# For divalent atoms the inner boundary is less well behaved ...
289+
tol = 2e-2
290+
286291
if inner_weight_scaled_to_whole_grid > tol:
287292
warning_msgs.append(
288293
f"The wavefunction is not close to zero at the inner boundary"

0 commit comments

Comments
 (0)