patonlab / GoodVibes

Calculate quasi-harmonic free energies from Gaussian output files with temperature and other corrections
http://www.patonlab.colostate.edu
MIT License
136 stars 52 forks source link

--ssymm issue with detecting point group #44

Closed chertianser closed 2 years ago

chertianser commented 3 years ago

Hi,

Thanks for providing such a great tool to use! I've encountered an issue regarding the use of the --ssymm tag on GoodVibes v3.0.1 (tested on both Windows and Mac, installed via conda). This particular structure I've included should have a C2 or C2v point group. My first optimization runs with Gaussian 16 C.01 were with nosymm, and running goodvibes with python -m goodvibes --qs truhlar --ssymm --imag results in the following error:

Traceback (most recent call last):
  File "C:\Users\Chertian\Anaconda3\lib\runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "C:\Users\Chertian\Anaconda3\lib\runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "C:\Users\Chertian\Anaconda3\lib\site-packages\goodvibes\__main__.py", line 18, in <module>
    sys.exit(GoodVibes.main())
  File "C:\Users\Chertian\Anaconda3\lib\site-packages\goodvibes\GoodVibes.py", line 2634, in main
    options.conc, options.freq_scale_factor, options.freespace, options.spc, options.invert,d3_energy,cosmo=cosmo_option,ssymm=ssymm_option,mm_freq_scale_factor=vmm_option)
  File "C:\Users\Chertian\Anaconda3\lib\site-packages\goodvibes\GoodVibes.py", line 425, in __init__
    sym_entropy_correction,pgroup = self.sym_correction(file.split('.')[0].replace('/','_'))
  File "C:\Users\Chertian\Anaconda3\lib\site-packages\goodvibes\GoodVibes.py", line 515, in sym_correction
    ex_sym,pgroup = self.ex_sym(file)
  File "C:\Users\Chertian\Anaconda3\lib\site-packages\goodvibes\GoodVibes.py", line 479, in ex_sym
    pgroup = symmetry.symmetry(c_coords).decode('utf-8')
AttributeError: 'NoneType' object has no attribute 'decode'

If I symmetrize the molecule and start from a C2v geometry, the final optimization result is a C2 structure but will be detected as C2v by goodvibes.

   Structure                                           E        ZPE             H        T.S     T.qh-S          G(T)       qh-G(T)  im freq  Point Group
   ******************************************************************************************************************************************************
o  c2v-opt                               -506.577099   0.113482   -506.453702   0.043949   0.042294   -506.497651   -506.495995          C2v
   ******************************************************************************************************************************************************

Would appreciate it if you could take a look at this error! All other molecules I've tried seem to work okay with --ssymm, so the problem might be specifically related to the starting structure that I used, but I have attempted re-optimizing the structure and the same error occurs. c2v-opt.log nosymm-opt.log

luchini18 commented 3 years ago

Hi @chertianser, Sorry that you ran into this issue. It looks like your structure should be classified as a C2v point group, and it appears that GoodVibes is identifying that correctly for the c2v-opt.log file, even if Gaussian is classifying it as C2.

I am able to reproduce the error you are getting with the nosymm-opt.log file. The point group is determined by using a compiled C-language file and I think that it seems to run into an issue with the optimized coordinates from this output file. I took this structure and reoptimized it at a much simpler level of theory (B3LYP/STO-3G), still using Symmetry=None and GoodVibes was able to find a C2v symmetry:

   Structure                                           E        ZPE             H        T.S     T.qh-S          G(T)       qh-G(T)  im freq  Point Group
   ******************************************************************************************************************************************************
o  nosymm-opt-simple                         -500.794637   0.122426   -500.662815   0.042844   0.042325   -500.705659   -500.705140          C2v
   ******************************************************************************************************************************************************

I know you mentioned that you tried reoptimizing but I'd suggest maybe minor perturbations to the initial structure if possible and reoptimizing. Let me know if this issue persists. nosymm-opt-simple.log

chertianser commented 3 years ago

Hi @luchini18,

Thanks for getting back! I'll just stick to the C2v output that I have. I raised this because I wanted to flag out that there was a potential issue with the symmetry detection code in this (potentially) edge case. The reoptimization at B3LYP/STO-3G probably shifted the geometry enough to remove the error. I'm not too sure if the symmetry detection issue has larger ramifications beyond this case, and whether it's not just isolated to my case, but in my numerous times of running goodvibes I've never encountered this error.