cell_volume

torch_sim.quantities.cell_volume(cell)[source]

Volume of one or more cells, positive for left- and right-handed cells.

det(cell) is negative for left-handed cells, which would flip the sign of anything derived from it (pressure, barostat forces, scaled cells). Use this helper rather than calling torch.det on a cell directly.

Parameters:

cell (Tensor) – Cell matrices with shape [..., 3, 3].

Returns:

Volumes with shape [...].

Return type:

Tensor