About the computational efficiency of UHF CCSD(T) analytical gradient calculation

Hello, I’ve been trying to run CCSD(T) analytical gradient calculation. Elements in the system include C H O. The input file is attached below. It only takes about 30s to calculate the single point energy of the UHF system, but it takes more than 90 minutes to calculate the analytical gradient. When it comes to the RHF system, the calculation will be much faster. Is this right? What is the reason for consuming such a large calculation time in calculating the analytical gradient?

Thanks!

#! Tests RHF CCSD(T)gradients

memory 24GB
molecule ben {

C 25.682000 7.531000 1.718000
H 28.000000 9.389000 1.768000
C 27.359000 8.534000 1.328000
H 26.707000 9.052000 0.621000
H 27.913000 7.702000 0.971000
O 25.022000 6.872000 2.343000

symmetry c1
}

set {
reference uhf
basis 6-31g**
MAXITER 999
r_convergence 1e-5
e_convergence 1e-4
d_convergence 1e-4
guess_mix = true
}
analytic, wfn = gradient(‘ccsd(t)’, return_wfn=True)
fchk_writer = psi4.FCHKWriter(wfn)
fchk_writer.write(‘cho.fchk’)

First, please read our guidelines for new help topics. In particular, note the backticks.

RHF can always be made faster than UHF. That said, I think more effort has been put into optimizing our RHF gradient code than our UHF gradient code. The slowdown you’re seeing probably is about Psi’s code rather than your input file.

If you want to know exactly what code, you’d need to look at the source yourself.

OK, I have read the guidelines for new help topics.

Thanks! I know that UHF calculation is slower than RHF calculation under normal circumstances, and I will read the Psi’s code to find the answer.

Good luck!

A few notes:

  • There is a lot of code marked cc in Psi. The code that runs when getting a gradient but not an energy single-point is cchbar::cchbar, cclambda::CCLambdaWavefunction construction and its compute_energy method (which isn’t really an energy computation…), and ccdensity::ccdensity. All of those live in subdirectories here.
  • The CC code in Psi4 is quite old and consequently not the easiest to read. There were plans to modernize it, but nothing came of it.
  • libdpd is Psi’s tensor contraction library. dpd is short for “Direct Product Decomposition.” I do not recommend looking at the innards of the library unless absolutely necessary.
  • For technical questions about specific lines of code, you may want to get on the Psi slack channel. I’ll warn you that the only person who I know has worked with that code is @crawdad, whose time is quite limited.

Thanks a lot! This will be of great use to me.

Hi, I saw the example to calculate the ccsd(t) analytical gradient on psi4 github(https://github.com/psi4/psi4/blob/master/samples/cc13c/input.dat), and I have three questions:
1.The unit of the system structure uses bohr, is this necessary?
2.The values of r_convergence, e_convergence, and d_convergence are all 14. But if I look it up in psi4 Manual, the default value for r_convergence is 1e-7. What’s the difference between the two values?
3.In the case of water, how did the ‘CFOUR RESULTS’ come out, and what does it do in calculating the ccsd(t) analytical gradient?
Thanks for your kindness! I am looking forward to your reply.

Hi,
When I calculate the CCSD(T) analytical gradient of one water with aug-cc-PVTZ basis set, it only takes one minute, but it takes about an hour for the system to contain two waters, and it takes three minutes to calculate the single point energy of the two waters at the same level . The number of cpu cores used is 52. Water is a closed shell system, so I don’t know why the analytical gradient calculation is so time-consuming.
The input file for calculating the analytical gradient and single point energy is attached below, and I hope to get your answer.
"
#! Tests RHF CCSD(T)gradients
memory 240GB
molecule ben {

O 0.18635100 -2.11797200 -0.00263300
H 0.74864900 -2.65458800 0.56911800
H -0.27199600 -2.74118300 -0.57928900
O -0.00186500 0.00158100 -2.10379300
H 0.59134000 -0.49521400 -2.68099000
H -0.59610200 0.49952500 -2.67893900

symmetry c1
}
set {
reference rhf
basis aug-cc-PVTZ
}
analytic, wfn = gradient(‘ccsd(t)’, return_wfn=True)
fchk_writer = psi4.FCHKWriter(wfn)
fchk_writer.write(‘2-H2O.fchk’)
"
"
#! Tests RHF CCSD(T)gradients

memory 240GB
molecule ben {

O 0.18635100 -2.11797200 -0.00263300
H 0.74864900 -2.65458800 0.56911800
H -0.27199600 -2.74118300 -0.57928900
O -0.00186500 0.00158100 -2.10379300
H 0.59134000 -0.49521400 -2.68099000
H -0.59610200 0.49952500 -2.67893900

symmetry c1
}
set {
reference rhf
basis aug-cc-PVTZ
}
energy(‘ccsd(t)’)
"

  1. Using bohr isn’t necessary in the input file. You can supply a geometry in angstroms. However, Psi4 will convert it to bohr internally. Because we use bohr, several constants in the Hamiltonian simplify to 1.
  2. Psi solves its equations via iterative methods. Those numbers control how tightly we ask that various quantities be converged before we say that we have solved the equations. e_convergence is the convergence criteria for the change of energy between iterations. d_convergence is the convergence criteria for change of the SCF density between iterations. r_convergence is the convergence criteria for satisfying the residual equations.
  3. I doubt that sample will even run. The actual sample you want to look at is: https://github.com/psi4/psi4/blob/master/tests/cc13c/input.dat. CFOUR RESULTS is simply the gradient as computed by the CFOUR program. That isn’t used to compute Psi’s gradient, only to check that the gradient computed by our code is correct.

The timings you’re reporting certainly sound suspicious, but I don’t know the details of the coupled cluster code enough to say exactly where the issue is.

Thanks for your careful explanation! When I want to lower the convergence standard, can I reset e_convergence, d_convergence , r_convergence to 1e-4, 1e-4, 1e-5, respectively?

Psi will allow you to do that, yes.

Whether that is a good idea for your use case, I can’t say, as I don’t know your use case.

OK. Thanks a lot! I will test it against my system.