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.AbstractSymmetryType
abstract type AbstractSymmetry end

An 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 x represents a 3D point, then symm(x) should be the image of that point.
  • if x represents a 3D basis of space, then symm(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 x is a vertex, symm[x] is the image of x by the symmetry.
  • if i is the integer identifier of vertex x, symm[i] is the identifier of symm[x].
source
PeriodicGraphs.SimpleSymmetryType
SimpleSymmetry{K,T,D} <: AbstractSymmetry

Symmetry operation defined by a map of type T and an optional dict of type D accepting keys of type K.

source
PeriodicGraphs.SimpleSymmetryMethod
SimpleSymmetry(map::T, dict::D) where {T,D}

Create a SimpleSymmetry{keytype(D),T,D} object symm such that symm[x] is

  • map[dict[x]] if x isa keytype(D).
  • map[x] otherwise, if x isa Integer.
source

Symmetry group

PeriodicGraphs.AbstractSymmetryGroupType
AbstractSymmetryGroup{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 of i such 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 s yields the list of symmetry operations symm, each represented as an object of type T (where T <:AbstractSymmetry is the parameter to typeof(s)). The identity symmetry should not be part of these yielded symm, except for the specific IncludingIdentity subtype of AbstractSymmetryGroup.
  • one(s) is the identity symmetry of type T.
source