Skip to content

Exchange-correlation potential in pyscf #650

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
AlexanderFreeman opened this issue Jul 2, 2020 · 13 comments
Closed

Exchange-correlation potential in pyscf #650

AlexanderFreeman opened this issue Jul 2, 2020 · 13 comments

Comments

@AlexanderFreeman
Copy link

AlexanderFreeman commented Jul 2, 2020

Hello! Could you please explain me how does pyscf calculate exchange-correlation potential in GGA case? I analyzed code and it seems to me that pyscf uses only first-order gradients of xc energy density w.r.t. rho from libxc (vrho, vgamma). I found in file "/dft/numint.py" a function "nr_rks" and in case of GGA, for example, it slices the result obtained from "eval_xc" function:
exc, vxc = ni.eval_xc(xc_code, rho, spin=0, relativity=relativity, deriv=1, verbose=verbose)[:2]
And it uses only exc, vxc, but discards kxc and fxc. Does it mean that pyscf somehow calculates second-order gradients needed for exchange-correlation potential calculation? Or it uses another way for calculating exchange-correlation potential?

@gkc1000
Copy link
Contributor

gkc1000 commented Jul 2, 2020 via email

@AlexanderFreeman
Copy link
Author

AlexanderFreeman commented Jul 2, 2020

The standard definition of GGA only requires first derivatives of rho. Meta-gga's requires the kinetic energy density, and TDDFT requires fxc.

On Thu, Jul 2, 2020 at 7:50 AM AlexanderFreeman @.***> wrote: Hello! Could you please explain me how does pyscf calculate exchange-correlation potential? I analyzed code and it seems to me that pyscf uses only first-order gradients from libxc (vrho, vgamma). I found in file "/dft/numint.py" a function "nr_rks" and in case of GGA, for example, it slices the result obtained from "eval_xc" function: exc, vxc = ni.eval_xc(xc_code, rho, spin=0, relativity=relativity, deriv=1, verbose=verbose)[:2] And it uses only exc, vxc, but discards kxc and fxc. Does it mean that pyscf somehow calculates second-order gradients needed for exchange-correlation potential calculation? Or it uses another way for calculating exchange-correlation potential? — You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub <#650>, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAN5NRDSPSWTZI5WVPJ2PS3RZSNEHANCNFSM4OO62ZMA .

I mean not gradients of rho, but gradients of xc energy density w.r.t. rho. In gga case vxc (exchange-correlation potential) depends not only on dexc/dp, dexc/dsigma, but also on d2exc/dpdsigma, d2exc/dsigma^2. These gradients are included in fxc.

@AlexanderFreeman
Copy link
Author

AlexanderFreeman commented Jul 2, 2020

I used the GGA Vxc definition from article : https://www.researchgate.net/publication/1826446_Evaluation_of_Exchange-Correlation_Energy_Potential_and_Stress . You can find it on page 2 (Vxc gga case).

@gkc1000
Copy link
Contributor

gkc1000 commented Jul 2, 2020 via email

@gkc1000
Copy link
Contributor

gkc1000 commented Jul 2, 2020 via email

@AlexanderFreeman
Copy link
Author

AlexanderFreeman commented Jul 2, 2020

Ok, so if you are looking for the value of vxc on a grid specifically, this quantity is not used to evaluate (a|vxc|b) for GGA's. Although you could reconstruct it from the libxc interface.

On Thu, Jul 2, 2020 at 9:19 AM AlexanderFreeman @.***> wrote: I used the GGA definition from article : https://www.researchgate.net/publication/1826446_Evaluation_of_Exchange-Correlation_Energy_Potential_and_Stress http://url — You are receiving this because you commented. Reply to this email directly, view it on GitHub <#650 (comment)>, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAN5NRD4ZDCL5CMDA3YXQRDRZSXQ5ANCNFSM4OO62ZMA .

Thank you for your answers! Everything becomes much clearer.

@AlexanderFreeman
Copy link
Author

Ok, so if you are looking for the value of vxc on a grid specifically, this quantity is not used to evaluate (a|vxc|b) for GGA's. Although you could reconstruct it from the libxc interface.

On Thu, Jul 2, 2020 at 9:19 AM AlexanderFreeman @.***> wrote: I used the GGA definition from article : https://www.researchgate.net/publication/1826446_Evaluation_of_Exchange-Correlation_Energy_Potential_and_Stress http://url — You are receiving this because you commented. Reply to this email directly, view it on GitHub <#650 (comment)>, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAN5NRD4ZDCL5CMDA3YXQRDRZSXQ5ANCNFSM4OO62ZMA .

Can pyscf be used for vxc potential calculation on specific grid? Is procedure for that implemented in pyscf?

@gkc1000
Copy link
Contributor

gkc1000 commented Jul 2, 2020 via email

@sunqm
Copy link
Collaborator

sunqm commented Jul 4, 2020 via email

@ajz34
Copy link
Contributor

ajz34 commented Aug 12, 2020

I've probably reproduced GGA vxc(r) on specific grid, using fxc from PySCF's LibXC interface (NumInt).
https://ajz34.readthedocs.io/zh_CN/latest/QC_Notes/XC_Potential_Series/PBE_xc_potential.html
Code's in the blog. It's written in Chinese, but mostly equations and code. Hope not be confused by language (0.0)
It's default grid on Ne atom, 6-311G. Restricted PBE.
Figure 5 of V. N. Staroverov JCTC 2013 was reproduced, though this code is not reproducing concept of that article directly.
I think equation (2) of L. C. Balbas PRB 2001 is very similar to expression of vxc(r) in my blog.
Expression of vxc(r) in my blog was derived independently, so no reference for that.

@ajz34
Copy link
Contributor

ajz34 commented Aug 12, 2020

To my understanding, doing PBE SCF process does need vxc matrix in atomic orbital form, and does not require fxc; but generating vxc(r) does need fxc in GGA's case.
For LDA, only vxc (i.e. xc kernel's first derivative) is required for vxc(r). Also, vxc(r) is actually functional of rho.
It's really tricky for me 😹

@zhendongli2008
Copy link
Contributor

zhendongli2008 commented Aug 13, 2020 via email

@zhendongli2008
Copy link
Contributor

zhendongli2008 commented Aug 13, 2020 via email

@fishjojo fishjojo closed this as completed Oct 5, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants