wulfric.crystal.cure_negative#

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

Shifts all atoms with the same vector in a way that all relative coordinates becomes non-negative.

Modifies given atoms dictionary.

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 = {
...     "names": ["Cr1", "Cr2"],
...     "positions": [[-0.5, 0.5, 0.0], [0.1, 0.5, 0.0]],
... }
>>> wulfric.crystal.cure_negative(atoms)
>>> for i in range(len(atoms["names"])):
...     print(atoms["names"][i], atoms["positions"][i])
Cr1 [0.  0.5 0. ]
Cr2 [0.6 0.5 0. ]