Skip to content

Commit

Permalink
Cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
kbarros committed Aug 4, 2023
1 parent 131fbe3 commit 29424bd
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 35 deletions.
2 changes: 1 addition & 1 deletion examples/fei2_tutorial.jl
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@ swt = SpinWaveTheory(sys_min);
# provided $q$-points with given `density`.
rv = reciprocal_vectors(cryst)
points = [rv*p for p in [[0,0,0], [1,0,0], [0,1,0], [1/2,0,0], [0,1,0], [0,0,0]]]
density = 600
density = 50
path, numbers = connected_path(points, density);
xticks = (numbers, ["[0,0,0]", "[1,0,0]", "[0,1,0]", "[1/2,0,0]", "[0,1,0]", "[0,0,0]"])

Expand Down
37 changes: 3 additions & 34 deletions src/SpinWaveTheory/SpinWaveTheory.jl
Original file line number Diff line number Diff line change
Expand Up @@ -35,14 +35,13 @@ function Base.show(io::IO, ::MIME"text/plain", swt::SpinWaveTheory)
# modename = swt.dipole_corrs ? "Dipole correlations" : "Custom correlations"
modename = "Dipole correlations"
printstyled(io, "SpinWaveTheory [$modename]\n"; bold=true, color=:underline)
println(io, "Atoms in magnetic supercell: $(length(swt.positions))")
println(io, "Atoms in magnetic supercell: $(natoms(swt.sys.crystal))")
end

function num_bands(swt::SpinWaveTheory)
(; sys) = swt
Nm, Ns = length(sys.dipoles), sys.Ns[1] # number of magnetic atoms and dimension of Hilbert space
Nf = sys.mode == :SUN ? Ns-1 : 1
return Nf * Nm
nbosons = sys.mode == :SUN ? sys.Ns[1]-1 : 1
return nbosons * natoms(sys.crystal)
end


Expand Down Expand Up @@ -160,33 +159,3 @@ function SpinWaveTheory(sys::System{N}; energy_ϵ::Float64=1e-8, energy_tol::Flo
recipvecs = reciprocal_vectors(sys.crystal)
return SpinWaveTheory(sys, s̃_mat, T̃_mat, Q̃_mat, c′_coef, R_mat, positions, recipvecs, energy_ϵ, energy_tol)
end



# """
# chemical_to_magnetic

# Convert the components of a wavevector from the original Brillouin zone (of the chemical lattice) to the reduced Brillouin zone (BZ)
# (of the magnetic lattice). \
# This is necessary because components in the reduced BZ are good quantum numbers.
# `K` is the reciprocal lattice vector, and `k̃` is the components of wavevector in the reduced BZ. Note `k = K + k̃`
# """
# function chemical_to_magnetic(swt::SpinWaveTheory, k)
# k = Vec3(k)
# α = swt.recipvecs_mag \ k
# k̃ = Vector{Float64}(undef, 3)
# K = Vector{Int}(undef, 3)
# for i = 1:3
# if abs(α[i]) < eps()
# K[i] = k̃[i] = 0.0
# else
# K[i] = Int(round(floor(α[i])))
# k̃[i] = α[i] - K[i]
# end
# @assert k̃[i] ≥ 0.0 && k̃[i] < 1.0
# end
# k_check = swt.recipvecs_mag * (K + k̃)
# @assert norm(k - k_check) < 1e-12

# return K, k̃
# end

0 comments on commit 29424bd

Please sign in to comment.