Configuration manager

class mchammer.ConfigurationManager(atoms, sublattices)[source]

The ConfigurationManager owns and handles information pertaining to a configuration being sampled in a Monte Carlo simulation.

  • atoms (ASE Atoms) – configuration to be handled
  • sublattices (Sublattices) – sublattices class used to define allowed occupations and so on


  • revise docstrings

atomic structure associated with configuration (copy)

Return type:Atoms

Returns a site index and a new species for the site.

Parameters:sublattice_index (int) – index of sublattice from which to pick a site
Return type:Tuple[int, int]

Returns two random sites (first element of tuple) and their occupation after a swap (second element of tuple). The new configuration will obey the occupation constraints associated with the configuration mananger.

Parameters:sublattice_index (int) – sublattice from which to pick sites
Return type:Tuple[List[int], List[int]]

Checks if swap is possible on specific sublattice.

Parameters:sublattice_index (int) – index of sublattice to be checked
Return type:bool

occupation vector of the configuration (copy)

Return type:List[int]

sublattices of the configuration

Return type:Sublattices
update_occupations(sites, species)[source]

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

  • sites (List[int]) – indices of sites of the configuration to change
  • species (List[int]) – new occupations by atomic number