spirit-code / spirit

Atomistic Spin Simulation Framework
http://spirit-code.github.io
MIT License
118 stars 52 forks source link

Core: Gradient_DDI has wrong prefactor #444

Closed MSallermann closed 6 years ago

MSallermann commented 6 years ago

Hamiltonian_Heisenberg::Gradient_DDI( ... ) currently has the wrong prefactor. One mu_B too much.

It should say: scalar mult = C::mu_0 * C::mu_B / ( 4*C::Pi * 1e-30 );

instead of: scalar mult = C::mu_0 * std::pow(C::mu_B, 2) / ( 4*C::Pi * 1e-30 );

MSallermann commented 6 years ago

It turns out that I was wrong. As the gradient is intended to be the derivation with respect to the spin-directions (not the magnetic moments!) std::pow(C::mu_B, 2) is actually correct.