class matlantis_features.features.reaction.reaction_string.ReactionStringFeature(optimize_is: bool = True, optimize_fs: bool = True, fmax_rp: float = 0.05, fmax_ts: float = 0.05, fmax_rd: float = 0.01, fmax_eq: float = 0.001, local_extrema_tol: float = 0.001, interesting: Optional[Callable[[List[List[Atoms]]], List[bool]]] = None, timeout: Optional[timedelta] = None, logfile_rp: Optional[str] = None, logfile_eq: Optional[str] = None, observers_rp: Optional[List[Callable[[], None]]] = None, observers_eq: Optional[List[Callable[[], None]]] = None, remove_rotation_and_translation: Optional[bool] = None, max_workers: Optional[int] = None, optimizer_eq: Union[OptimizerBuilder, str] = ‘FIRELBFGS’, optimizer_rp: Union[OptimizerBuilder, str] = ‘FIRES’, k: float = 0.1, dx_ts: float = 0.02, dx_rp: float = 0.3, dx_rm: float = 1.0, estimator_fn: Optional[Callable[[], Estimator]] = None, dump_directory: Optional[Path] = None, dump_frequency: Optional[timedelta] = None)#

Bases: FeatureBase

Reliable string method that surely connect IS and FS.

All local minima are true local minima. All local maxima is the result of dimer method.

References

For more information, please refer to Matlantis Guidebook.

Methods

__init__([optimize_is, optimize_fs, …])

Initialize an instance.

__call__(images)

Get the reaction path between the initial and end images.

attach_ctx([ctx])

Attach the feature to matlantis_features.utils.Context.

check_estimator_fn(estimator_fn)

Checks if the given estimator function is None and output a warning if so.

cost_estimate([atoms])

Estimate the cost of the feature.

from_dict(res)

Construct a FeatureBase object from serialized dict.

get_savedir_from_ctx()

Get the temporary save directory from the context.

init_scope()

Context manager that enable to set attribution of the feature.

repeat(n_repeat)

Set the maximum number of times that allowed to run the __call__ function.

to_dict()

Dictionary representation of the ReactionStringFeature.

__init__(optimize_is: bool = True, optimize_fs: bool = True, fmax_rp: float = 0.05, fmax_ts: float = 0.05, fmax_rd: float = 0.01, fmax_eq: float = 0.001, local_extrema_tol: float = 0.001, interesting: Optional[Callable[[List[List[Atoms]]], List[bool]]] = None, timeout: Optional[timedelta] = None, logfile_rp: Optional[str] = None, logfile_eq: Optional[str] = None, observers_rp: Optional[List[Callable[[], None]]] = None, observers_eq: Optional[List[Callable[[], None]]] = None, remove_rotation_and_translation: Optional[bool] = None, max_workers: Optional[int] = None, optimizer_eq: Union[OptimizerBuilder, str] = ‘FIRELBFGS’, optimizer_rp: Union[OptimizerBuilder, str] = ‘FIRES’, k: float = 0.1, dx_ts: float = 0.02, dx_rp: float = 0.3, dx_rm: float = 1.0, estimator_fn: Optional[Callable[[], Estimator]] = None, dump_directory: Optional[Path] = None, dump_frequency: Optional[timedelta] = None) None#

Initialize an instance.

Parameters
  • optimize_is (bool, optional) – Optimize initial structure. Defaults to True.

  • optimize_fs (bool, optional) – Optimize final structure. Defaults to True.

  • fmax_rp (float, optional) – Convergence criteria for reaction path. Defaults to 0.05.

  • fmax_ts (float, optional) – Convergence criteria for transition states.
    If math.isinf(fmax_ts), climbing algorithm will not be executed while optimizing.
    Defaults to 0.05.

  • fmax_rd (float, optional) – Convergence criterial for rate determining step (highest TS).
    If math.isinf(fmax_rd), climbing algorithm will not be executed while optimizing.
    Defaults to 0.01.

  • fmax_eq (float, optional) – Convergence criteria for local minimas. Defaults to 0.001.

  • local_extrema_tol (float, optional) – Local extrema smaller than this will be ignored. Defaults to 1e-3.

  • interesting (list[list[Atoms]] -> list[bool] or None, optional) – Interesting path or not. Defaults to None.

  • timeout (timedelta or None, optional) – Timeout. Defaults to None.

  • logfile_rp (str or None, optional) – Logfile for reaction path finding algorithms.
    If logfile is a string, a file with that name will be opened.
    Use ‘-’ for stdout. Defaults to None.

  • logfile_eq (str or None, optional) – Logfile for local minima optimization.
    If logfile is a string, a file with that name will be opened.
    Use ‘-’ for stdout. Defaults to None.

  • observers_rp (list[ -> None] or None, optional) – Called in each step of reaction path optimzation. Defaults to None.

  • observers_eq (list[ -> None] or None, optional) – Called after local minimas are optimized. Defaults to None.

  • remove_rotation_and_translation (bool or None, optional) – True actives NEB-TR for removing translation and
    rotation during NEB. By default applied non-periodic
    systems Defaults to None.

  • max_workers (int or None, optional) – Max number of concurrent threads. If it is not specified,
    it is automatically determined based on the number of input atoms.

  • optimizer_eq (OptimizerBuilder or str, optional) – Optimizer generator for structural optimization. Defaults to “FIRELBFGS”.
    Passing OptimizerBuilder type objects will be deprecated in a future version.

  • optimizer_rp (OptimizerBuilder or str, optional) – Optimizer generator for reaction path optimization. Defaults to “FIRE”.
    Passing OptimizerBuilder type objects will be deprecated in a future version.

  • k (float, optional) – NEB spring constant for String and NEB hybrid algorithm. Defaults to 0.1.

  • dx_ts (float, optional) – Distance between images for climbing string. Defaults to 0.02.

  • dx_rp (float, optional) – Distance between images for reaction path. Defaults to 0.3.

  • dx_rm (float, optional) – Images closer than this value will be linearly interpolated to skip connection.
    Defaults to 1.0.

  • estimator_fn (EstimatorFnType or None, optional) – A factory method to create a custom estimator.
    Please refer Customizing estimator used in matlantis-features for detail. Defaults to None.

  • dump_directory (Path or None, optional) – Folder to save images during optimization.
    If dump_directory is not None, you must specify dump_frequency as well.

  • dump_frequency (timedelta or None, optional) – Interval to dump images on dump_directory.
    If dump_frequency is not None, you must specify dump_directory as well.

__call__(images: List[List[Union[Atoms, MatlantisAtoms]]]) ReactionStringFeatureResult#

Get the reaction path between the initial and end images.

Parameters

images (list[list[MatlantisAtoms or ASEAtoms]]) – Images defining path from initial to final state.

Returns

The calculation result.

Return type

ReactionStringFeatureResult

attach_ctx(ctx: Optional[Context] = None) None#

Attach the feature to matlantis_features.utils.Context.

Parameters

ctx (Context or None, optional) – The matlantis_features.utils.Context object. Defaults to None.

check_estimator_fn(estimator_fn: Optional[Callable[[], Estimator]]) None#

Checks if the given estimator function is None and output a warning if so.

Parameters

estimator_fn (EstimatorFnType or None, optional) – A factory method to create a custom estimator.
Please refer Customizing estimator used in matlantis-features for detail. Defaults to None.

cost_estimate(atoms: Optional[Union[Atoms, MatlantisAtoms]] = None) FeatureCost#

Estimate the cost of the feature.

Parameters

atoms (ASEAtoms or MatlantisAtoms or None, optional) – The input atoms. Defaults to None.

Returns

The cost of the feature.

Return type

FeatureCost

classmethod from_dict(res: Dict[str, Any]) FeatureBase#

Construct a FeatureBase object from serialized dict.

Parameters

res (dict[str, Any]) – A dict containing a serialized FeatureBase from to_dict().

Returns

The deserialized object from provided dict.

Return type

FeatureBase

get_savedir_from_ctx() Path#

Get the temporary save directory from the context.

Returns

The temporary save directory .

Return type

pathlib.Path

init_scope() Iterator[None]#

Context manager that enable to set attribution of the feature.

Returns

Init_scope context manager.

Return type

Iterator[None]

repeat(n_repeat: int) Self#

Set the maximum number of times that allowed to run the __call__ function.

Parameters

n_repeat (int) – The maximum number of repeats.

Returns

The feature.

Return type

Self

to_dict() Dict[str, Any]#

Dictionary representation of the ReactionStringFeature.

Returns

A dict containing a serialized ReactionStringFeature.

Return type

dict[str, Any]