Skip to content

DavidSvejda2507/FYS4411-Project2

Repository files navigation

Variational Monte Carlo solver for a Fermionic condensate

Languages Size

This repository contains the code for the second project of the course FYS4411 (spring 2023). This code was adapted from the code for the first project, which was forked from this template repository, whose authors are thankfully acknowledged.

Disclaimer

This README was written for the first project and has not been properly updated for the second project. It may be out of date.

Requirements

The code is written in C++. To compile it, you need to have the nlopt library and OpenMP installed. The data analysis is written in python.

Compiling and running the project

Provided Cmake is installed, compile by running the script compile_project via

./compile_project

This produces an executable called vmc in the top directory. It should be run as:

./vmc Input/simulation_input.txt

where Input/simulation_input.txt is the file containing the parameters of the simulation. There are two ways of running the code.

  1. If the input file contains the line calculateGradients=1, the code will compute the gradients and run an optimization algorithm for the parameters of the wave function. By default this is LBFGS, but it can be set to be gradient descent with momentum by providing an extra command-line argument GD:

        ./vmc Input/simulation_input.txt GD

    Progress of the optimization is written to Outputs/output.txt.

  2. If the input file contains the line calculateGradients=0, the code will NOT compute the gradients. This is meant to spare the computational costs when the wave function is already optimized. It will output a lot of files in the Outputs folder, which contain the sampled energies and the one-body histograms (in binary format).

Data Analysis

The python scripts for the data analysis are contained in the DataAnalysis folder, they assume that a simulation has been run without calculating gradients.

  • onebodydensity.py computes and plots the histograms and the corresponding gaussian fit.
  • blocking.py contains the blocking function provided by Marius Jonsson and uses it to analyse the simulation data.

Authors

David Svejda

The first project whose code forms the basis of this project was done in collaboration with Gianmarco Puleo

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published