This is a follow-up to a series of questions that I have asked here:

I calculate the A-matrix using this code:

import numpy
from pyscf import gto, scf, dft, tddft
mol = gto.Mole()
mol.atom = [['H' , (0. , 0. , .917)],['F' , (0. , 0. , 0.)], ]
mol.basis = 'sto3g'
mf = scf.RHF(mol).run()
a, b = tddft.TDHF(mf).get_ab()
nocc, nvir = a.shape[:2]
a = a.reshape(nocc*nvir,nocc*nvir)

But how can I confirm the correctness of this A-matrix? I attempted to utilize the A-matrix computed using the sto3g method within the (AQAE) script. It resulted in a minimum eigenvalue of value=0.5, which significantly contrasts with the output from the following script:

import pyscf 
mol = pyscf.M(atom = ‘H 0 0 0.917; F 0 0 0', basis = 'sto3g', 
symmetry = True,)
myhf = mol.RHF().run()
cisolver = pyscf.fci.FCI(myhf)
print('E(FCI) = %.12f' % cisolver.kernel()[0])

1 Answer 1


You are applying TDA upon TDHF, which results in CIS. So the A matrix is identical to the CIS Hamiltonian matrix minus the HF energy, or equivalently, the singles-singles block of the FCI matrix minus the HF energy. Therefore, the result differs from your FCI energy due to three reasons:

  1. After the FCI matrix is diagonalized, one typically does not subtract the HF energy from the eigenvalues;
  2. The lowest eigenvalue of the A matrix corresponds to the first excited state, not the ground state (since the A matrix does not include the ground state); and
  3. The A matrix does not include double and higher excitations.

Therefore, the correct way would be to generate the CIS Hamiltonian (I don't know what's the best way to do that in PySCF, but at least you can take the singles-singles block of the FCI Hamiltonian), subtract the HF energy from the diagonal elements, and compare against the A matrix. This should give perfect agreement. Nevertheless there are a few caveats:

  1. The two matrices only agree when the functional is HF. If you do TDA upon a density functional that is not HF, then TDA is not equivalent to CIS, even if you use the DFT Fock matrix to build the CIS Hamiltonian.
  2. The TDA and CIS codes of PySCF probably have a large overlap. So the agreement of TDA and CIS does not give you much extra confidence that your result is correct. If you feel it necessary, you can compare against the TDA or CIS matrix calculated by another program.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .