SunnySuite / Sunny.jl

Spin dynamics and generalization to SU(N) coherent states
Other
79 stars 19 forks source link

Missing U(1) gauge invariance in :dipole mode? #216

Closed kbarros closed 7 months ago

kbarros commented 8 months ago

Inside SpinWaveTheory.jl, for :dipole mode, we define a quantization axis via the rotation

        # Build `R = exp(-i ϕ Sᶻ) exp(-i θ Sʸ)`, with `R * [0, 0, 1] = n`. This
        # specific choice of gauge seems to be important.
        θ = acos(n[3])       # polar angle
        ϕ = atan(n[2], n[1]) # azimuthal
        R = SA[-sin(ϕ) -cos(ϕ)*cos(θ) cos(ϕ)*sin(θ);
                cos(ϕ) -sin(ϕ)*cos(θ) sin(ϕ)*sin(θ);
                  0.0          sin(θ)        cos(θ)]

One can introduce an additional change of "U(1) gauge" by rotation about the quantization axis:

            ϕ = 0.53
            R = R * SA[
                -sin(ϕ) -cos(ϕ)     0;
                 cos(ϕ) -sin(ϕ)     0;
                 0.0          0     1
            ]

Doing so, however, will cause many tests to fail. We should understand why.

To debug this, one can checkout the the branch test_u1 and execute

using Sunny, LinearAlgebra

latvecs = lattice_vectors(1, 1, 10, 90, 90, 120)
cryst = Crystal(latvecs, [[0, 0, 0]])
sys = System(cryst, (2,1,1), [SpinInfo(1; S=1, g=1)], :dipole, seed=0)
set_exchange!(sys, 1, Bond(1, 1, [1,0,0]))
set_onsite_coupling!(sys, S -> 0.2*S[3]^2, 1)

sys.dipoles[1] = [1, 0, 0]
sys.dipoles[2] = [0, 0, 1]

for arbitrary_U1 in (true, false)
    swt = SpinWaveTheory(sys; arbitrary_U1)
    nmodes = length(sys.dipoles)
    H = zeros(ComplexF64, 2nmodes, 2nmodes)
    Sunny.swt_hamiltonian_dipole!(H, swt, Sunny.Vec3(0,0,0))
    println(eigvals(H))
end

#= Prints:
[-2.0143136504653643, -0.09999999000000004, 0.023843381590439083, 1.9904702988749243]
[-2.0506248923742554, -0.09999998999999979, 0.10000001000000011, 1.9506249123742552]
=#

If there were true U(1) gauge invariance, I would expect the two lines of printed eigenvalues of H to be identical. Commenting out either exchange or anisotropy interaction will restore the U(1) gauge invariance.

kbarros commented 8 months ago

The problem seems to be very specific to having both exchange and anisotropy together.

kbarros commented 7 months ago

Fixed by https://github.com/SunnySuite/Sunny.jl/pull/223.