magnopy.SpinHamiltonian.set_distribution#

method

SpinHamiltonian.set_distribution(strategy='symmetrize') None[source]#

Enforces one of the supported distributions of parameters within the sets of equivalent parameters.

Added in version 0.5.2.

See Equivalent parameters for more details.

Parameters:
strategystr, default "symmetrize"

Strategy for distributing overall value between parameters of the equivalent set. Case-insensitive. Supported options are

  • "symmetrize" (default) All parameters from the set are equal to each other.

  • "one-for-all" The sum is assigned to the single representative parameter. All other parameters from the set are set to zeros.

Raises:
ValueError

If strategy is not one of the supported options.

ValueError

If spinham.convention.multiple_counting is False. See Notes below.

Notes

If spinham.convention.multiple_counting is False, then this function raises a ValueError as the distribution of parameters is fixed and can not be changed.

On contrary to SpinHamiltonian.restore_missing_parameters(), this method never changes the physics of the Hamiltonian.

Examples

See Symmetrization for more details on how to use this function.