I would like to be able to make a de-symmetrized (C1) deep copy of a RHF wavefunction. RHF::c1_deep_copy() seemed to be the obvious choice, however when I run:
wfn.c1_deep_copy(wfn.basisset())
I get
Fatal Error: Passed in functional was unpolarized for UV reference.
I looked up the source code and I suspect this might be related to the fact that c1_deep_copy returns a generic Wavefunction, not a RHF one.
I’ve found the issue and will leave it for people more familiar with the DFT infrastructure than I to fix. As a workaround, explicitly supply set reference rks before calling c1_deep_copy on an RKS DFT wavefunction object.
You’re right. I was looking at wfn and not hf_wfn in the C++ code.
It looks like I may have misunderstood the purpose of c1_deep_copy(). I thought it would strip the symmetry from the basis but it seems it simply copies a few arrays. Anyway, setting the reference to ‘rks’ seems to fix the problem. Which is weird because the rest of the code worked fine with ‘rhf’.