StructureBuilder
StructureBuilder
Bases: ABC
An abstract class for building structures out of motifs and lattices. In general. this class works by tiling space to an extent specified, and then filling that space according to the motif (mapping of site types to locations within the unit cell) provided.
Source code in pylattica/core/structure_builder.py
8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 |
|
__init__(lattice, motif)
Instantiates a StructureBuilder using a Lattice and a motif.
Parameters
Lattice
The Lattice with which space will be tiled.
Dict[str, List[Tuple]]
The motif with which sites will be placed inside the structure. These motifs are given by a mapping of site type (str) to list of locations inside the unit cell that that site type exists.
Source code in pylattica/core/structure_builder.py
17 18 19 20 21 22 23 24 25 26 27 28 29 30 |
|
build(size)
Builds a structure with the provided size.
Parameters
Union[Tuple[int], int]
Either an integer or a tuple of integers specifying the extent of the desired structure in each dimension.
Returns
PeriodicStructure The resulting structure.
Raises
ValueError If the size is a tuple that is not of length equal to the lattice dimension, a value error is thrown. In other words, you must specify size along each dimension of the lattice.
Source code in pylattica/core/structure_builder.py
32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 |
|