/// Implements sparse force sets in terms of dense force sets.
///
/// Assumes `compute_dense_force` produces values that only differ from the
/// original forces in a neighborhood of the displacement. This can be true if
/// the potential...
///
///  * is deterministic,
///  * implements a cutoff radius, and
///  * does not recklessly adjust coordinates
///
/// ...so that with the help of the "ensure_only_carts", even this
/// exact equality check should be effective at sparsifying the data.
///
/// Which is good, because it's tough to define an approximate scale for comparison
/// here, as the forces are the end-result of catastrophic cancellations.
Implements sparse force sets in terms of dense force sets.
Assumes `compute_dense_force` produces values that only differ from the
original forces in a neighborhood of the displacement. This can be true if
the potential



so that with the help of the "ensure_only_carts", even this
exact equality check should be effective at sparsifying the data.

Which is good, because it's tough to define an approximate scale for comparison
here, as the forces are the end-result of catastrophic cancellations.
Implements sparse force sets in terms of dense force sets . Assumes ` compute_dense_force ` produces values that only differ from the original forces in a neighborhood of the displacement . This can be true if the potential so that with the help of the " ensure_only_carts " even this exact equality check should be effective at sparsifying the data . Which is good because it ' s tough to define an approximate scale for comparison here as the forces are the end - result of catastrophic cancellations .
pub fn sparse_deltas_from_dense_deterministic(
    original_force: &[V3],
    final_force: &[V3],
) -> BTreeMap<usize, V3> {
    zip_eq!(original_force, final_force).enumerate()
        .map(|(atom, (old, new))| (atom, new - old))
        .filter(|&(_, v)| v != V3::zero())
        .collect()
}
pub fn sparse_deltas_from_dense_deterministic ( original_force : & [ V3 ] , final_force : & [ V3 ] , ) -> BTreeMap < usize , V3 > { zip_eq ! ( original_force final_force ) . enumerate ( ) . map ( | ( atom , ( old , new ) ) | ( atom , new - old ) ) . filter ( | & ( _ , v ) | v != V3 :: zero ( ) ) . collect ( ) }
Implements sparse force sets in terms of dense force sets.
Implements sparse force sets in terms of dense force sets .
original_force
&[V3]
final_force
&[V3]