Skip to content

Inversion Terms Collapse to Single Instance Per Planar Center #21

@TKanX

Description

@TKanX

Description:

The current ImproperDihedral implementation generates only 1 inversion term per sp²/resonant center, but the DREIDING paper (Mayo et al., J. Phys. Chem. 1990) explicitly requires 3 terms—one for each neighbor acting as the axis atom. The root cause is that ImproperDihedral::new() sorts all three peripheral atoms into a canonical tuple, collapsing distinct axis choices into a single hash entry. This silently undercounts inversion contributions and violates the paper's rotational invariance requirement. We will redesign the topology type into a clear Inversion struct with explicit axis_atom and plane_atoms fields, emit three instances per valid center, and align terminology with the paper (Torsion/Inversion instead of ProperDihedral/ImproperDihedral).

Tasks:

  • Core Types (src/core/topology.rs)

    • Replace ImproperDihedral with Inversion: fields center_atom, axis_atom, plane_atoms: (usize, usize) (sorted pair only).
    • Rename ProperDihedralTorsion; update MolecularTopology fields accordingly.
    • Add unit tests verifying same-center-different-axis instances are distinct.
  • Builder (src/builder/mod.rs)

    • Rewrite build_impropers()build_inversions() to emit 3 inversions per sp²/resonant degree-3 center.
    • Rename build_propers()build_torsions(); update call sites.
  • API & Docs

    • Update src/lib.rs re-exports and doctests to use new type names.
    • Update docs/04_topology_builder.md and docs/ARCHITECTURE.md with new semantics and paper citation.
  • Validation

    • Run cargo test and cargo clippy; verify benzene produces 18 inversions.

Metadata

Metadata

Assignees

Labels

Type

Projects

Status

Done

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions