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

molden files and orbkit #48

Closed Audiochemie closed 11 months ago

Audiochemie commented 11 months ago

Hi Felix, thanks for the nice program. It is really helpful!

I ran into trouble though trying to compute particle hole densities and transition densities with the orbkit interface.

  File "xxx/TheoDORE_3.1.1/theodore/lib_tden.py", line 745, in compute_rho_0_n
    cube_ids=lib_orbkit.compute_rho_0_n(
  File "xxx/TheoDORE_3.1.1/theodore/orbkit_full.py", line 139, in compute_rho_0_n
    qc = self.orbkit_geo_ao_conversion(mos, molden_file=molden_file)
  File "xxx/TheoDORE_3.1.1/theodore/orbkit_full.py", line 47, in orbkit_geo_ao_conversion
    qc = read.read_molden(tmp)
  File "xxx/orbkit/orbkit/read/molden.py", line 370, in read_molden
    sym = sym[0].split('.')[-1]

Presumably this is linked to the fact that not the molden file specified in the input is used, but a temporary file which only contains the molden file header and a bit of a mo section. orbkit fails to read as it (rightfully) awaits mo coefficients. As I do not see a good reason for a temporary file to be passed to orbkit, I'd suggest to simply use the molden file specified by the user this should fix the issue.

Best regards Timo

felixplasser commented 11 months ago

Hi Timo, I am happy to have a look at that if you upload the full set of files TheoDORE reads.

The orbkit interface is not super robust. So, there might be an easy fix ...

Audiochemie commented 11 months ago

Thanks for the fast response. The involved files still create a gz > 50Mb so I created a smaller example, which throws the same exception. I think it should be an easy fix. Maybe extend the orbkit interface to accept **kwargs and pass sth like molden_file=xxx?

theodore_troubleshooting.tar.gz

Best Timo

Audiochemie commented 11 months ago

Thanks for the fast response. The involved files still create a gz > 50Mb so I created a smaller example, which throws the same exception. I think it should be an easy fix. Maybe extend the orbkit interface to accept **kwargs and pass sth like molden_file=xxx?

theodore_troubleshooting.tar.gz

Best Timo

I forgot to adapt the molden file. As I mentioned here orbkit has a problem with negative floats without leading zeros.

felixplasser commented 11 months ago

Hi, I had a look at this. In the first instance this tells me

FileNotFoundError: [Errno 2] No such file or directory: 'singlet1.in.out'

So, I guess we'd need that file as well.

Does the test work for you.

cd EXAMPLES
pytest-3 EXTRA/fa2.orbkit
Audiochemie commented 11 months ago

Whoops... I renamed the file to mrci.log and didn't change it in the dens_ana.in. Don't know why I did that. Here's a - hopefully - working archive: theodore_troubleshooting.tar.gz The test fails with the same error message as posted above.

felixplasser commented 11 months ago

Ok, if the test also fails, then this indicates a problem with the installation or orbkit version. I had a go with your files. It all works. As a proof I am attaching some figures made with qc_pymol. rho_0_1b1 rho_0_1b2 rho_0_1a2

felixplasser commented 11 months ago

Maybe the safest way to do it is to clone the git repo with all the same versions that I am using git clone --recursive https://github.com/felixplasser/theodore-qc.git

This sets symlinks to orbkit and cclib.

Then you install orbkit as described here https://theodore-qc.sourceforge.io/docs/installation.html#external-packages

Do you want to give this a go?

Audiochemie commented 11 months ago

Yeah I'll try to sort it out! Thanks for the help.

Audiochemie commented 11 months ago

A reinstall with the recursively cloned repo worked. :-)