wulfric.Atom#

class wulfric.Atom(name='X', position=(0, 0, 0), spin=None, magmom=None, g_factor=2.0, charge=None, index=None)[source]#

Atom class.

Parameters:
namestr, default "X"

Name of the atom. It cannot start or end with double underline "__".

position(3,) array-like, default [0, 0, 0]

Position of the atom in absolute or relative coordinates.

spinfloat or (3,) array-like, optional

Spin or spin vector of the atom. If only one value is given, then spin vector is oriented along z axis. Connected with magmom, see Atom.magmom.

magmomfloat or (3,) array-like, optional

Magnetic moment of the atom. Vector or the value. If a number is given, then oriented along z axis. Connected with spin, see Atom.spin.

g_factorfloat, default 2

Lande g-factor. Relates magmom and spin.

chargefloat, optional

Charge of the atom.

indexint, optional

Custom index of an atom. It is used differently in different scenarios. Combination of name and index is meant to be unique, when an atom belongs to some group (i.e. to Crystal).

Notes

"==" (and "!=") operator compare two atoms based on their names and indexes. If index of one atom is not defined, then comparison raises ValueError. If two atoms have the same Atom.name and Atom.index then they are considered to be equal. Even if they have different Atom.positions. For the check of the atom type use Atom.type. In most cases Atom.name = Atom.type.

Methods:

copy()

Create a copy of the atom.

Properties:

charge

Charge of the atom.

fullname

Fullname (Atom.name`+``__``+:py:attr:`Atom.index) of an atom.

g_factor

g-factor of an atom, relates its Atom.spin with its Atom.magmom.magmom

index

Index of an atom, meant to be unique in some abstract group of atoms.

magmom

Magnetic moment of the atom.

name

Name of the atom.

position

Relative or absolute position of the atom in some units.

spin

Spin value of the atom.

spin_angles

Polar \(\theta\) and azimuthal \(\varphi\) angles of the spin vector:

spin_direction

Direction of the classical spin vector.

spin_vector

Classical spin vector of the atom.

type

Type of an atom (i.e. Cr, Ni, ...).