Download presentation
Presentation is loading. Please wait.
1
Hartree-Fock Program in C++
2
Make a directory and copy the files
Note! First You need to load the c++ libraries every time in your terminal Alternatively you could add this to the end of your .bashrc located in your home ls –a to see it
3
Getting Started compile the c++ program by typing make
It spits out a bunch a text but it should work there should be a HF.exe file now 2. Run the c++ code in the terminal ./HF.exe
4
It should output something like this
This is the answer
5
Where to start coding Simple, open main.cpp in your favourite text editor (nano, vi, emacs ,ect.) Note! I use nano, but the rest are probably better It has a few matrix formatting functions and a few template functions simply scroll down to line 88 to get started here, note we are using libraries armadillo and a read_ao_int file
6
Where to start coding the code should be fairly commented but this is how to get the data from AO int defined in read_ao_int.cpp, and .h this is how you call the data
7
Where to start coding the code should be fairly commented but this is how to get the data from AO int you must declare everything so we have a way to kill the scf iterations
8
Where to start coding Now your good to start writing the HF program
Don’t forget to put a stop condition in you can format your output
9
Break down of the other .cpp files
This is the preprocessor stuff, shouldn’t have to change this, but you can if you want to split the code into multiple files (explained later)
10
Break down of the other .cpp files
These are some basic functions to grab the numbers from the AO int files used in the class constructor
11
class constructor->formats the data nicely for you and gets the proper symmetries for <ij|kl>
12
compiling multiple files into 1 program
Edit the Makefile add name of .cpp file here as a .o then include the header in the code that uses it
13
useful resources For Armadillo (c++ library): Mike’s office
matlab syntax conversion Mike’s office C2: 271 general c++ syntax I found this youtube video helpful This link has useful short tutorials Also this textbook The C++ Programing Language by Bjarne Stroustrup, publisher Addison Wesly Makefile
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.