Neighbor lists

Utilities to attach neighbor lists to a metatomic.torch.System object.

metatrain.utils.neighbor_lists.get_system_with_neighbor_lists_transform(requested_neighbor_lists: List[NeighborListOptions]) Callable[source]

Returns a function that adds the requested neighbor lists to each system.

Parameters:

requested_neighbor_lists (List[NeighborListOptions]) – A list of NeighborListOptions objects, each of which specifies the parameters for a neighbor list.

Returns:

A function that takes a list of System objects and returns a new list of System objects with the requested neighbor lists added.

Return type:

Callable

metatrain.utils.neighbor_lists.get_requested_neighbor_lists(module: Module) List[NeighborListOptions][source]

Get the neighbor lists requested by a module and its children.

Parameters:

module (Module) – The module for which to get the requested neighbor lists.

Returns:

A list of NeighborListOptions objects requested by the module.

Return type:

List[NeighborListOptions]

metatrain.utils.neighbor_lists.get_system_with_neighbor_lists(system: System, neighbor_lists: List[NeighborListOptions]) System[source]

Attaches neighbor lists to a System object.

Parameters:
  • system (System) – The system for which to calculate neighbor lists.

  • neighbor_lists (List[NeighborListOptions]) – A list of NeighborListOptions objects, each of which specifies the parameters for a neighbor list.

Returns:

The System object with the neighbor lists added.

Return type:

System