full_to_half_list

torch_sim.models.pair_potential.full_to_half_list(mapping, system_mapping, shifts_idx)[source]

Reduce a full neighbor list to a half list.

Keeps each unordered pair exactly once. For i != j pairs, the copy with i < j is kept. For self-image pairs (i == j, non-zero periodic shift), the copy whose first non-zero shift component is positive is kept.

Parameters:
  • mapping (Tensor) – Pair indices, shape [2, n_pairs].

  • system_mapping (Tensor) – System index per pair, shape [n_pairs].

  • shifts_idx (Tensor) – Periodic shift vectors per pair, shape [n_pairs, 3].

Returns:

(mapping, system_mapping, shifts_idx) with duplicates removed.

Return type:

tuple[Tensor, Tensor, Tensor]