Configuration manager

class mchammer.ConfigurationManager(structure: ase.atoms.Atoms, sublattices: icet.core.sublattices.Sublattices)[source]

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

Parameters
  • structure (ase.Atoms) – configuration to be handled

  • sublattices (Sublattices) – sublattices class used to define allowed occupations and so on

Todo

  • revise docstrings

get_flip_state(sublattice_index: int, allowed_species: List[int] = None) → Tuple[int, int][source]

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

Parameters
  • sublattice_index – index of sublattice from which to pick a site

  • allowed_species – list of atomic numbers for allowed species

get_occupations_on_sublattice(sublattice_index: int) → List[int][source]

Returns the occupations on one sublattice.

Parameters

sublattice_index – the sublattice for which the occupations should be returned

get_swapped_state(sublattice_index: int, allowed_species: List[int] = None) → Tuple[List[int], List[int]][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 – sublattice from which to pick sites

  • allowed_species – list of atomic numbers for allowed species

is_swap_possible(sublattice_index: int, allowed_species: List[int] = None) → bool[source]

Checks if swap is possible on specific sublattice.

Parameters
  • sublattice_index – index of sublattice to be checked

  • allowed_species – list of atomic numbers for allowed species

property occupations

occupation vector of the configuration (copy)

property structure

atomic structure associated with configuration (copy)

property sublattices

sublattices of the configuration

update_occupations(sites: List[int], species: List[int])[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 – indices of sites of the configuration to change

  • species – new occupations by atomic number