This program summarizes the coefficients from DIRAC (http://diracprogram.org) output file that the .ANALYZE option and *PRIVEC and .VECPRI options in **ANALYZE section are used. (c.f. http://www.diracprogram.org/doc/release-23/manual/analyze/privec.html)
DIAC
C 2
1. 4
H -0.58016472 -1.08506272 0.00000000
H -0.57014631 0.42814547 0.87365150
H -0.59014631 0.42814547 -0.87365150
H -2.00681915 -0.07623954 0.00000000
LARGE BASIS STO-3G
6. 1
C -0.93681915 -0.07625272 0.00000000
LARGE BASIS STO-3G
FINISH
sum_dirac_dfcoef実行時のエラーとトレースバック
Traceback (most recent call last):
File "/home/noda/.pyenv/versions/3.9.15/bin/sum_dirac_dfcoef", line 8, in <module>
sys.exit(main())
File "/home/noda/.pyenv/versions/3.9.15/lib/python3.9/site-packages/sum_dirac_dfcoef/sum_dirac_dfcoef.py", line 18, in main
functions_info = get_functions_info(dirac_output)
File "/home/noda/.pyenv/versions/3.9.15/lib/python3.9/site-packages/sum_dirac_dfcoef/functions_info.py", line 151, in get_functions_info
func = read_func_info(words, line_str, component_func, symmetry)
File "/home/noda/.pyenv/versions/3.9.15/lib/python3.9/site-packages/sum_dirac_dfcoef/functions_info.py", line 115, in read_func_info
atom, subshell, gto_type = parse_plabel(plabel)
File "/home/noda/.pyenv/versions/3.9.15/lib/python3.9/site-packages/sum_dirac_dfcoef/functions_info.py", line 101, in parse_plabel
subshell = plabel[3].strip() # e.g. "g" in "Cm g400"
IndexError: string index out of range
molファイル(Hについて左に1つスペースが空いている)
sum_dirac_dfcoef実行時のエラーとトレースバック
https://github.com/RQC-HU/sum_dirac_dfcoef/blob/5d262cfc9b484e59b1238f3c202553dfce95b12e/src/sum_dirac_dfcoef/functions_info.py#L113 上記コードで.stripしているため、Hの左のスペースが余分に1つ消えてしまい、それ以降のパース時のインデックスもズレてしまうため、IndexErrorが発生する
従って、stripしないことでインデックスがずれないようにしなければならない