magnopy.SpinHamiltonian.add_41#
method
- SpinHamiltonian.add_41(alpha: int, parameter, units=None, 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). Given in the units of
units.- unitsstr, optional
Units in which the
parameteris given. Parameters have the the units of energy. By default assumesSpinHamiltonian.units. For the list of the supported units see Units of Hamiltonian's parameters. If givenunitsare different fromSpinHamiltonian.units, then the parameter's value will be converted automatically fromunitstoSpinHamiltonian.units.Added in version 0.3.0.
- 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.