radtools.Crystal.cell#

property

property Crystal.cell#

Cell of the lattice.

Main difference of the cell attribute of the crystal from the cell attribute of the lattice is that change of the crystal`s cell leads to the computation of the atom coordinate.

Returns:
cell(3, 3) numpy.ndarray

Cell of the crystal`s lattice.

Examples

>>> import radtools as rad
>>> c = rad.Crystal()
>>> c.add_atom(rad.Atom("Cr", (0.5, 0.5, 0.5)))
>>> c.cell
array([[1, 0, 0],
       [0, 1, 0],
       [0, 0, 1]])
>>> c.atoms[0].position
array([0.5, 0.5, 0.5])
>>> c.lattice.cell = [[2,0,0],[0,2,0],[0,0,2]]
>>> c.cell
array([[2, 0, 0],
       [0, 2, 0],
       [0, 0, 2]])
>>> c.atoms[0].position
array([0.5, 0.5, 0.5])
>>> c.lattice.cell = [[1,0,0],[0,1,0],[0,0,1]]
>>> c.cell = [[2,0,0],[0,2,0],[0,0,2]]
>>> c.cell
array([[2, 0, 0],
       [0, 2, 0],
       [0, 0, 2]])
>>> c.atoms[0].position
array([1., 1., 1.])