Why do the CC and SCF density appear the same?

Hate to resurrect this, but I don’t think that the fchk utility is printing out the correct CC density after all.

This is a little bit of an odd test, but I am using the density matrix to calculate Hellmann-Feynman forces. When I use the CC density matrix, I get forces that are identical to those I get from using the SCF density matrix. Is there any way we can take a look at the fchk utility to make sure it is printing the right thing when called? I would be happy to help if pointed in the right place.

I have also tried adding:
psi4.set_options({'ccdensity__opdm_relax': 'true'})
to no avail.

(@andysim, I have a feeling you might also be able to help show me where to look for this)

The fchk utility is printing what the ccdensity code assigned as density matrix to the wave function object.
Should be this section: https://github.com/psi4/psi4/blob/master/psi4/src/psi4/cc/ccdensity/ccdensity.cc#L367

While the Hellmann-Feynman theorem does not apply here I am confused why the results from two different densities should be identical.

I’m making this into a new topic.

As Holger said, the densities used are those obtained from the wavefunction. Call the Da and Db methods to see those yourself.

Any further investigation on our end will require the input file you’re using to get these FCHK results.

The input file (df-psi4_grad.py) is:

import sys
import numpy as np
import psi4
import time

read in args

xyzfile = sys.argv[1]
basisname = sys.argv[2]
theory = sys.argv[3]
if theory == ‘ccsdt’:
theory = ‘ccsd(t)’

xyzprefix = xyzfile.split(‘.’)[0]

psi4.core.set_num_threads(250)
psi4.set_memory(‘500 GB’)
psi4.core.set_output_file(‘output.dat’, False)

with open(xyzfile) as f:
temp = f.readlines()[2:]

molstr = ’ '.join(temp)
molstr = molstr + “\n symmetry c1 \n no_reorient \n”
mol = psi4.geometry(molstr)

psi4.set_options({‘scf_type’: ‘df’,‘cc_type’: ‘df’})

grad, wfn = psi4.gradient(‘{}/{}’.format(theory,basisname), return_wfn=True)

fchk_writer = psi4.core.FCHKWriter(wfn)
fchk_writer.write(‘molecule.fchk’)

np.savetxt(‘molecule.psi4_forces’,grad)

To generate the CCSD(T) density, the command is:

python df-psi4_grad.py 01_Water-Water_0.80.xyz aug-cc-pvqz ccsdt

and for the SCF density, the command is:

python df-psi4_grad.py 01_Water-Water_0.80.xyz aug-cc-pvqz scf

where the xyz file is:

6 
#
O     -0.702196   -0.056060    0.009942  
H     -1.022193    0.846776   -0.011489  
H      0.257521    0.042121    0.005219  
O      1.866609    0.029496    0.001450  
H      2.243230   -0.408884    0.767575  
H      2.238873   -0.446717   -0.743952  

When I do this test, I find the densities that I get in the two fchk files are identical.

Unfortunately, DF-CC densities are not working.
(Sorry for being brief, on mobile)

There’s the explanation- thanks!

To add some weird info here: it works for me on Windows (ubuntu shell) but fails on HPC. Both with ostensibly the same version of psi4.

The HPC one is tracked as “1.3.2” but psi4 -V returns “undefined”

The Win one is tracked as “1.3.2” and psi4 -V returns “1.3.2”

Working with conventional coupled cluster has gotten really painful! I just opened an issue on Github to incorporate density fitted CCSD(T) densities, in case anyone is interested in tackling this.

I’m marking this solved. The original post is about the CC density overwriting the HF density, a bug that is fixed in developer Psi and will be available in 1.4.

DF-CCSD(T) densities (which aren’t quite on-topic) were made accessible on the wavefunction the same day.

Thanks again, @jmisiewicz. Do you know if these changes are reflected in the most recent developer psi4 version on conda?

No, they aren’t; the most recent developer version on conda is a month old. You’d need to ask @loriab about when the next one will be.

Thanks for putting up the most recent commit, @loriab! The DF-CCSD(T) density works now in the most recent dev version on conda.

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