Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Better validation of cutoff & atomic_gaussian_width #228

Merged
merged 1 commit into from
Sep 6, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions rascaline/src/calculators/lode/radial_integral/gto.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,13 @@ impl LodeRadialIntegralGtoParameters {
));
}

if self.cutoff < 0.0 || !self.cutoff.is_finite() {
if self.cutoff <= 1e-16 || !self.cutoff.is_finite() {
return Err(Error::InvalidParameter(
"cutoff must be a positive number for GTO radial integral".into()
));
}

if self.atomic_gaussian_width < 0.0 || !self.atomic_gaussian_width.is_finite() {
if self.atomic_gaussian_width <= 1e-16 || !self.atomic_gaussian_width.is_finite() {
return Err(Error::InvalidParameter(
"atomic_gaussian_width must be a positive number for GTO radial integral".into()
));
Expand Down
4 changes: 2 additions & 2 deletions rascaline/src/calculators/soap/radial_integral/gto.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,13 @@ impl SoapRadialIntegralGtoParameters {
));
}

if self.cutoff < 0.0 || !self.cutoff.is_finite() {
if self.cutoff <= 1e-16 || !self.cutoff.is_finite() {
return Err(Error::InvalidParameter(
"cutoff must be a positive number for GTO radial integral".into()
));
}

if self.atomic_gaussian_width < 0.0 || !self.atomic_gaussian_width.is_finite() {
if self.atomic_gaussian_width <= 1e-16 || !self.atomic_gaussian_width.is_finite() {
return Err(Error::InvalidParameter(
"atomic_gaussian_width must be a positive number for GTO radial integral".into()
));
Expand Down