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.

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

Todo

  • revise docstrings
atoms

atomic structure associated with configuration (copy)

Return type:Atoms
get_flip_state(sublattice_index)[source]

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]
get_swapped_state(sublattice_index)[source]

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]]
is_swap_possible(sublattice_index)[source]

Checks if swap is possible on specific sublattice.

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

occupation vector of the configuration (copy)

Return type:List[int]
sublattices

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.

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