Sensible noise#158
Merged
Merged
Conversation
JonathanMaes
approved these changes
Jun 3, 2026
lamoreel
approved these changes
Jun 4, 2026
Open
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
The Idea
The idea is to expand the sensible time step calculation with thermal noise
$dt = f / \max{(|\tau|)}$ $f$ a sensible factor. This slightly complicates things, because the thermal noise torque depends on the time step. Take $n$ as all thermal noise and prefactors except the time step $dt$ , then
$\tau \rightarrow \tau + \frac{1}{\sqrt{dt}} n$
$\max{\left( |\tau + \frac{1}{\sqrt{dt}} n | \right)} \quad \le \quad \max{(|\tau|)} + \frac{1}{\sqrt{dt}} \max{(|n|)}$
with
To deal with the maximum and norm, I used
This becomes a second order equation to solve.
One bug I encountered was when noise dominates over torque, which can easily happen with minimized magnetization, that the sensible time step would become identically 0 due to numerical limitations. In this limit I used a different function.
Graphing Behavior
To check this visually, we can move to dimensionless parameters. We can define dimensionless temperature
$x = N^2 / (f \mathcal{T})$ $N$ the max norm of noise (sqrt of temperature) and $\mathcal{T}$ the max norm of torque in the system. We can also define a dimensionless time step.
$y = dt * \mathcal{T} / f$ $\mathcal{T}$ and $f$ constant (in a skyrmion system) and varying temperature, we get the following time step estimates.

$x=0$ we get the old sensible time step formula ($y=1$ ). Adding any noise decreases this time step, where eventually noise will dominate.
with
Keeping
At
We can see that this behaves sensibly. Inspired by all cases of this figure, I added the tests.
Consistency
One thing that bothers me is that the sensible time step is now random, because taking the max norm of the noise is random. It is possible to estimate the expected maximum norm of the thermal noise. First, you can simply take the maximum pre-factor of all physical variables. For the noise itself, each norm of 3 random Gaussians is distributed as a$\chi_3$ (or Maxwell-Boltzmann) distribution. The maximum of a collection of these numbers depends on the number of cells in the geometry. Using Extreme Value Theory, the expected value of this maximum can be calculated in the limit of a large number of cells. This works fairly well, as seen in the following figure.

The Problem
The problem in the code base, is that this would require each
DynamicEquationto keep track of an extraQuantityEvaluator, simply for theTimesolverto estimate the noise about once per simulation if temperature is non-zero. This felt so stupid, that I did not implement it.