Note that electron charge is negative, so magnetic moment $\mu$ should point opposite to the angular momentum dipole $\mathbf{S}$. The explicit minus side is needed because, in magnetism, it is conventional to take $g \approx 2$ positive (this is the electron-spin g-factor convention). Note that the Bohr magneton $\mu_B$ is always positive.
As of this writing (June, 2024), SpinW also has a sign error in its Zeeman coupling.
Our guidance to users:
Sunny 0.5 and prior: To get physically correct results, one can reverse the sign of the external field. (But note that there are additional bugs in the direction of momentum transfer.)
Sunny 0.6 and after: No action needed, the bugs are now fixed!
Sunny currently defines:
This is the wrong sign! The correct formula is,
$$\hat{\mu} = - \mu_B g \hat{\mathbf{S}}.$$
Note that electron charge is negative, so magnetic moment $\mu$ should point opposite to the angular momentum dipole $\mathbf{S}$. The explicit minus side is needed because, in magnetism, it is conventional to take $g \approx 2$ positive (this is the electron-spin g-factor convention). Note that the Bohr magneton $\mu_B$ is always positive.
As of this writing (June, 2024), SpinW also has a sign error in its Zeeman coupling.
Our guidance to users: