Teaching Extras
Programming Hartree Fock in Matlab: Youtube Series
Videos Code
HF Program (Zip)
Lesson 1: Intro to HF
HF_Driver.m: Shell program that runs the calculation

Lesson 2: Basis Functions
Build_Basis: Builds our set of basis functions
Build_SOrbital: Builds an S-orbital primitive Gaussian

Lesson 3: Overlap & Kinetic Energy
GProd_1D: Multiplies 2 Gaussians along a single coordinate
goverlap.m: Calculates the overlap integral of 2 Gaussians
Build_Overlap: Build the Overlap or S matrix
Build_Kinetic.m: Builds the Kinetic Energy (T) Matrix

Lesson 4: Coulomb Integrals
Boys.m coulombg.m Build_Nuclear_Attraction.m
Files needed to calculate the electron-nuclear
attraction matrix
Build_Electron_Repulsion.m: Builds the 4 center
2 electron integrals

Lesson 5: The Hartree-Fock SCF Loop
SCF.m Fock_Energy.m Build_Density.m Sort_Eigs.m
Files for running the HF SCF loop after calculating
the matrix elements.

While teaching our undergraduate Quantum and Spectroscopy class, I realized that there is a large gap between how much we can teach molecular orbitals beyond molecules as simple as H2+. I wrote a matlab code for performing Hartree-Fock calculations in Matlab, and made a series of Youtube Videos explaining the process line-by-line as I write the code. The progam is written in Matlab for 2 reasons. First, it is easier to use and more transparent than something like C or Fortran. Secondly, most undergraduate students have free access to Matlab software through their universities. If you've ever wondered how a computer can calculate the energy of a molecule, join me in writing your own code. The total time to create this HF program for S orbitals is roughly 3 hours.   This series is aimed at students (upper level undergraduates or 1st year graduate students) who are already familiar with some background of Hartree Fock, who may or may not have any programing experience.


If you're looking for an introduction to Hartree Fock theory, I'd highly recommend the video "CompChem.04.01 Ab Initio Hartree-Fock Theory: Basis Sets and LCAO Wave Functions" by my colleague Prof. Chris Cramer (@ChemProfCramer)