wulfric.crystal.ensure_000#

wulfric.crystal.ensure_000(atoms) None[source]#

Ensures that all atoms are within (0,0,0) unit cell.

In other word ensures that all relative coordinates of all atoms are \(\in [0,1]\).

Parameters:
atomsdict

Dictionary with N atoms. Expected keys:

  • "positions" : (N, 3) array-like Positions of the atoms in the basis of lattice vectors (cell). In other words - relative coordinates of atoms.

Examples

>>> import wulfric
>>> atoms = {"positions": [[0, 0.5, 0], [1.25, 0, -0.52], [0.25, -0.65, 2.375]]}
>>> for p in atoms["positions"]:
...     print(p)
[0, 0.5, 0]
[1.25, 0, -0.52]
[0.25, -0.65, 2.375]
>>> wulfric.crystal.ensure_000(atoms)
>>> for p in atoms["positions"]:
...     print(p)
[0, 0.5, 0]
[0.25, 0, 0.48]
[0.25, 0.35, 0.375]