Types
Manual
PeriodicGraphEmbeddings provide the new type PeriodicGraphEmbedding which wraps:
- A
PeriodicGraph - The list of positions of the vertices in a unit cell of the graph
- Optionally, a
Cellif 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.PeriodicGraphEmbedding — Type
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.
PeriodicGraphEmbeddings.PeriodicGraphEmbedding3D — Type
PeriodicGraphEmbedding3DAlias for PeriodicGraphEmbedding{3}
PeriodicGraphEmbeddings.PeriodicGraphEmbedding — Method
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.
To obtain a PeriodicGraphEmbedding with sorted positions, use SortedPeriodicGraphEmbedding instead
PeriodicGraphEmbeddings.SortedPeriodicGraphEmbedding — Type
SortedPeriodicGraphEmbedding{T}Constructor for PeriodicGraphEmbedding{D,T} where D with sorted positions.
PeriodicGraphEmbeddings.SortedPeriodicGraphEmbedding — Method
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.
See also PeriodicGraphEmbedding{D,T}(graph, placement::AbstractMatrix{T}, cell) where {D,T} and SortedPeriodicGraphEmbedding(graph, placement::AbstractMatrix, cell).
SortedPeriodicGraphEmbedding(graph::PeriodicGraph{D}, placement::AbstractMatrix, cell::Cell=Cell()) where DBuild 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.
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}.
PeriodicGraphEmbeddings.PeriodicGraphEmbedding — Method
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.
Cell API
PeriodicGraphEmbeddings.Cell — Type
Cell{T}Representation of a periodic cell in 3D. Contains information about the cell (axes lengths and angles) and its symmetry group, through its Hall number.
See PeriodicGraphEmbeddings.SPACE_GROUP_HALL, PeriodicGraphEmbeddings.SPACE_GROUP_FULL, PeriodicGraphEmbeddings.SPACE_GROUP_HM and PeriodicGraphEmbeddings.SPACE_GROUP_IT for the correspondance between Hall number and usual symbolic representations.
PeriodicGraphEmbeddings.cell_parameters — Function
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.
PeriodicGraphEmbeddings.EquivalentPosition — Type
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 SVector{3, Rational{Int64}} with indices SOneTo(3):
2//3
1//4
1//2The type parameter T is the numeric type used to store the symmetry operations. It should be typically either Rational{Int} or Float64.
Base.parse — Method
Base.parse(::Type{EquivalentPosition{T}}, s::AbstractString, refid=("x", "y", "z")) where T
Base.parse(::Type{EquivalentPosition}, s::AbstractString, refid=("x", "y", "z"))Parse a string into its represented EquivalentPosition{T} given the name of the three variables obtained from find_refid.
The version with no explicit type parameter T returns a EquivalentPosition{Rational{Int}}.
Multiplicative coefficients must be placed before the variables, with no '*' symbol. Likewise, an operation like x/2 must be written 1/2x
Example
julia> parse(EquivalentPosition, "a+0.5; c; -1/3+b", ("a", "b", "c"))
x+1/2,z,y-1/3PeriodicGraphEmbeddings.find_refid — Function
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").