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

Weird default tolerance in testing function #29

Closed
mfherbst opened this issue Aug 11, 2024 · 2 comments
Closed

Weird default tolerance in testing function #29

mfherbst opened this issue Aug 11, 2024 · 2 comments

Comments

@mfherbst
Copy link
Member

This default rtol of 1e8 strikes me as odd.

function test_forces(sys, calculator; force_eltype=nothing, rtol=1e8, kwargs...)

I have not read through the full mechanics, but I'd expect something <1, so I suspect it's a typo and 1e-8 is meant.

@cortner
Copy link
Member

cortner commented Aug 11, 2024

good catch. And it should probably be sqrt(precision)

tjjarvinen added a commit that referenced this issue Aug 15, 2024
@tjjarvinen tjjarvinen mentioned this issue Aug 15, 2024
@tjjarvinen
Copy link
Collaborator

tjjarvinen commented Aug 15, 2024

Thanks for noticing this.

The reason for the correct value 1e-8 is that only very special methods have accuracy more than 8 significant numbers. So there should be no need smaller tolerance in practive.

On the other hand there can be issues with multithreading and even different implementations of calculators for different calls (forces vs energy_forces etc.) that cause small variations. So, it is better to have relatively loose tolerance here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants