nvalchemi.csp.estimate_formula_unit_volume#

nvalchemi.csp.estimate_formula_unit_volume(atomic_numbers, *, atomic_volumes=None)[source]#

Estimate formula-unit volume by summing per-atom contributions.

Parameters:
  • atomic_numbers (torch.Tensor, shape [A]) – Nonempty one-dimensional tensor using torch.uint8, torch.int8, torch.int16, torch.int32, or torch.int64.

  • atomic_volumes (Mapping[int, float], optional) – Complete replacement table in cubic angstroms per atom. When omitted, the bundled COD-derived table is used. A custom mapping does not overlay defaults.

Returns:

volume – Estimated formula-unit volume in cubic angstroms.

Return type:

float

Raises:
  • TypeError – If atomic_numbers is not a tensor, has an unsupported dtype, or atomic_volumes is not a mapping.

  • ValueError – If the tensor is empty or malformed, a table value is invalid, or one or more atomic numbers are missing from the selected table.

Examples

>>> import torch
>>> estimate_formula_unit_volume(torch.tensor([6, 8]))
23.78