Skip to content

Commit ecc99dd

Browse files
committed
don't normalize bravaistypes by default; change to keyword argument normalize
- bump version to v0.3.8
1 parent 8a95fe2 commit ecc99dd

File tree

4 files changed

+23
-15
lines changed

4 files changed

+23
-15
lines changed

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name = "Crystalline"
22
uuid = "ae5e2be0-a263-11e9-351e-f94dad1eb351"
33
authors = ["Thomas Christensen <[email protected]>"]
4-
version = "0.3.7"
4+
version = "0.3.8"
55

66
[deps]
77
Combinatorics = "861a8166-3701-5b0c-9a16-15d98fcdc6aa"

src/bravais.jl

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@ way as to ensure that the sampling is uniform over the joint
190190
interval [-1/`lims[1]`, -1] ∪ [1, `lims[2]`].
191191
192192
This is useful for ensuring an even sampling of numbers that are
193-
either smaller or larger than unity. Eg. for `x = relrand((0.2,5.0))`,
193+
either smaller or larger than unity. E.g. for `x = relrand((0.2,5.0))`,
194194
`x` is equally probable to fall in inv(`x`)∈[1,5] or `x`∈[1,5].
195195
"""
196196
function relrand(lims::NTuple{2,<:Real})
@@ -312,18 +312,22 @@ const CRYSTALSYSTEM_ABBREV = (ImmutableDict("linear"=>'l'),
312312
"""
313313
$(TYPEDSIGNATURES)
314314
315-
Return the Bravais type of `sgnum` in dimension `dim` as a string (as the concatenation
315+
Return the Bravais type of `sgnum` in dimension `D` as a string (as the concatenation
316316
of the single-character crystal abbreviation and the centering type).
317317
318-
## Note
318+
## Keyword arguments
319319
320-
If the centering type associated with `sgnum` is `'A'`, we chose to "normalize" the
321-
centering to `'C'`, since the difference between `A` and `C` centering only amounts to a
322-
basis change. This ensures that `unique(bravaistype.(1:230, 3))` creates only 14 Bravais
323-
types, rather than 15.
324-
This impacts space groups 38-41, whose Bravais types are normalized from `oA` to `oC`.
320+
If the centering type associated with `sgnum` is `'A'`, we can choose (depending on the
321+
keyword argument `normalize`, defaulting to `false`) to "normalize" to the centering type
322+
`'C'`, since the difference between `A` and `C` centering only amounts to a basis change.
323+
With `normalize=true` we then have only the canonical 14 Bravais type, i.e.
324+
`unique(bravaistype.(1:230, 3), normalize=true)` returns only 14 distinct types, rather
325+
than 15.
326+
327+
This only affects space groups 38-41 (normalizing their conventional Bravais types from
328+
`oA` to `oC`).
325329
"""
326-
@inline function bravaistype(sgnum::Integer, D::Integer=3)
330+
@inline function bravaistype(sgnum::Integer, D::Integer=3; normalize::Bool=false)
327331
cntr = centering(sgnum, D)
328332
system = crystalsystem(sgnum, D)
329333

@@ -333,10 +337,9 @@ This impacts space groups 38-41, whose Bravais types are normalized from `oA` to
333337
# the same Bravais lattice; there is no significance in trying to
334338
# differentiate them - if we do, we end up with 15 Bravais lattices in
335339
# 3D rather than 14: so we manually fix that here:
336-
if cntr == 'A'
337-
println(sgnum)
340+
if normalize
341+
cntr = cntr == 'A' ? 'C' : cntr
338342
end
339-
cntr = cntr == 'A' ? 'C' : cntr
340343

341344
# pick the correct crystal system abbreviation from CRYSTALSYSTEM_ABBREV
342345
# and return its concatenation with the (now-"normalized") centering type

src/special_representation_domain_kpoints.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ See `is_holosymmetric` for description of holosymmetric space groups and of
181181
their connection to the representation and basic domains Φ and Ω.
182182
"""
183183
function _find_holosymmetric_sgnums(D::Integer)
184-
bravaistypes = bravaistype.(OneTo(MAX_SGNUM[D]), D)
184+
bravaistypes = bravaistype.(OneTo(MAX_SGNUM[D]), D, normalize=true)
185185
uniquebravaistypes = unique(bravaistypes) # Bravais types (1, 5, & 14 in 1D, 2D, & 3D)
186186

187187
# find maximum point groups for each bravais type
@@ -246,7 +246,7 @@ function find_holosymmetric_superpointgroup(G::SpaceGroup)
246246
# between hP and hR need to be accounted for explicitly, so there we
247247
# have to explicitly ensure that we only compare with pointgroups
248248
# that indeed match the lattice type (hR and hP have different holohedries)
249-
bt = bravaistype(num(G), D)
249+
bt = bravaistype(num(G), D, normalize=true)
250250
for pglab in HOLOSYMMETRIC_PG_FOR_BRAVAISTYPE[bt]
251251
# this check is actually redunant for everything except the hR groups; we do it anyway
252252
P = pointgroup(pglab, D) # holosymmetric point group (::PointGroup)

src/wyckoff.jl

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,11 @@ julia> ops = [opʰ∘opᵍ for opʰ in cosets(g) for opᵍ in g];
172172
julia> Set(sg) == Set(ops)
173173
true
174174
```
175+
176+
## Terminology
177+
178+
Mathematically, the site symmetry group is a *stabilizer group* for a Wyckoff position,
179+
in the same sense that the little group of **k** is a stabilizer group for a **k**-point.
175180
"""
176181
function SiteGroup(sg::SpaceGroup{D}, wp::WyckPos{D}) where D
177182
Nsg = order(sg)

0 commit comments

Comments
 (0)