Guide to Setting Up and Coding a Hartree-Fock Program in C++

Slide Note
Embed
Share

"Learn how to compile and run a Hartree-Fock program in C++, set up the directory, load C++ libraries, start coding, and structure the program effectively. Follow step-by-step instructions to develop a successful HF program. Code examples and images included."


Uploaded on Sep 17, 2024 | 0 Views


Download Presentation

Please find below an Image/Link to download the presentation.

The content on the website is provided AS IS for your information and personal use only. It may not be sold, licensed, or shared on other websites without obtaining consent from the author. Download presentation by click this link. If you encounter any issues during the download, it is possible that the publisher has removed the file from their server.

E N D

Presentation Transcript


  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 1. 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): matlab syntax conversion http://arma.sourceforge.net/docs.html#syntax Mike s office C2: 271 mikelecours@gmail.com general c++ syntax I found this youtube video helpful https://www.youtube.com/watch?v=Rub-JsjMhWY This link has useful short tutorials http://www.cplusplus.com/doc/tutorial Also this textbook The C++ Programing Language by Bjarne Stroustrup, publisher Addison Wesly Makefile http://mrbook.org/blog/tutorials/make/ https://www.cs.umd.edu/class/fall2002/cmsc214/Tutorial/makefile.html

Related


More Related Content