felixplasser / theodore-qc

TheoDORE - A package for Theoretical Density, Orbital Relaxation and Exciton analysis
https://theodore-qc.sourceforge.io/
GNU General Public License v3.0
29 stars 8 forks source link

Error in calculation of Particle-hole density with orbkit, orbkit to blame? #15

Closed srk closed 3 years ago

srk commented 3 years ago

I get a 'list index out of range' error thown from orbkit-1.1.0 on Python 3.8, in line 370 of orbkit/read/molden.py, in the function read_molden, while running 'analyze_tden.py' on the following input data (attached). I prepared the 'orbs.mld' file in the manner recommended. I guess this is an orbkit error rather than a 'theodore-qc' error, but can anyone see what's tripping this up? The affected line is: sym=sym[0].split('.')[-1] so it's something in the parsing of the MOs that tries to find a suffix after a '.' test_camb3lyp.zip

felixplasser commented 3 years ago

Hi Steven,

I have a fork of orbkit that is a bit more flexible in terms of parsing Molden files https://github.com/felixplasser/orbkit Does that solve the problem? Otherwise, I'll take a look. The Molden files always look a bit different between the different programs, so it is hard to have a parser that works for all of them.

srk commented 3 years ago

Hello Felix, Replaced orbkit with your version and it seems to run but now the hole and particle densities are being output as cube files with prefixes 'rho_0','rho_p','rho_h'. Fortunately, for the calculated NTO molden files, the 'extract_molden.py' script generate the desired hole and particle information in separate Molden files but I am getting occupations of less than 1 (e.g. 0.973). Where is the 'occupation leak' happening here?

srk commented 3 years ago

I don't know if its possible to add an output routine to write .fchk files as an alternative to MOLDEN files (assuming the .fchk produced by Gaussian and by QChem are interchangeable) ?

felixplasser commented 3 years ago

Hi Steven, yes, TheoDORE by itself produces the molden files and you can separate particle and hole using extract_molden.py (this just divides the file into two parts and duplicates the header). orbkit is only needed for cube files

For CIS/TDA computations the integral over rho_p or rho_h should be exactly 1. This is the promotion number p given in the output from analyze_sden.py. Per default, TheoDORE does not print the smaller orbital contributions. To change this, it should be possible to just set min_occ = 0. in the input file to analyze_sden.py https://sourceforge.net/p/theodore-qc/wiki/Keywords/ If not, please let me know.

felixplasser commented 3 years ago

I don't know if its possible to add an output routine to write .fchk files as an alternative to MOLDEN files (assuming the .fchk produced by Gaussian and by QChem are interchangeable) ?

TheoDORE itself is not well equipped to write fchk files, since it does not even know about the specific form of the basis functions. All it does is copying headers around. You can try writing a conversion utility but it is not trivial to get it working properly because of the ordering and normalisation of the AOs etc

srk commented 3 years ago

Hi Steven, yes, TheoDORE by itself produces the molden files and you can separate particle and hole using extract_molden.py (this just divides the file into two parts and duplicates the header). orbkit is only needed for cube files

For CIS/TDA computations the integral over rho_p or rho_h should be exactly 1. This is the promotion number p given in the output from analyze_sden.py. Per default, TheoDORE does not print the smaller orbital contributions. To change this, it should be possible to just set min_occ = 0. in the input file to analyze_sden.py https://sourceforge.net/p/theodore-qc/wiki/Keywords/ If not, please let me know.

That did the trick: got it up to 0.9982 which is probably as close as is possible with the limited number of digits in the input files.