Automate arbitrary noise parameters. #205
Merged
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.
For the arbitrary noise thermostats, based on Fourier transforming the noise power spectrum, we have two parameters, the number of frequencies and the number of truncated point which have default values or can be user specified. However, it is very difficult for the user to choose the correct values without doing several simulations to check the number of frequencies is large enough for the discrete Fourier transform to be a good approximation of the integral, or the truncation number to be large enough not to cut off the tail of the memory kernel. Even if everything looks ok, the number of frequencies needed actually needs to be very high in many cases.
I've changed the code so that these parameters are now determined automatically. This is done by systematically increasing their values until the DFT or memory kernel are identical within a (quite tight) tolerance.