Types

Manual

PeriodicGraphEmbeddings provide the new type PeriodicGraphEmbedding which wraps:

  1. A PeriodicGraph
  2. The list of positions of the vertices in a unit cell of the graph
  3. Optionally, a Cell if the dimension of the graph is 3 or below, which contains the geometry of the unit cell.

A PeriodicGraphEmbedding can be built through different methods, depending on whether the list of positions should be permuted to be sorted, or offset to have all positions between 0 and 1 for instance:

PeriodicGraphEmbeddings.PeriodicGraphEmbeddingType
PeriodicGraphEmbedding{D,T}

Embedding in euclidean space of a PeriodicGraph of dimension D. Each vertex is assigned a D-uplet of coordinates of type T.

PeriodicGraphEmbedding3D is provided as an alias for PeriodicGraphEmbedding{3}. Symmetry detection provided by PeriodicGraphEmbeddings.jl can only be performed on PeriodicGraphEmbedding3D.

source
PeriodicGraphEmbeddings.PeriodicGraphEmbeddingMethod
PeriodicGraphEmbedding{D,T}(graph::PeriodicGraph{D}, placement::AbstractMatrix{T}, cell::Cell=Cell()) where {D,T}
PeriodicGraphEmbedding{D}(graph::PeriodicGraph{D}, placement::AbstractMatrix{T}, cell::Cell=Cell()) where D
PeriodicGraphEmbedding(graph::PeriodicGraph{D}, placement::AbstractMatrix{T}, cell::Cell=Cell())

Build a PeriodicGraphEmbedding{D,T} from the corresponding graph and placement of the vertices, such that each vertex has its fractional coordinate represented in a column of the matrix.

Coordinates out of [0, 1) are translated back to the unit cell with the corresponding offset added to the graph.

The cell optional argument will not be used if D > 3.

Warning

This function modifies the input graph if any element of placement is out of [0, 1).

Note

To obtain a PeriodicGraphEmbedding with sorted positions, use SortedPeriodicGraphEmbedding instead

source
PeriodicGraphEmbeddings.SortedPeriodicGraphEmbeddingMethod
SortedPeriodicGraphEmbedding{T}(graph::PeriodicGraph{D}, placement::AbstractMatrix, cell::Cell=Cell()) where {D,T}

Build a PeriodicGraphEmbedding{D,T} from the corresponding graph and placement of the vertices, so that the result has its vertices sorted by position.

Return the PeriodicGraphEmbedding as well as the permutation of the columns of placement that yielded the resulting order on the vertices.

The cell optional argument will not be used if D > 3.

Warning

This function modifies the input graph if any element of placement is out of [0, 1).

See also PeriodicGraphEmbedding{D,T}(graph, placement::AbstractMatrix{T}, cell) where {D,T} and SortedPeriodicGraphEmbedding(graph, placement::AbstractMatrix, cell).

source
SortedPeriodicGraphEmbedding(graph::PeriodicGraph{D}, placement::AbstractMatrix, cell::Cell=Cell()) where D

Build a PeriodicGraphEmbedding{D,T} from the corresponding graph and placement of the vertices, so that the result has its vertices sorted by position. T is determined as the smallest type between Rational{Int32}, Rational{Int64}, Rational{Int128} and Rational{BigInt} that can fit all the elements of placement with some additional margin.

Return the PeriodicGraphEmbedding as well as the permutation of the columns of placement that yielded the resulting order on the vertices.

The cell optional argument will not be used if D > 3.

Warning

This function modifies the input graph if any element of placement is out of [0, 1).

Tip

This function is inherently type-unstable since T cannot be statically determined. This can be useful because having a too large T may slow down later computations.

To provide the parameter explicitly, pass it to the SortedPeriodicGraphEmbedding constructor by calling SortedPeriodicGraphEmbedding{T}(graph, placement, cell).

See also PeriodicGraphEmbedding{D,T}(graph, placement::AbstractMatrix{T}, cell) where {D,T}.

source
PeriodicGraphEmbeddings.PeriodicGraphEmbeddingMethod
PeriodicGraphEmbedding{D,T}(pge::PeriodicGraphEmbedding{N,S}) where {D,T,N,S}
PeriodicGraphEmbedding{D}(pge::PeriodicGraphEmbedding{N,S}) where {D,N,S}

Return a PeriodicGraphEmbedding{D,T} with the same structural information as the input pge but embedded in D dimensions instead of N.

If T is not provided it defaults to S.

The same caveats that apply to PeriodicGraph{D}(graph::PeriodicGraph{N}) are valid here: namely, the dimensionality of the graph should be at least D and the behaviour is undefined if D < N and there are multiple non-identical connected components.

Moreover, if D < N, the N-D last coordinates of all vertices must be zero or this function will error.

source

Cell API

PeriodicGraphEmbeddings.cell_parametersFunction
cell_parameters(cell::Cell)

Return ((lengths, angles), mat) where mat is the matrix of the cell in upper triangular format, lengths is the triplet (a, b, c) of lengths of the three axes, and angles is the triplet (α, β, γ) of angles between them.

source
PeriodicGraphEmbeddings.EquivalentPositionType
EquivalentPosition{T}

Representation of a symmetry operation in 3D, defined by a matrix multiplication and addition.

Example

julia> eq = parse(EquivalentPosition, "1-x, z, y+1/2")
-x+1,z,y+1/2

julia> eq([1//3, 0, 1//4])
3-element StaticArrays.SVector{3, Rational{Int64}} with indices SOneTo(3):
 2//3
 1//4
 1//2

The type parameter T is the numeric type used to store the symmetry operations. It should be typically either Rational{Int} or Float64.

source
Missing docstring.

Missing docstring for Base.parse(::Type{EquivalentPosition}, s::AbstractString). Check Documenter's build log for details.

PeriodicGraphEmbeddings.find_refidFunction
find_refid(eqs)

Find the reference identifiers for the three dimensions for the CIF group called symmetry_equiv_pos_as_xyz or space_group_symop_operation_xyz. Usually this is simply ("x", "y", "z").

source