function export_vtf(file::AbstractString, pge::PeriodicGraphEmbedding3D{T}, types=nothing, repeatedges=6, colorname=false, tostring=string, atomnumof==(a,i)->(a isa Integer ? a : i)) where T
If specified, types is a list of types for each vertex of pge. Each type is converted to string by the tostring function. The atomnumof function takes two arguments ty and i where ty is a type and i is the number of the vertex, and return an Int representing an atom number.
function export_vtf(file::AbstractString, pge::PeriodicGraphEmbedding3D{T}, types=nothing, repeatedges=6, colorname=false, tostring=string, atomnumof==(a,i)->(a isa Integer ? a : i)) where T
If specified, types is a list of types for each vertex of pge. Each type is converted to string by the tostring function. The atomnumof function takes two arguments ty and i where ty is a type and i is the number of the vertex, and return an Int representing an atom number.
Return a SymmetryGroup3D object storing the list of symmetry operations on the graph embedding, found using spglib. Use retrieve_symmetries to simply extract the symmetries already specified in the Cell of the graph embedding.
If vtypes !== nothing, ensure that two vertices x and y cannot be symmetry-related if vtypes[x] != vtypes[y].
check_symmetry must be a function that takes the same four arguments pge, t, r and vtypes as check_valid_symmetry and return either (vmap, offsets) or nothing if the input is not a valid symmetry. It can be used to specify additional constraints that cannot be carried by vtypes alone.
An explicit tolerance can be set. Otherwise, the default is a loose tolerance if the positions are floating points, or a stringent tolerance if they are rationals.
Determine the hall number corresponding to the given hallsymbol. The Hermann-Mauguin symbol hm can alternatively be used, or simply the International Table number of the space group it to get the hall number of the standard setting of the group.
Passing an empty string to hallsymbol or hm or 0 to it disregards the argument.
The optional argument warnonnotfound specifies whether to print a warning if one of the provided arguments was not reckognized.
Wrapper around the SpglibDataset type exported by spglib. Its accessible fields are the same as in the C counterpart, except that strings are already converted to String, lists to Vector and matrices to Matrix.
To access the raw pointers without conversion, prepend an underscore to the field: for example dataset._rotations yields a Ptr{Cint} where dataset.rotations is a 3×3 Matrix{Int}.
If vtypes !== nothing, ensure that two vertices x and y cannot be symmetry-related if vtypes[x] != vtypes[y].
An explicit tolerance can be set. Otherwise, the default is a loose tolerance if the positions are floating points, or a stringent tolerance if they are rationals.
Check that the periodic graph embedding is identical to that rotated by r (if it is not nothing) then translated by t. If vtypes is not nothing, any vertex x must additionally be mapped to a vertex y such that vtypes[x] == vtypes[y]. If issorted is set and T <: Rational, assume that issorted(pge.pos) to use a faster dichotomy approach.
If so, return the the vmap between the initial vertices and their symmetric images, as well as the offsets of each symmetric image compared to the origin. Otherwise, return nothing.
Return a SymmetryGroup3D object storing the list of symmetry operations on the graph embedding, found using spglib. Use retrieve_symmetries to simply extract the symmetries already specified in the Cell of the graph embedding.
If vtypes !== nothing, ensure that two vertices x and y cannot be symmetry-related if vtypes[x] != vtypes[y].
check_symmetry must be a function that takes the same four arguments pge, t, r and vtypes as check_valid_symmetry and return either (vmap, offsets) or nothing if the input is not a valid symmetry. It can be used to specify additional constraints that cannot be carried by vtypes alone.
An explicit tolerance can be set. Otherwise, the default is a loose tolerance if the positions are floating points, or a stringent tolerance if they are rationals.
Determine the hall number corresponding to the given hallsymbol. The Hermann-Mauguin symbol hm can alternatively be used, or simply the International Table number of the space group it to get the hall number of the standard setting of the group.
Passing an empty string to hallsymbol or hm or 0 to it disregards the argument.
The optional argument warnonnotfound specifies whether to print a warning if one of the provided arguments was not reckognized.
Wrapper around the SpglibDataset type exported by spglib. Its accessible fields are the same as in the C counterpart, except that strings are already converted to String, lists to Vector and matrices to Matrix.
To access the raw pointers without conversion, prepend an underscore to the field: for example dataset._rotations yields a Ptr{Cint} where dataset.rotations is a 3×3 Matrix{Int}.
If vtypes !== nothing, ensure that two vertices x and y cannot be symmetry-related if vtypes[x] != vtypes[y].
An explicit tolerance can be set. Otherwise, the default is a loose tolerance if the positions are floating points, or a stringent tolerance if they are rationals.
Check that the periodic graph embedding is identical to that rotated by r (if it is not nothing) then translated by t. If vtypes is not nothing, any vertex x must additionally be mapped to a vertex y such that vtypes[x] == vtypes[y]. If issorted is set and T <: Rational, assume that issorted(pge.pos) to use a faster dichotomy approach.
If so, return the the vmap between the initial vertices and their symmetric images, as well as the offsets of each symmetric image compared to the origin. Otherwise, return nothing.
The list of positions of the vertices in a unit cell of the graph
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:
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.
The list of positions of the vertices in a unit cell of the graph
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:
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.
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).
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).
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).
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.
Representation of a periodic cell in 3D. Contains information about the cell (axes lengths and angles) and its symmetry group, through its Hall number.
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.
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).
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).
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).
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.
Representation of a periodic cell in 3D. Contains information about the cell (axes lengths and angles) and its symmetry group, through its Hall number.
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.
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").
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").