class matlantis_features.features.common.neb.NEBFeature(optimizer: ASEOptFeature, n_images: int = 5, k: float = 0.1, climb: bool = False, method: str = ‘aseneb’, idpp: bool = False)#

Bases: FeatureBase

The matlantis-feature to run nudged elastic band (NEB) calculation.

The NEB method interpolates a number of intermediate images between the given initial and final states.
Then the constrained optimization is performed by adding spring forces between images to find the minimum energy path.

Methods

__init__(optimizer[, n_images, k, climb, …])

Initialize an instance.

__call__([atoms_init, atoms_end, neb_images])

Run NEB 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_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()

Serialize NEBFeature object to dict.

__init__(optimizer: ASEOptFeature, n_images: int = 5, k: float = 0.1, climb: bool = False, method: str = ‘aseneb’, idpp: bool = False) None#

Initialize an instance.

Parameters
  • optimizer (ASEOptFeature) – The optimizer to relax each image.

  • n_images (int, optional) – The number of interpolated images between the given initial
    and final NEB states. Defaults to 5.

  • k (float, optional) – The spring constant of the spring force. The unit is eV/Ang.
    Defaults to 0.1.

  • climb (bool, optional) – Use the climbing image NEB. Defaults to False.

  • method (str, optional) – The scheme for the spring force. Must be in ‘aseneb’,
    ‘improvedtangent’ and ‘eb’. Defaults to ‘aseneb’.

  • idpp (bool, optional) – Interpolate the images between initial and final states with
    IDPP method. Defaults to False.

__call__(atoms_init: Optional[Union[Atoms, MatlantisAtoms]] = None, atoms_end: Optional[Union[Atoms, MatlantisAtoms]] = None, neb_images: Optional[List[Union[Atoms, MatlantisAtoms]]] = None) NEBFeatureResult#

Run NEB calculation. If ‘atoms_init’ and ‘atoms_end’ are provided, the initial guess of the NEB path is automatically generated by interpolation. Otherwise, the initial guess of NEB path will be read from ‘neb_images’.

Parameters
  • atoms_init (ASEAtoms or MatlantisAtoms or None, optional) – The initial state of the NEB calculation. Defaults to None.

  • atoms_end (ASEAtoms or MatlantisAtoms or None, optional) – The final state of the NEB calculation. Defaults to None.

  • neb_images (list[ASEAtoms or MatlantisAtoms] or None, optional) – The initial guess of the NEB pathway. Defaults to None.

Returns

NEB calculation.

Return type

NEBFeatureResult

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]#

Serialize NEBFeature object to dict.

Returns

The dictionary containing the serialized NEBFeature.

Return type

dict[str, Any]