Recently I got a shocking discovery while working on "skyrmions". I am using Mathematica to help me in calculations. The calculation involves only derivatives, but different evaluations give different results, which are totally astonishing.
Here is the work.
define a "skyrmion" with the "CP1 field" Z[x,y]:
Z = {λ/Sqrt[(x^2 + y^2)^n + λ^2], (x + I y)^n/Sqrt[(x^2 + y^2)^n + λ^2]};
compute the magnetization by the formula $\boldsymbol{m} = Z^{\dagger}.\boldsymbol{\sigma}_i.Z$
m0 = (Conjugate[Z].PauliMatrix[#].Z) & /@ {1, 2, 3} // ComplexExpand; m = Simplify[m0, Assumptions -> x ∈ Reals && y ∈ Reals && λ ∈ Reals && n ∈ Integers]
which gives $\left\{\frac{2 \lambda \left(x^2+y^2\right)^{n/2} \cos (n \arg (x+i y))}{\lambda ^2+\left(x^2+y^2\right)^n},\frac{2 \lambda \left(x^2+y^2\right)^{n/2} \sin (n \arg (x+i y))}{\lambda ^2+\left(x^2+y^2\right)^n},\frac{\lambda ^2-\left(x^2+y^2\right)^n}{\lambda ^2+\left(x^2+y^2\right)^n}\right\}$
Calculate $(\partial_x \boldsymbol{m})^2 + (\partial_y \boldsymbol{m})^2$
Simplify[Sum[D[m[[ii]], x]^2 + D[m[[ii]], y]^2, {ii, 1, 3}] // ComplexExpand, Assumptions -> x ∈ Reals && y ∈ Reals && λ ∈ Reals && n ∈ Integers]
which gives $\frac{4 \lambda ^2 n^2 \left(x^2+y^2\right)^{n-1}}{\left(\lambda ^2+\left(x^2+y^2\right)^n\right)^2}$ on my computer (Mathematica 11 on both Linux and Windows).
This is bizarre because I know the correct answer should be TWICE the result.
So I tried to simplify the expression of m manually and replaced the code in step 2 by
m = {(2 (x^2 + y^2)^(n/2) λ Cos[n ArcTan[x, y]])/((x^2 + y^2)^n + λ^2),
(2 (x^2 + y^2)^(n/2) λ Sin[
n ArcTan[x, y]])/((x^2 + y^2)^n + λ^2),
(-(x^2 + y^2)^n + λ^2)/((x^2 + y^2)^n + λ^2)};
where I've replaced Arg[x+ Iy]
by ArcTan[x, y]
, which should be equivalent.
However, after this, reevaluating step 3 gives $\frac{8 \lambda ^2 n^2 \left(x^2+y^2\right)^{n-1}}{\left(\lambda ^2+\left(x^2+y^2\right)^n\right)^2}$
It is a critical moment for me because, if I am not to resolve this issue, I will give up using Mathematica, which I really don't want to.
Can anyone help me? Where is the problem? Anyone has similar problems before?