diff --git a/src/ryd_numerov/angular/angular_ket.py b/src/ryd_numerov/angular/angular_ket.py index 1a749c8..40b2028 100644 --- a/src/ryd_numerov/angular/angular_ket.py +++ b/src/ryd_numerov/angular/angular_ket.py @@ -364,7 +364,7 @@ def calc_reduced_overlap(self, other: AngularKetBase) -> float: ov: float = 0 for coeff, jj_ket in fj.to_state("JJ"): ov += coeff * ls.calc_reduced_overlap(jj_ket) - return ov + return float(ov) raise NotImplementedError(f"This method is not yet implemented for {self!r} and {other!r}.") diff --git a/src/ryd_numerov/angular/angular_state.py b/src/ryd_numerov/angular/angular_state.py index a5961ca..6b780b4 100644 --- a/src/ryd_numerov/angular/angular_state.py +++ b/src/ryd_numerov/angular/angular_state.py @@ -95,7 +95,7 @@ def to(self, coupling_scheme: CouplingScheme) -> AngularState[Any]: else: kets.append(scheme_ket) coefficients.append(coeff * scheme_coeff) - return AngularState(coefficients, kets) + return AngularState(coefficients, kets, warn_if_not_normalized=abs(self.norm - 1) < 1e-10) def calc_exp_qn(self, q: AngularMomentumQuantumNumbers) -> float: """Calculate the expectation value of a quantum number q. diff --git a/src/ryd_numerov/radial/wavefunction.py b/src/ryd_numerov/radial/wavefunction.py index 6ada48f..cfd0b32 100644 --- a/src/ryd_numerov/radial/wavefunction.py +++ b/src/ryd_numerov/radial/wavefunction.py @@ -283,6 +283,11 @@ def sanity_check(self, z_stop: float, run_backward: bool) -> bool: # noqa: C901 elif n <= 16: tol = 2e-3 + species = self.radial_state.species + if species.number_valence_electrons == 2: + # For divalent atoms the inner boundary is less well behaved ... + tol = 2e-2 + if inner_weight_scaled_to_whole_grid > tol: warning_msgs.append( f"The wavefunction is not close to zero at the inner boundary"