Skip to content

Add option to set the symmetry number for orientational entropy - #499

Open
harryswift01 wants to merge 5 commits into
mainfrom
497-feature-option-to-set-the-symmetry-number
Open

harryswift01 wants to merge 5 commits into
mainfrom
497-feature-option-to-set-the-symmetry-number

Conversation

@harryswift01

Copy link
Copy Markdown
Member

Summary

This PR adds a symmetry_number option to set the rotational symmetry number σ used in the orientational entropy, instead of the value computed from the RDKit bond graph. The graph count can overestimate σ (e.g. 24 instead of 12 for methane), which can make the orientational term zero. The computed value stays the default, so existing results do not change.

Closes #497

Changes

  • Added --symmetry_number (CLI and YAML). Entries are VALUE (all molecule groups) or RESNAME:VALUE (molecules whose first residue has that name). A residue entry takes precedence over a plain value, and unmatched groups keep the computed value.
    • CodeEntropy --symmetry_number 12
    • CodeEntropy --symmetry_number MET:12 NH3:3
    • YAML: symmetry_number: ["MET:12", "NH3:3"]
  • Added parse_symmetry_number() as the single parser for the option. Invalid values (negative, non-integer, malformed or duplicate) are rejected in validate_inputs() before the run starts, and values above 24 log a warning.
  • User values replace the computed ones in LevelDAG._initialise_neighbor_metadata(). 0 keeps its existing meaning (spherical, no orientational entropy).
  • Docs: new options table row, a "Symmetry Number" section in Getting Started with point-group examples, and a note in the orientational entropy theory section.

Testing

  • Unit tests for parsing (accepted and rejected inputs), validation and warnings, and applying the values in LevelDAG (all groups, per residue, precedence, unmatched entries).

Impact

  • No change to results unless symmetry_number is set.
  • A plain VALUE also applies to water unless water_entropy is enabled.
  • Molecules made of several residues are matched on their first residue name only.
  • RDKit is still used for linearity, so molecules whose RDKit conversion fails (e.g. some metal complexes) are not covered yet.

Checklist

  • Tests added or updated
  • Documentation updated
  • If dependencies in pyproject.toml changed, the lower bounds were reviewed deliberately

@harryswift01
harryswift01 requested a review from skfegan November 27, 2026 15:30
@harryswift01 harryswift01 self-assigned this Nov 27, 2026
@harryswift01 harryswift01 added documentation Improvements or additions to documentation feature request New feature or request labels Nov 27, 2026

@skfegan skfegan left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. This change should allow users to easily correct the symmetry numbers for cases when the RDKit based determination of symmetry fails.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation feature request New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature]: Option to set the symmetry number used in the orientational entropy

2 participants