mortele / variational-monte-carlo-fys4411

Example class structure for use in FYS4411: Quantum mechanical systems at UiO.
https://www.uio.no/studier/emner/matnat/fys/FYS4411/
The Unlicense
13 stars 31 forks source link
c-plus-plus quantum-monte-carlo variational-monte-carlo

Variational Monte Carlo solver template for FYS4411

Example class structure for the first VMC project of FYS4411 (spring 2023). You may, if you wish, fork this repository and make it the basis of your project. If you choose to do this, you will have to implement a lot of the crucial functions yourself. The relevant functions you need to implement are spread throughout the project, but they are all commented with a note saying what each function should do.

Please note that this is only a start, and when you have implemented all of these functions you will only have completed the first exercise. However, once this is done, you will have a very good basis for further work, and adding functionality will be easier with a good class structure.

If you want to write your own code from scratch, you are of course welcome to do so, and feel free to use this code as inspiration for your own class structure.

Compiling and running the project

The recommend way to compile this project is by using CMake to create a Makefile that you can then run. You can install CMake through one of the Linux package managers, e.g., apt install cmake, pacman -S cmake, etc. For Mac you can install using brew install cmake. Other ways of installing are shown here: https://cmake.org/install/.

Compiling the project using CMake

In a Linux/Mac terminal this can be done by the following commands

# Create build-directory
mkdir build

# Move into the build-directory
cd build

# Run CMake to create a Makefile
cmake ../

# Make the Makefile using two threads
make -j2

# Move the executable to the top-directory
mv vmc ..

Or, simply run the script compile_project via

./compile_project

and the same set of commands are done for you. Now the project can be run by executing

./vmc

in the top-directory.

Cleaning the directory

Run make clean in the top-directory to remove the executable vmc and the build-directory.

Windows

Compilation of the project using Windows should work using CMake as it is OS-independent, but make does not work on Windows so the compile_project-script will not work.

Completing the missing parts

Here follows a suggestion for how you can work to complete the missing parts of the code: