pantea.simulation package#
Submodules#
pantea.simulation.lennard_jones module#
pantea.simulation.molecular_dynamics module#
- class pantea.simulation.molecular_dynamics.MDSimulator(time_step, thermostat=None)[source]#
Bases:
objectA molecular dynamics simulator to predict trajectory of particles over time. :type time_step:
float:param time_step: time step in Hartree time unit :type time_step: float :type thermostat:Optional[BrendsenThermostat] :param thermostat: input thermostat that controls the temperature of the systemto the target value, defaults to None
This simulator is intended to be used for small systems of atoms during the potential training in order to generate new training dataset.
pantea.simulation.monte_carlo module#
- class pantea.simulation.monte_carlo.MCSimulator(translate_step, target_temperature, movements_per_step=1, seed=12345)[source]#
Bases:
objectA Monte Carlo simulator to predict atom configurations for a given temperature.
- Parameters
translate_step (float) – maximum translate step in Bohr unit
target_temperature (float) – target temperature for the system
atomic_masses (Optional[Array], optional) – atomic mass of atoms in the input structure, defaults to None
movements_per_step (int, default to 1) – number of random movements per step
seed (int, optional) – seed for generating random atom movements, defaults to 12345
It must be noted that this MC simulator modifies atom positions and total_energy of Structure inside the system.
This simulator is intended to be used for small systems of atoms during the potential training in order to generate new dataset.
pantea.simulation.simulate module#
- class pantea.simulation.simulate.MDSystemInterface(*args, **kwargs)[source]#
Bases:
Protocol- potential: PotentialInterface#
- class pantea.simulation.simulate.SimulatorInterface(*args, **kwargs)[source]#
Bases:
Protocol- step: int#
- pantea.simulation.simulate.simulate(system, simulator, num_steps=1, output_freq=None, filename=None, append=False)[source]#
Simulate system for a given number of steps.
- Parameters
system (MDSystemInterface) – a system of particles and the interacting potential.
simulator (SimulatorInterface) – either a molecular dynamics (MD) or monte carlo (MC) simulator
num_steps (int, optional) – number of steps, defaults to 1
output_freq (Optional[int], optional) – print outputs and/or dump configuration file after this number of steps, defaults to None
filename (Optional[Path], optional) – output configuration file (e.g., *.xyz) as supported in the ASE, defaults to None
append (bool, optional) – whether append to the exiting configuration file or not, defaults to False
- Return type
None
pantea.simulation.system module#
- class pantea.simulation.system.System(potential, structure, velocities, masses)[source]#
Bases:
objectAn extended atom Structure for molecular simulations (e.g. MD).
- property forces: ArrayImpl#
- Return type
ArrayImpl
- classmethod generate_random_velocities(temperature, masses, seed)[source]#
Generate Maxwell-Boltzmann distributed random velocities.
- Return type
ArrayImpl
- masses: ArrayImpl#
- property natoms: int#
- Return type
int
- property positions: ArrayImpl#
- Return type
ArrayImpl
- potential: PotentialInterface#
- velocities: ArrayImpl#
pantea.simulation.thermostat module#
- class pantea.simulation.thermostat.BrendsenThermostat(target_temperature, time_constant)[source]#
Bases:
objectControl simulation temperature using Brendsen thermostat.
- class pantea.simulation.thermostat.BrendsenThermostatParams(time_step, time_constant, current_temperature, target_temperature)[source]#
Bases:
tupleCreate new instance of BrendsenThermostatParams(time_step, time_constant, current_temperature, target_temperature)
- current_temperature: ArrayImpl#
Alias for field number 2
- target_temperature: ArrayImpl#
Alias for field number 3
- time_constant: ArrayImpl#
Alias for field number 1
- time_step: ArrayImpl#
Alias for field number 0
Module contents#
- class pantea.simulation.BrendsenThermostat(target_temperature, time_constant)[source]#
Bases:
objectControl simulation temperature using Brendsen thermostat.
- class pantea.simulation.LJPotential(sigma, epsilon, r_cutoff, gradient_method='direct')[source]#
Bases:
objectA simple implementation of Lennard-Jones potential.
- class pantea.simulation.MCSimulator(translate_step, target_temperature, movements_per_step=1, seed=12345)[source]#
Bases:
objectA Monte Carlo simulator to predict atom configurations for a given temperature.
- Parameters
translate_step (float) – maximum translate step in Bohr unit
target_temperature (float) – target temperature for the system
atomic_masses (Optional[Array], optional) – atomic mass of atoms in the input structure, defaults to None
movements_per_step (int, default to 1) – number of random movements per step
seed (int, optional) – seed for generating random atom movements, defaults to 12345
It must be noted that this MC simulator modifies atom positions and total_energy of Structure inside the system.
This simulator is intended to be used for small systems of atoms during the potential training in order to generate new dataset.
- class pantea.simulation.MDSimulator(time_step, thermostat=None)[source]#
Bases:
objectA molecular dynamics simulator to predict trajectory of particles over time. :type time_step:
float:param time_step: time step in Hartree time unit :type time_step: float :type thermostat:Optional[BrendsenThermostat] :param thermostat: input thermostat that controls the temperature of the systemto the target value, defaults to None
This simulator is intended to be used for small systems of atoms during the potential training in order to generate new training dataset.
- class pantea.simulation.System(potential, structure, velocities, masses)[source]#
Bases:
objectAn extended atom Structure for molecular simulations (e.g. MD).
- property forces: ArrayImpl#
- Return type
ArrayImpl
- classmethod generate_random_velocities(temperature, masses, seed)[source]#
Generate Maxwell-Boltzmann distributed random velocities.
- Return type
ArrayImpl
- masses: ArrayImpl#
- property natoms: int#
- Return type
int
- property positions: ArrayImpl#
- Return type
ArrayImpl
- potential: PotentialInterface#
- velocities: ArrayImpl#
- pantea.simulation.simulate(system, simulator, num_steps=1, output_freq=None, filename=None, append=False)[source]#
Simulate system for a given number of steps.
- Parameters
system (MDSystemInterface) – a system of particles and the interacting potential.
simulator (SimulatorInterface) – either a molecular dynamics (MD) or monte carlo (MC) simulator
num_steps (int, optional) – number of steps, defaults to 1
output_freq (Optional[int], optional) – print outputs and/or dump configuration file after this number of steps, defaults to None
filename (Optional[Path], optional) – output configuration file (e.g., *.xyz) as supported in the ASE, defaults to None
append (bool, optional) – whether append to the exiting configuration file or not, defaults to False
- Return type
None