Skip to content

Sensible noise#158

Merged
ilateur merged 6 commits into
devfrom
sensible-noise
Jun 4, 2026
Merged

Sensible noise#158
ilateur merged 6 commits into
devfrom
sensible-noise

Conversation

@ilateur
Copy link
Copy Markdown
Collaborator

@ilateur ilateur commented Jun 3, 2026

The Idea

The idea is to expand the sensible time step calculation with thermal noise
$dt = f / \max{(|\tau|)}$
with $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$
To deal with the maximum and norm, I used
$\max{\left( |\tau + \frac{1}{\sqrt{dt}} n | \right)} \quad \le \quad \max{(|\tau|)} + \frac{1}{\sqrt{dt}} \max{(|n|)}$
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})$
with $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$
Keeping $\mathcal{T}$ and $f$ constant (in a skyrmion system) and varying temperature, we get the following time step estimates.
image
At $x=0$ we get the old sensible time step formula ($y=1$). Adding any noise decreases this time step, where eventually noise will dominate.
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.
image

The Problem

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

@ilateur ilateur requested review from JonathanMaes and lamoreel June 3, 2026 10:51
@ilateur ilateur self-assigned this Jun 3, 2026
@ilateur ilateur added the bug Something isn't working label Jun 3, 2026
@ilateur ilateur added this to the v1.2.1 milestone Jun 3, 2026
Comment thread src/core/timesolver.cpp Outdated
Comment thread src/core/timesolver.cpp
@ilateur ilateur merged commit f486164 into dev Jun 4, 2026
@ilateur ilateur mentioned this pull request Jun 4, 2026
@ilateur ilateur deleted the sensible-noise branch June 5, 2026 09:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants