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

orca.cis is not parsed when TDDFT core excitations are specified #25

Closed zacmathe closed 2 years ago

zacmathe commented 3 years ago

I am interested in using TheoDORE to analyze X-ray absorption transitions calculated using TDDFT XAS in ORCA. In this procedure, excitations are allowed only from user-specified core orbitals.

TheoDORE is not able to read the orca.cis file when core excitations are specified. I have made two minimal TDDFT calculations, one including all excitations (the default; for e.g. UVVis), and one specifying a donor orbital (for XAS). The former can be analyzed using analyze_tden.py as expected, but the latter cannot:

...
Reading CI vectors from binary ORCA file orca.cis
Number of vectors: 5
! Reading ALPHA coefficients ...
  nmo: 33 , nocc: 1 , nact: 1 , nvir: 32
Traceback (most recent call last):
  File "/Users/zm/science/theodore/TheoDORE_2.4/bin/analyze_tden.py", line 56, in <module>
    tdena.read_dens()
  File "/Users/zm/science/theodore/TheoDORE_2.4/theodore/dens_ana_base.py", line 95, in read_dens
    self.state_list = ccli.read(self.mos)
  File "/Users/zm/science/theodore/TheoDORE_2.4/theodore/cclib_interface.py", line 76, in read
    self.tden_orca(state_list, mos, rect_dens)
  File "/Users/zm/science/theodore/TheoDORE_2.4/theodore/cclib_interface.py", line 258, in tden_orca
    raise error_handler.MsgError("Inconsistent number of MOs")
theodore.error_handler.MsgError:

  ERROR: Inconsistent number of MOs

I have attached a zip containing all files from the two orca calculations, plus the piped TheoDORE output. For convenience, here is the orca input file used for both calculations. It should run in a couple seconds on a laptop.

! RKS BP86 Def2-TZVP Def2/J

%tddft 
    OrbWin[0] = 0, 0, -1, -1 # Allow excitations only from orbital 0 for XAS. Omit this line for UVVis.  
    NRoots 5
    end

* xyz 0 1
F   0   0   0
H   0   0   0.9168
*

Addionally, I had to make one trivial modification to TheoDORE_2.4/cclib/parser/orcaparser.py, since we are using ORCA 5 and the output syntax has changed slightly since ORCA 4. Line 782 was changed from: self.etenergies.append(float(broken[-2])) to self.etenergies.append(float(broken[-5])) We are using ORCA 5 because it is a major upgrade to the program. For example, TDDFT calculations on large transition metal complexes run multiple times faster.

Please let me know if I can provide further information.

HF.zip

felixplasser commented 3 years ago

ok! This looks like this may just be a trivial error in terms of the dimension of the expected matrix. I'll see what can be done.

In terms of Orca 5, yes there seem to be some changes. I am not quite sure if that was fixed in cclib yet (which is the external library used to parse Orca).

RagnarB83 commented 2 years ago

Hi, any update on this issue? I would also be interested in this. Theodore looks like it would be quite useful for analyzing XAS spectra using ORCA so it would be great if this could be fixed.

felixplasser commented 2 years ago

If either of you wants to fix it, then I can tell you where to look. Otherwise maybe in a month or so ...

felixplasser commented 2 years ago

Sorry, I do not have the time to work on general feature requests.

We can think about it, if you want to turn this into a joint publication.

RagnarB83 commented 2 years ago

I will try to find time to take a look at this myself.