Skip to content

Latest commit

 

History

History
111 lines (83 loc) · 2.94 KB

project1.md

File metadata and controls

111 lines (83 loc) · 2.94 KB

Project 1 - VMC on Bosonic Systems

(To view the code at the point of delivery of project 1, see project1-delivery)

Build & Run

The project is based on CMake, which means it should be able to build the project codes on most systems. The only external dependency is Google Tests, used for the unit tests exclusively. Your system must provide a C++ compiler with C++14 support.

To build the entire project:

> mkdir build && cd build  # Enter a dir where the build files should be placed.
> cmake .. -DCMAKE_BUILD_TYPE=[Debug/Release/Coverage]
> make

Running the main script:

> ./main.x 

Usage: ./main.x analytic[OFF=0,ON=1] sampler[Metro=0,Imp=1] dim n_bosons n_cycles alpha beta gamma a step n_bins max_radius filename 

Running the optimization script:

> ./optimize

Usage: ./optimize.x sampler[Metro=0,Imp=1] dim n_bosons alpha_guess beta gamma a step learning_rate n_cycles min_gradient

Running the tests:

> make gtest

Producing test coverage reports (requires lcov):

> cmake .. -DCMAKE_BUILD_TYPE=Coverage
> make coverage
> open coverage_out/index.html

Producing documentation (requires doxygen):

> make doc
> open html/index.html

Source Structure

.
├── CMakeLists.txt
├── Doxyfile.in
├── app
├── cmake
├── data
├── external
├── include
├── python
├── report
├── results
├── src
└── tests

Report

The PDF report, with accompanying source file can be found in report/.

Source Code

The sources for the project are located in src/, with the corresponding header files in include/. To get an overview of the codes, it is recommended to view the header files first. These include the documentation for all classes and functions.

Tests

The codes are extensively tested. All the tests are located in tests/, and named according to the files they test.

Executables

The executables are located in app/.

Python

The data processing is done in Python, and the files for this are in python/. The notebook python/analysis.ipynb shows the production of all the figures and tables used in the report.

Note: The Python scripts expect the executable to be in a folder named build-release in this folder. In order to run the Python functions, you will need to name the build directory as such.

Results

All figures and tables produced are located in this folder.

Data

Selected data files are stored in data/. The file format describes the parameters used to the main.x executable.

Note that the files are binary, and not human readable. They can be loaded by the code in python/analysis.ipynb, or directly using NumPy:

numpy.fromfile(filename, count=-1, dtype=numpy.float64)