xnn.ffnn.models.oplslib.resolve_dihedral_type#

xnn.ffnn.models.oplslib.resolve_dihedral_type(dihedral_types, a, b, c, d)[source]#

Find the best dihedral-type key for the class quadruple.

Both atom orders are tried; among the keys that match (with X matching any class), the one with the most non-wildcard positions wins, ties broken alphabetically for determinism. This is the usual exact- before-wildcard precedence of OPLS implementations.

Parameters:
  • dihedral_types (dict) – The library’s dihedral-type table.

  • a (str) – Atom classes along the dihedral.

  • b (str) – Atom classes along the dihedral.

  • c (str) – Atom classes along the dihedral.

  • d (str) – Atom classes along the dihedral.

Returns:

The best matching key, or None.

Return type:

str or None