Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Gauge derivative - 1/2 factor and gradient flow #38

Open
wants to merge 12 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 33 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ configure_file(
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OpenMP_CXX_FLAGS} -D_USE_OMP_")

find_package(yaml-cpp)

include_directories(${YAML_CPP_INCLUDE_DIR} ${YAML_CPP_INCLUDE_DIR}/yaml-cpp/)

find_package(xtl)
Expand All @@ -60,6 +59,11 @@ configure_file(
find_package(xtensor)
include_directories(${xtensor_INCLUDE_DIRS} ${xtensor_INCLUDE_DIRS}/xtensor/)


if(${HIGHFIVE_FORMAT})
find_package(HighFive REQUIRED)
endif()

# We could just have two `add_executable` blocks listing almost all source
# files. However, CMake would then compile the source files twice, once for
# each executable. The rationale is that different flags can be used for
Expand Down Expand Up @@ -90,9 +94,31 @@ add_executable(test-groups test.cc)
add_executable(scaling scaling.cc)
add_executable(try tryreduce.cc)

set(test_progs "links" "smearing" "yaml")

if(${HIGHFIVE_FORMAT})
set(test_progs ${test_progs} "h5-gen" "h5-dump")
endif()

set(test_progs_fullname "")
foreach(target ${test_progs})
add_executable(test-${target}.exe test/${target}.cpp)
list(APPEND test_progs_fullname test-${target}.exe) # now FOO="a;b"
endforeach(target)


target_link_libraries(test-yaml.exe ${YAML_CPP_LIBRARIES})

foreach(target ${test_progs_fullname})
if(${HIGHFIVE_FORMAT})
target_link_libraries(${target} HighFive)
endif()
endforeach(target)


target_link_directories(${CMAKE_PROJECT_NAME} PUBLIC ${YAML_CPP_LIBRARY_DIR})

foreach(target u1-main su2-main su2-kramers test-groups scaling try)
foreach(target u1-main su2-main su2-kramers test-groups scaling try ${test_progs_fullname})
target_link_libraries(${target} su2 ${YAML_CPP_LIBRARIES})

if(Boost_FOUND)
Expand All @@ -110,4 +136,9 @@ install(TARGETS ${PROJECT_NAME}
install(TARGETS u1-main su2-main)
install(TARGETS su2-kramers test-groups scaling try)

# tests

foreach(target ${test_progs})
install(TARGETS test-${target}.exe LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR})
endforeach(target)

11 changes: 5 additions & 6 deletions base_program.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
#pragma once

#include "flat-energy_density.hh"
#include "flat-gauge_energy.hpp"
#include "gauge_energy.hh"
#include "flat-sweep.hh" // flat spacetime
#include "gaugeconfig.hh"
#include "io.hh"
Expand All @@ -21,7 +21,7 @@
#include "random_gauge_trafo.hh"
// #include "rotating-energy_density.hpp" // rotating spacetime
// #include "rotating-gauge_energy.hpp" // rotating spacetime
//#include "rotating-sweep.hpp" // rotating spacetime
// #include "rotating-sweep.hpp" // rotating spacetime
#include "su2.hh"
#include "u1.hh"
#include "vectorfunctions.hh"
Expand Down Expand Up @@ -423,10 +423,9 @@ template <class Group, class sparam_type> class base_program {
if ((*this).omeas.verbosity > 0) {
std::cout << "## online measuring: J^{PC} glueball correlators.\n";
}
if ((*this).omeas.glueball.correlator) {
omeasurements::meas_glueball_correlator<Group>(omeas.glueball.interpolator_type,
U, i, (*this).omeas);
}

const std::string glb_interp = omeas.glueball.interpolator_type;
omeasurements::meas_glueball_correlator<Group>(glb_interp, U, i, (*this).omeas);
}
return;
}
Expand Down
File renamed without changes.
13 changes: 5 additions & 8 deletions doc/users/Makefile → doc/Makefile
Original file line number Diff line number Diff line change
@@ -1,21 +1,18 @@
# Makefile

# file paths and variables
STAGG = ./staggered_fermions.Rmd
u1 = ./u1.Rmd
main = ./main.Rmd

define generate_html
Rscript -e 'library(rmarkdown); rmarkdown::render("$(1)", "html_document")'
Rscript -e 'library(rmarkdown); rmarkdown::render("$(1)", "pdf_document")'
endef

all: staggered u1
all: main
make clean

u1: $(u1)
$(call generate_html,$(u1))

staggered: $(STAGG)
$(call generate_html,$(STAGG))
main: $(main)
$(call generate_html,$(main))


clean:
Expand Down
4 changes: 4 additions & 0 deletions doc/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Users guide

This directory contains the users guide to this project.
In order to produce the `html` and `pdf` output run `make all` from the present directory.
File renamed without changes.
26 changes: 1 addition & 25 deletions doc/users/u1.Rmd → doc/howto.Rmd
Original file line number Diff line number Diff line change
@@ -1,28 +1,7 @@
---
title: u1
author: Simone Romiti
output: html_document
bibliography: biblio.bib
csl: 2d-materials.csl
link-citations: true
---

## Introduction and main features

This repository contains a program called `main-u1.cpp`, which is capable of both generating gauge configurations and doing measurements on them for a $U(1)$ theory in $d=2,3,4$ dimensions.
At present the gauge configurations can be generated with the following Markov Chain Monte Carlo algorithms (see @gattringer2009quantum for the theoretical background):

- Metropolis
- Hybrid Monte Carlo

The measurements can be generated either online (during the MCMC) or offline (on previously generated configurations). At present the supported observables are:

- Plaquette standard and clover-improved energy
- Glueball correlators
- "pion" correlator
- Wilson loops and static potential among $\bar{q} q$ pairs
- Wilson gradient flow

## Program execution

The `main-u1.cpp` program works using an input file `main.input` as follows:
Expand Down Expand Up @@ -101,7 +80,4 @@ WRITE DOCUMENTATION HERE
- `Wloop`
- `potential` block.
- `glueball` block. The user can specify the interpolators and the APE smearing parameters
- `gradient_flow` block

## References

- `gradient_flow` block
74 changes: 74 additions & 0 deletions doc/main.Rmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
---
title: Documentation `su2` project
author: Simone Romiti
output:
html_document:
toc: true
theme: united
bibliography: biblio.bib
csl: 2d-materials.csl
link-citations: true
---

The present repository contains routines for numerical simulations of $SU(2)$ and $U(1)$ lattice gauge theories in $d=2,3,4$ dimensions.

# Library routines

The gauge configurations can be generated with the following Markov Chain Monte Carlo algorithms (see @gattringer2009quantum for the theoretical background):

- Metropolis
- Hybrid Monte Carlo

The measurements can be generated either online (during the MCMC) or offline (on previously generated configurations). At present the supported observables are:

- Plaquette standard and clover-improved energy
- Glueball correlators
- "pion" correlator
- Wilson loops and static potential among $\bar{q} q$ pairs
- Wilson gradient flow

### Programs info

- Programs: `main-u1.cpp` and `main-su2.cpp`
- Parameters parsing: `yaml` input file
- Input file example: see [./main.input](main.input)
Notes:
- Each run produces/updates a file named `nconf_counter.txt` in the directory storing the gauge configurations. This file contains a header line and the values below. An example:
```
heat i path_conf
1 1140 ./confs/config_u1.4.4.1.16.b1.900000.1140
```
- `restart` and `heat` cannot be passed simultaneously
- If `restart: true` is passed, the last configuration id and path are read from the `nconf_counter.txt` file.
- The program can do online and offline measurements

##### `hadron` folder

In the `hadron/` folder are found scripts for data manipulation such that online measurements are more easily readable with the `R` library `hadron`: https://github.com/HISKP-LQCD/hadron:

- `glueball.py`: converts the data for the interpolators and correlators of the glueball.
1. This is done in a separate step and not directly in the `C++` code on purpose. One may want to generate configurations and do offline measurements afterwards in parallel (multiple jobs, one for each bunch of measurements).
2. The scripts takes care of deleting the files in the old format. For each choice of the parameters and interpolator type, only 4 files are saved in the corresponding folders:

- `iconf.dat` : list of trajectory indices that have been put in `hadron` format

- `pp.dat`, `pm.dat`, `mp.dat`, `mm.dat`: correlators

3. The storage space saved in this way is mostly negligible, but avoids potential filesystem slowdowns due to the access to large number of files. Besides, the analysis scripts won't have to cope with reading the configurations one by one.
4. The script uses the same input file used for the runs

### tests

In the `test/` folder the user can find various simple programs implementing the routines of this repository. For further details please look at the `test/README.md` file.

# How to use the library

```{r child = './howto.Rmd'}
```

# Theoretical background

Fermions are included as a degenerate doublet using the staggered discretization.

```{r child = './staggered_fermions.Rmd'}
```
File renamed without changes.
12 changes: 7 additions & 5 deletions doc/users/staggered_fermions.Rmd → doc/staggered_fermions.Rmd
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
---
title: Staggered fermions
author: Simone Romiti
#title: Staggered fermions
#author: Simone Romiti
output: html_document
bibliography: biblio.bib
csl: 2d-materials.csl
link-citations: true
#bibliography: biblio.bib
#csl: 2d-materials.csl
#link-citations: true
---

## Staggered fermions

For staggered fermions the Dirac operator is:

$$
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
31 changes: 0 additions & 31 deletions doc/users/README.md

This file was deleted.

2 changes: 2 additions & 0 deletions hadron/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
This folder contains scripts for formatting online (offline) measurements.
Tha data is formatted such that is more easily readable by the routines of the "R" library "hadron": https://github.com/HISKP-LQCD/hadron
Loading