diff --git a/examples/fei2_tutorial.jl b/examples/fei2_tutorial.jl index 8a3cce87c..585251f89 100644 --- a/examples/fei2_tutorial.jl +++ b/examples/fei2_tutorial.jl @@ -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]"]) diff --git a/src/SpinWaveTheory/SpinWaveTheory.jl b/src/SpinWaveTheory/SpinWaveTheory.jl index 9a96bb7f0..49b35f743 100644 --- a/src/SpinWaveTheory/SpinWaveTheory.jl +++ b/src/SpinWaveTheory/SpinWaveTheory.jl @@ -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 @@ -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