magnopy.SpinHamiltonian.add_44#

method

SpinHamiltonian.add_44(alpha: int, beta: int, gamma: int, epsilon: int, nu: tuple, _lambda: tuple, rho: tuple, parameter, units=None, replace=False) None#

Adds a (four spins & four sites) parameter to the Hamiltonian.

Doubles of the bonds are managed automatically (independently of the convention of the Hamiltonian).

Parameters:
alphaint

Index of an atom from the (0, 0, 0) unit cell.

0 <= alpha < len(spinham.atoms.names).

betaint

Index of an atom from the nu unit cell.

0 <= beta < len(spinham.atoms.names).

gammaint

Index of an atom from the _lambda unit cell.

0 <= gamma < len(spinham.atoms.names).

epsilonint

Index of an atom from the rho unit cell.

0 <= epsilon < len(spinham.atoms.names).

nutuple of 3 int

Three relative coordinates with respect to the three lattice vectors, that specify the unit cell for the second atom.

\[\nu = (x_{\boldsymbol{a}_1}, x_{\boldsymbol{a}_2}, x_{\boldsymbol{a}_3})\]
_lambdatuple of 3 int

Three relative coordinates with respect to the three lattice vectors, that specify the unit cell for the third atom.

\[\lambda = (x_{\boldsymbol{a}_1}, x_{\boldsymbol{a}_2}, x_{\boldsymbol{a}_3})\]
rhotuple of 3 int

Three relative coordinates with respect to the three lattice vectors, that specify the unit cell for the fourth atom.

\[\rho = (x_{\boldsymbol{a}_1}, x_{\boldsymbol{a}_2}, x_{\boldsymbol{a}_3})\]
parameter(3, 3, 3, 3) array-like

Value of the parameter (\(3\times3\times3\times3\) matrix). Given in the units of units.

unitsstr, optional

Units in which the parameter is given. Parameters have the the units of energy. By default assumes SpinHamiltonian.units. For the list of the supported units see Units of Hamiltonian's parameters. If given units are different from SpinHamiltonian.units, then the parameter's value will be converted automatically from units to SpinHamiltonian.units.

Added in version 0.3.0.

replacebool, default False

Whether to replace the value of the parameter if the triplet of atoms alpha, beta, gamma, nu, lambda or one of its duplicates already have a parameter associated with it.

Raises:
ValueError

If an atom already has a parameter associated with it.

See also

p44
remove_44

Notes

If spinham.convention.multiple_counting is True, then this function adds the bond and all its duplicates to the Hamiltonian. It will cause an ValueError to add the duplicate of the bond after the bond is added.

If spinham.convention.multiple_counting is False, then only the primary version of the bond is added to the Hamiltonian.

For the definition of the primary version see Multiple counting.