Skip to content

Commit 09eee83

Browse files
committed
Merge branch 'master' into bandpaths-data
2 parents 8aa1889 + 8858586 commit 09eee83

9 files changed

+101
-28
lines changed

.github/workflows/ci.yml

+5-13
Original file line numberDiff line numberDiff line change
@@ -21,29 +21,21 @@ jobs:
2121
- x64
2222
steps:
2323
- uses: actions/checkout@v4
24+
- uses: actions/cache@v4
2425
- uses: julia-actions/setup-julia@v1
2526
with:
2627
version: ${{ matrix.version }}
2728
arch: ${{ matrix.arch }}
28-
- uses: actions/cache@v1
29-
env:
30-
cache-name: cache-artifacts
31-
with:
32-
path: ~/.julia/artifacts
33-
key: ${{ runner.os }}-test-${{ env.cache-name }}-${{ hashFiles('**/Project.toml') }}
34-
restore-keys: |
35-
${{ runner.os }}-test-${{ env.cache-name }}-
36-
${{ runner.os }}-test-
37-
${{ runner.os }}-
29+
- uses: julia-actions/cache@v1
3830
- run: | # force use of the local version of Bravais (instead of just the latest registered version)
3931
julia --color=yes --project -e '
4032
using Pkg
4133
Pkg.develop(PackageSpec(path=joinpath(pwd(), "Bravais")))'
4234
shell: bash # avoid escaping issues w/ pwsh on Windows (cf. https://github.com/julia-actions/setup-julia#matrix-testing)
43-
- uses: julia-actions/julia-buildpkg@latest
44-
- uses: julia-actions/julia-runtest@latest
35+
- uses: julia-actions/julia-buildpkg@v1
36+
- uses: julia-actions/julia-runtest@v1
4537
continue-on-error: ${{ matrix.version == 'nightly' }}
4638
- uses: julia-actions/julia-processcoverage@v1
4739
- uses: codecov/codecov-action@v3
4840
with:
49-
file: lcov.info
41+
file: lcov.info

build/setup_2d_band_representations.jl

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ using Crystalline: irdim, constant, free, AbstractIrrep, iscorep,
55
import Crystalline: mulliken, realify, group
66
using StaticArrays
77

8-
# The implementation here follows Elcoro et al., Phys. Rev. B 97, 035139 (2018)
8+
# The implementation here follows Cano et al., Phys. Rev. B 97, 035139 (2018)
99
# (https://doi.org/10.1103/PhysRevB.97.035139), specifically, Sections II.C-D
1010

1111
# ---------------------------------------------------------------------------------------- #

build/setup_2d_littlegroup_irreps.jl

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ using Crystalline
55
# every group. The notation follows Bilbao's LKVEC tool [^1] entirely. Note that this
66
# implies some occasionally odd-looking choices, e.g. (see (*) marks below):
77
# - *Plane groups 3 & 4*: the X and Y labels are defined counter-intuitively, such that
8-
# X = (0,1/2) and Y = (1/2,0). This also differs from the definitions in other
9-
# the other primitive rectangular (op) Bravais lattices (i.e. 6, 7, & 8), which
8+
# X = (0,1/2) and Y = (1/2,0). This also differs from the definitions in the
9+
# other primitive rectangular (op) Bravais lattices (i.e. 6, 7, & 8), which
1010
# instead have X = (1/2,0) etc. The difference also exists for k-line labels.
1111
# - *Plane group 5 vs. 9*: although both are centred rectangular (oc) Bravais lattices,
1212
# their k-vector labels do not agree, but differ by coordinate permutations.

ext/CrystallineGraphMakieExt.jl

+1-1
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,7 @@ end
235235

236236
function Makie.plot(gr::GroupRelationGraph;
237237
axis = NamedTuple(), figure = NamedTuple(), kws...)
238-
f = Makie.Figure(resolution=(800,900); figure...)
238+
f = Makie.Figure(size=(800,900); figure...)
239239
f[1,1] = ax = Makie.Axis(f; axis...)
240240
p = Makie.plot!(ax, gr; kws...)
241241
return Makie.FigureAxisPlot(f, ax, p)

src/grouprelations/show.jl

+82-5
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ function Base.summary(io::IO, rels::GroupRelations{D,AG}) where {D,AG}
55
print(io, "GroupRelations{", AG, "} ⋕", rels.num, " (", iuc(rels.num, D),
66
") with ", length(rels), " elements")
77
end
8+
89
function Base.summary(io::IO, rel::GroupRelation{D,AG}) where {D,AG}
910
print(io, "GroupRelation{", AG, "} ⋕", rel.num)
1011
printstyled(io, is_tgleiche(rel.kind) ? "" : "";
@@ -18,15 +19,24 @@ function Base.show(io::IO, ::MIME"text/plain", rels::GroupRelations{D,AG}) where
1819
summary(io, rels)
1920
print(io, ":")
2021
for rel in values(rels)
21-
print(io, '\n')
22+
print(io, "\n ")
2223
_print_child(io, rel.num, rel.kind, rel.index)
2324
end
2425
end
2526

26-
function _print_child(io::IO, num::Int, kind::GleicheKind, index::Int)
27-
print(io, "", num)
28-
printstyled(io, is_tgleiche(kind) ? "" : "", color = is_tgleiche(kind) ? :green : :red)
29-
print(io, " (index ", index, ")")
27+
function _print_child(
28+
io::IO,
29+
num::Int,
30+
kind::Union{Nothing, GleicheKind},
31+
index::Union{Nothing, Int})
32+
print(io, "", num)
33+
if !isnothing(kind)
34+
printstyled(io, is_tgleiche(kind) ? "" : "";
35+
color = is_tgleiche(kind) ? :green : :red)
36+
end
37+
if !isnothing(index)
38+
printstyled(io, " (index ", index, ")"; color=:light_black)
39+
end
3040
end
3141

3242
function Base.show(io::IO, rels::GroupRelations{D,AG}) where {AG,D}
@@ -40,6 +50,7 @@ function Base.show(io::IO, rels::GroupRelations{D,AG}) where {AG,D}
4050
end
4151
print(io, "]")
4252
end
53+
4354
function Base.show(io::IO, ::MIME"text/plain", g::GroupRelation)
4455
summary(io, g)
4556
print(io, ":")
@@ -48,6 +59,7 @@ function Base.show(io::IO, ::MIME"text/plain", g::GroupRelation)
4859
print(io, ct)
4960
end
5061
end
62+
5163
function Base.show(io::IO, t::ConjugacyTransform{D}) where D
5264
print(io, "P = ")
5365
if isnothing(t.P) && isnothing(t.p)
@@ -64,4 +76,69 @@ function Base.show(io::IO, t::ConjugacyTransform{D}) where D
6476
replace(string(rationalize.(float(p))), r"//1([,|\]])"=>s"\1", "//"=>"/", "Rational{Int64}"=>""))
6577
end
6678
end
79+
end
80+
81+
function Base.summary(io::IO, gr::GroupRelationGraph{D, AG}) where {D,AG}
82+
print(io, "GroupRelationGraph",
83+
" (", gr.direction == SUPERGROUP ? "super" : "sub", "groups)",
84+
" of ", AG, "", first(gr.nums),
85+
" with ", length(gr.nums), " vertices")
86+
end
87+
function Base.show(io::IO, gr::GroupRelationGraph)
88+
summary(io, gr)
89+
print(io, ":")
90+
num = first(gr.nums) # find "base" group number
91+
_print_graph_leaves(io, gr, num, Bool[], nothing, nothing)
92+
end
93+
function _print_graph_leaves(
94+
io::IO,
95+
gr::GroupRelationGraph,
96+
num::Int,
97+
is_last::Vector{Bool},
98+
kind::Union{Nothing, GleicheKind},
99+
index::Union{Nothing, Int}
100+
)
101+
102+
# indicate "structure"-relationship of graph "leaves"/children via box-characters
103+
indent = length(is_last)
104+
print(io, "\n ")
105+
if indent 2
106+
for l in 1:indent-1
107+
if !is_last[l]
108+
printstyled(io, ""; color=:light_black)
109+
print(io, " ")
110+
else
111+
print(io, " ")
112+
end
113+
end
114+
end
115+
if indent > 0
116+
printstyled(io, last(is_last) ? "" : "", "─►"; color=:light_black)
117+
end
118+
119+
# print info about child
120+
_print_child(io, num, kind, index)
121+
122+
# now move on to children of current child; print info about them, recursively
123+
if !isnothing(kind) && kind == KLASSENGLEICHE
124+
# avoid printing recursively for klassengleiche as this implies infinite looping
125+
# NB: in principle, this means we don't show the entire structure of
126+
# `gr.infos`; but it is also really not that clear how to do this
127+
# properly for klassengleiche relations which are not a DAG but often
128+
# cyclic
129+
130+
# only one child and child is trivial group
131+
elseif length(gr.infos[num].children) == 1 && gr.infos[num].children[1].num == 1
132+
child = gr.infos[num].children[1]
133+
printstyled(io, " ╌╌►"; color=:light_black)
134+
_print_child(io, child.num, child.kind, child.index)
135+
136+
# multiple children/nontrivial children
137+
else
138+
N_children = length(gr.infos[num].children)
139+
for (i,child) in enumerate(gr.infos[num].children)
140+
child_is_last = vcat(is_last, i==N_children)
141+
_print_graph_leaves(io, gr, child.num, child_is_last, child.kind, child.index)
142+
end
143+
end
67144
end

src/grouprelations/types.jl

+1-1
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ struct GroupRelationGraph{D,AG} <: Graphs.AbstractGraph{Int}
4444
direction :: RelationKind # whether this is a sub- or supergroup relation
4545
end
4646
dim(::GroupRelationGraph{D}) where D = D
47-
47+
Base.getindex(gr::GroupRelationGraph, i::Integer) = getindex(gr.infos, i)
4848
# ---------------------------------------------------------------------------------------- #
4949
# Graphs.jl `AbstractGraph` interface for `GroupRelationGraph`
5050

src/notation.jl

+5-3
Original file line numberDiff line numberDiff line change
@@ -478,8 +478,8 @@ Return the Mulliken label of a point group irrep `pgir`.
478478
479479
## Notes
480480
This functionality is a simple mapping between the tabulated CDML point group irrep labels
481-
and associated Mulliken labels, using the listings from the Bilbao Crystallographic
482-
Database [^1].
481+
and associated Mulliken labels [^1], using the listings from the Bilbao Crystallographic
482+
Database [^2].
483483
484484
Ignoring subscript, the rough rules associated with assignment of Mulliken labels are:
485485
@@ -498,7 +498,9 @@ Ignoring subscript, the rough rules associated with assignment of Mulliken label
498498
describe here.
499499
500500
## References
501-
[^1]: Bilbao Crystallographic Database's
501+
[^1]: Mulliken, Report on Notation for the Spectra of Polyatomic Molecules,
502+
[J. Chem. Phys. *23*, 1997 (1955)](https://doi.org/10.1063/1.1740655).
503+
[^2]: Bilbao Crystallographic Database's
502504
[Representations PG program](https://www.cryst.ehu.es/cgi-bin/cryst/programs/representations_point.pl?tipogrupo=spg).
503505
"""
504506
function mulliken(pgir::PGIrrep{D}) where D

src/pointgroup.jl

+3-1
Original file line numberDiff line numberDiff line change
@@ -106,14 +106,16 @@ end
106106
Return the (crystallographic) point group irreps of the IUC label `iuclab` of dimension `D`
107107
as a `Vector{PGIrrep{D}}`.
108108
109+
See `Crystalline.PG_IUC2NUM[D]` for possible IUC labels in dimension `D`.
110+
109111
## Notation
110112
111113
The irrep labelling follows the conventions of CDML [^1] [which occasionally differ from
112114
those in e.g. Bradley and Cracknell, *The Mathematical Theory of Symmetry in Solids*
113115
(1972)].
114116
115117
To use Mulliken ("spectroscopist") irrep labels instead, set the keyword argument
116-
`mulliken = true` (default, `false). See also [`mulliken`](@ref).
118+
`mulliken = true` (default, `false`). See also [`mulliken`](@ref).
117119
118120
## Data sources
119121

src/utils.jl

+1-1
Original file line numberDiff line numberDiff line change
@@ -254,7 +254,7 @@ end
254254
# === misc functionality ===
255255

256256
"""
257-
isapproxin(x, itr) --> Bool
257+
isapproxin(x, itr, optargs...; kwargs...) --> Bool
258258
259259
Determine whether `x` ∈ `itr` with approximate equality.
260260
"""

0 commit comments

Comments
 (0)