How to copy orbitals from cas_wfn to scf_wfn?

I find that fchk() writer is not valid for detci since PSI4 1.4. The error is

FCHKWriter: Theory module DETCI is currently not supported by the FCHK writer.

So I use a workaround

casscf_energy, cas_wfn = energy('casscf',ref_wfn=scf_wfn,return_wfn=True)
scf_wfn.Ca = cas_wfn.Ca

But I find that natural orbitals are not copied from cas_wfn into scf_wfn. How to make a successful copy?
Or, is there any more elegant way to achieve this?
Thank you very much.

Just to be clear, you want an FCHK file using the natural orbitals from a CASSCF computation?

Thanks for your quick response. Yes, this was valid in PSI4 1.3.2, and I did not need to copy orbitals since fchk() can be used for detci at that time.
What I want is the CASSCF natural orbitals to be written in Alpha MO coefficients in a .fch(k) file. I don’t need the occupation numbers and CASSCF density.

You say, β€œI find that natural orbitals are not copied from cas_wfn into scf_wfn.” They should be copied. How do you know this? Do you know this by looking at the FCHK file, or by looking at the cas_wfn object?

I know this by visualizing orbitals in FCHK file. I find that the orbitals in newly generated .fch file are the same as the CASSCF initial orbitals I provided (initial orbitals are read in and stored in scf_wfn.Ca). An example is attached:

00-h2o_cc-pVDZ_1.5_uhf_gvb4_CASSCF.inp is just the PSI4 input file.
00-h2o_cc-pVDZ_1.5_uhf_gvb4_CASSCF.out is the output.
00-h2o_cc-pVDZ_1.5_uhf_uno_asrot2gvb4_s.A file contains the CASSCF initial orbitals.
00-h2o_cc-pVDZ_1.5_uhf_uno_asrot2gvb4_s.fch is the original .fch file which holds CASSCF initial orbitals. The *.A file is actually generated via fch2psi 00-h2o_cc-pVDZ_1.5_uhf_uno_asrot2gvb4_s.fch.

After running this example, a file named 00-h2o_cc-pVDZ_1.5_uhf_gvb4_CASSCF_NO.fch will be generated. I find that orbitals in this newly generated .fch file are the same as those orbitals in original .fch file. I know this is not normal or correct because I can use other quantum chemistry packages to produce correct CASSCF natural orbitals. Besides, one can utilize his/her chemical intuition that CASSCF natural orbitals are delocalized (but my provided initial orbitals are localized).

Thanks for your patience. (24.2 KB)
(You need to remove the suffix .dat and then unzip the compressed package.)

I see the problem. When you write scf_wfn.Ca = cas_scf.Ca, you are not changing the orbitals. You are changing the function that Psi uses on the Python-side to determine what the orbitals are. To actually change the orbitals, try scf_wfn.Ca().copy(cas_wfn.Ca()). That gives me much more reasonable results when I try it. This is why it is so important to include input files!

I’ll make an issue about improving FCHK support for FCI. The underlying problem is some inconsistency across various Psi methods, which is something I’m dealing with, but it’s slow-going.

1 Like

It works! Thank you.

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.