magnopy.SpinHamiltonian.add_41#

method

SpinHamiltonian.add_41(alpha: int, parameter, replace=False) None#

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

Parameters:
alphaint

Index of an atom, with which the parameter is associated.

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

parameter(3, 3, 3, 3) array-like

Value of the parameter (\(3\times3\times3\times3\) tensor).

replacebool, default False

Whether to replace the value of the parameter if an atom already has a parameter associated with it.

Raises:
ValueError

If an atom already has a parameter associated with it.

See also

p41
remove_41