infer_property_scope¶
- torch_sim.state.infer_property_scope(state, ambiguous_handling='error')[source]¶
Infer whether a property is global, per-atom, or per-batch.
Analyzes the shapes of tensor attributes to determine their scope within the atomistic system representation.
- Parameters:
state (SimState) – The state to analyze
ambiguous_handling ("error" | "globalize" | "globalize_warn") – How to handle properties with ambiguous scope. Options: - “error”: Raise an error for ambiguous properties - “globalize”: Treat ambiguous properties as global - “globalize_warn”: Treat ambiguous properties as global with a warning
- Returns:
- Dictionary mapping
each scope category to a list of property names
- Return type:
dict[Literal[“global”, “per_atom”, “per_batch”], list[str]]
- Raises:
ValueError – If n_atoms equals n_batches (making scope inference ambiguous) or if ambiguous_handling=”error” and an ambiguous property is encountered