Groups
All groups in Crystalline are concrete instances of the abstract supertype Crystalline.AbstractGroup{D}, referring to a group in D dimensions. Crystalline.AbstractGroup{D} is itself a subtype of AbstractVector{SymOperation{D}}. Crystalline currently supports five group types: SpaceGroup, PointGroup, LittleGroup, SubperiodicGroup, SiteGroup, and MSpaceGroup.
Example: space groups
The one, two, and three-dimensional space groups are accessible via spacegroup, which takes the space group number sgnum and dimension D or Val(D) as input and returns a SpaceGroup{D}:
using Crystalline
D = 3 # dimension
sgnum = 16 # space group number (≤2 in 1D, ≤17 in 2D, ≤230 in 3D)
sg = spacegroup(sgnum, D) # or `spacegroup(sgnum, Val(D))`SpaceGroup{3} ⋕16 (P222) with 4 operations:
1
2₀₀₁
2₀₁₀
2₁₀₀Where practical, spacegroup should be called with a Val(D) dimension to ensure type stability; here and elsewhere in the documentation, we will often use D::Int instead for simplicity.
By default, the returned operations are given in the conventional setting of the International Tables of Crystallography, Volume A (ITA). Conversion to a primitive basis (in the CDML setting) can be accomplished via primitivize.
In addition to space groups, Crystalline.jl provides access to the operations of point groups (pointgroup), little groups (littlegroups), subperiodic groups (subperiodicgroup; including rod, layer, and frieze groups), site symmetry groups (sitegroup and sitegroups), and magnetic space groups (mspacegroup).
Multiplication tables
We can compute the multiplication table of a space group (under the previously defined notion of operator composition) using MultTable:
MultTable(sg)4×4 MultTable{SymOperation{3}}:
──────┬────────────────────────
│ 1 2₀₀₁ 2₀₁₀ 2₁₀₀
──────┼────────────────────────
1 │ 1 2₀₀₁ 2₀₁₀ 2₁₀₀
2₀₀₁ │ 2₀₀₁ 1 2₁₀₀ 2₀₁₀
2₀₁₀ │ 2₀₁₀ 2₁₀₀ 1 2₀₀₁
2₁₀₀ │ 2₁₀₀ 2₀₁₀ 2₀₀₁ 1
──────┴────────────────────────
Alternatively, exploiting overloading of the *-operator, "raw" multiplication tables can be constructed via a simple outer product:
sg .* permutedims(sg) # equivalent to `reshape(kron(sg, sg), (length(sg), length(sg)))`4×4 Matrix{SymOperation{3}}:
1 2₀₀₁ 2₀₁₀ 2₁₀₀
2₀₀₁ 1 2₁₀₀ 2₀₁₀
2₀₁₀ 2₁₀₀ 1 2₀₀₁
2₁₀₀ 2₀₁₀ 2₀₀₁ 1Symmorphic vs. nonsymorphic space groups
To determine whether a space group is symmorphic or not, use issymmorph taking either a SpaceGroup, LittleGroup, or SubperiodicGroup (or a SpaceGroup identified by its number and dimensionality; in this case, using tabulated look-up). To test whether a given SymOperation is symmorphic in a given centering setting, use issymmorph(::SymOperation, ::Char)
Group generators
Generators of SpaceGroups, PointGroups, and SubperiodicGroups are accessible via generators, e.g.:
ops = generators(sgnum, SpaceGroup{D})2-element Vector{SymOperation{3}}:
2₀₀₁
2₀₁₀To generate a group from a list of generators, we can use the generate method. As an example, we can verify that ops in fact returns symmetry operations identical to those in sg:
generate(ops)GenericGroup{3} with 4 operations:
2₀₀₁
2₀₁₀
1
2₁₀₀Magnetic space groups
Magnetic space groups are accessible via mspacegroup.