# Chemistry - Are there any full worked examples of DFT calculations?

## Solution 1:

The XC potential for DFT actually consists of two terms: $V_x$ and $V_c$. Depending on which XC functional you choose, the exchange part is either computed exactly (using Hartree-Fock) or using fitted parameters or in a combination of both. In the case of B3LYP the exchange is 20% Hartree + 8% Slater + 72% Becke88. The correlation functional consists of three (3) different terms (LYP) in a different form. If you take a different functional, say M06-2X, it has different functional type (54% Hartree exchange, 200+ parameters!).

Coming to the next part: You use a basis set only to compute the kinetic energy and exchange terms in the system. Let me walk you through a HF routine first:

The Hamiltonian consists of four terms(nuclear kinetic energy is zero because of Born-Oppenheimer Approximation) : $T_{elec} + V_{nn} + V_{en} + V_{ee}$. The nuclear-nuclear potential energy is constant (because they are 'clamped'). The first and third terms are fairly trivial, and are computed with relative ease. The electron-electron potential term consists of Pauli's exchange term, and the coulomb repulsion term. They are the computationally expensive part of the HF calculation, and the eigenvalues (energies) are solved self-consistently.

So, when you obtain the HF energy of a system, it is obtained variationally with respect to all the energy components in an interacting system of electrons and nuclei. Coming to DFT:

The first term you mentioned $V_{ext}$ is the external potential, which is usually the nuclear potential for an unperturbed system. The second term is equivalent to Coulomb repulsion. The third term is evaluated using the XC potential of your choice(every DFT method differs only at this part). You evaluate the energies for each and every orbital using the effective potential $V_s$ which you mentioned. Note: You evaluate energies for every orbital separately.

This is because of the KS theorem that equates the density created by non-interacting particles to be the same as that of interacting particles. So, we solve Kohn-Sham equation instead of Schrodinger equation, under a constraint that the sum of square of all the orbitals gives the density:

$$\rho(\mathbf r)=\sum_i^N |\phi_{i}(\mathbf r)|^2$$

This means that the energy computed using DFT is minimum with respect to a non-interacting system of electrons. This is the biggest assumption of DFT, which is quite valid too. As a result, DFT provides a good account of correlation energy at a very minimal computational expense (HF accounts for ZERO correlation)!!!

I took a computational chemistry course, where DFT was a small part, so I am not able to explain more in detail. I used Prof. Kieron Burke's ABC of DFT book, which he has uploaded online in his site for free use. It is a good source to start. There is also a video lecture of Prof. David Sherrill on Youtube: https://www.youtube.com/watch?v=5orzn-XA29M .

I missed the last question: For any molecule:

1. Compute the kinetic energy (using the KE functional)
2. Compute the external potential ($V_{ext}$)
3. Compute the Coulomb repulsion using an initial guess density ($n(r)$)
4. Compute the XC potential from the XC functional
5. Use Kohn Sham equations to find out orbital energies (under the constraint that the density ($n(r)$) is equal to the density of interacting particles (electrons). In this case, the density must be equal to the total number of electrons.
6. Using the newly obtained density, recompute the effective potential ($V_s$)
7. Perform until self-consistency is achieved. Then total energy is the sum of occupied orbital energies times the occupancy number.

Hope this helps!

## Solution 2:

Let me be the elephant here and answering your question:

To actually perform calculations technically speaking you don't really need all this stuff. You need them to able to read papers, design scientifically sound research, understand what the input parameters mean and discuss your results, but not for the manual part of the labor. There are several + 1 commercial and free software are available which does these things for you as those are mentioned in the very useful comments. If you find an unscratched itch to add some energy term that is not in the software and you don't know how, it is kind of a sure sign you don't know what you are doing. It may sound harsh, but the truth is that you need to understand much more about the calculations before you can just add terms here and there, and at that level you will be able to use the developer version of those programs anyway.

It is a funny side effect of education: generally QChem is taught by people who develop code, who talk all day about HF theory and numerical details, but mostly used by students who does not need to develop code, but use already existing programs. You come out from the lecture, learnt all those equations, you think you need to use somewhere, but the cold truth is that you have to open a window an click-click here and there or open a textfile and put some cryptic switches. At manual level, QChem calculations are much more about know-how and experience than writing equations.