- class matlantis_features.features.reaction.rest_scan.RestScanFeature(scans: List[List[ScanRestraint]], trajectory: Optional[str] = None, logfile: Optional[str] = None, show_progress_bar: bool = False, tqdm_options: Optional[Dict[str, Any]] = None, show_logger: bool = False, logger_interval: int = 10, estimator_fn: Optional[Callable[[], Estimator]] = None)#
-
Bases:
FeatureBase
RestScan is a method for continuously changing molecular structures into different structures. This can be used to make initial estimates of reaction paths or to obtain alternative structures from existing molecular structures. It’s similar to the Gaussian scan function.
References
For more information, please refer to Matlantis Guidebook.
Methods
__init__
(scans[, trajectory, logfile, …])Initialize an instance.
__call__
(atoms[, fmax, n_run, energy_stop, …])Run the RestScan calculation.
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 the temporary save directory from the context.
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 FeatureBase.
- __init__(scans: List[List[ScanRestraint]], trajectory: Optional[str] = None, logfile: Optional[str] = None, show_progress_bar: bool = False, tqdm_options: Optional[Dict[str, Any]] = None, show_logger: bool = False, logger_interval: int = 10, estimator_fn: Optional[Callable[[], Estimator]] = None)#
-
Initialize an instance.
- Parameters
-
-
scans (list[list[ScanRestraint]]) – The scans is given as a list of lists of scans.
The number of scans to be applied is increased in the order of the outer list. -
trajectory (str or None, optional) – Attach trajectory object. If trajectory is a string a
Trajectory will be constructed. Use None for no
trajectory. Defaults to None. -
logfile (str or None, optional) – If logfile is a string, a file with that name will be opened.
Use ‘-’ for stdout. Defaults to None. -
show_progress_bar (bool, optional) – Show progress bar. Defaults to False.
-
tqdm_options (dict[str, Any] or None, optional) – Options for tqdm.
-
show_logger (bool, optional) – Show log information. Defaults to False.
-
logger_interval (int, optional) – The interval of when to print out logger information.
Defaults to 10. -
estimator_fn (EstimatorFnType or None, optional) – A factory method to create a custom estimator.
Please refer Customizing estimator used in matlantis-features for detail.
-
- __call__(atoms: Union[Atoms, MatlantisAtoms], fmax: float = 0.01, n_run: int = 10000, energy_stop: Optional[float] = None, local_minima_de: float = 0.01, local_minima_n: int = 1, attach_methods: Optional[List[Callable[[], None]]] = None) RestScanFeatureResult #
-
Run the RestScan calculation.
- Parameters
-
-
atoms (ASEAtoms or MatlantisAtoms) – The input structure.
-
fmax (float, optional) – The maximum force (in eV/Angstrom) for convergence of scan.
Defaults to 0.01. -
n_run (int, optional) – The maximum number of scan steps performed to try to
reach force convergence (specified by fmax). Defaults to 10000. -
energy_stop (float or None, optional) – Exit when the potential energy of the atoms is higher than this value.
Defaults to None. -
local_minima_de (float, optional) – Local minimas that are lower than local maxima by this value
are counted as local minimas. Defaults to 0.01. -
local_minima_n (int, optional) – Exit when the trajectory reach n’th local minima. Defaults to 1.
-
attach_methods (list[ -> None] or None, optional) – Functions to be called by the restscan. A list of callable functions.
If None, no functions will be attached. Defaults to None.
-
- Returns
-
The calculation result.
- Return type
- 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
- 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 FeatureBase.
- Returns
-
A dict containing a serialized FeatureBase.
- Return type
-
dict[str, Any]
Resource Library
matlantis_features.features.reaction.rest_scan.RestScanFeature