Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Manual LGIrrep{3} additions for missing k-points in Φ-Ω #30

Merged
merged 4 commits into from
Sep 16, 2021
Merged
Show file tree
Hide file tree
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
14 changes: 11 additions & 3 deletions build/write_littlegroup_irreps.jl
Original file line number Diff line number Diff line change
Expand Up @@ -118,9 +118,17 @@ foreach(jldfile -> close(jldfile), values(Crystalline.LGIRREPS_JLDFILES))
foreach(jldfile -> close(jldfile), values(Crystalline.LGS_JLDFILES))

# 3D (from ISOTROPY)
include("build/ParseIsotropy.jl") # load the ParseIsotropy module which
using Main.ParseIsotropy # exports `parselittlegroupirreps`
__write_littlegroupirreps(parselittlegroupirreps())
include(joinpath((@__DIR__), "ParseIsotropy.jl")) # load the ParseIsotropy module
using Main.ParseIsotropy # (exports `parselittlegroupirreps`)
LGIRS_3D = parselittlegroupirreps()
# ... ISOTROPY is missing several irreps; we bring those in below, obtained from manual
# transcription of irreps from Bilbao; script below defines `LGIRS_add` which stores these
# manual additions (a Dict with `sgnum` keys)
include(joinpath((@__DIR__), "..", "data/lgirreps/manual_lgirrep_additions.jl"))
for (sgnum, lgirsd_add) in LGIRS_add # merge Bilbao additions with ISOTROPY irreps
merge!(LGIRS_3D[sgnum], lgirsd_add)
end
__write_littlegroupirreps(LGIRS_3D)

# 2D (from point group matching)
__write_littlegroupirreps(LGIRS_2D′)
Expand Down
Binary file modified data/lgirreps/3d/irreps_data.jld2
Binary file not shown.
Binary file modified data/lgirreps/3d/littlegroups_data.jld2
Binary file not shown.
644 changes: 644 additions & 0 deletions data/lgirreps/manual_lgirrep_additions.jl

Large diffs are not rendered by default.

36 changes: 4 additions & 32 deletions src/special_representation_domain_kpoints.jl
Original file line number Diff line number Diff line change
@@ -1,35 +1,7 @@
# The basic goal of this endeavor is only to find the irreps that
# are missing in ISOTROPY but feature in the bandreps from Bilbao.
# There are 145 such irreps, across 20 space groups, they are: (... I manually pieced this table together)
# ┌───────┬─────────────────────────────────────────────────────────────────────────────┬───────────────┬────────────────────────────────┐
# │ │ Missing │ Missing │ [NS≡nonsymmorph; S≡symmorph] │
# │ SGs │ LGIrrep labels │ KVec labels │ Match method │
# │───────┼─────────────────────────────────────────────────────────────────────────────┼───────────────┼────────────────────────────────│
# │ 23 │ WA₁, WA₂, WA₃, WA₄ │ WA │ S: MonoOrthTetraCubic ┐ │
# │ 24 │ WA₁ │ WA │ NS: Inherits from └ 23 │
# │ 82 │ PA₁, PA₂, PA₃, PA₄ │ PA │ S: MonoOrthTetraCubic │
# │ 121 │ PA₁, PA₂, PA₃, PA₄, PA₅ │ PA │ S: MonoOrthTetraCubic ┐ │
# │ 122 │ PA₁, PA₂ │ PA │ NS: Inherits from └ 121 │
# │ 143 │ HA₁, HA₂, HA₃, KA₁, KA₂, KA₃, PA₁, PA₂, PA₃ │ HA, KA, PA │ S: TriHex │
# │ 144 │ HA₁, HA₂, HA₃, KA₁, KA₂, KA₃, PA₁, PA₂, PA₃ │ HA, KA, PA │ NS: Orphan (type b) ┐ │
# │ 145 │ HA₁, HA₂, HA₃, KA₁, KA₂, KA₃, PA₁, PA₂, PA₃ │ HA, KA, PA │ NS: Orphan (type b) ┘ │
# │ 150 │ HA₁, HA₂, HA₃, KA₁, KA₂, KA₃, PA₁, PA₂, PA₃ │ HA, KA, PA │ S: TriHex │
# │ 152 │ HA₁, HA₂, HA₃, KA₁, KA₂, KA₃, PA₁, PA₂, PA₃ │ HA, KA, PA │ NS: Orphan (type b) ┐ │
# │ 154 │ HA₁, HA₂, HA₃, KA₁, KA₂, KA₃, PA₁, PA₂, PA₃ │ HA, KA, PA │ NS: Orphan (type b) ┘ │
# │ 157 │ HA₁, HA₂, HA₃, KA₁, KA₂, KA₃, PA₁, PA₂, PA₃ │ HA, KA, PA │ S: TriHex ───────┐ │
# │ 159 │ HA₁, HA₂, HA₃, KA₁, KA₂, KA₃, PA₁, PA₂, PA₃ │ HA, KA, PA │ NS: Inherits from └ 157 │
# │ 174 │ HA₁, HA₂, HA₃, HA₄, HA₅, HA₆, KA₁, KA₂, KA₃, KA₄, KA₅, KA₆, PA₁, PA₂, PA₃ │ HA, KA, PA │ S: TriHex │
# │ 189 │ HA₁, HA₂, HA₃, HA₄, HA₅, HA₆, KA₁, KA₂, KA₃, KA₄, KA₅, KA₆, PA₁, PA₂, PA₃ │ HA, KA, PA │ S: TriHex ───────┐ │
# │ 190 │ HA₁, HA₂, HA₃, KA₁, KA₂, KA₃, KA₄, KA₅, KA₆, PA₁, PA₂, PA₃ │ HA, KA, PA │ NS: Inherits from └ 189 │
# │ 197 │ PA₁, PA₂, PA₃, PA₄ │ PA │ S: MonoOrthTetraCubic ┐ │
# │ 199 │ PA₁, PA₂, PA₃ │ PA │ NS: Inherits from └ 197 │
# │ 217 │ PA₁, PA₂, PA₃, PA₄, PA₅ │ PA │ S: MonoOrthTetraCubic ┐ │
# │ 220 │ PA₁, PA₂, PA₃ │ PA │ NS: Inherits from └ 217 │
# └───────┴─────────────────────────────────────────────────────────────────────────────┴───────────────┴────────────────────────────────┘
# Of course, in principle, we might consider trying to create ALL the missing points from Φ-Ω,
# but for what we need, this is sufficient.
# Of these space groups, only sg 82 has a nontrivial symmetry indicator classification for
# bosons with TR.
# The basic goal of this endeavor is only to find the k-points and irreps that
# are missing in ISOTROPY still belong to representation domain Φ (ISOTROPY all points from
# the basic domain Ω and some - but not all - from Φ).
# TODO: Unfortunately, it doesn't currently work.

# --- STRUCTS ---

Expand Down
25 changes: 12 additions & 13 deletions src/symops.jl
Original file line number Diff line number Diff line change
Expand Up @@ -379,7 +379,8 @@ function check_multtable_vs_ir(lgir::LGIrrep{D}, αβγ=nothing) where D
primitive_ops = primitivize.(ops, cntr) # must do multiplication table in primitive basis, cf. choices in `compose`
check_multtable_vs_ir(MultTable(primitive_ops), lgir, αβγ)
end
function check_multtable_vs_ir(mt::MultTable, ir::AbstractIrrep, αβγ=nothing)
function check_multtable_vs_ir(mt::MultTable, ir::AbstractIrrep, αβγ=nothing;
verbose::Bool=false)
havewarned = false
Ds = ir(αβγ)
ops = operations(ir)
Expand Down Expand Up @@ -419,19 +420,17 @@ function check_multtable_vs_ir(mt::MultTable, ir::AbstractIrrep, αβγ=nothing)
end
if !match
checked[i,j] = false
if !havewarned
if verbose
println("""Provided irreps do not match group multiplication table for group $(num(ir)) in irrep $(label(ir)):
First failure at (row,col) = ($(i),$(j));
Expected idx $(mtidx), got idx $(findall(≈(Dⁱʲ), Ds))""")
print("Expected irrep = ")
if ir isa LGIrrep
println(cis(ϕ)*Ds[mtidx])
else
println(Dⁱʲ)
end
println("Got irrep = $(Dⁱʲ)")
if !havewarned && verbose
println("""Provided irreps do not match group multiplication table for group $(num(ir)) in irrep $(label(ir)):
First failure at (row,col) = ($(i),$(j));
Expected idx $(mtidx), got idx $(findall(≈(Dⁱʲ), Ds))""")
print("Expected irrep = ")
if ir isa LGIrrep
println(cis(ϕ)*Ds[mtidx])
else
println(Dⁱʲ)
end
println("Got irrep = $(Dⁱʲ)")
havewarned = true
end
end
Expand Down
59 changes: 20 additions & 39 deletions test/bandrep.jl
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ end
@testset "k-vectors required by BandRepSet analysis" begin
allpaths = false
spinful = false
verbose = false
debug = false

@testset "Complex (no TR) irreps" begin
# --- test complex-form irreps (not assuming time-reversal symmetry) ---
Expand All @@ -21,35 +21,20 @@ for (sgnum, lgirsd) in enumerate(LGIRS)

for (iridx_BRS, irlab_BRS) in enumerate(irlabs_BRS)
klab = klabel(irlab_BRS)
if irlab_BRS ∉ irlabs_ISO
if verbose
@info "Cannot find complex irrep $(irlab_BRS) in ISOTROPY dataset (sgnum = $sgnum)"
end
@test_broken false
kidx_BRS = findfirst(==(klab), klabs_BRS)

# test that for each of the (P,K,W,H)A k-label variants, that the associated k-vector is
# just equal to minus the kvector in the (P,K,W,H) variant (i.e. without the 'A' postscript)
@test -BRS.kvs[kidx_BRS] == kvec(first(lgirsd[klab[1:1]]))

# TODO: to get the irreps of these variants, we need to follow the prescription
# detailed in CDML p. 69-73 (though that won't work, presumably, for sgnum=205)
# This is the subject of Cracknell & Davies 1976b (On the completeness of tables
# of irreducible representations of the classical space groups)
else
kidx_BRS = findfirst(==(klab), klabs_BRS)
@test irlab_BRS ∈ irlabs_ISO
if debug && irlab_BRS ∉ irlabs_ISO
@info "Cannot find complex irrep $(irlab_BRS) in ISOTROPY dataset (sgnum = $sgnum)"
end

# test that ISOTROPY's labelling & representation of k-vectors agree with BCD
@test BRS.kvs[kidx_BRS] == kvec(first(lgirsd[klab]))
if verbose
if BRS.kvs[kidx_BRS] ≠ kvec(first(lgirsd[klab]))
println("Different definitions of k-point labels in space group ", sgnum)
println(" BRS, ", klab, ": ",string(BRS.kvs[kidx_BRS]))
println(" ISO, ", klab, ": ",string(kvec(first(lgirsd[klab]))))
println()
end
end
# test that ISOTROPY's labelling & representation of k-vectors agree with BCD
kidx_BRS = findfirst(==(klab), klabs_BRS)
@test BRS.kvs[kidx_BRS] == kvec(first(lgirsd[klab]))
if debug && BRS.kvs[kidx_BRS] ≠ kvec(first(lgirsd[klab]))
println("Different definitions of k-point labels in space group ", sgnum)
println(" BRS, ", klab, ": ",string(BRS.kvs[kidx_BRS]))
println(" ISO, ", klab, ": ",string(kvec(first(lgirsd[klab]))), "\n")
end

end
end
end
Expand All @@ -74,18 +59,14 @@ for (sgnum, lgirsd) in enumerate(LGIRS)

for (iridx_BRS, irlab_BRS) in enumerate(irlabs_BRS)
klab = klabel(irlab_BRS)
if irlab_BRS ∉ realirlabs_ISO
if verbose
@info "Cannot find real irrep $(irlab_BRS) in ISOTROPY dataset (sgnum = $sgnum)"
end
@test_broken false

else
kidx_BRS = findfirst(==(klab), klabs_BRS)

# test that ISOTROPY's labelling & representation of k-vectors agree with BCD
@test BRS.kvs[kidx_BRS] == kvec(first(lgirsd[klab]))
@test irlab_BRS ∈ realirlabs_ISO
if debug && irlab_BRS ∉ realirlabs_ISO
@info "Cannot find real irrep $(irlab_BRS) in ISOTROPY dataset (sgnum = $sgnum)"
end

# test that ISOTROPY's labelling & representation of k-vectors agree with BCD
kidx_BRS = findfirst(==(klab), klabs_BRS)
@test BRS.kvs[kidx_BRS] == kvec(first(lgirsd[klab]))
end
end
end
Expand Down
25 changes: 22 additions & 3 deletions test/parsed_vs_loaded_littlegroup_irreps.jl
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,31 @@ if !isdefined(Main, :LGIRS)
end

@testset "Test equivalence of parsed and loaded LGIrreps" begin
for sgnum in 1:230
addition_klabs = ("WA", "HA", "KA", "PA")
for sgnum in 1:MAX_SGNUM[3]
lgirsd′ = LGIRS′[sgnum] # parsed variant
lgirsd = LGIRS[sgnum] # loaded variant
lgirsd = LGIRS[sgnum] # loaded variant; may contain more irreps than parsed ISOTROPY (cf. `manual_lgirrep_additions.jl`)

# test we have same k-points in `lgirsd` and `lgirsd′` (or, possibly more in
# k-points `lgirsd`, if it contains manual additions)
klabs = sort!(collect(keys(lgirsd)))
klabs′ = sort!(collect(keys(lgirsd′)))
if klabs == klabs′
@test length(lgirsd) == length(lgirsd′)
else
# in case loaded irreps contain manually added 'xA'-type k-points (either "HA",
# "HA", "KA", or "PA", see `addition_klabs`) from Φ-Ω
extra_klabidxs = findall(klab -> klab ∉ klabs′, klabs)::Vector{Int}
extra_klabs = klabs[extra_klabidxs]
@test length(lgirsd) > length(lgirsd′) && all(∈(addition_klabs), extra_klabs)
end

@test length(lgirsd) == length(lgirsd′)
for (kidx, (klab, lgirs)) in enumerate(lgirsd)
if !haskey(lgirsd′, klab) && klab ∈ addition_klabs
# `lgirs` is a manual addition that is not in ISOTROPY; nothing to compare
continue
end

lgirs′ = lgirsd′[klab]
@test length(lgirs) == length(lgirs′)
for (iridx, lgir) in enumerate(lgirs)
Expand Down