17.1.1.3. pysisyphus.cos package
17.1.1.3.1. Submodules
17.1.1.3.2. pysisyphus.cos.AdaptiveNEB module
- class pysisyphus.cos.AdaptiveNEB.AdaptiveNEB(images, adapt=True, adapt_fact=0.25, adapt_between=1, scale_fact=False, keep_hei=True, free_ends=True, **kwargs)[source]
Bases:
NEB
- __init__(images, adapt=True, adapt_fact=0.25, adapt_between=1, scale_fact=False, keep_hei=True, free_ends=True, **kwargs)[source]
(Free-End) Adaptive Nudged Elastic Band.
- Parameters:
images (list of Geometry objects) -- Images of the band.
adapt (bool, default True) -- Whether to adapt the image number or not. This switch is included to support the FreeEndNEB class, that is just a thin wrapper around this class.
adapt_fact (positive float) -- Factor that is used to decide wether to adapt. The inital threshold is calculated by multiplying the RMS force of the band with this factor. When the RMS of the force falls below this threshold adaption takes place.
adapat_between (positive integer) -- Number of images to interpolate between the highest energy image and its neighbours. The number of starting images must be higher or equal then 2*adapt_between+3, as we reuse/transfer the calculators from the starting images onto the new ones.
scale_fact (bool, default False) -- Whether to increase adapt_fact in deeper levels. This may lead to earlier adapation.
keep_hei (bool, optional) -- Whether to keep the highest energy image (usually a very good idea) or to interpolate only between the neighbouring images.
free_ends (bool, default True) -- Whether to use modified forces on the end images.
- adapt_this_cycle(forces)[source]
Decide wether to adapt.
- Parameters:
forces (np.array) -- Forces of the previous optimization cycle.
- Returns:
adapt -- Flag that indicates if adaption should take place in this cycle.
- Return type:
bool
- property forces
See Eq. (7) in [2].
17.1.1.3.3. pysisyphus.cos.ChainOfStates module
- class pysisyphus.cos.ChainOfStates.ChainOfStates(images, fix_first=True, fix_last=True, align_fixed=True, climb=False, climb_rms=0.005, climb_lanczos=False, climb_lanczos_rms=0.005, climb_fixed=False, ts_opt=False, ts_opt_rms=0.0025, energy_min_mix=False, scheduler=None, cluster=False, cluster_kwargs=None, progress=False)[source]
Bases:
object
- property atoms
- property calculator
- property cart_coords
Return a flat 1d array containing the cartesian coordinates of all images.
- compare_image_rms_forces(ref_rms)[source]
Compare rms(forces) value of an image against a reference value.
Used to decide if we designate an image as climbing image or a TS node.
Only initiate climbing on a sufficiently converged MEP. This can be determined from a supplied threshold for the RMS force (rms_force) or from a multiple of the RMS force convergence threshold (rms_multiple, default).
- property coords
Return a flat 1d array containing the coordinates of all images.
- property coords3d
- property energy
- property forces
- get_full_cycles()[source]
Return array of integers that indexes self.all_true_forces/self.all_cart_coords.
When the ChainOfStates is not yet fully grown this list will be empty. The items of this list can be used to index self.all_true_forces and related lists, to extract image coordinate & forces data for all cycles when the COS was already fully grown.
This data can then be used to, e.g., construct a (TS)-Hessian for an selected image.
- Return type:
ndarray
- get_tangent(i, kind='upwinding', lanczos_guess=None, disable_lanczos=False)[source]
[1] Equations (8) - (11)
- property gradient
- property image_coords
- property image_inds
- property is_analytical_2d
- property last_index
- logger = <Logger cos (DEBUG)>
- property masses_rep
- property max_image_num
- property moving_images
- property moving_indices
Returns the indices of the images that aren't fixed and can be optimized.
- property nimages: int
- property perpendicular_forces
- prepare_opt_cycle(last_coords, last_energies, last_forces)[source]
Implements additional logic in preparation of the next optimization cycle.
Should be called by the optimizer at the beginning of a new optimization cycle. Can be used to implement additional logic as needed for AdaptiveNEB etc.
- propagate(force_unique_overlap_data_fns=True)[source]
Propagate chkfiles and root information along COS.
Does an energy calculation at every image and tries to propagate the converged wavefunction to the next image.
When excited states should be tracked it is assumed that the correct root is set at the first image. In most cases, e.g. in COS calculations started from YAML input the initial root will be the same for all images. When the correct root switches between the first image (with the correct root) and the last image, then using the same root for all images will be wrong. This is also corrected here. From the second image on the excited state (ES) overlaps are calculated between the current image and the image before it and the root with the highest overlap to the root on the previous image is set on the current image. As we start from the correct root at the first image this will ensure that the correct root is selected at all images.
If requested, unique names for the dumped overlap data HDF5 will be picked.
- property results
- set_coords_at(i, coords)[source]
Called from helpers.procrustes with cartesian coordinates. Then tries to set cartesian coordinate as self.images[i].coords which will raise an error when coord_type != "cart".
- set_zero_forces_for_fixed_images()[source]
This is always done in cartesian coordinates, independent of the actual coord_type of the images as setting forces only work with cartesian forces.
- property use_dask
- valid_coord_types = ('cart', 'cartesian', 'dlc')
- zero_vec
It was a rather unfortunate choice to fill/grow self.coords_list and self.all_true_forces in different methods. self.prepare_opt_cycle() appends to self.coords_list, while self.calculate_forces() appends to self.all_true_forces().
After a succsessful COS optimization both lists differ in length; self.all_true_forces has 1 additional item, compared to self.coords_list, as self.calculate_forces() is called in Optimizer.prepare_opt() once. Afterwards, self.coords_list and self.all_true_forces grow in a consistent manner.
Two choices can be made: keep this discrepancy in mind and omit/neglect the first item in self.coords_list, or grow another list in self.calculate_forces(). For now, we will go with the latter option.
17.1.1.3.4. pysisyphus.cos.FreeEndNEB module
- class pysisyphus.cos.FreeEndNEB.FreeEndNEB(*args, fix_first=False, fix_last=False, **kwargs)[source]
Bases:
AdaptiveNEB
- __init__(*args, fix_first=False, fix_last=False, **kwargs)[source]
Simple Free-End-NEB method.
Derived from AdaptiveNEB with disabled adaptation. Only implements Eq. (7) from [2]. For other implementations please see the commit 01bc8812ca6f1cd3645d43e0337d9e3c5fb0ba55. There the other variants are present but I think Eq. (7) in [2] is the simplest & best bet.
17.1.1.3.5. pysisyphus.cos.FreezingString module
17.1.1.3.6. pysisyphus.cos.GrowingChainOfStates module
- class pysisyphus.cos.GrowingChainOfStates.GrowingChainOfStates(images, calc_getter, max_nodes=10, **kwargs)[source]
Bases:
ChainOfStates
- property arc_dims
- property max_image_num
- prepare_opt_cycle(*args, **kwargs)[source]
Implements additional logic in preparation of the next optimization cycle.
Should be called by the optimizer at the beginning of a new optimization cycle. Can be used to implement additional logic as needed for AdaptiveNEB etc.
- propagate(force_unique_overlap_data_fns=True)[source]
Propagate chkfiles and root information along COS.
Does an energy calculation at every image and tries to propagate the converged wavefunction to the next image.
When excited states should be tracked it is assumed that the correct root is set at the first image. In most cases, e.g. in COS calculations started from YAML input the initial root will be the same for all images. When the correct root switches between the first image (with the correct root) and the last image, then using the same root for all images will be wrong. This is also corrected here. From the second image on the excited state (ES) overlaps are calculated between the current image and the image before it and the root with the highest overlap to the root on the previous image is set on the current image. As we start from the correct root at the first image this will ensure that the correct root is selected at all images.
If requested, unique names for the dumped overlap data HDF5 will be picked.
17.1.1.3.7. pysisyphus.cos.GrowingNT module
- class pysisyphus.cos.GrowingNT.GrowingNT(geom, step_len=0.5, rms_thresh=0.0017, r=None, final_geom=None, between=None, bonds=None, r_update=True, r_update_thresh=1.0, stop_after_ts=False, require_imag_freq=0.0, hessian_at_ts=False, out_dir='.', dump=True)[source]
Bases:
object
- property P
Projector that keeps perpendicular component.
- property atoms
- property cart_coords
- property cart_forces
- property coords
- property energy
- property forces
- logger = <Logger cos (DEBUG)>
- property r
Parallel/search direction.
17.1.1.3.8. pysisyphus.cos.GrowingString module
- class pysisyphus.cos.GrowingString.GrowingString(images, calc_getter, perp_thresh=0.05, param='equi', reparam_every=2, reparam_every_full=3, reparam_tol=None, reparam_check='rms', max_micro_cycles=5, reset_dlc=True, climb=False, **kwargs)[source]
Bases:
GrowingChainOfStates
- property forces
- property full_string_image_inds
- property fully_grown
Returns wether the string is fully grown. Don't count the first and last node.
- get_new_image(ref_index)[source]
Get new image by taking a step from self.images[ref_index] towards the center of the string.
- property image_inds
- property left_size
- property lf_ind
Index of the left frontier node in self.images.
- property nodes_missing
Returns the number of nodes to be grown.
- property rf_ind
Index of the right frontier node in self.images.
- property right_size
- property string_size
17.1.1.3.9. pysisyphus.cos.NEB module
- class pysisyphus.cos.NEB.NEB(images, variable_springs=False, k_max=0.3, k_min=0.1, perp_spring_forces=None, bandwidth=None, **kwargs)[source]
Bases:
ChainOfStates
- property forces
- property parallel_forces
17.1.1.3.10. pysisyphus.cos.SimpleZTS module
- class pysisyphus.cos.SimpleZTS.SimpleZTS(images, param='equal', **kwargs)[source]
Bases:
ChainOfStates