mcmala.montecarlo package

Submodules

mcmala.montecarlo.averager module

Averager to extract information from multiple Markov chains.

class mcmala.montecarlo.averager.Averager

Bases: object

Averager class used to average over multiple Markov chains.

add_markov_chain(markov_chain_id)

Add a Markov chain to the analysis.

Observables of this particular Markov chain will be used for averaging.

Parameters

markov_chain_id (string) – String identifier of the Markov chain to be added to analysis.

property rdf

Total energy of the system (in eV).

property total_energy

Total energy of the system (in eV).

mcmala.montecarlo.markovchain module

Markov chain for Monte Carlo simulation.

class mcmala.montecarlo.markovchain.MarkovChain(temperatureK, evaluator: ase.calculators.calculator.Calculator, configuration_suggester: mcmala.simulation.configuration_suggester.ConfigurationSuggester, initial_configuration, calculate_observables_after_steps=1, markov_chain_id='mcmala_default', additonal_observables=[], ensemble='nvt')

Bases: object

Represent a single Markov chain.

Parameters
  • temperatureK (float) – Temperature in Kelvin.

  • evaluator (ase.calculators.calculator.Calculator) – Evaluator object used to calculate the total energy.

  • configuration_suggester (mcmala.simulation.configuration_suggester.ConfigurationSuggester) – Suggests changes to configuration of MarkovChain. Depends on the type of model.

  • initial_configuration (Any) – Initial configuration of atoms, spin grid, etc.

  • calculate_observables_after_steps (int) – Controls after how many steps the obervables are calculated. Does not apply to the energy, which is calculated at any step for obvious reasons.

  • additonal_observables (list) – A list of additional (=not the total energy) observables that will be calculated at each calculate_observables_after_steps-th step.

  • ensemble (string) – Determines based on which ensemble the acceptance will be handled. “nvt” : NVT (canonical) ensemble “debug” : each configuration will be accepted.

run(steps_to_evolve, print_energies=False, save_run=True)

Run this Markov chain for a specified number of steps.

Parameters
  • steps_to_evolve (int) – Number of steps to run the simulation for.

  • print_energies (bool) – If True, the energies are printed at each step of the simulation.

  • save_run (bool) – Is True by default; if False, the run will not be saved (e.g. for examples and such).

property total_energy

Total energy of the system in eV.

mcmala.montecarlo.markovchain.random()x in the interval [0, 1).

Module contents

Everything Monte Carlo related MCMALA contains.