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, traj_suffix, wrapper, count_snaps, count_equil, md_steps, md_timestep, md_friction, temp, calc_params, charge=0, solvent=None, constraints=None, dynamics=None, snap_wrapper=None, snap_calc_params=None, continuation=False, store_full_traj=False, debugger=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
- traj_suffix: str
- String appended to seed and target state to give full trajectory filename
- wrapper: ESTEEM wrapper class
- Wrapper containing run_md and singlepoint functions
- 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
- store_full_traj: bool
- Determines whether the full step-by-step trajectory is written, or just the snapshots each md_steps
- 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)
- solvent:
- Implicit solvent description
- 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, exts, use_subdirs=False)[source]¶ Move restart files around so that each step continues from the previous one
-
esteem.trajectories.
find_initial_geometry
(seed, geom_opt_func=None, calc_params={}, which_traj=None, ntraj=-1)[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, traj_suffix, input_target, input_suffix, wrapper, calc_params, input_traj_range=None, input_traj_label=None, output_traj_offset=0, charge=0, solvent=None, calc_forces=True, calc_dipole=True, geom_opt_kernel=False, vibfreq_kernel=False)[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, traj_suffix, prevtarg, currtarg, prevstep, currstep, db_ext)[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 ABCDEDFGHIJKLMNOPQRSTUVWXYZ (26) then uses AA,AB,…,ZZ (26^2)
-
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.
diff_traj
(itrajfile, jtrajfile, outtrajfile)[source]¶ Takes two trajectory filenames and finds the energy and force difference between them, outputting the result to a trajectory name outtrajfile
-
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.
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_func=<function plot_diff>, plot_file=None, xlabel=None, ylabel=None, clabel=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.