Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Fix a bug with irreducible kpoints in IBZ #46

Merged
merged 2 commits into from
Nov 4, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 11 additions & 6 deletions toolbox/test_extend.jl
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ using PyCall
const PySpatial = PyNULL()
using BrillouinZoneMeshes.LinearAlgebra
using SymmetryReduceBZ
using SymmetryReduceBZ.Symmetry: calc_ibz, inhull
using SymmetryReduceBZ.Symmetry: calc_ibz, inhull, calc_pointgroup, complete_orbit
import SymmetryReduceBZ.Utilities: get_uniquefacets
import QHull
include("default_colors.jl")
Expand Down Expand Up @@ -132,9 +132,9 @@ convention = "ordinary"

br = BZMeshes.Brillouin(lattice=lattice, atoms=atoms, positions=positions)
#br = BZMeshes.Brillouin(lattice=lattice)
msize = (8, 8, 8)
msize = (4, 4, 4)

bzmesh = UniformBZMesh(br=br, size=msize, shift=[false, false, false])
bzmesh = UniformBZMesh(br=br, size=msize, shift=[true, true, true])
meshmap = MeshMap(bzmesh)

recip_lattice = lattice_vector(bzmesh)
Expand Down Expand Up @@ -168,10 +168,15 @@ println(fullmesh)
reducedmesh = [fullmesh[i] for i in meshmap.irreducible_indices]

reducedmesh = []
pointgroup = calc_pointgroup(Matrix{Float64}(lattice_vector(bzmesh)))
points = [ibz.points[i, :] for i in 1:size(ibz.points, 1)]
for idx in meshmap.irreducible_indices
sym_points = [fullmesh[pidx] for pidx in meshmap.inv_map[idx]]
points = [ibz.points[i, :] for i in 1:size(ibz.points, 1)]
point = get_closest_point(points, sym_points)
# sym_points = [fullmesh[pidx] for pidx in meshmap.inv_map[idx]]
orbit = complete_orbit(fullmesh[idx], Matrix{Float64}.(pointgroup))
orbit = [orbit[:, i] for i in 1:size(orbit, 2)]
# println(size(orbit))
point = get_closest_point(points, orbit)
# println(sym_points, " -> ", point)
push!(reducedmesh, point)
end

Expand Down