Support Options

Submit a Support Ticket


A MATLAB code for Hartree Fock calculation of H-H ground state bondlength and energy using STO-4G

By Amritanshu Palaria

Purdue University

Download (M)

Licensed according to this deed.



Published on


Hartree Fock (HF) theory is one of the basic theories underlying the current understanding of the electronic structure of materials. It is a simple non-relativistic treatment of many electron system that accounts for the antisymmetric (fermion) nature of electronic wavefunction but does not account for correlation effects. The matrix representation of this theory constitutes the Roothan Equations. This simple MATLAB Code uses the Roothan Equations, within Born Oppenheimer approximation and non-relativistic limit, to calculate the energy of H-H (two Hydrogen atoms) system with different bond lengths using Slater Type Orbital with 4 Gaussian basis functions (STO-4G) for each spatial orbital. It can be used as an example for a class on electronic structure theory or as a starting skeleton for developing more complex ab initio codes, that use a similar basis set.


Prof. Jorge Rodriguez @ Physics, Purdue University for his lectures on Hartree Fock theory (Phys 570A - Computational Biomolecular Physics), J.M. Thijssen for his book "Computational Physics"

Cite this work

Researchers should cite this work as follows:

  • Amritanshu Palaria (2006), "A MATLAB code for Hartree Fock calculation of H-H ground state bondlength and energy using STO-4G,"

    BibTex | EndNote

Tags, a resource for nanoscience and nanotechnology, is supported by the National Science Foundation and other funding agencies. Any opinions, findings, and conclusions or recommendations expressed in this material are those of the author(s) and do not necessarily reflect the views of the National Science Foundation.