System¶
Instead of a custom System class, featomic-torch uses the class defined
by metatomic: metatomic.torch.System. Featomic provides converters
from all the supported system providers (i.e. everything in
featomic.IntoSystem) to the TorchScript compatible System.
- featomic.torch.systems_to_torch(systems: featomic.systems.IntoSystem, positions_requires_grad: bool | None = None, cell_requires_grad: bool | None = None) System¶
- featomic.torch.systems_to_torch(systems: Sequence[featomic.systems.IntoSystem], positions_requires_grad: bool | None = None, cell_requires_grad: bool | None = None) List[System]
Convert a arbitrary system to
metatomic.torch.System, putting all the data intorch.Tensorand making the overall object compatible with TorchScript.- Parameters:
system – any system supported by featomic. If this is an iterable of system, this function converts them all and returns a list of converted systems.
positions_requires_grad – The value of
requires_gradon the outputpositions. IfNoneand the positions of the input is already atorch.Tensor,requires_gradis kept the same. Otherwise it is initialized toFalse.cell_requires_grad – The value of
requires_gradon the outputcell. IfNoneand the positions of the input is already atorch.Tensor,requires_gradis kept the same. Otherwise it is initialized toFalse.