I’m decomposing the matrices of HF and DFT results but have some problems about the DFT Fock and DFT exchange-correlation energy matrices, with numpy library.
I could gain HF Fock matrix with
np.asarray(hf_wfn.Fa()) (np is numpy)
option and I guess this Fock matrix is constructed as
However, when I do the same thing with the DFTs wfn, (e.g. np.asarray(dft_wfn.Fa())), I guess the output Fock matrix is not the desired one like
F=H+2J+Vxc, (I’m using GGA like pbe and, so, there is no K)
So, my question is
- Is it right to get DFT’s Fock matrix with np.asarray(dft_wfn.Fa()) option?
- How can I get Vxc matrix from SCF converged calculation?
Thank you in advance!
dft_wfn.Fa() will return the full Fock matrix. You should probably verify this for your own edification.
- The Vxc matrix can be obtained by
Please note that a freshly constructed
F will differ slightly from
hf_wfn.Fa() as the orbitals are one “step” past the current Fock matrix. The size of the difference will depend on how converged your Wavefunction is. See here for further information.
PS: I forget when I added the
Va constructor, you may need a fresh version from
Thank you for the kind reply.
I could gain Va matrix successfully via upgrading the psi4 version as you told.
Actually, I’m trying to reproduce the DFT energies with matrices.
For the RHF, I could gain HF energy as
Etot=(H+F)*D+E_nuc (where Etot = total energy, H is core-Hamiltonian, T+Vne and E_nuc is nuclear-nuclear repulsion one.)
But in the case of DFT, I couldn’t get the same value with that.
I saw the tutorial you’ve mentioned but it is kind of hard to me since I’m lack of information to know what the psi4 module is doing such as Vpot.properties(), Vpot.functional(), superfunctional, etc.
My goal is calculating DFT like the psi4numpy tutorial 3a.(https://github.com/psi4/psi4numpy/blob/master/Tutorials/03_Hartree-Fock/3a_restricted-hartree-fock.ipynb)
And, therefore, I’m trying to modify that tutorial 3a to do the DFT.
I’ve found ks_helper.py in the Tutorial 04 but couldn’t use it for the same reason above…
So, my main question is if it is possible to create Exc directly with DFT Fock matrix (=H+2J+Vxc).
Thank you very much.
@nesquik91 Exc is not computed by a contraction of Vxc with the density, it is computed as a direct summation of the xc energy at every grid point. I don’t think its possible to do what you ask.