Relax tolerances when testing HinderedRotor.get_enthalpy() #2457
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Motivation or Problem
When testing
HinderedRotor.get_enthalpy()
method using a Fourier series potential in the quantum limit it callsget_enthalpy
which, in the quantum limit, callssolve_schrodinger_equation
, which callsscipy.linalg.eig_banded(H, lower=True, eigvals_only=True, overwrite_a_band=True)
, which apparently now gives a subtly different answer, and the unit test fails.There's a lengthy discussion in #1682 trying to track down the possibility of a bug due to some gnarly numerical issues. In the end they increased the tolerance on a unit test.
Since nothing has changed recently relating to this code, except some C++ libraries on conda-forge that are used on the test runners, I propose taking the same approach, and relaxing the tolerance on the test. Maybe we're more accurate now than we used to be 🤷
Description of Changes
The tolerance in
test_get_enthalpy_quantum_fourier
was 0.1%. It's now 0.2%.Testing and Reviewer Tips
There's a deep dive at #1682.
The unit tests now pass on this branch.