magnopy.SpinHamiltonian.restore_missing_parameters#

method

SpinHamiltonian.restore_missing_parameters(strategy='zeros') None[source]#

Checks that all interactions from the equivalent sets are present in the Hamiltonian and adds the missing ones (if any).

Added in version 0.5.2.

See Equivalent parameters for more details on sets of equivalent parameters.

Parameters:
strategystr, default "zeros"

When some parameters from the equivalent set are missing, this argument defines the value of the added parameters. Case-insensitive. Supported options are

  • "zeros" (default) Values of missing parameters are set to zeros. This option does not change the physics of the Hamiltonian.

  • "mean" Values of the missing parameters are set to the mean value of the parameters from the equivalent set. This value might change the physics of the Hamiltonian (as it adds new non-zero parameters).

Raises:
ValueError

If strategy is not one of the supported options.

Notes

If spinham.convention.multiple_counting is False, then this function does nothing as only one parameter per set is stored and no parameters can be missing.