magnopy.SpinHamiltonian.add_1#

method

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

Adds a (one spin & 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, ) array-like

Value of the parameter (\(3\times1\) vector).

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

p1
remove_1