Trajectories module¶
Low-level tools for handling trajectory files.
Python library usage¶
Functions to help generate and manipulate trajectories
-
esteem.trajectories.
generate_md_trajectory
(model, seed, target, traj_label, trajname_suffix, md_func, count_snaps, count_equil, md_steps, md_timestep, temp, calc_params, constraints=None, dynamics=None, singlepoint_func=None)[source]¶ Runs equilibration followed by statistics generation MD for a given model.
This generic function gets called by both AIMD and by MLMD.
- model: ASE Atoms
- Initial geometry for the MD trajectory
- seed: str
- String containing name of molecule and excited state index
- target: int or None
- Excited state index
- traj_label: character or str
- String labelling trajectory (usually A,B,C..)
- seed: str
- String containing name of molecule and excited state index
- trajname_suffix: str
- String appended to
seed_state_traj
to give full trajectory filename - md_func: function
- Wrapper function that runs
md_steps
steps of MD onmodel
- count_snaps: int
- Number of snapshot runs
- count_equil: int
- Number of equilibration runs
- md_steps: int
- Number of molecular dynamics timesteps in each run above
- md_timestep: float
- Molecular dynamics timestep within the runs
- temp: float
- Thermostat temperature (NVT ensemble)
- calc_params:
- Control-parameters for the wrapper (for QM this is the basis, functional, and target; for ML this is the calculator seed, suffix, prefix and target)
- constraints: wrapper-dependent type
- Variables controlling the constraints
- dynamics: wrapper-dependent type
- Variables controlling the dynamics
-
esteem.trajectories.
cycle_step_labels_and_restarts
(seed, traj_label, prevdir, currdir, nextdir, prevtarg, currtarg, nexttarg, prevstep, currstep, nextstep, count, prevcount, rst_ext=None)[source]¶ Move restart files around so that each step continues from the previous one
-
esteem.trajectories.
find_initial_geometry
(seed, geom_opt_func, calc_params, which_traj=None)[source]¶ Obtains a suitable initial geometry for the current seed and state. Optimises it if not present.
- seed: str
- String indicating name of molecule, used to find xyz file
- geom_opt_func: function
- Wrapper function that runs a geometry optimisation
- calc_params:
- Control-parameters for the wrapper (for QM this is the basis, functional, and target; for ML this is the calculator seed, suffix, prefix and target)
-
esteem.trajectories.
recalculate_trajectory
(seed, target, traj_label, trajname_suffix, input_target, input_suffix, singlepoint_func, calc_params, input_traj_range=None, output_traj_offset=0, solvent=None)[source]¶ Loads snapshots from a trajectory and recalculates the energy and forces with the current settings seed: str
String containing name of molecule and excited state index- target: int or None
- Excited state index
- traj_label: character or str
- String labelling trajectory (usually A,B,C..)
-
esteem.trajectories.
cycle_restarts
(seed, traj_label, trajname_suffix, prevtarg, currtarg, prevstep, currstep)[source]¶ Move db files around so that each step continues from the previous one
-
esteem.trajectories.
get_trajectory_list
(ntraj)[source]¶ Returns a list of characters to be used as trajectory labels Currently ABCDEDFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz (52)
-
esteem.trajectories.
merge_traj
(trajnames, trajfile)[source]¶ Merges a list of trajectories supplied as a list of filenames, and writes the result to another trajectory supplied as a filename
-
esteem.trajectories.
split_traj
(input_traj_file, output_trajs=None, ntrajs=None, randomise=False, start=0, end=-1)[source]¶ Takes in a trajectory filename, and splits it into sections, randomly or sequentially
-
esteem.trajectories.
fit_atom_energies_to_traj
(traj, atom_traj_file)[source]¶ Uses linear regression to best fit atom energies to trajectory with varying numbers of atoms of each species
-
esteem.trajectories.
subtract_atom_energies_from_traj
(traj, atom_traj, trajout)[source]¶ Subtracts the energies associated with isolated atoms from the total energies in a trajectory
-
esteem.trajectories.
compare_traj_to_traj
(trajx, trajy, plot_file=None, xlabel=None, ylabel=None)[source]¶ Compares two trajectories to each other and calculates statistics for how much they differ in energy and force
- trajx: ASE Trajectory
- Trajectory whose energy is plotted along x-axis
- trajy: ASE Trajectory
- Trajectory whose energy is plotted along y-axis
- plot_file:
- Filename to write plot image to.
- xlabel, ylabel: str
- Axis labels for plots.