Symmetries
PeriodicGraphs.jl comes with a general API for the manipulation of symmetries. Concrete implementations of the API can be found in PeriodicGraphEmbeddings.jl.
Single symmetry operations
PeriodicGraphs.AbstractSymmetry — Typeabstract type AbstractSymmetry endAn abstract type representing a symmetry.
Interface
Subtypes T of AbstractSymmetry should implement a method to make their objects symm callable on any object upon which the symmetry can act. For example, if T represents a symmetry of a 3D embedding of a graph:
- if
xrepresents a 3D point, thensymm(x)should be the image of that point. - if
xrepresents a 3D basis of space, thensymm(x)should be the image of that basis.
When the symmetry is naturally defined on a discrete set of objects, their image should be accessible by indexing on the symmetry. With the same example as before:
- if
xis a vertex,symm[x]is the image ofxby the symmetry. - if
iis the integer identifier of vertexx,symm[i]is the identifier ofsymm[x].
PeriodicGraphs.IdentitySymmetry — TypeIdentitySymmetry <: AbstractSymmetryIdentity symmetry, i.e. such that for s::IdentitySymmetry, ∀x, s[x] == x.
PeriodicGraphs.SimpleSymmetry — TypeSimpleSymmetry{K,T,D} <: AbstractSymmetrySymmetry operation defined by a map of type T and an optional dict of type D accepting keys of type K.
PeriodicGraphs.SimpleSymmetry — MethodSimpleSymmetry(map::T, dict::D) where {T,D}Create a SimpleSymmetry{keytype(D),T,D} object symm such that symm[x] is
map[dict[x]]ifx isa keytype(D).map[x]otherwise, ifx isa Integer.
PeriodicGraphs.SimpleSymmetry — MethodSimpleSymmetry(map)Create a SimpleSymmetry object symm such that symm[x] == map[x] for all x.
Symmetry group
PeriodicGraphs.AbstractSymmetryGroup — TypeAbstractSymmetryGroup{T<:AbstractSymmetry}An abstract type representing the set of symmetries of a graph.
Interface
Any AbstractSymmetryGroup type must define methods for Base functions unique, iterate, length and one such that, for any s of type <: AbstractSymmetryGroup{T}:
s(i)is a representative on the symmetry orbit ofisuch that all elements on the orbit share the same representative. The representative should be an integer.unique(s)is an iterator over such representatives.- iterating over
syields the list of symmetry operationssymm, each represented as an object of typeT(whereT <:AbstractSymmetryis the parameter totypeof(s)). The identity symmetry should not be part of these yieldedsymm, except for the specificIncludingIdentitysubtype ofAbstractSymmetryGroup. one(s)is the identity symmetry of typeT.
PeriodicGraphs.NoSymmetryGroup — TypeNoSymmetryGroup <: AbstractSymmetryGroup{IdentitySymmetry}The trivial AbstractSymmetryGroup devoid of any symmetry operation. NoSymmetryGroup(num) creates a NoSymmetryGroup over num unique representatives.
PeriodicGraphs.IncludingIdentity — TypeIncludingIdentity{S<:AbstractSymmetry,T<:AbstractSymmetryGroup{S}} <: AbstractSymmetryGroup{S}Wrapper around an AbstractSymmetry that explicitly includes the identity operation.