All the methods below are available directly under pylada.crystal.
Returns Folds vector back to origin.
This may not be the vector with the smallest possible norm if the cell is very skewed.
Parameters: |
|
---|
Returns Folds vector into first Brillouin zone of the input cell.
This returns the periodic image with the smallest possible norm.
Parameters: |
|
---|
Returns Folds vector into periodic the input cell.
Parameters: |
|
---|
Creates a supercell of an input lattice.
Parameters: |
|
---|---|
Returns: | A Structure representing the supercell. If lattice contains an attribute name, then the result’s is set to “supercell of ...”. All other attributes of the lattice are deep-copied to the supercell. The atoms within the result contain an attribute index which is an index to the equivalent site within lattice. Otherwise, the atoms are deep copies of the lattice sites. |
Returns the primitive unit-cell lattice of an input lattice.
Parameters: |
|
---|---|
Returns: | A new Structure representing the primitive lattice. |
Returns a copy of the structure transformed according to affine operation.
Parameters: |
|
---|
Returns True if the lattice is primitive.
Parameters: |
|
---|
Finds and stores point group operations.
Implementation taken from ENUM.
Parameters: |
|
---|---|
Returns: | python list of affine symmetry operations for the given structure. Each element is a 4x3 numpy array, with the first 3 rows forming the rotation, and the last row is the translation. The affine transform is applied as rotation * vector + translation. |
Raises ValueError: | |
if the input structure is not primitive. |
Map sites from a lattice onto a structure.
This function finds out which atomic sites in a supercell refer to the sites in a parent lattice. site attribute are added to the atoms in the mappee structure. These attributes hold an index to the relevant sites in the mapper. If a particular atom could not be mapped, then site is None.
Parameters: |
|
---|---|
Returns: | True if all sites in mappee where mapped to mapper. |
Returns list of neighbors to input position
Creates a list referencing neighbors of a given position in a structure. In order to make this function well defined, it may return more atoms that actually requested. For instance, in an fcc structure with center at the origin, if asked for the 6 first neighbors, actually the first twelve are returned since they are equidistant. The input tolerance is the judge of equidistance.
Parameters: |
|
---|---|
Returns: | A list of 3-tuples. The first item is a refence to the neighboring atom, the second is the position of its relevant periodic image relative to the center, the third is its distance from the center. |
Creates list of coordination shells up to given order.
Parameters: |
|
---|---|
Returns: | A list of lists of tuples. The outer list is over coordination shells. The inner list references the atoms in a shell. Each innermost tuple contains a reference to the atom in question, a vector from the center to the relevant periodic image of the atom, and finally, the associated distance. |
Creates periodic divide-and-conquer boxes.
Creates a list of divide-and-conquer boxes for a periodic system. Takes into account periodic images. In order to make sure that a box contains all atoms relevant for a given calculation, it allows for an overlap, so that atoms which are close (say close enough to form a bond) which are not nominally within the are also referenced. In other words, the boxes have fuzzy limits. The return clearly indicates whether an atom is truly within a box or merely sitting close by.
Parameters: |
|
---|---|
Returns: | If return_mesh is false, returns a list of lists of 3-tuples (atom, translation, insmallbox). Each inner list represents a single divide-and-conquer box (+overlapping atoms). Each item within that box contains a reference to an atom, a possible translation to push the atom from its current position to its periodic image within the box, and boolean which is true if the atom truly inside the box as opposed to sitting just outside within the specified overlap. If return_mesh is true, then returns a two-tuple consisting of the mesh and the list of lists previously described. |
Creates a split-configuration for a given structure and atomic origin.
Split-configurations are a symmetry-agnostic atom-centered description of a chemical environment [ABMZ].
Parameters: |
|
---|---|
Returns: | A list of splitted configuration. Each item in this list is itself a view, e.g. a list with two inner items. The first inner item is an ordered list of references to atoms. The second inner item is the weight for that configuration. The references to the atoms are each a 2-tuple consisting of an actual reference to an atom, as well as the coordinates of that atom in the current view. |
[ABMZ] | d’Avezac, Botts, Mohlenkamp, Zunger, SIAM J. Comput. 30 (2011) |
Tries to read a VASP POSCAR file.
param path: Path to the POSCAR file. Can also be an object with file-like behavior. type path: str or file object param types: Species in the POSCAR. type types: None or sequence of str
Returns: | pylada.crystal.Structure instance. |
---|
Writes a poscar to file.
Parameters: |
|
---|
>>> with open("POSCAR", "w") as file: write.poscar(structure, file, vasp5=True)
Species in structures can be substituted for others (when using vasp5 format). Below, aluminum atoms are replaced by cadmium atoms. Other atoms are left unchanged.
>>> with open("POSCAR", "w") as file:
>>> write.poscar(structure, file, vasp5=True, substitute={"Al":"Cd"})
Selective dynamics are added to the POSCAR file if an atom in the structure has a freeze attribute (of non-zero length). It is expected that this attribute is a string and that it contains one of “x”, “y”, “z”, corresponding to freezing the first, second, or third fractional coordinates. Combinations of these are also allowed.