Repository navigation
Add symmetry_number option for the orientational entropy - #500
Open
michalkrompiec wants to merge 3 commits into
Open
michalkrompiec wants to merge 3 commits into
michalkrompiec wants to merge 3 commits into
Conversation
When set, the given symmetry number replaces the value computed by `Neighbors.get_symmetry` for every molecule group. Unset keeps the computed value. Negative or non-integer values are refused in `validate_inputs`.
Adds unit tests for parsing, validation, the level DAG override and the resulting orientational entropy, and a fast benzaldehyde regression case with `symmetry_number: 1`.
michalkrompiec
marked this pull request as ready for review
November 27, 2026 17:19
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds a
symmetry_numberargument that sets the symmetry number σ used in the orientational entropy, in place of the value computed byNeighbors._get_symmetry_number. Closes #497.The computed value counts graph automorphisms of the heavy-atom skeleton, which can be larger than the rotational symmetry number of the point group (24 rather than 12 for methane, 6 rather than 3 for ammonia). When σ exceeds the orientation count, Ω is floored at 1 and the orientational term becomes zero. The new argument lets the user give the rotational symmetry number directly. If it is not set, the computed value is used as before.
Changes
CodeEntropy/config/argparse.py: newsymmetry_numberargument (int, defaultNone), set from the CLI orconfig.yaml.validate_inputsrefuses negative or non-integer values.0keeps its existing meaning (no orientational entropy).CodeEntropy/levels/graph/level_dag.py:_initialise_neighbor_metadatareplaces the computed symmetry number of every molecule group withargs.symmetry_numberwhen it is set, and logs the given and computed values at INFO level.getting_started.rst) and a short paragraph in the orientational entropy section (science.rst) on how σ is computed and how to override it.benzaldehyde/symmetry_number(theselection_subsetconfig withsymmetry_number: 1).Testing
pytest tests/unit: 710 tests pass (695 before this change; the same two divide-by-zero warnings as onmain); coverage ofargparse.pyandlevel_dag.pystays at 100%.pytest tests/regression --system benzaldehydeand--system methane(fast cases): existing baselines unchanged. In the new benzaldehyde case the computed σ is 2; withsymmetry_number: 1onlyresidue:Orientationalchanges, from 20.48 to 26.24 J/mol/K, a difference of R ln 2.pre-commit run --all-filesand the docs build with-Wpass.ValueError: Invalid 'symmetry_number': -1. It must be an integer greater than or equal to 0.Impact
symmetry_numberis set.Checklist
pyproject.tomlchanged, the lower bounds were reviewed deliberately (no dependency changes)