Skip to content

Commit

Permalink
Cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
kbarros committed Jul 17, 2023
1 parent 64d2d94 commit c4c557d
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 10 deletions.
8 changes: 2 additions & 6 deletions src/SpinWaveTheory/SWTCalculations.jl
Original file line number Diff line number Diff line change
Expand Up @@ -65,12 +65,8 @@ function swt_hamiltonian!(swt::SpinWaveTheory, k̃ :: Vector{Float64}, Hmat::Mat
isculled && break

### Bilinear exchange
if coupling.bilin isa Number
J = Mat3(coupling.bilin*I)
else
J = coupling.bilin
end


J = Mat3(coupling.bilin*I)
sub_i, sub_j, ΔRδ = bond.i, bond.j, bond.n

tTi_μ = s̃_mat[:, :, :, sub_i]
Expand Down
3 changes: 2 additions & 1 deletion src/System/Interactions.jl
Original file line number Diff line number Diff line change
Expand Up @@ -316,10 +316,11 @@ function set_forces_aux!(B, dipoles::Array{Vec3, 4}, ints::Interactions, sys::Sy
if !iszero(coupling.biquad)
J = coupling.biquad
if sys.mode == :dipole
# Renormalization procedure introduces a factor r and a
# Heisenberg term, https://arxiv.org/abs/2304.03874.
Sᵢ = (sys.Ns[site1]-1)/2
Sⱼ = (sys.Ns[site2]-1)/2
S = (Sᵢ*Sⱼ)
# Renormalization introduces a factor r and a Heisenberg term
r = (1 - 1/S + 1/4S^2)
B[site1] -= J * (2r*sⱼ*(sᵢsⱼ) - sⱼ/2)
B[site2] -= J * (2r*sᵢ*(sᵢsⱼ) - sᵢ/2)
Expand Down
2 changes: 2 additions & 0 deletions src/System/OnsiteCoupling.jl
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@ function OnsiteCoupling(sys::System, matrep::Matrix{ComplexF64}, N)
end


# k-dependent renormalization of Stevens operators O[k,q] as derived in
# https://arxiv.org/abs/2304.03874.
function anisotropy_renormalization(N)
S = (N-1)/2
return ((1), # k=1
Expand Down
4 changes: 2 additions & 2 deletions src/System/System.jl
Original file line number Diff line number Diff line change
Expand Up @@ -436,8 +436,8 @@ spin_operators(sys::System{N}, site::Site) where N = spin_matrices(N=sys.Ns[to_a
stevens_operators(sys, site::Int)
Returns a generator of Stevens operators appropriate to an atom or
[`Site`](@ref) index. The return value `O` can be indexed as `O[q,m]`, where ``0
q ≤ 6`` labels an irrep and ``m = -q, …, q``. This will produce an ``N×N``
[`Site`](@ref) index. The return value `O` can be indexed as `O[k,q]`, where ``0
k ≤ 6`` labels an irrep and ``q = -k, …, k``. This will produce an ``N×N``
matrix of appropriate dimension ``N``.
"""
stevens_operators(sys::System{N}, i::Int) where N = StevensMatrices(sys.Ns[i])
Expand Down
2 changes: 1 addition & 1 deletion src/System/Types.jl
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ mutable struct System{N}
# inhomogeneous (defined for every cell in the system).
interactions_union :: Union{Vector{Interactions}, Array{Interactions,4}}

# Optional long-range dipole-dipole interactions (Vector is mutable box)
# Optional long-range dipole-dipole interactions
ewald :: Union{Ewald, Nothing}

# Dynamical variables and buffers
Expand Down

0 comments on commit c4c557d

Please sign in to comment.