nvalchemi.dynamics.mep.NEB#

class nvalchemi.dynamics.mep.NEB(*, model, engine=None, engine_kwargs=<factory>, n_steps=None, extra_hooks=<factory>, cache_engine=False, spring=0.1, method='improved_tangent', climbing=None, optimizer=<class 'nvalchemi.dynamics.optimizers.fire2.FIRE2'>, optimizer_kwargs=<factory>, fmax=0.05, endpoint_mode='fixed', fixed_atom_indices=None, diagnostics_log_path=None, diagnostics_frequency=1, compile=False, compile_kwargs=<factory>, neighbor_hooks=None, convergence_hook=None, regular_convergence_hook=None)[source]#

Run regular or climbing-image nudged elastic band optimization.

Every graph in the input batch is one path image, and its group layout identifies complete paths. The strategy builds a group-aware FusedStage containing one or two optimizer stages.

Parameters:
  • model (BaseModelMixin)

  • engine (Annotated[type | None, BeforeValidator(func=~nvalchemi._serialization._validate_type, json_schema_input_type=PydanticUndefined), PlainSerializer(func=~nvalchemi._serialization._serialize_type, return_type=PydanticUndefined, when_used=always)])

  • engine_kwargs (dict[str, Any])

  • n_steps (Annotated[int, FieldInfo(annotation=NoneType, required=True, metadata=[Strict(strict=True), Gt(gt=0)])] | None)

  • extra_hooks (list[Hook])

  • cache_engine (bool)

  • spring (float | SpringConfig)

  • method (str | NEBMethod | TorchNEBMethod)

  • climbing (ClimbingImageConfig | None)

  • optimizer (Annotated[type, BeforeValidator(func=~nvalchemi._serialization._validate_type, json_schema_input_type=PydanticUndefined), PlainSerializer(func=~nvalchemi._serialization._serialize_type, return_type=PydanticUndefined, when_used=always)])

  • optimizer_kwargs (dict[str, Any])

  • fmax (Annotated[float, Gt(gt=0)])

  • endpoint_mode (Literal['fixed', 'relaxed'])

  • fixed_atom_indices (dict[int, tuple[int, ...]] | None)

  • diagnostics_log_path (Path | None)

  • diagnostics_frequency (Annotated[int, Strict(strict=True), Gt(gt=0)])

  • compile (Annotated[bool, Strict(strict=True)])

  • compile_kwargs (dict[str, Any])

  • neighbor_hooks (list[Hook] | None)

  • convergence_hook (ConvergenceHook | None)

  • regular_convergence_hook (ConvergenceHook | None)

convergence_hook#

Optional override for the final or only optimizer stage. When provided, it takes precedence over fmax. Otherwise, build_engine() constructs the force criterion from fmax. Overrides must use the standard hook type with frequency=1.

Type:

ConvergenceHook or None

regular_convergence_hook#

Optional override for the preliminary stage of an after_regular run. When provided, it takes precedence over climbing.regular_fmax and fmax. Otherwise, build_engine() constructs the force criterion from those thresholds. It has the same type and frequency constraints and is otherwise ignored.

Type:

ConvergenceHook or None

build_engine()[source]#

Construct a fresh fused optimizer.

Returns:

Group-aware one- or two-stage optimizer strategy.

Return type:

FusedStage

classmethod from_spec_dict(spec, *, model, extra_hooks=None)[source]#

Rebuild NEB configuration, including convergence hooks.

Parameters:
Return type:

Self

model_config = {'arbitrary_types_allowed': True, 'extra': 'forbid', 'revalidate_instances': 'never', 'validate_assignment': True}#

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

model_post_init(context, /)#

This function is meant to behave like a BaseModel method to initialise private attributes.

It takes context as an argument since that’s what pydantic-core passes when calling it.

Parameters:
  • self (BaseModel) – The BaseModel instance.

  • context (Any) – The context.

Return type:

None

to_spec_dict()[source]#

Serialize NEB configuration and convergence hooks.

Return type:

dict[str, Any]