Skip to content

Conversation

@goldmanm
Copy link
Contributor

@goldmanm goldmanm commented Aug 25, 2017

This PR is meant to solve issue #1177. It implements:

  1. turning the symmetry number into a float (we don't compare or change symmetries, so this should be easier than bonds or degeneracy)
  2. halving the symmetry number when a chiral center is found. This occurs in the calculateAtomSymmetryNumber method since finding a chiral center (an atom with four different groups), already occurs there. We half the symmetry number because a chiral center increases entropy by $R\ln(2)$, which is the same effect as halving the symmetry number (the symmetry number effects entropy by $-R\ln(\sigma)$).
  3. adding a unittest to test for a change in atom symmetry number with a chiral center (we didn't have a chiral center in symmetry unittests before this one)
  4. updating documentation to describe that the symmetry attribute contains chiral center modification.

Since unittests were written, all the review need to do is understand the theory written above and check for any differences in RMG-tests

@mention-bot
Copy link

@goldmanm, thanks for your PR! By analyzing the history of the files in this pull request, we identified @jwallen, @nickvandewiele and @bbuesser to be potential reviewers.

@goldmanm goldmanm requested a review from KEHANG August 25, 2017 01:34
@codecov
Copy link

codecov bot commented Aug 25, 2017

Codecov Report

Merging #1179 into master will not change coverage.
The diff coverage is 0%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #1179   +/-   ##
=======================================
  Coverage   46.52%   46.52%           
=======================================
  Files         152      152           
  Lines       27553    27553           
  Branches     5416     5416           
=======================================
  Hits        12818    12818           
  Misses      13860    13860           
  Partials      875      875
Impacted Files Coverage Δ
rmgpy/molecule/molecule.py 0% <ø> (ø) ⬆️
rmgpy/molecule/symmetry.py 0% <0%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update f030b20...88679b1. Read the comment docs.

@goldmanm goldmanm added the Status: Ready for Review PR is complete and ready to be reviewed label Aug 25, 2017
@KEHANG KEHANG self-assigned this Sep 1, 2017
center, defined by 4 different groups attached to a carbon, and halves the symmetry
for each chiral center.

THe effect of cis-trans isomers is currently not accounted for in RMG.
Copy link
Member

Choose a reason for hiding this comment

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

THe --> The

symmetryNumber *= calculateAtomSymmetryNumber(molecule, atom)
self.assertEqual(symmetryNumber, 9)

def testAtomSymmetryNumberEthanewithDeuteriumTritium(self):
Copy link
Member

Choose a reason for hiding this comment

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

more complicated molecules (based on RMG's imagination) might need to be tested. Can we justify the entropy changes for the molecules from eg1 in RMG-tests (https://travis-ci.org/ReactionMechanismGenerator/RMG-tests/builds/268177870?utm_source=github_status&utm_medium=notification)? They seem to differ by R*ln2. But I'm not fully clear about why the chiral center will half the symmetry number on top of previous symmetry calculation. Do you foresee any potential issues with kinetic estimation for a reaction with one side having chiral center?

@KEHANG
Copy link
Member

KEHANG commented Sep 4, 2017

Review comments on things to be done before merging:

  • fix the requested changes

  • git rebase

  • need evidence from other examples in RMG-tests to support this PR.

@goldmanm
Copy link
Contributor Author

goldmanm commented Sep 4, 2017

Reasons regarding the changing of symmetry number to account for enantiomers:

Separately, each enantiomer should have the thermo value that RMG currently gives it. RMG, however, lumps all the enantiomers together. Since there are now 2 different forms of the species that RMG represents as one, the entropy should be increased by Rln(2), since otherwise RMG would get the equilibrium of the following reaction wrong (where s and r are the enantiomeric forms and sr is the lumped form):

in reality:

A <-> B(s)
A <-> B(r)

in RMG:

A <-> B(sr)

For there to be the same concentration of s and r forms in RMG as in the separated representation (at equilibrium), the entropy of B(sr) needs to be Rln2 higher than that of B(s) or B(r).

RMG can accomplish this by modifying the symmetry number because accounting for symmetry and enantiomer relationship separately can be accomplished by halving the symmetry number

$Rln(2) - Rln(\sigma) = -Rln(\sigma/2)$

This explination is already partially discussed in RMG documentation but RMG currently does not account for it, added by Nick.

This implementation makes the assumption that all enantiomeric centers have additive effects, which is made in GENYSIS source

examples from RMG-tests

one chiral center

The molecule from RMG-tests, [CH2]C(C)C=C, has 1 chiral center. Labeling the centes looks like [CH2]C*(C)C=C. This molecule should have an increase of (ln2), and indeed RMG tests shows that the entropy is increased by 1.37 ~ R(ln2). calculation

two chiral centers

The molecule from RMG-tests, [CH2]CC([CH2])C(C)C=C, has two chiral centers. Labeling the centes looks like [CH2]CC*([CH2])C*(C)C=C. This molecule should have an increase of 2R(ln2), and indeed RMG tests shows that the entropy increased by 2.76kcal/mol ~ 2R(ln2). calculation

I can write an example like this for RMG unittests

molecule on a symmetric ring.

Another case of interest is a chiral center on a symmetric ring. I will write a unittest for this too.

Bear in mind that RMG's symmetry (and non-existent) enantiomer corrections are ad-hoc heuristics and no one is going get perfect values in all cases since it isn't possible to go from a 2D graph to 3D representation infaliably even with force-field like methods.

kinetics with enantiomers

You asked a good question. RMG does not take enantiomers into account when doing kinetics. It doesn't take symmetry into account either. In both these cases, some effect is captured by reaction path degeneracy, and some is probably not. Fixing that is a very different beast and might be a later pull request.

@goldmanm
Copy link
Contributor Author

goldmanm commented Sep 7, 2017

@KEHANG, I added a unittest for the case of multiple chiral centers in a molecule. There are already tests (testTotalSymmetryNumber12Dimethylbenzene & testTotalSymmetryNumber14Dimethylbenzene) ensuring that RMG does not account for symmetry number on rings, so I didn't duplicate those.

Is there anything I missed? Let me know when I should rebase for you to merge.

@KEHANG
Copy link
Member

KEHANG commented Sep 7, 2017

BTW, one typo I mentioned in thermo.rst has not been fixed yet. Otherwise, it's good and please go ahead and run RMG-tests, and provide a table similar to the one in #1187 (not the first one, the one down in the conversation chain)

@goldmanm goldmanm force-pushed the account_for_enantiomers_in_entropy branch 2 times, most recently from 07f6d94 to e89852d Compare September 7, 2017 19:48
KEHANG
KEHANG previously approved these changes Sep 7, 2017
@goldmanm
Copy link
Contributor Author

goldmanm commented Sep 8, 2017

memory benchmark memory new time benchmark time new example
466.57 472.91 00:00:03:09 00:00:03:10 eg1
399.64 399.70 00:00:12:11 00:00:12:19 eg3
355.73 357.62 00:00:01:44 00:00:01:45 eg5
346.75 346.96 00:00:00:52 00:00:00:52 eg6
337.49 337.58 00:00:00:35 00:00:00:35 eg7
352.40 351.99 00:00:01:50 00:00:01:50 NC

@goldmanm
Copy link
Contributor Author

goldmanm commented Sep 8, 2017

appears very similar. rebasing to master (for you to merge)

Since symmetry encompases chirality effects when modifying symmetry
number, and does it by halfing the symmetry, non-integer values
are possible. This change makes symmetry a float value.
When four different groups are found, the symmetry number should be
halved to account for chirality (which will increase entropy by Rln2)
Explain in the documentation that chirality is incorportated into
symmetry number. This should clarify user concerns about the symmetry
value.
@goldmanm goldmanm force-pushed the account_for_enantiomers_in_entropy branch from e89852d to 88679b1 Compare September 8, 2017 14:25
@goldmanm
Copy link
Contributor Author

goldmanm commented Sep 8, 2017

@KEHANG, could you merge the pull request now that you accepted it?

@KEHANG KEHANG merged commit d242d1a into master Sep 8, 2017
@KEHANG KEHANG deleted the account_for_enantiomers_in_entropy branch September 8, 2017 16:06
@amarkpayne amarkpayne removed the Status: Ready for Review PR is complete and ready to be reviewed label Sep 8, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants