17.1.1.6. pysisyphus.dynamics package
17.1.1.6.1. Submodules
17.1.1.6.2. pysisyphus.dynamics.Gaussian module
- class pysisyphus.dynamics.Gaussian.Gaussian(w=1, s=1, x0=None, colvar=None, dump_name=None)[source]
Bases:
object
- __init__(w=1, s=1, x0=None, colvar=None, dump_name=None)[source]
-
V(f(x)) = w * exp(-(f(x) - f0)**2 / (2*s**2))
F(x) = -dV/dx = -dV/df * df/dx
- calculate(coords, x0=None, gradient=False)[source]
Return potential and gradient for Gaussian(s) centered at x0.
- property s
- property w
17.1.1.6.3. pysisyphus.dynamics.colvars module
17.1.1.6.4. pysisyphus.dynamics.driver module
- class pysisyphus.dynamics.driver.MDResult(coords, t_ps, step, terminated, T, E_tot, v_last, coords_last)[source]
Bases:
object
-
E_tot:
ndarray
-
T:
ndarray
-
coords:
ndarray
-
coords_last:
ndarray
-
step:
int
-
t_ps:
float
-
terminated:
Optional
[str
]
-
v_last:
ndarray
-
E_tot:
- pysisyphus.dynamics.driver.md(geom, v0, steps, dt, remove_com_v=True, thermostat=None, T=298.15, timecon=100, term_funcs=None, constraints=None, constraint_kwargs=None, gaussians=None, verbose=True, print_stride=50, dump_stride=None, h5_group_name='run')[source]
Velocity verlet integrator.
- Parameters:
geom (Geometry) -- The system for which the dynamics are to be run.
v0 (np.array, floats) -- Initial velocities in Bohr/fs.
steps (float) -- Number of simulation steps.
dt (float) -- Timestep in fs.
remove_com_v (bool, default=True) -- Remove center-of-mass velocity.
thermostat (str, optional, default None) -- Which and whether to use a thermostat.
T (float, optional, default=None) -- Desired temperature in thermostated runs.
timecon (float) -- Timeconsanst of the thermostat in fs.
term_funcs (dict, optional) -- Iterable of functions that are called with the atomic coordinates in every MD cycle and result in termination
constraints (2d iterable, optional) -- 2D iterable containing atom indices describing constrained bond lengths. of the MD integration when they evaluate to true.
constraint_kwargs (dict, optional) -- Keyword arguments for the constraint algorithm.
gaussians (list, optional, default=None) -- List of Gaussians to be used in a metadynamics run.
verbose (bool, default=True) -- Do additional printing when True.
print_stride (int, default=50) -- Report every n-th step.
dump_stride (int, default=None) -- If given, MD data will be dumped to a HDF5 file every n-th step.
str (h5_group_name =) -- Name of the HDF5 group, used for dumping.
optional -- Name of the HDF5 group, used for dumping.
17.1.1.6.5. pysisyphus.dynamics.helpers module
- pysisyphus.dynamics.helpers.get_mb_velocities(masses, cart_coords, T, remove_com_v=True, remove_rot_v=True, seed=None)[source]
Initial velocities from Maxwell-Boltzmann distribution.
- Parameters:
masses (np.array, 1d, shape (number of atoms, )) -- Atomic masses in amu.
cart_coords (iterable, 1d, shape (3 * number of atoms, )) -- Atomic cartesian coordinates. Needed for removal of rotation.
T (float) -- Temperature in Kelvin.
remove_com_v (bool, default=True, optional) -- Whether to remove center-of-mass velocity.
remove_rot_v (bool, default=True, optional) -- Whether to remove rotational velocity.
seed (int, default=None, optional) -- Seed for the random-number-generator.
- Returns:
v -- Initial velocities in Bohr/fs.
- Return type:
np.array, 2d, shape (number of atoms, 3)
- pysisyphus.dynamics.helpers.get_mb_velocities_for_geom(geom, T, remove_com_v=True, remove_rot_v=True, seed=None)[source]
Initial velocities from Maxwell-Boltzmann distribution.
See 'get_mb_velocities' for explanation.
- pysisyphus.dynamics.helpers.kinetic_energy_for_temperature(atom_number, T, fixed_dof=0)[source]
Kinetic energy for given temperature and number of atoms.
Each atom has three degrees of freedom (1/2 * 3 == 3/2).
- Parameters:
atom_number (int) -- Number of atoms. Each atom has three degrees of freedom.
T (float) -- Temperature in Kelvin.
fixed_dof (int, optional, default=0) -- Number of fixed degrees of freedom, e.g. 3 when the center-of-mass velocity is removed.
- Returns:
E_kin -- Kinetic energy in Hartree.
- Return type:
float
- pysisyphus.dynamics.helpers.kinetic_energy_from_velocities(masses, velocities)[source]
Kinetic energy for given velocities and masses.
- Parameters:
masses (1d array, shape (number of atoms, )) -- Atomic masses in amu.
velocities (2d array, (number of atoms, 3)) -- Atomic velocities in Bohr/fs.
- Returns:
E_kin -- Kinetic energy in Hartree.
- Return type:
float
- pysisyphus.dynamics.helpers.remove_com_velocity(v, masses, keep_norm=True)[source]
Remove center-of-mass velocity.
Returned units vary with the given input units.
- Parameters:
v (np.array, 2d, shape (number of atoms, 3)) -- Velocities.
masses (np.array, 1d, shape (number of atoms, )) -- Atomic masses.
keep_norm (bool, default=True) -- Whether to rescale v to its original norm, after removal of v_com.
- Returns:
v -- Velocities without center-of-mass velocity.
- Return type:
np.array
- pysisyphus.dynamics.helpers.scale_velocities_to_energy(masses, v, E_desired)[source]
Scale velocities to a given temperature.
- Parameters:
masses (np.array, 1d, shape (number of atoms, )) -- Atomic masses in amu.
v (np.array, 2d, shape (number of atoms, 3)) -- (Unscaled) velocities in Bohr/fs.
E_desired (float) -- Desired kinetic energy in Hartree.
- Returns:
v -- Scaled velocities in Bohr/fs.
- Return type:
np.array, 2d, shape (number of atoms, 3)
- pysisyphus.dynamics.helpers.scale_velocities_to_temperatue(masses, v, T_desired, fixed_dof=0)[source]
Scale velocities to a given temperature.
- Parameters:
masses (np.array, 1d, shape (number of atoms, )) -- Atomic masses in amu.
v (np.array, 2d, shape (number of atoms, 3)) -- (Unscaled) velocities in Bohr/fs.
T_desired (float) -- Desired temperature in Kelvin.
fixed_dof (int, optional, default=0) -- Number of fixed degrees of freedom, e.g. 3 when the center-of-mass velocity is removed.
- Returns:
v -- Scaled velocities in Bohr/fs.
- Return type:
np.array, 2d, shape (number of atoms, 3)
- pysisyphus.dynamics.helpers.temperature_for_kinetic_energy(atom_number, E_kin, fixed_dof=0)[source]
Temperature for given kinetic energy and atom number.
Each atom has three degrees of freedom (1/2 * 3 == 3/2).
- Parameters:
atom_number (int) -- Number of atoms. Each atom has three degrees of freedom.
E_kin (float) -- Kinetic energy in Hartree.
fixed_dof (int, optional, default=0) -- Number of fixed degrees of freedom, e.g. 3 when the center-of-mass velocity is removed.
- Returns:
Temperature -- Temperature in Kelvin.
- Return type:
float
- pysisyphus.dynamics.helpers.unscaled_velocity_distribution(masses, T, seed=None)[source]
ρ ∝ exp(- v² * m / (2 * kT)) ln(ρ) ∝ - 1/2 * v² * m / kT v² ∝ -2 * ln(ρ) * kT / m v ∝ ±(-2 * ln(ρ) * kT / m)**0.5 v ∝ ±(-2 * k)**0.5 * (ln(ρ) * T / m)**0.5
The first term of the RHS is constant. As we later scale the velocities we neglect it. Don't use these velocities unscaled!
v ∝ ±(ln(ρ) * T / m)**0.5
17.1.1.6.6. pysisyphus.dynamics.lincs module
17.1.1.6.7. pysisyphus.dynamics.mdp module
- pysisyphus.dynamics.mdp.MDPResult
alias of
MDResult
17.1.1.6.8. pysisyphus.dynamics.rattle module
17.1.1.6.9. pysisyphus.dynamics.thermostats module
- pysisyphus.dynamics.thermostats.csvr_closure(sigma, dof, dt, tau=100, rng=None)[source]
- Parameters:
sigma (float) -- Target average value of the kinetic energy (1/2 dof k_b T) in the same units as cur_kinetic_energy.
dof (int) -- Degrees of freedom.
tau (float) -- Timeconstant of the thermostat. tau : float Timeconstant of the thermostat.
rng (numpy.random.Generator, optional) -- Instances of a random number generator (RNG). If it is not provided the module-level RNG will be used.