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 usingtorch.uint8,torch.int8,torch.int16,torch.int32, ortorch.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_numbersis not a tensor, has an unsupported dtype, oratomic_volumesis 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