Bases: object
Defines an atomic site.
All other keyword arguments become attributes. In other words, one could add magnetic=0.5 if one wanted to specify the magnetic moment of an atom.
For instance, the following will create a silicon atom at the origin:
atom = Atom(0, 0, 0, 'Si')
Or we could place a iron atom with a magntic moment:
atom = Atom(0.25, 0, 0.5, 'Si', moment=0.5)
The moment keyword will create a corresponding atom.moment keyword with a value of 0.5. There are strictly no limits on what kind of type to include as attributes. However, in order to work well with the rest of Pylada, it is best if extra attributes are pickle-able.
Note
the position is always owned by the object. Two atoms will not own the same position object. The position given on input is copied, not referenced. All other attributes behave like other python attributes: they are refence if complex objects and copies if a basic python type.
This class is also available directly under pylada.crystal.
Returns a deepcopy of the atom.
Returns a dictionary with shallow copies of items.
Position in cartesian coordinates.
The position does not yet have units. Units depend upon pylada.crystal.Structure.scale. Finally, the position is owned internally by the atom. It cannot be set to reference an object (say a list or numpy array). atom.pos = some_list will copy the values of``some_list``.
Occupation of this atomic site.
Can be any object whatsoever.
Bases: object
Defines a structure.
A structure is a special kind of sequence containing only Atom. It also sports attributes such a cell and scale.
Note
The cell is always owned by the object. Two structures will not own the same cell object. The cell given on input is copied, not referenced. All other attributes behave like other python attributes: they are refence if complex objects and copies if a basic python type.
This class is also available directly under pylada.crystal.
Volume of the structure.
Includes scale.
Cell matrix in cartesian coordinates.
Unlike most ab-initio codes, cell-vectors are given in column vector format. The cell does not yet have units. Units depend upon Structure.scale. Across pylada, it is expected that a cell time this scale are angstroms. Finally, the cell is owned internally by the structure. It cannot be set to reference an object (say a list or numpy array). structure.cell = some_list will copy the values of some_list.
Scale factor of this structure. Should be a number or unit given by the python package quantities. If given as a number, then the current units are kept. Otherwise, it changes the units.
Returns a deepcopy of the structure.
Returns a dictionary with shallow copies of items.
Removes all atoms from structure.
Inserts atom at given position.
Parameters: |
|
---|
Removes and returns atom at given position.
Appends list of atoms to structure.
The argument is any iterable objects containing only atoms, e.g. another Structure.
Appends an Atom or subtype to the structure.
Transform a structure in-place.
Applies an affine transformation to a structure. An affine transformation is a 4x3 matrix, where the upper 3 rows correspond to a rotation (applied first), and the last row to a translation (applied second).
Parameters: | matrix – Affine transformation defined as a 4x3 numpy array. |
---|---|
Returns: | A new Structure (or derived) instance. |
Adds atom to structure.
The argument to this function is either another atom, in which case a reference to that atom is appended to the structure. Or, it is any arguments used to initialize atoms in Atom. Finally, this function can be chained as follows:
structure.add_atom(0,0,0, 'Au') \
.add_atom(0.25, 0.25, 0.25, ['Pd', 'Si'], m=5)\
.add_atom(atom_from_another_structure)
In the example above, both structure and the other structure will reference the same atom (atom_from_another_structure). Changing, say, that atom’s type in one structure will also change it in the other.
Returns: | The structure itself, so that add_atom methods can be chained. |
---|
Retrieves atom or slice.
Parameters: | index – If an integer, returns a refence to that atom. If a slice, returns a list with all atoms in that slice. |
---|
Sets atom or atoms.
Parameters: |
|
---|
Bases: object
Defines a hftransform.
The Hart-Forcade transform computes the cyclic group of supercell with respect to its backbone lattice. It can then be used to index atoms in the supercell, irrespective of which periodic image is given [HF].
Parameters: |
|
---|
This class is also available directly under pylada.crystal.
Periodicity quotient.
Transformation matrix to go from position to hf index.
Returns a deepcopy of the hftransform.
indices of input atomic position in cyclic Z-group.
Parameters: | vec – A 3d-vector in the sublattice of interest. |
---|---|
Returns: | The 3-d indices in the cyclic group. |
Flattens cyclic Z-group indices.
Parameters: |
|
---|---|
Returns: | An integer which can serve as an index into a 1d array. |
Flat index into cyclic Z-group.
Parameters: |
|
---|