-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
also load
generators
via reference to ROTATIONS_...
and `TRANSLA…
…TIONS_...` - additionally, structure a few things more consistently in the encoding of operations & also rename some stuff
- Loading branch information
Showing
948 changed files
with
985 additions
and
277 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
function generators(iuclab::String, ::Type{PointGroup{D}}=PointGroup{3}) where D | ||
@boundscheck _check_valid_pointgroup_label(iuclab, D) | ||
codes = PG_GENS_CODES_Ds[D][iuclab] | ||
|
||
# convert `codes` to `SymOperation`s and add to `operations` | ||
operations = Vector{SymOperation{D}}(undef, length(codes)) | ||
for (n, code) in enumerate(codes) | ||
op = SymOperation{D}(get_indexed_rotation(code, Val{D}()), zero(SVector{D,Float64})) | ||
operations[n] = op | ||
end | ||
|
||
return operations | ||
end | ||
function generators(pgnum::Integer, ::Type{PointGroup{D}}, setting::Integer=1) where D | ||
iuclab = pointgroup_num2iuc(pgnum, Val(D), setting) | ||
return generators(iuclab, PointGroup{D}) | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,93 @@ | ||
""" | ||
generators(num::Integer, T::Type{AbstractGroup{D}}[, optargs]) | ||
generators(pgiuc::String, T::PointGroup{D}}) --> Vector{SymOperation{D}} | ||
Return the generators of the group type `T` which may be a `SpaceGroup{D}` or a | ||
`PointGroup{D}` parameterized by its dimensionality `D`. Depending on `T`, the group is | ||
determined by inputting as the first argument: | ||
- `SpaceGroup{D}`: the space group number `num::Integer`. | ||
- `PointGroup{D}`: the point group IUC label `pgiuc::String` (see also | ||
[`pointgroup(::String)`) or the canonical point group number `num::Integer`, which can | ||
optionally be supplemented by an integer-valued setting choice `setting::Integer` (see | ||
also [`pointgroup(::Integer, ::Integer, ::Integer)`](@ref)]). | ||
- `SubperiodicGroup{D}`: the subperiodic group number `num::Integer`. | ||
Setting choices match those in [`spacegroup`](@ref), [`pointgroup`](@ref), and | ||
[`subperiodicgroup`](@ref). | ||
Iterated composition of the returned symmetry operations will generate all operations of the | ||
associated space or point group (see [`generate`](@ref)). | ||
As an example, `generate(generators(num, `SpaceGroup{D}))` and `spacegroup(num, D)` return | ||
identical operations (with different sorting typically); and similarly so for point and | ||
subperiodic groups. | ||
## Example | ||
Generators of space group 200: | ||
```jldoctest | ||
julia> generators(200, SpaceGroup{3}) | ||
4-element Vector{SymOperation{3}}: | ||
2₀₀₁ | ||
2₀₁₀ | ||
3₁₁₁⁺ | ||
-1 | ||
``` | ||
Generators of point group m-3m: | ||
```jldoctest | ||
julia> generators("2/m", PointGroup{3}) | ||
2-element Vector{SymOperation{3}}: | ||
2₀₁₀ | ||
-1 | ||
``` | ||
Generators of the Frieze group 𝓅2mg: | ||
```jldoctest | ||
julia> generators(7, SubperiodicGroup{2, 1}) | ||
2-element Vector{SymOperation{2}}: | ||
2 | ||
{m₁₀|½,0} | ||
``` | ||
## Citing | ||
Please cite the original data sources if used in published work: | ||
- Space groups: | ||
[Aroyo et al., Z. Kristallogr. Cryst. Mater. **221**, 15 | ||
(2006)](https://doi.org/10.1524/zkri.2006.221.1.15); | ||
- Point group: Bilbao Crystallographic Server's | ||
[2D and 3D GENPOS](https://www.cryst.ehu.es/cryst/get_point_genpos.html); | ||
- Subperiodic groups: Bilbao Crystallographic Server's | ||
[SUBPERIODIC GENPOS](https://www.cryst.ehu.es/subperiodic/get_sub_gen.html). | ||
## Extended help | ||
Note that the returned generators are not guaranteed to be the smallest possible set of | ||
generators; i.e., there may exist other generators with fewer elements (an example is space | ||
group 168 (P6), for which the returned generators are `[2₀₀₁, 3₀₀₁⁺]` even though the group | ||
could be generated by just `[6₀₀₁⁺]`). | ||
The returned generators, additionally, are not guaranteed to be | ||
[minimal](https://en.wikipedia.org/wiki/Generating_set_of_a_module), i.e., they may include | ||
proper subsets that generate the group themselves (e.g., in space group 75 (P4), the | ||
returned generators are `[2₀₀₁, 4₀₀₁⁺]` although the subset `[4₀₀₁⁺]` is sufficient to | ||
generate the group). | ||
The motivation for this is to expose as similar generators as possible for similar crystal | ||
systems (see e.g. Section 8.3.5 of the International Tables of Crystallography, Vol. A, | ||
Ed. 5 (ITA) for further background). | ||
Note also that, contrary to conventions in ITA, the identity operation is excluded among the | ||
returned generators (except in space group 1) since it composes trivially and adds no | ||
additional context. | ||
""" | ||
function generators(sgnum::Integer, ::Type{SpaceGroup{D}}=SpaceGroup{3}) where D | ||
@boundscheck _check_valid_sgnum_and_dim(sgnum, D) | ||
codes = SG_GENS_CODES_Vs[D][sgnum] | ||
|
||
# convert `codes` to `SymOperation`s and add to `operations` | ||
operations = Vector{SymOperation{D}}(undef, length(codes)) | ||
_include_symops_from_codes!(operations, codes; add_identity=false) | ||
|
||
return operations | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
""" | ||
generators(num::Integer, ::Type{SubperiodicGroup{D,P}}) --> ::Vector{SymOperation{D}} | ||
Return a canonical set of generators for the subperiodic group `num` of embedding dimension | ||
`D` and periodicity dimension `P`. See also [`subperiodicgroup`](@ref). | ||
See also [`generators(::Integer, ::Type{SpaceGroup})`](@ref) and information therein. | ||
## Example | ||
```jldoctest | ||
julia> generators(7, SubperiodicGroup{2, 1}) | ||
2-element Vector{SymOperation{2}}: | ||
2 | ||
{m₁₀|½,0} | ||
``` | ||
## Data sources | ||
The generators returned by this function were originally retrieved from the [Bilbao | ||
Crystallographic Database, SUBPERIODIC GENPOS](https://www.cryst.ehu.es/subperiodic/get_sub_gen.html). | ||
""" | ||
function generators(num::Integer, ::Type{SubperiodicGroup{D,P}}) where {D,P} | ||
@boundscheck _check_valid_subperiodic_num_and_dim(num, D, P) | ||
codes = SUBG_GENS_CODES_Vs[(D,P)][num] | ||
|
||
# convert `codes` to `SymOperation`s and add to `operations` | ||
operations = Vector{SymOperation{D}}(undef, length(codes)) | ||
_include_symops_from_codes!(operations, codes; add_identity=false) | ||
|
||
return operations | ||
end |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
76c7af9
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@JuliaRegistrator register
76c7af9
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Registration pull request created: JuliaRegistries/General/98714
Tip: Release Notes
Did you know you can add release notes too? Just add markdown formatted text underneath the comment after the text
"Release notes:" and it will be added to the registry PR, and if TagBot is installed it will also be added to the
release that TagBot creates. i.e.
To add them here just re-invoke and the PR will be updated.
Tagging
After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.
This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via: