Index
Common interface
LightLattices.AbstractCollection — Type
Union of node collections and physical collections in D-dimensional space. Use this alias for interfaces that operate on both plain node collections and physical collections.
LightLattices.AbstractNodeCollection — Type
abstract type AbstractNodeCollection{D, T}Abstract collection of nodes in D-dimensional space. Type T is used to represent coordinates.
LightLattices.AbstractPhysicalCollection — Type
abstract type AbstractPhysicalCollection{D, T, ST}Abstract collection of nodes in D-dimensional space, occupied by the physical objects from a Tuple of species ST. The type T is used to represent coordinates.
LightLattices.IsHomogeneous — Type
struct IsHomogeneous{BT}Trait to distinguish homogeneous and inhomogeneous collections. Informally speaking, collection can have several groups of nodes, where each of the groups corresponds to its own type of physical object occupying the nodes of the group. Collections with a single group are called homogeneous, while in the case of multiple groups, they are called inhomogeneous.
AtomsBase.species — Method
AtomsBase.species(collection::AbstractPhysicalCollection, I...)Return the species at index I of an AbstractPhysicalCollection.
Base.getindex — Method
getindex(collection::AbstractNodeCollection, I...)
Return the position of the node with index `I`.Base.getindex — Method
getindex(collection::AbstractPhysicalCollection, I...)Returns the position and the species at node with index I.
Base.position — Function
AtomsBase.position(collection::AbstractCollection, I...)Returns the cartesian coordinates of the node with index I.
LightLattices.group_iterator — Function
(collection::AbstractCollection, ig::Int)Return an iterator over the indices inside the ig-th group.
LightLattices.group_size — Function
group_size(collection::AbstractCollection, ig::Int)Return the number of nodes corresponding to the group (species) with index ig.
LightLattices.group_species — Method
group_species(pcol::AbstractPhysicalCollection, ig::Int)Returns an object corresponding to the ig-th group of the collection.
LightLattices.is_homogeneous — Function
is_homogeneous(nodes::AbstractNodeCollection)Computes the IsHomogeneous trait for the given collection. Returns IsHomogeneous{true}() for single-group collections and IsHomogeneous{false} otherwise.
LightLattices.num_of_groups — Function
num_of_groups(collection::AbstractCollection)Returns the number of different groups in the collection. Since the groups are in one-to-one correspondence with the different species, it gives the number of the different kinds of species.
LightLattices.relative_position — Function
relative_position(collection::AbstractNodeCollection, i1, i2)Returns the coordinate of node with index i1 relative to coordinate of the node with index i2 for the collection collection.
Physical Collections
LightLattices.PhysicalCollection — Type
struct PhysicalCollection{D, T, ST<:Tuple, NCT<:LightLattices.AbstractNodeCollection{D, T}} <: LightLattices.AbstractPhysicalCollection{D, T, ST<:Tuple}nodes::LightLattices.AbstractNodeCollection: Underlying node collection.
species::Tuple: The tuple of the species occupying the nodes. The species are in one-to-one correspondence with the groups of thenodescollection.
Collection of nodes in D-dimensional space, occupied by the physical objects of types ST. The type T is used to represent coordinates.
Subcollections
LightLattices.Subcollection — Type
struct Subcollection{D, T, ST, IT, PCT<:(LightLattices.PhysicalCollection{D, T, ST, NCT} where {ST<:Tuple, NCT<:LightLattices.AbstractNodeCollection{D, T}}), N} <: LightLattices.AbstractPhysicalCollection{D, T, ST}pcol::LightLattices.PhysicalCollection: Underlying PhysicalCollection
indices::Any: Indices of the nodes that belong to the subcollectionDocStringExtensions.TypeDefinition() DocStringExtensions.TypeFields(true).group_indices::NTuple{N, Int64} where N: Indices of the groups that contain nodes belonging to the Subcollection.
group_sizes::NTuple{N, Int64} where N:group_size[i]is the number of nodes with group indexgroup_indices[i]that belong to the Subcollection.
species::Any: Species of the underlying PhysicalCollection that belong to the subcollection.
A Collection that is obtained if we restrict a PhysicalCollection to a subset of nodes.
Composite Collections
LightLattices.CompositeCollection — Type
struct CompositeCollection{D, T, ST, N, CST<:NTuple{N, LightLattices.AbstractPhysicalCollection{D, T}}} <: LightLattices.AbstractPhysicalCollection{D, T, ST}collections::NTuple{N, LightLattices.AbstractPhysicalCollection{D, T}} where {D, T, N}: Tuple of underlying collections.
group_numbers::NTuple{N, Int64} where N: Tuple of the numbers of groups in each of the underlying collections.
num_of_groups::Int64: Total number of groups
species::Any: The tuple of all the species of the underlying collections combined together.
A composite type for a physical collection composed from other physical collections and subcollections. The groups of the underlying collections are combined together and form the groups of the CompositeCollection.
LightLattices.compose — Method
compose(
col1::LightLattices.AbstractPhysicalCollection{D, T},
col2::LightLattices.AbstractPhysicalCollection{D, T},
cols::LightLattices.AbstractPhysicalCollection{D, T}...
) -> Union{LightLattices.CompositeCollection{_A, _B, var"#s185", _C, _D} where {_C, _D<:NTuple{_C, LightLattices.AbstractPhysicalCollection{_A, _B}}}, LightLattices.CompositeCollection{_A, _B, var"#s185", N, _D} where {N, _D<:NTuple{N, LightLattices.AbstractPhysicalCollection{_A, _B}}}} where {_A, _B, var"#s185"<:Tuple}
Combine several PhysicalCollection-s or Subcollection-s into a single CompositeCollection.
Cells
LightLattices.AbstractCell — Type
abstract type AbstractCell{D, T} <: LightLattices.AbstractNodeCollection{D, T}Abstract unordered collection of nodes in D-dimensional space. Type T is used to represent coordinates.
LightLattices.HomogeneousCell — Type
struct HomogeneousCell{D, T, L<:Union{Nothing, Symbol}} <: LightLattices.AbstractCell{D, T}cell_vectors::Array{StaticArraysCore.SVector{D, T}, 1} where {D, T}: Coordinates of nodes.
label::Union{Nothing, Symbol}: Label of the cell.
Unodered homogeneous collection of nodes in D-dimensional space.
LightLattices.InhomogeneousCell — Type
struct InhomogeneousCell{D, T, N, L<:Union{Nothing, Symbol}} <: LightLattices.AbstractCell{D, T}cell_vectors::NTuple{N, Array{StaticArraysCore.SVector{D, T}, 1}} where {D, T, N}: Coordinates of nodes.
group_sizes::NTuple{N, Int64} where N: Sizes of the homogeneous groups inside inhomogeneous cell.
label::Union{Nothing, Symbol}: Label of the cell.
Unordered inhomogeneous collection of nodes in D-dimensional space. This type allows one to partition the nodes of the cell into several groups. Different groups of nodes may correspond to the different classes of physical objects occupying these nodes.
LightLattices.TrivialCell — Type
struct TrivialCell{D, T} <: LightLattices.AbstractCell{D, T}Trivial cell consisting of one node at the origin of D-dimensional coordinate system. The type T is used to represent coordinates.
Base.length — Method
length(cell::AbstractCell)
Returns the number of the nodes in the cell.
Base.position — Method
position(cell::AbstractCell, i...)
Returns the cartesian coordinates of the $i$-th node of the cell. In the case of InhomogeneousCell we can use double index i = i1, i2 to access $i_1$-th node of $i_2$-th group.
LightLattices.group_size — Method
group_size(
cell::Union{LightLattices.HomogeneousCell, LightLattices.TrivialCell},
ig::Int64
) -> Int64
Returns the size of the ig-th homogeneous group inside a cell.
LightLattices.num_of_groups — Method
num_of_groups(
cell::Union{LightLattices.HomogeneousCell, LightLattices.TrivialCell}
) -> Int64
Return the number of separate groups in a cell.
LightLattices.switch_coord_type — Method
switch_coord_type(cell::AbstractCell{D, T}, ::Type{T′})
Converts the type used to represent coordinates from T to T′.
Lattices
LightLattices.AbstractLattice — Type
abstract type AbstractLattice{D, T, PB} <: LightLattices.AbstractNodeCollection{D, T}The supertype for Lattices in D-dimensional space. Type T is used to represent coordinates. The boundary conditions can be either periodic (PB=true) or free (PB=false).
LightLattices.RegularLattice — Type
struct RegularLattice{D, T, PB, CT, N, L<:Union{Nothing, Symbol}} <: LightLattices.AbstractLattice{D, T, PB}lattice_dims::NTuple{D, Int64} where D: The number of basis cells along each of the basis directions.
primitive_vecs::StaticArraysCore.SMatrix{D, D} where D: Cartesian coordinates of the primitive vectors of the underlying Bravais lattice.primitive_vecs[:, i]gives the $i$-th primitive vector.
basis_cell::Any: Repeated basis cell of the lattice.
label::Union{Nothing, Symbol}: Label of the Lattice.
num_of_cells::Int64: Total number of cells.
num_of_nodes::Int64: Total number of nodes.
central_cell::CartesianIndex: Cartesian index of the central cell (in the case of even length among of dimensions it is an approximation).
This type describes a regular arrangment of nodes in D-dimensional space with boundary condition PB (PB=true for periodic boundary conditions, PB=false for free periodic boundary conditions). A general lattice consists of identical cells (combinations of nodes) arranged as a Bravais lattice.
LightLattices.RegularLattice — Method
RegularLattice(lattice_dims::NTuple{D, Int}, primitive_vecs::SMatrix{D,D}, basis_cell::AbstractCell{D}; label=nothing, periodic=true)
Convenient constructor which allows to specify the label and boundary condition as keyword arguments.
LightLattices.RegularLattice — Method
RegularLattice(lattice_dims::NTuple{D, Int}, a::T=1; label=:cubic, periodic=true)
Constructs hypercubic lattice with lattice parameter a and trivial unit cell.
LightLattices.num_of_groups — Method
num_of_groups(lattice::LightLattices.RegularLattice) -> Any
Return the number of lattice separate groups.
LightLattices.relative_position — Method
relative_position(
lattice::LightLattices.RegularLattice{D, T, true, <:LightLattices.TrivialCell},
I1::CartesianIndex{D},
I2::CartesianIndex{D}
) -> Any
For periodic lattice, the "shortest" relative position is calculated instead.
For, that the following heuristic is used. Cartesian indices of the two nodes are shifted by the same amount, so that the cartesian index of the second node corresponds to the central cell of the lattice. Then, the cartesian index of the first node is translated back inside the lattice. The relative coordinate is computed using the resulting indices.
This heuristic guarantees that relative_position(lattice, I1, I2) == -relative_position(lattice, I2, I1).
Utils
LightLattices.group_iterator — Method
group_iterator(collection, ig)Returns iterator over the group ig. For homogeneous collections, the index of the group is omitted.
LightLattices.takes_precedence — Method
takes_precedence(i1, i2)
Returns true if the index i1 occurs before i2 while iterating over a node collection.