Skip to content

Update vesin usage #1143

Description

@Luthaf

Description of the issue

The code in metatrain uses vesin.ase_neighbor_list, with a fallback to the ase NL for partial PBC:

if np.all(atoms.pbc) or np.all(~atoms.pbc):
nl_i, nl_j, nl_S, nl_D = vesin.ase_neighbor_list(
"ijSD",
atoms,
cutoff=options.cutoff,
)
else:
# this is not implemented in vesin, so we use ASE
nl_i, nl_j, nl_S, nl_D = ase.neighborlist.neighbor_list(
"ijSD",
atoms,
cutoff=options.cutoff,
)

IMO it could be good to update to a more recent vesin which should bring a couple of improvements:

  • partial PBC support
  • compute the NL on GPU directly, which removes the need to transfer a large amount of data from CPU to GPU

I would also remove vesin.ase_neighbor_list in favor of an explicit vesin.NeighborList, since the sorting done by vesin.ase_neighbor_list can slow down the calculation quite a bit (Luthaf/vesin#147)

We could also consider using nvalchemi on CUDA, but this dependency has been a bit problematic so to be discussed.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions