Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Symmetry number estimations not always accurate #49

Open
nateharms opened this issue Nov 19, 2019 · 4 comments
Open

Symmetry number estimations not always accurate #49

nateharms opened this issue Nov 19, 2019 · 4 comments

Comments

@nateharms
Copy link

Symmetry numbers calculated using RMG's symmetry package tend to result in incorrect estimations of symmetry numbers. Below is an example of ethane which should have a symmetry number of 6. This issue arose when creating PR #48. Some investigation into alternate packages may remedy this.

In [1]: from autotst.species import Conformer                                                                                

In [2]: conf = Conformer("CC")                                                                                               

In [3]: conf.calculate_symmetry_number()                                                                                     
symmetry.py:253 write_input_file INFO Symmetry input file written to ./CC.symm
symmetry.py:219 parse INFO Point group: C1
Out[3]: 1
@whgreen
Copy link
Member

whgreen commented Nov 19, 2019 via email

@nateharms
Copy link
Author

Thanks for the recommendation, I just reached out to him.

@goldmanm
Copy link

RMG's symmetry algorithm includes both internal (from sigma bond rotation) and external symmetry (from rotation the whole molecule). Since the C-C bond in ethane can rotate a methyl group, it has an internal rotational symmetry of 3. Combined with the external symmetry you cite, the symmetry number RMG's symmetry algorithm should return is 18.

Running the current RMG package leads to:

>>> from rmgpy.species import Species
>>> s = Species().from_smiles('CC')
>>> s.get_symmetry_number()
18.0

This seems to work in RMG. I am not sure why it isn't working in AutoTST.

@nateharms
Copy link
Author

Thanks, I'll switch it to this. We are currently doing this at the moment as a method of autotst.species.Conformer:

    def calculate_symmetry_number(self):
        from rmgpy.qm.symmetry import PointGroupCalculator
        from rmgpy.qm.qmdata import QMData

        atom_numbers = self.ase_molecule.get_atomic_numbers()
        coordinates = self.ase_molecule.get_positions()

        qmdata = QMData(
            groundStateDegeneracy=1,  # Only needed to check if valid QMData
            numberOfAtoms=len(atom_numbers),
            atomicNumbers=atom_numbers,
            atomCoords=(coordinates, str('angstrom')),
            energy=(0.0, str('kcal/mol'))  # Only needed to avoid error
        )
        settings = type(str(''), (), dict(symmetryPath=str(
            'symmetry'), scratchDirectory="."))()  # Creates anonymous class
        pgc = PointGroupCalculator(settings, self.smiles, qmdata)
        pg = pgc.calculate()
        #os.remove("{}.symm".format(self.smiles))

        if pg is not None:
            symmetry_number = pg.symmetry_number
        else:
            symmetry_number = 1

        return symmetry_number

This aspect comes from what was done in the first version of AutoTST, but it's looking like it's time for a change.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants