su2hmc
Loading...
Searching...
No Matches
main.c File Reference

Hybrid Monte Carlo algorithm for Two Colour QCD with Wilson-Gor'kov fermions based on the algorithm of Duane et al. Phys. Lett. B195 (1987) 216. More...

#include <assert.h>
#include <coord.h>
#include <math.h>
#include <matrices.h>
#include <par_mpi.h>
#include <random.h>
#include <string.h>
#include <su2hmc.h>
Include dependency graph for main.c:

Go to the source code of this file.

Functions

int main (int argc, char *argv[])
 

Detailed Description

Hybrid Monte Carlo algorithm for Two Colour QCD with Wilson-Gor'kov fermions based on the algorithm of Duane et al. Phys. Lett. B195 (1987) 216.

There is "up/down partitioning": each update requires one operation of Congradq() on complex*16 vectors to determine \((M^{\dagger} M)^{-1} \Phi\) where \(\Phi\) has dimension 4*kvol*nc*Nf - The matrix M is the Wilson matrix for a single flavor there is no extra species doubling as a result

Matrix multiplies done using routines Hdslash() and Hdslashd()

Hence, the number of lattice flavors Nf is related to the number of continuum flavors \(N_f\) by \( \text{Nf} = 2 N_f\)

Fermion expectation values are measured using a noisy estimator. on the Wilson-Gor'kov matrix, which has dimension 8*kvol*nc*Nf inversions done using Congradp(), and matrix multiplies with Dslash(), Dslashd()

Trajectory length is random with mean dt*stepl The code runs for a fixed number ntraj of trajectories.

\(\Phi\): pseudofermion field
bmass: bare fermion mass
\(\mu\): chemical potential
actiona: running average of total action

Fermion expectation values are measured using a noisy estimator.

outputs:
fermi psibarpsi, energy density, baryon density
bose spatial plaquette, temporal plaquette, Polyakov line
diq real<qq>

Author
SJH (Original Code, March 2005)
P.Giudice (Hybrid Code, May 2013)
D. Lawlor (Fortran to C Conversion, March 2021. Mixed Precision. GPU, March 2024)

Definition in file main.c.

Function Documentation

◆ main()

int main ( int argc,
char * argv[] )

For the early phases of this translation, I'm going to try and copy the original format as much as possible and keep things in one file. Hopefully this will change as we move through the methods so we can get a more logical structure.

Another vestige of the Fortran code that will be implemented here is the frequent flattening of arrays. But while FORTRAN Allows you to write array(i,j) as array(i+M*j) where M is the number of rows, C resorts to pointers

One change I will try and make is the introduction of error-codes (nothing to do with the Irish postal service) These can be found in the file errorcode.h and can help with debugging

Lastly, the comment style for the start of a function is based off of doxygen. It should consist of a description of the function, a list of parameters with a brief explanation and lastly what is returned by the function (on success or failure).

Input Parameters.

The input file format is like the table below, with values sepearated by whitespace

0.0100 1.7 0.1780 0.00 0.000 0.0 0.0 100 4 1 5 1
dt beta akappa jqq thetaq fmu aNf stepl ntraj istart icheck iread

The default values here are straight from the FORTRAN. Note that the bottom line labelling each input is ignored

Parameters
dtStep length for HMC
betaInverse Gauge Coupling
akappaHopping Parameter
jqqDiquark Source
thetaqDepericiated/Legacy.
fmuChemical Potential
aNfDepreciated/Legacy
steplMean number of steps per HMC trajectory
istartIf 0, start from cold start. If one, start from hot start
iprintHow often are measurements made (every iprint trajectories)
icheckHow often are configurations saved (every icheck trajectories)
ireadConfig to read in. If zero, the start based on value of istart

Initialisation

Changing the value of istart in the input parameter file gives us the following start options. These are quoted from the FORTRAN comments

istart < 0: Start from tape in FORTRAN?!? How old was this code? (depreciated, replaced with iread)

istart = 0: Ordered/Cold Start For some reason this leaves the trial fields as zero in the FORTRAN code?

istart > 0: Random/Hot Start

Timing

To time the code compile with

-DSA3AT 

This is arabic for hour/watch so is probably not reserved like time is

Definition at line 79 of file main.c.

References Average_Plaquette(), AVX, Complex, Complex_f, Dslashd_f(), FILELEN, Gauss_c(), Gauss_d(), gvol, halo, Hamilton(), hd, hu, Init(), kferm, kferm2, kferm2Halo, kfermHalo, kmom, ksize, ksizet, kvol, M_PI, nc, ndim, nf, ngorkov, nt, nx, ny, nz, Par_begin(), Par_fcopy(), Par_icopy(), Polyakov(), rank, rescga, rescgg, respbp, Reunitarise(), seed, size, and Trial_Exchange().

Here is the call graph for this function: