qsimulate-open / bagel

Brilliantly Advanced General Electronic-structure Library
GNU General Public License v3.0
96 stars 43 forks source link

Final XMS-CASPT2 CI vector #244

Closed LinyaoZhang closed 2 years ago

LinyaoZhang commented 2 years ago

Dear developer,

Following the issues #159 #203 #241 . It seems BAGEL didn't print out the final ci vector for a xms-caspt2 calculaiton. The ci vector in spinfreebase.cc comes before perturbative step.

In my calculations for 1,3-CHD molecule, the ci vector comes from the spinfreebase.cc is not consistent with the final state order.

I'm just wondering is there a easy way to get the final ci vertor for a xms-caspt2 calculation?

Many thanks!

lijingbai2009 commented 2 years ago

I think the current source codes have added the modifications in #159 to /src/smith/spinfreebase.cc. In line 159 and 160, I found
// print rotated CI vectors new_ciwfn->civectors()->print();

It prints the ci vectors after the XMS-CASPT2 rotation matrix. The CASSCF ci vectors are also printed. But It is before the XMS-CASPT2 rotation matrix.

LinyaoZhang commented 2 years ago

I know that #159 fix, but this fix does not print out the final CI vector for XMS-CASPT2, it seems to be the CI vectors for the intermediate states before perturbation as the last comments in #159. I have compared results with OpenMolcas for my system, and it shows the CI vector printed with #159 fix is not the final ones.

See also the https://github.com/sharc-md/sharc/blob/master/bin/SHARC_BAGEL.py, which is an dynamics code interface for BAGEL. I have use the get_dets_from_cores function to get the final CI vector.

lijingbai2009 commented 2 years ago

I see. Thanks for the explanation. I haven't looked at #159 since 2020. Let's see if the developer can fix it.

shiozaki commented 2 years ago

I know this is a bit tardy but the situation is the following. (i) the computation of the final CI vector is not necessary for energy and gradient evaluation, so they are not implemented. I don't intent to add this feature either. (ii) however, it is trivial to implement this here: https://github.com/qsimulate-open/bagel/blob/master/src/smith/caspt2/CASPT2.cc#L228

auto new_ciwfn = this->rotate_ciwfn(info_->ciwfn(), *heff_);
new_ciwfn->civectors()->print();

I haven't tried it so it may have some minor issues, but I am sure you guys can trouble shoot. Good luck :-)

LinyaoZhang commented 2 years ago

Thank you! This works~