How to do a DFT calculation
Density functional theory from a SMILES string to trustworthy numbers: which functional and basis set to pick, why you always check frequencies, and how to read the output.
What DFT gives you
DFT calculates the electronic structure of a molecule. From it you get optimized geometries, relative energies of conformers and reactions, orbital energies such as the HOMO LUMO gap, partial charges, electrostatic potential maps and IR, UV Vis and NMR spectra. Popular programs are Gaussian, ORCA (free for academic use), Psi4 and PySCF (open source), Q-Chem and NWChem.
Step 1. Build a starting geometry
- Generate 3D coordinates from SMILES, for example with RDKit.
- Flexible molecules have many conformers: search them (CREST is a common choice) and run DFT on the lowest few, not on a random one.
- A quick GFN2-xTB preoptimization saves DFT time.
Step 2. Set charge and multiplicity
- Charge: the net charge of the molecule (0 for neutral, +1 for a protonated amine).
- Multiplicity: 1 for ordinary closed shell molecules, 2 for radicals, 3 for triplets.
Getting these wrong is the most common reason a calculation fails or gives nonsense.
Step 3. Choose the level of theory
| Goal | A sensible choice |
|---|---|
| Geometries of organic molecules | B3LYP-D3(BJ)/def2-SVP or 6-31G(d), or the fast r2SCAN-3c |
| Reaction and conformer energies | ωB97X-D or PBE0-D3(BJ) with def2-TZVP on those geometries |
| UV Vis (TD-DFT) | CAM-B3LYP or ωB97X-D, especially for charge transfer states |
| Anions | Add diffuse functions, for example 6-31+G(d,p) or aug-cc-pVDZ |
Always include a dispersion correction such as D3(BJ); without it, stacking and other weak interactions are badly wrong. Use a solvent model (CPCM or SMD) when the property in solution matters.
Step 4. Optimize the geometry
The program moves the atoms until the forces vanish. Check that it converged and that the structure still looks chemically right.
Step 5. Run a frequency calculation
- No imaginary frequencies means a true minimum. One imaginary frequency means a transition state (wanted only when you search for one).
- Frequencies also give zero point energy, enthalpy and Gibbs free energy at your temperature.
- The IR spectrum comes from the same calculation; scale the frequencies by the factor published for your method.
Step 6. Calculate the properties you need
- HOMO LUMO gap: a rough guide to reactivity and electronic excitation.
- Electrostatic potential: where the molecule is electron rich or poor, useful for interactions.
- Partial charges: CHELPG or RESP fit the electrostatic potential and suit molecular mechanics better than Mulliken charges.
- Reactivity descriptors: hardness, softness, electrophilicity and Fukui functions from frontier orbitals.
- Spectra: TD-DFT for UV Vis, GIAO for NMR shifts.
Common mistakes
- Wrong charge or multiplicity.
- No dispersion correction.
- Skipping the frequency check.
- Comparing energies calculated at different levels of theory.
- Using a minimal basis set such as STO-3G for anything you plan to publish.
Do it on ChemServer
DFT on ChemServer sets up all of the above from a SMILES string or a structure file and returns the numbers, orbitals and spectra. It is available on request: email chris@chemserver.online with your molecules.
Explore your molecules first
Descriptors, 3D structures and docking are open to every free account.