Atoms#
- class nfflr.Atoms(cell: Tensor, positions: Tensor, numbers: Tensor, *, batch_num_atoms: Iterable[int] | None = None)[source]#
Atoms: basic atomistic data structure supporting batching
The goal is to make it easy to work with a common representation, and transform it as needed to other formats.
DGLGraph
ALIGNNGraphTuple
PyG format
…
- Parameters:
- cell
torch.Tensor cell matrix / lattice parameters
- positions
torch.Tensor Cartesian coordinates
- numbers
torch.Tensor atomic numbers
- cell
- Other Parameters:
- batch_num_atoms
Iterable[int],optional batch size for struct-of-arrays batched Atoms
- batch_num_atoms
- Attributes:
- batch_num_atoms
Methods
batched()Determine if multiple structures are batched together.
Convert cartesian coordinates to fractional coordinates.
to(device[, non_blocking])Transfer atoms data to compute device.
- scaled_positions() Tensor[source]#
Convert cartesian coordinates to fractional coordinates.
- Returns:
- scaled_positions
torch.Tensor
- scaled_positions
- to(device, non_blocking: bool = False)[source]#
Transfer atoms data to compute device.
- Parameters:
- device
torch.device compute device, e.g. “cpu”, “cuda”, “mps”
- non_blockingbool,
optional attempt asynchronous transfer.
- device