Configuration manager

class mchammer.ConfigurationManager(atoms, strict_constraints, sublattices, occupation_constraints=None)

ConfigurationManager store its own state of the configuration that are being sampled in the ensemble.

ConfigurationManager is responsible for all information and handling of the configuration.

Parameters:
  • occupations (list of int) – The occupation of the configurations. The integers refer to elements via their number in the periodic table
  • strict_constraints (list of list of int) – the strictest form of the allowed occupations.
  • occupation_constraints (list of list of int) – optional occupation constraint to enfore a more stricter species occupation than what is allowed from the Calculator.
  • sublattices (list of list of int) – the integers refer to lattice site indices in the configuration.

Todo

  • occupation constraint not implemented
  • add check that all sites in the different sublattices all have the same occupation constraint.
atoms

The atoms object.

get_flip_state(sublattice)

Returns a tuple of a list of a random index in a specific sublattice and a list of the element to flip it to.

Parameters:
  • sublattice (int) – The sublattice to pick indices from.
  • return ((list[int], list[int])) –
Return type:

Tuple[int, int]

get_swapped_state(sublattice)

Returns a tuple of a list of two random indices in a specific sublattice and what elements they will occupy after a swap. The two indices refer to lattice sites and the indices will, if swapped, produce a new, different configuration that is allowed by the occupation constraints.

Parameters:sublattice (int) – The sublattice to pick indices from.
Return type:Tuple[List[int], List[int]]
occupation_constraints

The occupation constraints for this configuration manager.

Return type:List[List[int]]
occupations

The occupations of the configuration.

Return type:List[int]
sublattices

The sublattices of the configuration.

Return type:List[List[int]]
update_occupations(list_of_sites, list_of_elements)

Update the element occupation of the configuration being sampled. This will change the state in both the configuration in the calculator and the state of configuration manager.

Parameters:
  • list_of_sites (list of int) – list of indices of the configuration to change.
  • list_of_elements (list of int) – list of elements to put on the lattice sites the indices refer to.

Todo

  • change occupation
  • change the element occupation