wulfric.crystal.ensure_000#

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

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

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

Parameters:
atomsdict

Dictionary with atoms. Must have a "positions" with value of (N,3) array-like.

Examples

>>> import wulfric as wulf
>>> 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]
>>> wulf.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]