operation
esta.general.operation
¶
Transform
¶
transfor class to * create supercell from crystal lattice object * rotation/translation etc...todo * .. * ..
- More transformations to unit cell/atomic positions/reciprocal lattice/kpoints to be added
author: sk email: sonukumar.physics@gmail.com
__init__(cryst_obj)
¶
cryst_obj is
crystal_lattice.CrystalLattice('POSCAR', './') object from inout
of vasp_bag
get_supercell(scale)
¶
-
create supercell by shifting ALL atoms in space with scaling [scale1,scale2,scale3]
-
looping is performed along three directions of lv's vectors
-
loops are: i = 0,1,2 ... sclae1 j = 0,1,2 ... scale2 k = 0,1,2 ... scale3
-
total atoms in supercell = atoms in unit-cell * np.product([scale1,scale2,scale3])
get_unique_list(inp)
¶
get unique elements of list
input: string: atomic labels
returns: string: uqique atomic labels for each type of atoms
get_grouped_list(llist)
¶
get same string elements of list grouped together
get_neach_type(inp)
¶
get number of list entries of each type
input:
list of strings of atomic labels
returns:
get integer number of list entries (atomic symbols) of each type
get_grouped_xyz()
¶
xyz file with grouped atoms of same type
get_sposcar()
¶
get poscar file with scaled dimensions: supercell of POSCAR file
input: instantiate the transform class, rest is done itself
output: SPOSCAR file
rot_trans(inp_mat, lcell=None, lposition=None, translation=None, rotation_matrix=None)
¶
given input matrix (may be cell matrix or position matrix in c order) and rotation matrix (optional; default is unit matrix), output respective new matrix
Parameters:
-
inp_mat
(array
) –rank 3 or rank N, N is no. of atoms.
-
lcell
(logical
, default:None
) –indicates inp_mat is for cell
-
lposition
(logical
, default:None
) –indicates that inp_mat is for atomic points/positions
-
translation
(array
, default:None
) –rank 1, optional (default is zero vector = (0 0 0))
-
rotation_matrix
(array of rank3
, default:None
) –rotation matrix; default is unit matrix
Returns:
-
out_mat
(array
) –output matrix of same shape as that of input matrix
-
.. note::
–following convention like spglib: .. _spglib: https://spglib.github.io/spglib/definition.html
====> Basis vectors (a,b,c) or (a1, a2, a3)
In spglib, basis vectors are represented by three column vectors (in Cartesian coordinates. ) :
a=⎛⎝⎜ax ay az⎞⎠⎟, b=⎛⎝⎜bx by bz⎞⎠⎟, c=⎛⎝⎜cx cy cz⎞⎠⎟,
====> atomic point x are represented as three fractional values relative to basis vectors as follows,
x=⎛⎝⎜x1x2x3⎞⎠⎟
====> The transformation matrix P changes choice of basis vectors as follows (a b c) = (as bs cs) P where (abc) and (as bs cs) are the basis vectors of an arbitrary system and of a starndardized system, respectively
The origin shift p gives the vector from the origin of the standardized system Os to the origin of the arbitrary system O
p = O − Os
A change of basis is described by the combination of the transformation matrix and the origin shift denoted by (P,p) where first the transformation matrix is applied and then origin shift. The points in the standardized system xs and arbitrary system x are related by
xs = P x + p
,or equivalently,
x = P^-1 xs − P^-1 p