├── Changelog ├── ChangeLog ├── TODO ├── CONF ├── lat..400 └── input_file ├── AUTHORS ├── tests ├── MMULs_test.h ├── U_Nops_test.h ├── geom_test.h ├── Makefile.am └── minunit.h ├── docs ├── Makefile └── SUNxU1_info.tex ├── src ├── Headers │ ├── balls.h │ ├── Qmoments.h │ ├── BPST_config.h │ ├── relax.h │ ├── hb.h │ ├── CUT_wrap.h │ ├── HYP.h │ ├── str_stuff.h │ ├── Qcorr.h │ ├── SUNCxU1_config.h │ ├── Qslab.h │ ├── SM_wrap.h │ ├── Qsusc.h │ ├── input_help.h │ ├── XML_info.h │ ├── config_gluons.h │ ├── read_headers.h │ ├── OBS_wrap.h │ ├── input_reader.h │ ├── MMULdagdag.h │ ├── Coulomb.h │ ├── writers.h │ ├── cuts.h │ ├── U1_top.h │ ├── 4D_fast.h │ ├── init.h │ ├── GF_wrap.h │ ├── CG.h │ ├── U1_obs.h │ ├── GLU_timer.h │ ├── glueprop.h │ ├── 3Dcuts.h │ ├── KPHB.h │ ├── MMUL_dag.h │ ├── par_KISS.h │ ├── ND_generic_HYP.h │ ├── MMUL_SUNC.h │ ├── MMUL_triple.h │ ├── CFACG.h │ ├── clover.h │ ├── pspace_landau.h │ ├── wflow.h │ ├── MMULdag_SUNC.h │ ├── BGQ_mmul.h │ ├── log_derivs.h │ ├── crc.h │ ├── HIREP.h │ ├── MOMggg.h │ ├── LU_SSE.h │ ├── MMUL_dag_SUNC.h │ ├── invert.h │ ├── MMULdagdag_SUNC.h │ ├── LU.h │ ├── MOMgg.h │ ├── draughtboard.h │ ├── vandermonde.h │ ├── adaptive_flow.h │ ├── givens.h │ ├── CERN.h │ ├── smear.h │ ├── Landau.h │ ├── smearing_param.h │ ├── gramschmidt.h │ ├── par_MWC_4096.h │ ├── par_WELL_512.h │ ├── par_XOR_1024.h │ ├── par_MWC_1038.h │ ├── evalues.h │ ├── read_config.h │ ├── MMULdag.h │ ├── cut_routines.h │ ├── readers.h │ ├── Scidac.h │ ├── Or.h │ ├── MMUL.h │ ├── BGQ_mmuldag.h │ ├── MAG.h │ ├── GLU_bswap.h │ ├── write_headers.h │ ├── expMat.h │ ├── BGQ_mmul_dag.h │ ├── FACG.h │ ├── POLY.h │ ├── GLU_sums.h │ ├── GLU_malloc.h │ ├── trace_abc.h │ ├── CGalloc.h │ ├── triplet_gen.h │ ├── taylor_logs.h │ ├── plan_ffts.h │ ├── staples.h │ ├── BGQ_mmuldagdag.h │ └── effs.h ├── Utils │ ├── str_stuff.c │ ├── GLU_timer.c │ └── GLU_sums.c ├── Gfix │ └── log_derivs.c ├── Wrappers │ └── CUT_wrap.c ├── Matrix_Ops │ ├── vandermonde.c │ └── MMUL │ │ └── MMULdag.c ├── Geometry │ └── init.c ├── Run │ └── Mainfile.c └── Cuts │ └── pspace_landau.c ├── m4 └── ltversion.m4 ├── NEWS ├── Makefile.am └── README /Changelog: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /ChangeLog: -------------------------------------------------------------------------------- 1 | changes are a coming 2 | -------------------------------------------------------------------------------- /TODO: -------------------------------------------------------------------------------- 1 | Things I would like to do 2 | ------------------------- 3 | 4 | -------------------------------------------------------------------------------- /CONF/lat..400: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RJHudspith/GLU/HEAD/CONF/lat..400 -------------------------------------------------------------------------------- /AUTHORS: -------------------------------------------------------------------------------- 1 | Thus begins the expansive list of authors. 2 | 3 | Jamie, and solely jamie. Also known a Renwick James Hudspith. -------------------------------------------------------------------------------- /tests/MMULs_test.h: -------------------------------------------------------------------------------- 1 | /** 2 | @file MMULs_test.h 3 | @brief MMULs test runner 4 | */ 5 | #ifndef GLU_MMULS_TEST_H 6 | #define GLU_MMULS_TEST_H 7 | 8 | /** 9 | @fn int MMUL_test( void ) 10 | @brief run the matrix multiply tests 11 | @return #GLU_SUCCESS or #GLU_FAILURE 12 | */ 13 | int 14 | MMUL_test( void ) ; 15 | 16 | #endif 17 | -------------------------------------------------------------------------------- /tests/U_Nops_test.h: -------------------------------------------------------------------------------- 1 | /** 2 | @file U_Nops_test.h 3 | @brief geometry test runner 4 | */ 5 | #ifndef GLU_UNOPS_TEST_H 6 | #define GLU_UNOPS_TEST_H 7 | 8 | /** 9 | @fn int UNOPS_test( void ) 10 | @brief run the geometry tests 11 | @return #GLU_SUCCESS or #GLU_FAILURE 12 | */ 13 | int 14 | UNOPS_test( void ) ; 15 | 16 | #endif 17 | -------------------------------------------------------------------------------- /tests/geom_test.h: -------------------------------------------------------------------------------- 1 | /** 2 | @file geom_test.h 3 | @brief geometry test runner 4 | */ 5 | #ifndef GLU_GEOM_TEST_H 6 | #define GLU_GEOM_TEST_H 7 | 8 | /** 9 | @fn int geometry_test( void ) 10 | @brief run the geometry tests 11 | @return #GLU_SUCCESS or #GLU_FAILURE 12 | */ 13 | int 14 | geometry_test( void ) ; 15 | 16 | #endif 17 | -------------------------------------------------------------------------------- /tests/Makefile.am: -------------------------------------------------------------------------------- 1 | ## simple makefile for the unit tests 2 | 3 | TOPDIR=@top_srcdir@ 4 | BUILDDIR=@top_builddir@ 5 | 6 | bin_PROGRAMS = unit 7 | unit_SOURCES = units.c geom_test.c U_Nops_test.c MMULs_test.c 8 | 9 | ## compile against GLUlib installed somewhere 10 | unit_CFLAGS = -Wall ${CFLAGS} -I${TOPDIR}/src/Headers/ 11 | unit_LDADD = ../src/libGLU.a ${LDFLAGS} 12 | -------------------------------------------------------------------------------- /docs/Makefile: -------------------------------------------------------------------------------- 1 | ## makes the documentation 2 | doxygen: 3 | doxygen Doxyfile 4 | 5 | .PHONY: 6 | doxygen 7 | 8 | documentation: 9 | pdflatex Setup_info.tex && pdflatex Setup_info_wflow.tex && pdflatex Gluon_info.tex && pdflatex Smearing_info.tex && pdflatex SUNxU1_info.tex && pdflatex Beginnings.tex && mv -v *.pdf ${DOCPREFIX}/docs/ && rm *.out *.log *.aux *~ 10 | 11 | .PHONY: 12 | documentation -------------------------------------------------------------------------------- /src/Headers/balls.h: -------------------------------------------------------------------------------- 1 | /** 2 | @file balls.c 3 | @brief GLU-balls calculation 4 | */ 5 | #ifndef GLU_BALLS_H 6 | #define GLU_BALLS_H 7 | 8 | /** 9 | @fn int GLU_balls( struct site *lat , const struct sm_info SMINFO ) 10 | @brief compute some glueballs 11 | @param lat :: lattice links 12 | @param SMINFO :: smearing information 13 | */ 14 | int 15 | GLU_balls( struct site *lat , 16 | struct sm_info SMINFO ) ; 17 | 18 | #endif 19 | -------------------------------------------------------------------------------- /tests/minunit.h: -------------------------------------------------------------------------------- 1 | /** 2 | @file minunit.h 3 | @brief minimal unit test framework 4 | 5 | http://www.jera.com/techinfo/jtns/jtn002.html 6 | */ 7 | #ifndef MINUNIT_H 8 | #define MINUNIT_H 9 | 10 | #define mu_assert(message, test) do { if (!(test)) return message; } while (0) 11 | #define mu_run_test(test) do { char *message = test(); tests_run++; \ 12 | if (message) { \ 13 | tests_fail++; \ 14 | return message ; \ 15 | }} while (0) 16 | extern int tests_run; 17 | extern int tests_fail; 18 | 19 | #endif 20 | -------------------------------------------------------------------------------- /src/Utils/str_stuff.c: -------------------------------------------------------------------------------- 1 | /** 2 | @file str_stuff.c 3 | @brief common functions that involve chars 4 | */ 5 | #include "Mainfile.h" 6 | 7 | // append a char 8 | void 9 | append_char( char **str , 10 | const char *tmp ) 11 | { 12 | *str = realloc( *str , (1+strlen(tmp)+strlen(*str))*sizeof(char) ) ; 13 | *str = strcat( *str , tmp ) ; 14 | } 15 | 16 | // strcmp defaults to 0 if they are equal which is contrary to standard if statements 17 | int 18 | are_equal( const char *str_1 , const char *str_2 ) { 19 | return !strcmp( str_1 , str_2 ) ; 20 | } 21 | -------------------------------------------------------------------------------- /CONF/input_file: -------------------------------------------------------------------------------- 1 | MODE = GAUGE_FIXING 2 | HEADER = NERSC 3 | DIM_0 = 4 4 | DIM_1 = 4 5 | DIM_2 = 4 6 | DIM_3 = 8 7 | CONFNO = 400 8 | RANDOM_TRANSFORM = NO 9 | SEED = 0 10 | GFTYPE = COULOMB 11 | GF_TUNE = 0.09 12 | ACCURACY = 14 13 | MAX_ITERS = 650 14 | CUTTYPE = GLUON_PROPS 15 | FIELD_DEFINITION = LINEAR 16 | MOM_CUT = CYLINDER_CUT 17 | MAX_T = 7 18 | MAXMOM = 4 19 | CYL_WIDTH = 2.0 20 | ANGLE = 60 21 | OUTPUT = ./ 22 | SMEARTYPE = APE 23 | DIRECTION = ALL 24 | SMITERS = 100 25 | ALPHA1 = 0.6 26 | ALPHA2 = 0.4 27 | ALPHA3 = 0.2 28 | U1_MEAS = U1_RECTANGLE 29 | U1_ALPHA = 0.07957753876221914 30 | U1_CHARGE = -1.0 31 | CONFIG_INFO = 2+1DWF_b2.25_TEST 32 | STORAGE = NERSC_GAUGE 33 | BETA = 6.0 34 | ITERS = 1500 35 | MEASURE = 1 36 | OVER_ITERS = 4 37 | SAVE = 25 38 | THERM = 100 -------------------------------------------------------------------------------- /m4/ltversion.m4: -------------------------------------------------------------------------------- 1 | # ltversion.m4 -- version numbers -*- Autoconf -*- 2 | # 3 | # Copyright (C) 2004 Free Software Foundation, Inc. 4 | # Written by Scott James Remnant, 2004 5 | # 6 | # This file is free software; the Free Software Foundation gives 7 | # unlimited permission to copy and/or distribute it, with or without 8 | # modifications, as long as this notice is preserved. 9 | 10 | # Generated from ltversion.in. 11 | 12 | # serial 3017 ltversion.m4 13 | # This file is part of GNU Libtool 14 | 15 | m4_define([LT_PACKAGE_VERSION], [2.2.6b]) 16 | m4_define([LT_PACKAGE_REVISION], [1.3017]) 17 | 18 | AC_DEFUN([LTVERSION_VERSION], 19 | [macro_version='2.2.6b' 20 | macro_revision='1.3017' 21 | _LT_DECL(, macro_version, 0, [Which release of libtool.m4 was used?]) 22 | _LT_DECL(, macro_revision, 0) 23 | ]) 24 | -------------------------------------------------------------------------------- /NEWS: -------------------------------------------------------------------------------- 1 | Wed 11/01/12 2 | 3 | Configure script bludgeoned into working in a satisfactory way. 4 | Should allow this code to be used by the unscrupulous masses I guess. 5 | Updated version number in my excitement. 6 | 7 | Tue 12/02/13 8 | 9 | Still not available to the masses. 10 | As a birthday treat to myself I am incorporating the automaking bit into the 11 | SVN. Will again update the version number in gross over-excitement. 12 | 13 | Mon 24/02/14 14 | 15 | Still not quite ready for the public. Many new additions, much wow. 16 | For one thing, I removed all the swearing, I have some error-checking for 17 | the gauge fixing routine and have got the Log smearing to work in single 18 | precision using the series expressions. 19 | 20 | Thurs 15/05/14 21 | 22 | I had to remove some more swearing in my comments. We now default to my 23 | CG codes for the gauge fixing. Checked and sped up the NC-generic codes. 24 | I have now put this online for the world to see. -------------------------------------------------------------------------------- /Makefile.am: -------------------------------------------------------------------------------- 1 | ## everything is in src and tests 2 | SUBDIRS = src tests 3 | 4 | ACLOCAL_AMFLAGS = -I m4 5 | 6 | ####################################### AUTOMATIC DOCUMENTATION GENERATION ##################################### 7 | 8 | ## Generates the doxygen for the code 9 | if !DOX 10 | ## if we have "dot" we generate call graphs 11 | if !DOT 12 | have_dot=YES 13 | else 14 | havedot=NO 15 | endif 16 | doxygen: 17 | ## seds the prefix path for the docs 18 | sed s~MYOUTDIR~"${prefix}/docs"~g ./docs/Doxyfile.prov | sed s~MYDOT~${have_dot}~g > ./docs/Doxyfile 19 | (cd docs && $(MAKE) $(AM_MAKEFLAGS) $@) || exit 1 20 | 21 | .PHONY: 22 | doxygen 23 | endif 24 | 25 | ## if we have pdflatex, I allow for the rule to autogenerate the documentation 26 | ## from the latex source 27 | if !PDFLTX 28 | documentation: 29 | ## export the prefix for the docs, can assign within make ... 30 | (cd docs && $(MAKE) DOCPREFIX="${prefix}" $(AM_MAKEFLAGS) $@) || exit 1 31 | .PHONY: 32 | documentation 33 | endif 34 | -------------------------------------------------------------------------------- /src/Headers/Qmoments.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2013-2025 Renwick James Hudspith 3 | 4 | This file (Qmoments.h) is part of GLU. 5 | 6 | GLU is free software: you can redistribute it and/or modify 7 | it under the terms of the GNU General Public License as published by 8 | the Free Software Foundation, either version 3 of the License, or 9 | (at your option) any later version. 10 | 11 | GLU is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | GNU General Public License for more details. 15 | 16 | You should have received a copy of the GNU General Public License 17 | along with GLU. If not, see . 18 | */ 19 | /** 20 | @file Qmoments.h 21 | @biref prototype declarations for Qmoment routines 22 | */ 23 | #ifndef GLU_QMOMENTS_H 24 | #define GLU_QMOMENTS_H 25 | 26 | /** 27 | @fn int compute_Qmoments( struct site *__restrict lat , struct Qmoments *Qmom ) 28 | @brief compute moments of the topological charge 29 | */ 30 | int 31 | compute_Qmoments( struct site *__restrict lat , 32 | struct Qmoments *Qmom ) ; 33 | 34 | #endif 35 | -------------------------------------------------------------------------------- /src/Headers/BPST_config.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2013-2016 Renwick James Hudspith 3 | 4 | This file (BPST_config.h) is part of GLU. 5 | 6 | GLU is free software: you can redistribute it and/or modify 7 | it under the terms of the GNU General Public License as published by 8 | the Free Software Foundation, either version 3 of the License, or 9 | (at your option) any later version. 10 | 11 | GLU is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | GNU General Public License for more details. 15 | 16 | You should have received a copy of the GNU General Public License 17 | along with GLU. If not, see . 18 | */ 19 | /** 20 | @file BPST_config.h 21 | @brief instanton configuration creator 22 | */ 23 | #ifndef GLU_BPST_CONFIG_H 24 | #define GLU_BPST_CONFIG_H 25 | 26 | /** 27 | @fn void instanton_config( struct site *lat ) 28 | @brief create a lattice-wide instanton configuration 29 | @param lat :: lattice gauge field 30 | @return #GLU_SUCCESS or #GLU_FAILURE 31 | @warning overwrites lat 32 | */ 33 | int 34 | instanton_config( struct site *lat ) ; 35 | 36 | #endif 37 | -------------------------------------------------------------------------------- /src/Headers/relax.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2013-2025 Renwick James Hudspith 3 | 4 | This file (relax.h) is part of GLU. 5 | 6 | GLU is free software: you can redistribute it and/or modify 7 | it under the terms of the GNU General Public License as published by 8 | the Free Software Foundation, either version 3 of the License, or 9 | (at your option) any later version. 10 | 11 | GLU is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | GNU General Public License for more details. 15 | 16 | You should have received a copy of the GNU General Public License 17 | along with GLU. If not, see . 18 | */ 19 | /** 20 | @file relax.h 21 | @brief performs over-relaxation over the whole lattice 22 | */ 23 | #ifndef GLU_RELAX_H 24 | #define GLU_RELAX_H 25 | 26 | /** 27 | @fn int OR_lattice( struct site *lat , const struct draughtboard db ) 28 | @brief overrelax our links 29 | @param lat :: lattice gauge fields 30 | @param db :: draughtboard indexing 31 | @return #GLU_SUCCESS or #GLU_FAILURE 32 | @warning overwrites lat 33 | */ 34 | int 35 | OR_lattice( struct site *lat , 36 | const struct draughtboard db ) ; 37 | 38 | #endif 39 | -------------------------------------------------------------------------------- /src/Headers/hb.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2013-2025 Renwick James Hudspith 3 | 4 | This file (hb.h) is part of GLU. 5 | 6 | GLU is free software: you can redistribute it and/or modify 7 | it under the terms of the GNU General Public License as published by 8 | the Free Software Foundation, either version 3 of the License, or 9 | (at your option) any later version. 10 | 11 | GLU is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | GNU General Public License for more details. 15 | 16 | You should have received a copy of the GNU General Public License 17 | along with GLU. If not, see . 18 | */ 19 | /** 20 | @file hb.h 21 | @brief prototype declarations for heatbath algorithm 22 | */ 23 | #ifndef GLU_HB_H 24 | #define GLU_HB_H 25 | 26 | /** 27 | @fn int hb_lattice( struct site *lat , const double invbeta , const struct draughtboard db ) 28 | @brief perform heat-bath updates 29 | @brief lat :: lattice gauge fields 30 | @brief invbeta :: the inverse of the coupling beta 31 | @brief db :: draughtboard indexing 32 | */ 33 | int 34 | hb_lattice( struct site *lat , 35 | const double invbeta , 36 | const struct draughtboard db ) ; 37 | 38 | #endif 39 | -------------------------------------------------------------------------------- /src/Headers/CUT_wrap.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2013-2025 Renwick James Hudspith 3 | 4 | This file (CUT_wrap.h) is part of GLU. 5 | 6 | GLU is free software: you can redistribute it and/or modify 7 | it under the terms of the GNU General Public License as published by 8 | the Free Software Foundation, either version 3 of the License, or 9 | (at your option) any later version. 10 | 11 | GLU is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | GNU General Public License for more details. 15 | 16 | You should have received a copy of the GNU General Public License 17 | along with GLU. If not, see . 18 | */ 19 | /** 20 | @file CUT_wrap.h 21 | @brief Wrapper for the cutting procedure 22 | */ 23 | #ifndef GLU_CUT_WRAP 24 | #define GLU_CUT_WRAP 25 | 26 | /** 27 | @fn void cuts_wrap_struct( struct site *__restrict lat , const struct cut_info CUTINFO , const struct sm_info SMINFO ) 28 | @brief Wrapper function 29 | 30 | @param lat :: Gauge fields 31 | @param CUTINFO :: cutting information 32 | @param SMINFO :: smearing information 33 | */ 34 | void 35 | cuts_wrap_struct( struct site *__restrict lat , 36 | const struct cut_info CUTINFO , 37 | const struct sm_info SMINFO ) ; 38 | 39 | #endif 40 | -------------------------------------------------------------------------------- /src/Headers/HYP.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2013-2025 Renwick James Hudspith 3 | 4 | This file (HYP.h) is part of GLU. 5 | 6 | GLU is free software: you can redistribute it and/or modify 7 | it under the terms of the GNU General Public License as published by 8 | the Free Software Foundation, either version 3 of the License, or 9 | (at your option) any later version. 10 | 11 | GLU is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | GNU General Public License for more details. 15 | 16 | You should have received a copy of the GNU General Public License 17 | along with GLU. If not, see . 18 | */ 19 | /** 20 | @file HYP.h 21 | @brief 3D (spatial) Hypercubically blocked smearing routine 22 | */ 23 | #ifndef GLU_HYP_H 24 | #define GLU_HYP_H 25 | 26 | /** 27 | @fn int HYPSLsmear3D( struct site *__restrict lat , const size_t smiters , const int type ) 28 | @brief 3D (spatial) Hypercubically blocked smearing routine 29 | @param lat :: lattice gauge field 30 | @param smiters :: number of smearing iterations 31 | @param type :: smearing type ( SM_LOG , SM_APE , SM_STOUT ) 32 | @return #GLU_FAILURE or #GLU_SUCCESS 33 | */ 34 | int 35 | HYPSLsmear3D( struct site *__restrict lat , 36 | const size_t smiters , 37 | const int type ) ; 38 | 39 | #endif 40 | -------------------------------------------------------------------------------- /src/Headers/str_stuff.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2013-2025 Renwick James Hudspith 3 | 4 | This file (str_stuff.h) is part of GLU. 5 | 6 | GLU is free software: you can redistribute it and/or modify 7 | it under the terms of the GNU General Public License as published by 8 | the Free Software Foundation, either version 3 of the License, or 9 | (at your option) any later version. 10 | 11 | GLU is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | GNU General Public License for more details. 15 | 16 | You should have received a copy of the GNU General Public License 17 | along with GLU. If not, see . 18 | */ 19 | /** 20 | @file str_stuff.h 21 | @brief prototype declarations for useful string functions 22 | */ 23 | #ifndef GLU_STR_STUFF_H 24 | #define GLU_STR_STUFF_H 25 | 26 | /** 27 | @fn void append_char( char **str , const char *tmp ) 28 | @brief appends tmp to str, reallocating str 29 | */ 30 | void 31 | append_char( char **str , 32 | const char *tmp ) ; 33 | 34 | /** 35 | @fn int are_equal( const char *str_1 , const char *str_2 ) 36 | @brief checks if two strings are the same, returns true if they are 37 | @return 1 or !1 if the are the same or not 38 | */ 39 | int 40 | are_equal( const char *str_1 , 41 | const char *str_2 ) ; 42 | 43 | #endif 44 | -------------------------------------------------------------------------------- /src/Headers/Qcorr.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2013-2025 Renwick James Hudspith 3 | 4 | This file (Qcorr.h) is part of GLU. 5 | 6 | GLU is free software: you can redistribute it and/or modify 7 | it under the terms of the GNU General Public License as published by 8 | the Free Software Foundation, either version 3 of the License, or 9 | (at your option) any later version. 10 | 11 | GLU is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | GNU General Public License for more details. 15 | 16 | You should have received a copy of the GNU General Public License 17 | along with GLU. If not, see . 18 | */ 19 | /** 20 | @file Qcorr.h 21 | @brief prototype declarations for topological correlator 22 | */ 23 | #ifndef GLU_QCORR_H 24 | #define GLU_QCORR_H 25 | 26 | /** 27 | @fn int compute_Qcorr( struct site *__restrict lat , const struct cut_info CUTINFO , const size_t measurement ) 28 | @brief compute the topological correlator 29 | @param lat :: lattice links 30 | @param CUTINFO :: config-space cutting information 31 | @param measurement :: measurement index 32 | @return #GLU_SUCCESS or #GLU_FAILURE 33 | */ 34 | int 35 | compute_Qcorr( struct site *__restrict lat , 36 | const struct cut_info CUTINFO , 37 | const size_t measurement ) ; 38 | 39 | #endif 40 | -------------------------------------------------------------------------------- /src/Headers/SUNCxU1_config.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2013-2025 Renwick James Hudspith 3 | 4 | This file (SUNCxU1_config.h) is part of GLU. 5 | 6 | GLU is free software: you can redistribute it and/or modify 7 | it under the terms of the GNU General Public License as published by 8 | the Free Software Foundation, either version 3 of the License, or 9 | (at your option) any later version. 10 | 11 | GLU is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | GNU General Public License for more details. 15 | 16 | You should have received a copy of the GNU General Public License 17 | along with GLU. If not, see . 18 | */ 19 | /** 20 | @file SUNCxU1_config.h 21 | @brief prototye declarations for the U(1)-ing of gauge links 22 | */ 23 | #ifndef GLU_SUNCxU1_CONFIG_H 24 | #define GLU_SUNCxU1_CONFIG_H 25 | 26 | /** 27 | @fn void suNC_cross_u1( struct site *__restrict lat , const struct u1_info U1INFO ) 28 | @brief creates links which are multiplied by a non-compact U(1) field 29 | 30 | @warning rewrites the gauge field 31 | @warning cannot write out configurations in any format but NCxNC #config_size 32 | 33 | calls compute_U1_obs() 34 | 35 | */ 36 | void 37 | suNC_cross_u1( struct site *__restrict lat , 38 | const struct u1_info U1INFO ) ; 39 | 40 | #endif 41 | -------------------------------------------------------------------------------- /src/Headers/Qslab.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2013-2025 Renwick James Hudspith 3 | 4 | This file (Qslab.h) is part of GLU. 5 | 6 | GLU is free software: you can redistribute it and/or modify 7 | it under the terms of the GNU General Public License as published by 8 | the Free Software Foundation, either version 3 of the License, or 9 | (at your option) any later version. 10 | 11 | GLU is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | GNU General Public License for more details. 15 | 16 | You should have received a copy of the GNU General Public License 17 | along with GLU. If not, see . 18 | */ 19 | /** 20 | @file Qslab.h 21 | @brief prototype definition of slab methond topological susceptibility 22 | */ 23 | #ifndef GLU_QSLAB_H 24 | #define GLU_QSLAB_H 25 | 26 | /** 27 | @fn int compute_Qsusc( struct site *lat , const struct cut_info CUTINFO , const size_t measurement ) 28 | @brief compute the topological susceptibility from translationally-averaged slabs 29 | @param lat :: lattice links 30 | @param CUTINFO :: formatting hangover from old code 31 | @param measurement :: measurement index 32 | @return #GLU_SUCCESS or #GLU_FAILURE 33 | */ 34 | int 35 | compute_Qsusc( struct site *lat , 36 | const struct cut_info CUTINFO , 37 | const size_t measurement ) ; 38 | 39 | #endif 40 | -------------------------------------------------------------------------------- /src/Headers/SM_wrap.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2013-2025 Renwick James Hudspith 3 | 4 | This file (SM_wrap.h) is part of GLU. 5 | 6 | GLU is free software: you can redistribute it and/or modify 7 | it under the terms of the GNU General Public License as published by 8 | the Free Software Foundation, either version 3 of the License, or 9 | (at your option) any later version. 10 | 11 | GLU is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | GNU General Public License for more details. 15 | 16 | You should have received a copy of the GNU General Public License 17 | along with GLU. If not, see . 18 | */ 19 | /** 20 | @file SM_wrap.h 21 | @brief wrapper for the smearing transformations 22 | */ 23 | #ifndef GLU_SM_WRAP_H 24 | #define GLU_SM_WRAP_H 25 | 26 | /** 27 | @fn int SM_wrap_struct( struct site *__restrict lat , const struct sm_info SMINFO ) 28 | @brief this is the smearing-wrapping function. 29 | @param lat :: lattice gauge field 30 | @param SMINFO :: smearing information
31 | 32 | in here you will find
33 | APE , HYP , STOUT , HEX , LOG , HYL and Wilson flow #smearing_types 34 | in ND and ND-1 dimensions
35 | returns #GLU_SUCCESS or #GLU_FAILURE 36 | **/ 37 | int 38 | SM_wrap_struct( struct site *__restrict lat , 39 | const struct sm_info SMINFO ) ; 40 | 41 | #endif 42 | -------------------------------------------------------------------------------- /src/Headers/Qsusc.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2013-2025 Renwick James Hudspith 3 | 4 | This file (Qsusc.h) is part of GLU. 5 | 6 | GLU is free software: you can redistribute it and/or modify 7 | it under the terms of the GNU General Public License as published by 8 | the Free Software Foundation, either version 3 of the License, or 9 | (at your option) any later version. 10 | 11 | GLU is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | GNU General Public License for more details. 15 | 16 | You should have received a copy of the GNU General Public License 17 | along with GLU. If not, see . 18 | */ 19 | /** 20 | @file Qsusc.h 21 | @brief prototype definitions for the Qsusc correlator 22 | */ 23 | #ifndef GLU_QSUSC_H 24 | #define GLU_QSUSC_H 25 | 26 | /** 27 | @fn int compute_Qsusc_step( struct site *__restrict lat , const struct cut_info CUTINFO , const struct sm_info SMINFO ) 28 | @brief computes the topological chare correlation function 29 | @param lat :: lattice gauge fields 30 | @param CUTINFO :: uses the max_mom value for the maximum r^2 used 31 | @param SMINFO :: smearing information 32 | @return #GLU_SUCCESS or #GLU_FAILURE 33 | */ 34 | int 35 | compute_Qsusc_step( struct site *__restrict lat , 36 | const struct cut_info CUTINFO , 37 | const struct sm_info SMINFO ) ; 38 | 39 | #endif 40 | -------------------------------------------------------------------------------- /src/Headers/input_help.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2013-2025 Renwick James Hudspith 3 | 4 | This file (input_help.h) is part of GLU. 5 | 6 | GLU is free software: you can redistribute it and/or modify 7 | it under the terms of the GNU General Public License as published by 8 | the Free Software Foundation, either version 3 of the License, or 9 | (at your option) any later version. 10 | 11 | GLU is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | GNU General Public License for more details. 15 | 16 | You should have received a copy of the GNU General Public License 17 | along with GLU. If not, see . 18 | */ 19 | /** 20 | @file input_help.h 21 | @brief function definition describing the possible options available to the end user 22 | */ 23 | #ifndef GLU_INPUT_HELP_H 24 | #define GLU_INPUT_HELP_H 25 | 26 | /** 27 | @fn void GLU_helps_those_who_help_themselves( const char *help_str ) 28 | @brief provided an argument --help={input file param} gives available options 29 | @param help_str :: a single string of the form --help={something} or --autoin={something} 30 | @return #GLU_SUCCESS 31 | */ 32 | int 33 | GLU_helps_those_who_help_themselves( const char *help_str ) ; 34 | 35 | /** 36 | @fn int GLUsage( void ) 37 | @brief print out to stdout how to use the code 38 | */ 39 | int 40 | GLUsage( void ) ; 41 | 42 | #endif 43 | -------------------------------------------------------------------------------- /src/Headers/XML_info.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2013-2025 Renwick James Hudspith 3 | 4 | This file (XML_info.h) is part of GLU. 5 | 6 | GLU is free software: you can redistribute it and/or modify 7 | it under the terms of the GNU General Public License as published by 8 | the Free Software Foundation, either version 3 of the License, or 9 | (at your option) any later version. 10 | 11 | GLU is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | GNU General Public License for more details. 15 | 16 | You should have received a copy of the GNU General Public License 17 | along with GLU. If not, see . 18 | */ 19 | /** 20 | @file XML_info.h 21 | @brief has the xml information parser for scidac and ILDG xml 22 | */ 23 | #ifndef GLU_XML_INFO_H 24 | #define GLU_XML_INFO_H 25 | 26 | /** 27 | @fn int parse_and_set_xml_SCIDAC( char *xml_info , struct head_data *HEAD_DATA ) 28 | @param xml_info :: the c-string of xml tags for this part of the header 29 | @param HEAD_DATA :: the struct of header data, some things are written out to 30 | 31 | @warning The lattice geometry in the struct Latt is written in here 32 | 33 | It takes the xml info as a string, and tokenizes the <> tags. Then looks for 34 | specific tag names. 35 | */ 36 | int 37 | parse_and_set_xml_SCIDAC( char *xml_info , 38 | struct head_data *HEAD_DATA ) ; 39 | 40 | #endif 41 | -------------------------------------------------------------------------------- /src/Headers/config_gluons.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2013-2025 Renwick James Hudspith 3 | 4 | This file (config_gluons.h) is part of GLU. 5 | 6 | GLU is free software: you can redistribute it and/or modify 7 | it under the terms of the GNU General Public License as published by 8 | the Free Software Foundation, either version 3 of the License, or 9 | (at your option) any later version. 10 | 11 | GLU is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | GNU General Public License for more details. 15 | 16 | You should have received a copy of the GNU General Public License 17 | along with GLU. If not, see . 18 | */ 19 | /** 20 | @file config_gluons.h 21 | @brief configuration space gluon propagators 22 | */ 23 | #ifndef GLU_CONFIG_GLUONS_H 24 | #define GLU_CONFIG_GLUONS_H 25 | 26 | /** 27 | @fn int cuts_struct_configspace( struct site *__restrict A , const struct cut_info CUTINFO , const struct sm_info SMINFO ) 28 | @brief computes the configuration-space gluon props 29 | @param A :: lattice fields 30 | @param CUTINFO :: cutting info 31 | @param SMINFO :: passed so that we can use smearing if we so wish 32 | 33 | @warning A is overwritten with the log fields 34 | */ 35 | int 36 | cuts_struct_configspace( struct site *__restrict A , 37 | const struct cut_info CUTINFO , 38 | const struct sm_info SMINFO ) ; 39 | 40 | #endif 41 | -------------------------------------------------------------------------------- /src/Headers/read_headers.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2013-2025 Renwick James Hudspith 3 | 4 | This file (read_headers.h) is part of GLU. 5 | 6 | GLU is free software: you can redistribute it and/or modify 7 | it under the terms of the GNU General Public License as published by 8 | the Free Software Foundation, either version 3 of the License, or 9 | (at your option) any later version. 10 | 11 | GLU is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | GNU General Public License for more details. 15 | 16 | You should have received a copy of the GNU General Public License 17 | along with GLU. If not, see . 18 | */ 19 | /** 20 | @file read_headers.h 21 | @brief reads the header information from the file format specified 22 | */ 23 | #ifndef GLU_READ_HEADERS_H 24 | #define GLU_READ_HEADERS_H 25 | 26 | /** 27 | @fn int read_header( FILE *__restrict infile , struct head_data *__restrict HEAD_DATA , const GLU_bool VERB ) 28 | @brief read the header of the specified configuration file's header 29 | @param infile :: configuration file 30 | @param HEAD_DATA :: header information taken from the file 31 | @param VERB :: verbose output or not? 32 | 33 | @return #GLU_SUCCESS or #GLU_FAILURE 34 | */ 35 | int 36 | read_header( FILE *__restrict infile , 37 | struct head_data *__restrict HEAD_DATA , 38 | const GLU_bool VERB ) ; 39 | 40 | #endif 41 | -------------------------------------------------------------------------------- /src/Headers/OBS_wrap.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2013-2025 Renwick James Hudspith 3 | 4 | This file (OBS_wrap.h) is part of GLU. 5 | 6 | GLU is free software: you can redistribute it and/or modify 7 | it under the terms of the GNU General Public License as published by 8 | the Free Software Foundation, either version 3 of the License, or 9 | (at your option) any later version. 10 | 11 | GLU is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | GNU General Public License for more details. 15 | 16 | You should have received a copy of the GNU General Public License 17 | along with GLU. If not, see . 18 | */ 19 | /** 20 | @file OBS_wrap.h 21 | @brief simple gauge observable calculation function prototypes 22 | */ 23 | #ifndef GLU_OBS_WRAP_H 24 | #define GLU_OBS_WRAP_H 25 | 26 | /** 27 | @fn void gauge( const struct site *__restrict lat ) 28 | @brief compute gauge observables 29 | @param lat :: lattice gauge field 30 | computations of temporal and spatial plaquettes and links and polyakov loops 31 | and derivatives with different field definitions 32 | */ 33 | void 34 | gauge( const struct site *__restrict lat ) ; 35 | 36 | /** 37 | @fn void gf_check( const struct site *__restrict lat ) ; 38 | @brief Checks wheteher we are gauge fixed 39 | @param lat :: Lattice fields 40 | */ 41 | void 42 | gf_check( const struct site *__restrict lat ) ; 43 | 44 | #endif 45 | -------------------------------------------------------------------------------- /src/Headers/input_reader.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2013-2025 Renwick James Hudspith 3 | 4 | This file (input_reader.h) is part of GLU. 5 | 6 | GLU is free software: you can redistribute it and/or modify 7 | it under the terms of the GNU General Public License as published by 8 | the Free Software Foundation, either version 3 of the License, or 9 | (at your option) any later version. 10 | 11 | GLU is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | GNU General Public License for more details. 15 | 16 | You should have received a copy of the GNU General Public License 17 | along with GLU. If not, see . 18 | */ 19 | /** 20 | @file input_reader.h 21 | @brief function definitions for getting information from our input file and telling the code what to do 22 | */ 23 | #ifndef GLU_INPUT_READER_H 24 | #define GLU_INPUT_READER_H 25 | 26 | /** 27 | @fn int get_input_data( struct infile_data *INFILE , const char *file_name ) 28 | @brief read in all the information from the input file 29 | @param INFILE :: the struct of all the input file 30 | @param file_name :: the input file's name 31 | 32 | If any of the information isn't there or doesn't make sense the code 33 | will complain and probably exit. 34 | 35 | @return #GLU_SUCCESS or #GLU_FAILURE 36 | */ 37 | int 38 | get_input_data( struct infile_data *INFILE , 39 | const char *file_name ) ; 40 | 41 | #endif 42 | -------------------------------------------------------------------------------- /src/Headers/MMULdagdag.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2013-2025 Renwick James Hudspith 3 | 4 | This file (MMULdagdag.h) is part of GLU. 5 | 6 | GLU is free software: you can redistribute it and/or modify 7 | it under the terms of the GNU General Public License as published by 8 | the Free Software Foundation, either version 3 of the License, or 9 | (at your option) any later version. 10 | 11 | GLU is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | GNU General Public License for more details. 15 | 16 | You should have received a copy of the GNU General Public License 17 | along with GLU. If not, see . 18 | */ 19 | /** 20 | @file MMULdagdag.h 21 | @brief prototype functions for matrix multiplication of generic matrices and SU(NC) only 22 | */ 23 | #ifndef GLU_MMULDAGDAG_H 24 | #define GLU_MMULDAGDAG_H 25 | 26 | #ifndef GLU_BGQ 27 | 28 | /** 29 | @fn void multab_dagdag( GLU_complex a[ NCNC ] , const GLU_complex b[ NCNC ] , const GLU_complex c[ NCNC ] ) 30 | @brief computes \f$ a = b^{\dagger} \times c^{\dagger} \f$ 31 | 32 | loop unrolled, standard matrix multiply 33 | **/ 34 | void 35 | multab_dagdag( GLU_complex a[ NCNC ] , 36 | const GLU_complex b[ NCNC ] , 37 | const GLU_complex c[ NCNC ] ) ; 38 | 39 | #else // GLU_BGQ ifdef 40 | 41 | // inline macros 42 | #include "BGQ_mmuldagdag.h" 43 | 44 | #endif // end of the BGQ inlining loop ... 45 | 46 | #endif 47 | -------------------------------------------------------------------------------- /src/Headers/Coulomb.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2013-2025 Renwick James Hudspith 3 | 4 | This file (Coulomb.h) is part of GLU. 5 | 6 | GLU is free software: you can redistribute it and/or modify 7 | it under the terms of the GNU General Public License as published by 8 | the Free Software Foundation, either version 3 of the License, or 9 | (at your option) any later version. 10 | 11 | GLU is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | GNU General Public License for more details. 15 | 16 | You should have received a copy of the GNU General Public License 17 | along with GLU. If not, see . 18 | */ 19 | /** 20 | @file Coulomb.h 21 | @brief Coulomb gauge fixing code 22 | 23 | Uses either the fourier-accelerated code or the normal steepest descent. 24 | Performs its iterations on a slice-by-slice basis. 25 | */ 26 | #ifndef GLU_COULOMB_H 27 | #define GLU_COULOMB_H 28 | 29 | /** 30 | @fn size_t Coulomb( struct site *__restrict lat , const double accuracy , const size_t iter ) 31 | @brief Coulomb gauge fixing 32 | 33 | @param lat :: Lattice fields 34 | @param accuracy :: Gauge fixing accuracy we are iterating to 35 | @param iter :: Maximum number of iterations before restarting 36 | 37 | @return the number of iterations 38 | */ 39 | size_t 40 | Coulomb( struct site *__restrict lat , 41 | const double accuracy , 42 | const size_t iter ) ; 43 | 44 | #endif 45 | -------------------------------------------------------------------------------- /src/Headers/writers.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2013-2025 Renwick James Hudspith 3 | 4 | This file (writers.h) is part of GLU. 5 | 6 | GLU is free software: you can redistribute it and/or modify 7 | it under the terms of the GNU General Public License as published by 8 | the Free Software Foundation, either version 3 of the License, or 9 | (at your option) any later version. 10 | 11 | GLU is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | GNU General Public License for more details. 15 | 16 | You should have received a copy of the GNU General Public License 17 | along with GLU. If not, see . 18 | */ 19 | /** 20 | @file writers.h 21 | @brief prototype function to write out lattice configuration 22 | */ 23 | #ifndef GLU_WRITERS_H 24 | #define GLU_WRITERS_H 25 | 26 | /** 27 | @fn int write_lat ( struct site *__restrict lat , FILE *__restrict out , const GLU_output type , char *__restrict details ) 28 | @brief writes out our lattice data 29 | @param lat :: lattice gauge field 30 | @param out :: configuration file being written 31 | @param type :: output type specified, should be #config_size 32 | @param details :: string of information to put into the "INFO" of the NERSC header 33 | */ 34 | int 35 | write_lat ( struct site *__restrict lat , 36 | FILE *out , 37 | const GLU_output type , 38 | const char *details , 39 | const char *outfile ) ; 40 | 41 | #endif 42 | -------------------------------------------------------------------------------- /src/Headers/cuts.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2013-2025 Renwick James Hudspith 3 | 4 | This file (cuts.h) is part of GLU. 5 | 6 | GLU is free software: you can redistribute it and/or modify 7 | it under the terms of the GNU General Public License as published by 8 | the Free Software Foundation, either version 3 of the License, or 9 | (at your option) any later version. 10 | 11 | GLU is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | GNU General Public License for more details. 15 | 16 | You should have received a copy of the GNU General Public License 17 | along with GLU. If not, see . 18 | */ 19 | /** 20 | @file cuts.h 21 | @brief prototype function def for the cutting procedures 22 | @ingroup Cuts 23 | */ 24 | #ifndef GLU_CUTS_H 25 | #define GLU_CUTS_H 26 | 27 | /** 28 | @fn int cuts_struct( struct site *__restrict A , const struct cut_info CUTINFO ) 29 | @brief cutting procedure generating our Fourier-transformed A(p) lie fields. 30 | @param A :: Our Fourier transformed gauge fields 31 | @param CUTINFO :: General cutting information 32 | 33 | Same as the old routine but with all of the cutting information 34 | squirreled away in CUTINFO.. 35 | 36 | @warning overwrites the stored gauge links in A 37 | 38 | @return #GLU_SUCCESS or #GLU_FAILURE 39 | **/ 40 | int 41 | cuts_struct( struct site *__restrict A , 42 | const struct cut_info CUTINFO ) ; 43 | 44 | #endif 45 | -------------------------------------------------------------------------------- /src/Headers/U1_top.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2013-2016 Renwick James Hudspith 3 | 4 | This file (U1_top.h) is part of GLU. 5 | 6 | GLU is free software: you can redistribute it and/or modify 7 | it under the terms of the GNU General Public License as published by 8 | the Free Software Foundation, either version 3 of the License, or 9 | (at your option) any later version. 10 | 11 | GLU is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | GNU General Public License for more details. 15 | 16 | You should have received a copy of the GNU General Public License 17 | along with GLU. If not, see . 18 | */ 19 | /** 20 | @file U1_top.h 21 | @brief U1 topological measures prototype function 22 | */ 23 | #ifndef GLU_U1_TOP_H 24 | #define GLU_U1_TOP_H 25 | 26 | /** 27 | @fn void U1_topological( int *monopole , int *d_sheet , double *qtop , const GLU_complex **O ) 28 | @brief measures some of the more elementary topological defects from the noncompact U(1) gauge field 29 | @param monopole :: number of monopoles 30 | @param d_sheet :: the "dirac sheet", the sum total of the non-zero windings around the elementary plaquette 31 | @param qtop :: the simplest measure of the U(1) naive gauge topological charge 32 | @param O :: the noncompact U(1) gauge field 33 | */ 34 | void 35 | U1_topological( int *monopole , 36 | int *d_sheet , 37 | double *qtop , 38 | const GLU_complex **O ) ; 39 | 40 | #endif 41 | -------------------------------------------------------------------------------- /src/Headers/4D_fast.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2013-2025 Renwick James Hudspith 3 | 4 | This file (4D_fast.h) is part of GLU. 5 | 6 | GLU is free software: you can redistribute it and/or modify 7 | it under the terms of the GNU General Public License as published by 8 | the Free Software Foundation, either version 3 of the License, or 9 | (at your option) any later version. 10 | 11 | GLU is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | GNU General Public License for more details. 15 | 16 | You should have received a copy of the GNU General Public License 17 | along with GLU. If not, see . 18 | */ 19 | /** 20 | @file 4D_fast.h 21 | @brief protoype functions for the most memory-expensive and usually fastest Hypercubic-blocking code. 22 | */ 23 | #ifndef GLU_FOURD_FAST_H 24 | #define GLU_FOURD_FAST_H 25 | 26 | /** 27 | @fn void HYPSLsmear4D_expensive( struct site *__restrict lat , const size_t smiters , const int type ) ; 28 | @brief This is the most memory-expensive Hypercubic-blocking code that we have. 29 | @param lat :: The lattice field. 30 | @param smiters :: The number of smearing iterations to perform. 31 | @param type :: Can either be SM_LOG, SM_APE or SM_STOUT 32 | 33 | @warning could not run if we dont have memory 34 | @return #GLU_SUCCESS or #GLU_FAILURE 35 | */ 36 | int 37 | HYPSLsmear4D_expensive( struct site *__restrict lat , 38 | const size_t smiters , 39 | const int type ) ; 40 | 41 | #endif 42 | -------------------------------------------------------------------------------- /src/Headers/init.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2013-2025 Renwick James Hudspith 3 | 4 | This file (init.h) is part of GLU. 5 | 6 | GLU is free software: you can redistribute it and/or modify 7 | it under the terms of the GNU General Public License as published by 8 | the Free Software Foundation, either version 3 of the License, or 9 | (at your option) any later version. 10 | 11 | GLU is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | GNU General Public License for more details. 15 | 16 | You should have received a copy of the GNU General Public License 17 | along with GLU. If not, see . 18 | */ 19 | /** 20 | @file init.h 21 | @brief lattice initialisation prototype declarations 22 | */ 23 | #ifndef GLU_INIT_H 24 | #define GLU_INIT_H 25 | 26 | /** 27 | @fn void free_latt( void ) 28 | @brief free the lattice struct information 29 | */ 30 | void 31 | free_latt( void ) ; 32 | 33 | /** 34 | @fn void init_latt( void ) 35 | @brief initialise vital constants 36 | Inits the constants #LSQ, #LCU and #LVOLUME 37 | */ 38 | void 39 | init_latt( void ) ; 40 | 41 | /** 42 | @fn void init_navig( struct site *__restrict lat ) 43 | @brief Function for generically initialising the lattice navigation 44 | 45 | @param lat :: Gauge field 46 | 47 | packs the struct lat's "neighbor" and 48 | "back" members which will be used for numerical 49 | derivatives and alike. 50 | **/ 51 | void 52 | init_navig( struct site *__restrict lat ) ; 53 | 54 | #endif 55 | -------------------------------------------------------------------------------- /src/Headers/GF_wrap.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2013-2025 Renwick James Hudspith 3 | 4 | This file (GF_wrap.h) is part of GLU. 5 | 6 | GLU is free software: you can redistribute it and/or modify 7 | it under the terms of the GNU General Public License as published by 8 | the Free Software Foundation, either version 3 of the License, or 9 | (at your option) any later version. 10 | 11 | GLU is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | GNU General Public License for more details. 15 | 16 | You should have received a copy of the GNU General Public License 17 | along with GLU. If not, see . 18 | */ 19 | /** 20 | @file GF_wrap.h 21 | @brief Funtion def for the wrapper of the gauge fixing code 22 | */ 23 | #ifndef GLU_GF_WRAP_H 24 | #define GLU_GF_WRAP_H 25 | 26 | /** 27 | @fn void GF_wrap( FILE *__restrict infile , struct site *__restrict lat , const struct gf_info GFINFO , const struct head_data HEAD_DATA ) 28 | @brief This is the wrapper that calls the gauge fixing functions. 29 | 30 | @param infile :: configuration file, be it HIREP or NERSC 31 | @param lat :: gauge field 32 | @param GFINFO :: general gauge fixing information from the input file 33 | 34 | It includes the smeared-preconditioned and MAG-preconditioned 35 | types of gauge fixing. 36 | 37 | @return #GLU_FAILURE or #GLU_SUCCESS 38 | **/ 39 | int 40 | GF_wrap( const char *__restrict infile , 41 | struct site *__restrict lat , 42 | const struct gf_info GFINFO ) ; 43 | 44 | #endif 45 | -------------------------------------------------------------------------------- /src/Headers/CG.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2013-2025 Renwick James Hudspith 3 | 4 | This file (CG.h) is part of GLU. 5 | 6 | GLU is free software: you can redistribute it and/or modify 7 | it under the terms of the GNU General Public License as published by 8 | the Free Software Foundation, either version 3 of the License, or 9 | (at your option) any later version. 10 | 11 | GLU is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | GNU General Public License for more details. 15 | 16 | You should have received a copy of the GNU General Public License 17 | along with GLU. If not, see . 18 | */ 19 | /** 20 | @file CG.h 21 | @brief common routines between Landau and Coulomb gauge fixing 22 | */ 23 | #ifndef GLU_CG_H 24 | #define GLU_CG_H 25 | 26 | /** 27 | @fn double PRfmax( const double a , const double b ) 28 | @brief returns the maximum of a and b 29 | */ 30 | double 31 | PRfmax( const double a , const double b ) ; 32 | 33 | /** 34 | @fn void set_gauge_matrix( GLU_complex *__restrict gx , const GLU_complex *__restrict *__restrict in , const double alpha , const size_t i ) 35 | @brief unpacks and exponentiates the derivative into the array gx at site i 36 | @param gx :: gauge transformation matrix 37 | @param in :: derivative at site i 38 | @param i :: site index 39 | */ 40 | void 41 | set_gauge_matrix( GLU_complex *__restrict gx , 42 | const GLU_complex *__restrict *__restrict in , 43 | const double alpha , 44 | const size_t i ) ; 45 | 46 | #endif 47 | -------------------------------------------------------------------------------- /src/Headers/U1_obs.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2013-2025 Renwick James Hudspith 3 | 4 | This file (U1_obs.h) is part of GLU. 5 | 6 | GLU is free software: you can redistribute it and/or modify 7 | it under the terms of the GNU General Public License as published by 8 | the Free Software Foundation, either version 3 of the License, or 9 | (at your option) any later version. 10 | 11 | GLU is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | GNU General Public License for more details. 15 | 16 | You should have received a copy of the GNU General Public License 17 | along with GLU. If not, see . 18 | */ 19 | /** 20 | @file U1_obs.h 21 | @brief U1 observable calculations 22 | */ 23 | #ifndef GLU_U1_OPS_H 24 | #define GLU_U1_OPS_H 25 | 26 | /** 27 | @fn void compute_U1_obs( const GLU_complex **U , const struct site *lat , const U1_meas meas ) 28 | @brief this function is a wrapper for the U1 measurements 29 | @param U :: the U(1) non-compact field 30 | @param lat :: the lattice gauge field used for look up of neighbors 31 | @param meas :: the measurement being made of type #U1_meas 32 | it computes the non-compact and compact plaquettes by default.
33 | if U1_RECTANGLE is defined, it outputs the compact rectangle
34 | if U1_TOPOLOGICAL is defined it outputs the number of monopoles 35 | and the "dirac_sheet". 36 | **/ 37 | void 38 | compute_U1_obs( const GLU_complex **U , 39 | const struct site *lat , 40 | const U1_meas meas ) ; 41 | 42 | #endif 43 | -------------------------------------------------------------------------------- /src/Headers/GLU_timer.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2013-2025 Renwick James Hudspith 3 | 4 | This file (GLU_timer.h) is part of GLU. 5 | 6 | GLU is free software: you can redistribute it and/or modify 7 | it under the terms of the GNU General Public License as published by 8 | the Free Software Foundation, either version 3 of the License, or 9 | (at your option) any later version. 10 | 11 | GLU is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | GNU General Public License for more details. 15 | 16 | You should have received a copy of the GNU General Public License 17 | along with GLU. If not, see . 18 | */ 19 | /** 20 | @file GLU_timer.h 21 | @brief function prototypes for the timing of functions 22 | @warning requires sys/time.h 23 | */ 24 | #ifndef GLU_TIMER_H 25 | #define GLU_TIMER_H 26 | 27 | /** 28 | @fn char* get_date( void ) 29 | @brief returns the current date if time.h exists, otherwise returns nonsense 30 | **/ 31 | char* 32 | get_date( void ) ; 33 | 34 | /** 35 | @fn double print_time( void ) 36 | @brief prints to stdout the time 37 | Here are the two timing functions I generally use, they are meant to 38 | be blocked in "#ifdef TIME_GF {...} #endif" 39 | 40 | @return the difference from start_timer() 41 | **/ 42 | double 43 | print_time( void ) ; 44 | 45 | /** 46 | @fn void start_timer( void ) 47 | @brief This refreshes the timer, meant to be followed by a print_time statement. 48 | **/ 49 | void 50 | start_timer( void ) ; 51 | 52 | #endif 53 | -------------------------------------------------------------------------------- /src/Headers/glueprop.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2013-2025 Renwick James Hudspith 3 | 4 | This file (glueprop.h) is part of GLU. 5 | 6 | GLU is free software: you can redistribute it and/or modify 7 | it under the terms of the GNU General Public License as published by 8 | the Free Software Foundation, either version 3 of the License, or 9 | (at your option) any later version. 10 | 11 | GLU is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | GNU General Public License for more details. 15 | 16 | You should have received a copy of the GNU General Public License 17 | along with GLU. If not, see . 18 | */ 19 | /** 20 | @file glueprop.h 21 | @brief prototype function def for gluon propagator measurements 22 | @ingroup Cuts 23 | */ 24 | #ifndef GLU_GLUEPROP_H 25 | #define GLU_GLUEPROP_H 26 | 27 | /** 28 | @fn int compute_gluon_prop( FILE *__restrict Ap , const struct site *__restrict A , const struct veclist *__restrict list , size_t num_mom[1] ) 29 | @brief computes the transverse and longitudinal gluon propagator scalar functions 30 | @param Ap :: file being written out to 31 | @param A :: Momentum space gluon fields 32 | @param list :: momentum list after cutting 33 | @param num_mom :: length of the momentum list 34 | 35 | @return #GLU_SUCCESS or #GLU_FAILURE 36 | */ 37 | int 38 | compute_gluon_prop( FILE *__restrict Ap , 39 | const struct site *__restrict A , 40 | const struct veclist *__restrict list , 41 | size_t num_mom[1] ) ; 42 | 43 | #endif 44 | -------------------------------------------------------------------------------- /src/Headers/3Dcuts.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2013-2025 Renwick James Hudspith 3 | 4 | This file (3Dcuts.h) is part of GLU. 5 | 6 | GLU is free software: you can redistribute it and/or modify 7 | it under the terms of the GNU General Public License as published by 8 | the Free Software Foundation, either version 3 of the License, or 9 | (at your option) any later version. 10 | 11 | GLU is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | GNU General Public License for more details. 15 | 16 | You should have received a copy of the GNU General Public License 17 | along with GLU. If not, see . 18 | */ 19 | /** 20 | @file 3Dcuts.h 21 | @brief Instantaneous temporal and spatial gluon propagator measurements 22 | @ingroup Cuts 23 | */ 24 | #ifndef GLU_CUTS_SPATIAL 25 | #define GLU_CUTS_SPATIAL 26 | 27 | /** 28 | @fn int cuts_spatial ( struct site *__restrict A , 29 | const struct cut_info CUTINFO ) ; 30 | 31 | @brief This code computes the instantaneous spatial and temporal gluon propagators this is for A - fields in Coulomb gauge. 32 | @param A :: The lattice field 33 | @param CUTINFO :: The general cutting information. i.e. Cut-type, Max and Min ... etc . 34 | 35 | As an added bonus it also shifts the result to reproduce the correct, 36 | momentum-space coulomb condition. Being p.A == 0. 37 | 38 | @return #GLU_FAILURE or #GLU_SUCCESS 39 | */ 40 | int 41 | cuts_spatial ( struct site *__restrict A , 42 | const struct cut_info CUTINFO ) ; 43 | 44 | #endif 45 | -------------------------------------------------------------------------------- /src/Headers/KPHB.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2013-2025 Renwick James Hudspith 3 | 4 | This file (KPHB.h) is part of GLU. 5 | 6 | GLU is free software: you can redistribute it and/or modify 7 | it under the terms of the GNU General Public License as published by 8 | the Free Software Foundation, either version 3 of the License, or 9 | (at your option) any later version. 10 | 11 | GLU is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | GNU General Public License for more details. 15 | 16 | You should have received a copy of the GNU General Public License 17 | along with GLU. If not, see . 18 | */ 19 | /** 20 | @file KPHB.h 21 | @brief prototype functions for quenched heat bath updates 22 | */ 23 | #ifndef GLU_KPHB_H 24 | #define GLU_KPHB_H 25 | 26 | /** 27 | @fn int hb_update( struct site *lat , const struct hb_info HBINFO , const char *traj_name , const GLU_output storage , const char *output_details ) 28 | @brief Heatbath-Overrelaxation algorithm 29 | @param lat :: lattice gauge field 30 | @param HBINFO :: heatbath information 31 | @param traj_name :: trajectory name to write out 32 | @param storage :: gauge field storage type to write out 33 | @param output_details :: information for the configuration file 34 | @return #GLU_SUCCESS or #GLU_FAILURE 35 | @warning overwrites lat 36 | */ 37 | int 38 | hb_update( struct site *lat , 39 | const struct hb_info HBINFO , 40 | const char *traj_name , 41 | const GLU_output storage , 42 | const char *output_details ) ; 43 | 44 | #endif 45 | -------------------------------------------------------------------------------- /src/Headers/MMUL_dag.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2013-2025 Renwick James Hudspith 3 | 4 | This file (MMUL_dag.h) is part of GLU. 5 | 6 | GLU is free software: you can redistribute it and/or modify 7 | it under the terms of the GNU General Public License as published by 8 | the Free Software Foundation, either version 3 of the License, or 9 | (at your option) any later version. 10 | 11 | GLU is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | GNU General Public License for more details. 15 | 16 | You should have received a copy of the GNU General Public License 17 | along with GLU. If not, see . 18 | */ 19 | /** 20 | @file MMUL_dag.h 21 | @brief prototype functions for computing the matrix product \f$ a = b \times c^{\dagger} \f$ 22 | */ 23 | #ifndef GLU_MMUL_DAG_H 24 | #define GLU_MMUL_DAG_H 25 | 26 | #ifndef GLU_BGQ // inlining matrix multiplies for the Q 27 | 28 | /** 29 | @fn void multab_dag( GLU_complex a[ NCNC ] , const GLU_complex b[ NCNC ] , const GLU_complex c[ NCNC ] ) 30 | @brief General matrix multiply \f$ a = b \times c^{\dagger}\f$ 31 | 32 | computes \f$ a = b \times c^{\dagger} \f$ general Nc x Nc matrix multiply does not require specific types of matrices uses the in-built complex multiply in complex.h 33 | **/ 34 | void 35 | multab_dag( GLU_complex a[ NCNC ] , 36 | const GLU_complex b[ NCNC ] , 37 | const GLU_complex c[ NCNC ] ) ; 38 | 39 | #else 40 | 41 | // inline matrix multiplies 42 | #include "BGQ_mmul_dag.h" 43 | 44 | #endif // end of the inline loop 45 | 46 | #endif 47 | -------------------------------------------------------------------------------- /src/Headers/par_KISS.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2013-2025 Renwick James Hudspith 3 | 4 | This file (par_KISS.h) is part of GLU. 5 | 6 | GLU is free software: you can redistribute it and/or modify 7 | it under the terms of the GNU General Public License as published by 8 | the Free Software Foundation, either version 3 of the License, or 9 | (at your option) any later version. 10 | 11 | GLU is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | GNU General Public License for more details. 15 | 16 | You should have received a copy of the GNU General Public License 17 | along with GLU. If not, see . 18 | */ 19 | /** 20 | @file par_KISS.h 21 | @brief parallel KISS rng 22 | */ 23 | #ifndef GLU_PAR_KISS_H 24 | #define GLU_PAR_KISS_H 25 | 26 | /** 27 | @fn void free_par_KISS( void ) 28 | @brief free the KISS rng 29 | */ 30 | void 31 | free_par_KISS( void ) ; 32 | 33 | /** 34 | @fn par_KISS_dbl( const uint32_t thread ) 35 | @brief redturn a uniformly distributed double value 36 | */ 37 | double 38 | par_KISS_dbl( const uint32_t thread ) ; 39 | 40 | /** 41 | @fn int read_par_KISS_table( FILE *rng_file ) 42 | @brief read the KISS table from a file 43 | @param rng_file :: the file with the rng state in 44 | */ 45 | int 46 | read_par_KISS_table( FILE *rng_file ) ; 47 | 48 | /** 49 | @fn int write_par_KISS_table( FILE *rng_file ) 50 | @brief write the KISS rng state to a file 51 | @param rng_file :: the file being written to 52 | */ 53 | int 54 | write_par_KISS_table( FILE *rng_file ) ; 55 | 56 | #endif 57 | -------------------------------------------------------------------------------- /src/Headers/ND_generic_HYP.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2013-2025 Renwick James Hudspith 3 | 4 | This file (ND_generic_HYP.h) is part of GLU. 5 | 6 | GLU is free software: you can redistribute it and/or modify 7 | it under the terms of the GNU General Public License as published by 8 | the Free Software Foundation, either version 3 of the License, or 9 | (at your option) any later version. 10 | 11 | GLU is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | GNU General Public License for more details. 15 | 16 | You should have received a copy of the GNU General Public License 17 | along with GLU. If not, see . 18 | */ 19 | /** 20 | @file ND_generic_HYP.h 21 | @brief prototype functions for the generic HYP code 22 | @ingroup Smear 23 | */ 24 | #ifndef GLU_ND_GENERIC_HYP_H 25 | #define GLU_ND_GENERIC_HYP_H 26 | 27 | /** 28 | @fn void HYsmearND( struct site *__restrict lat , const size_t smiters , const int type , const size_t directions ) 29 | @brief computes the ND-generic blocking transform via slow recursion 30 | @param lat :: lattice gauge field 31 | @param smiters :: number of smearing iterations being performed 32 | @param type :: smearing/projection type 33 | @param directions :: maximum dimensions of the problem 34 | Recursion was unfortunately the only way I could think of doing this. 35 | @warning this code is incredibly slow 36 | */ 37 | int 38 | HYsmearND( struct site *__restrict lat , 39 | const size_t smiters , 40 | const int type , 41 | const size_t directions ) ; 42 | 43 | #endif 44 | -------------------------------------------------------------------------------- /src/Headers/MMUL_SUNC.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2013-2025 Renwick James Hudspith 3 | 4 | This file (MMUL_SUNC.h) is part of GLU. 5 | 6 | GLU is free software: you can redistribute it and/or modify 7 | it under the terms of the GNU General Public License as published by 8 | the Free Software Foundation, either version 3 of the License, or 9 | (at your option) any later version. 10 | 11 | GLU is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | GNU General Public License for more details. 15 | 16 | You should have received a copy of the GNU General Public License 17 | along with GLU. If not, see . 18 | */ 19 | /** 20 | @file MMUL_SUNC.h 21 | @brief prototype functions for matrix multiplication routines 22 | */ 23 | #ifndef GLU_MMUL_SUNC_H 24 | #define GLU_MMUL_SUNC_H 25 | 26 | #ifndef GLU_BGQ // turns on the inline matrix multiplies 27 | 28 | #if NC < 4 29 | /** 30 | @fn void multab_suNC( GLU_complex a[ NCNC ] , const GLU_complex b[ NCNC ] , const GLU_complex c[ NCNC ] ) 31 | @brief SU(Nc)- tuned matrix multiply 32 | 33 | computes \f$ a = b \times c \f$ tuned for suNC by computing the signed minors for the bottom row 34 | 35 | @warning only use-able for \f$ a,b,c \in SU(NC) \f$ 36 | **/ 37 | void 38 | multab_suNC( GLU_complex a[ NCNC ] , 39 | const GLU_complex b[ NCNC ] , 40 | const GLU_complex c[ NCNC ] ) ; 41 | #else 42 | #define multab_suNC multab 43 | #endif 44 | 45 | #else // else we inline the matrix multiplies ... 46 | #include "BGQ_mmuls.h" 47 | #endif // end of the inline matrix mul loop 48 | #endif 49 | -------------------------------------------------------------------------------- /src/Headers/MMUL_triple.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2013-2025 Renwick James Hudspith 3 | 4 | This file (MMUL_SUNC.h) is part of GLU. 5 | 6 | GLU is free software: you can redistribute it and/or modify 7 | it under the terms of the GNU General Public License as published by 8 | the Free Software Foundation, either version 3 of the License, or 9 | (at your option) any later version. 10 | 11 | GLU is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | GNU General Public License for more details. 15 | 16 | You should have received a copy of the GNU General Public License 17 | along with GLU. If not, see . 18 | */ 19 | /** 20 | @file MMUL_triple.h 21 | @brief prototype functions for matrix multiplication routines 22 | */ 23 | #ifndef GLU_MMUL_TRIPLE_H 24 | #define GLU_MMUL_TRIPLE_H 25 | 26 | /** 27 | @fn void multabcdag_suNC( GLU_complex a[ NCNC ] , const GLU_complex b[ NCNC ] , const GLU_complex c[ NCNC ] , const GLU_complex d[ NCNC ] ) 28 | @brief SU(Nc) multiply a = b.c.d^\dagger 29 | */ 30 | void 31 | multabcdag_suNC( GLU_complex a[ NCNC ] , 32 | const GLU_complex b[ NCNC ] , 33 | const GLU_complex c[ NCNC ] , 34 | const GLU_complex d[ NCNC ] ) ; 35 | 36 | 37 | /** 38 | @fn void multadagbc_suNC( GLU_complex a[ NCNC ] , const GLU_complex b[ NCNC ] , const GLU_complex c[ NCNC ] , const GLU_complex d[ NCNC ] ) 39 | @brief SU(Nc) multiply a = b^\dagger.c.d 40 | */ 41 | void 42 | multadagbc_suNC( GLU_complex a[ NCNC ] , 43 | const GLU_complex b[ NCNC ] , 44 | const GLU_complex c[ NCNC ] , 45 | const GLU_complex d[ NCNC ] ) ; 46 | 47 | #endif 48 | -------------------------------------------------------------------------------- /src/Gfix/log_derivs.c: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2013-2025 Renwick James Hudspith 3 | 4 | This file (log_derivs.c) is part of GLU. 5 | 6 | GLU is free software: you can redistribute it and/or modify 7 | it under the terms of the GNU General Public License as published by 8 | the Free Software Foundation, either version 3 of the License, or 9 | (at your option) any later version. 10 | 11 | GLU is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | GNU General Public License for more details. 15 | 16 | You should have received a copy of the GNU General Public License 17 | along with GLU. If not, see . 18 | */ 19 | /** 20 | @file log_derivs.c 21 | @brief finite difference calculators ... 22 | */ 23 | #include "Mainfile.h" 24 | 25 | #include "lin_derivs.h" // for trace deriv 26 | 27 | // log definition of the gauge matrices at the point i 28 | double 29 | log_deriv( GLU_complex sum[ HERMSIZE ] , 30 | double *functional , 31 | const struct site *__restrict lat , 32 | const size_t i , 33 | const size_t MAX_DIR ) 34 | { 35 | GLU_complex A[ HERMSIZE ] , shiftA[ HERMSIZE ] ; 36 | GLU_real trAA ; 37 | *functional = 0.0 ; 38 | 39 | size_t mu ; 40 | for( mu = 0 ; mu < MAX_DIR ; mu++ ) { 41 | exact_log_slow_short( A , lat[i].O[mu] ) ; 42 | exact_log_slow_short( shiftA , lat[lat[i].back[mu]].O[mu] ) ; 43 | a_plus_Sxbminc_short( sum , 1.0 , shiftA , A ) ; 44 | 45 | // compute the functional in-step to remove a log 46 | trace_ab_herm_short( &trAA , A , A ) ; 47 | *functional += (double)trAA ; 48 | } 49 | return trace_deriv( sum ) ; 50 | } 51 | -------------------------------------------------------------------------------- /src/Headers/CFACG.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2013-2025 Renwick James Hudspith 3 | 4 | This file (CFACG.h) is part of GLU. 5 | 6 | GLU is free software: you can redistribute it and/or modify 7 | it under the terms of the GNU General Public License as published by 8 | the Free Software Foundation, either version 3 of the License, or 9 | (at your option) any later version. 10 | 11 | GLU is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | GNU General Public License for more details. 15 | 16 | You should have received a copy of the GNU General Public License 17 | along with GLU. If not, see . 18 | */ 19 | /** 20 | @file CFACG.h 21 | @brief Fourier Accelerated Coulomb gauge fixing routines 22 | */ 23 | #ifndef GLU_CFACG_H 24 | #define GLU_CFACG_H 25 | 26 | /** 27 | @fn size_t Coulomb_FA( struct site *__restrict lat , struct fftw_stuff *FFTW , const double accuracy , const size_t max_iter , const GLU_bool FACG ) ; 28 | @brief Coulomb gauge fixing codes 29 | @param lat :: lattice links 30 | @param FFTW :: fftw temporaries and plans 31 | @param accuracy :: the accuracy we wish to attain 32 | @param max_iter :: the maximum number of (per slice) iterations we wish to have before random transform 33 | @param FACG :: are we using the CG routines? 34 | @return the maximum number of iterations (i.e. the sum of each slice's) or 0 if something went wrong 35 | */ 36 | size_t 37 | Coulomb_FA( struct site *__restrict lat , 38 | struct fftw_stuff *FFTW , 39 | const double accuracy , 40 | const size_t max_iter , 41 | const GLU_bool FACG ) ; 42 | 43 | #endif 44 | -------------------------------------------------------------------------------- /src/Headers/clover.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2013-2025 Renwick James Hudspith 3 | 4 | This file (clover.h) is part of GLU. 5 | 6 | GLU is free software: you can redistribute it and/or modify 7 | it under the terms of the GNU General Public License as published by 8 | the Free Software Foundation, either version 3 of the License, or 9 | (at your option) any later version. 10 | 11 | GLU is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | GNU General Public License for more details. 15 | 16 | You should have received a copy of the GNU General Public License 17 | along with GLU. If not, see . 18 | */ 19 | /** 20 | @file clover.h 21 | @brief Calculation of the naive field strength "G_{\mu\nu}" and topological charge 22 | */ 23 | #ifndef GLU_CLOVER_H 24 | #define GLU_CLOVER_H 25 | 26 | /** 27 | @fn void compute_Gmunu_th( double *red , const struct site *lat ) 28 | @brief Gmunu calculation to be called within a parallel environment 29 | @param red :: reduction array 30 | @param lat :: lattice gauge links 31 | */ 32 | void 33 | compute_Gmunu_th( double *red , 34 | const struct site *lat ) ; 35 | 36 | /** 37 | @fn void compute_Gmunu_array( GLU_complex *__restrict *__restrict qtop , const struct site *__restrict lat ) 38 | @brief \f$ O(a^4) \f$ tree-improved field strength tensor from paper 39 | @param qtop :: Naive topological charge matrix 40 | @param lat :: lattice field 41 | */ 42 | void 43 | compute_Gmunu_array( GLU_complex *__restrict qtop , 44 | const struct site *__restrict lat ) ; 45 | 46 | #endif 47 | -------------------------------------------------------------------------------- /src/Headers/pspace_landau.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2013-2016 Renwick James Hudspith 3 | 4 | This file (pspace_landau.h) is part of GLU. 5 | 6 | GLU is free software: you can redistribute it and/or modify 7 | it under the terms of the GNU General Public License as published by 8 | the Free Software Foundation, either version 3 of the License, or 9 | (at your option) any later version. 10 | 11 | GLU is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | GNU General Public License for more details. 15 | 16 | You should have received a copy of the GNU General Public License 17 | along with GLU. If not, see . 18 | */ 19 | /** 20 | @file pspace_landau.h 21 | @brief protype functions for the momentum space landau correction 22 | */ 23 | #ifndef GLU_PSPACE_LANDAU_H 24 | #define GLU_PSPACE_LANDAU_H 25 | 26 | /** 27 | @fn void correct_pspace_landau( struct site *__restrict A , const struct veclist *__restrict list , const size_t *__restrict in , const size_t DIMS ) 28 | @brief performs the momentum space correction on our fields 29 | @param A :: Hermitian gauge fields in momentum space 30 | @param list :: the momentum lsit after the cutting procedure 31 | @param in :: the length of the momentum list , has dimension 1 32 | @param DIMS :: dimensions we are FFT-ing in 33 | 34 | Computes, 35 | \f[ 36 | 37 | e^{ip_\mu/2} A_\mu(p) 38 | 39 | \f] 40 | */ 41 | void 42 | correct_pspace_landau( struct site *__restrict A , 43 | const struct veclist *__restrict list , 44 | const size_t *__restrict in , 45 | const size_t DIMS ) ; 46 | 47 | #endif 48 | -------------------------------------------------------------------------------- /src/Headers/wflow.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2013-2025 Renwick James Hudspith 3 | 4 | This file (wflow.h) is part of GLU. 5 | 6 | GLU is free software: you can redistribute it and/or modify 7 | it under the terms of the GNU General Public License as published by 8 | the Free Software Foundation, either version 3 of the License, or 9 | (at your option) any later version. 10 | 11 | GLU is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | GNU General Public License for more details. 15 | 16 | You should have received a copy of the GNU General Public License 17 | along with GLU. If not, see . 18 | */ 19 | /** 20 | @file wflow.h 21 | @brief prototype functions for the integration of gauge fields with a fictitious flow time 22 | */ 23 | #ifndef GLU_WFLOW_H 24 | #define GLU_WFLOW_H 25 | 26 | /** 27 | @fn int flow_RK3( struct site *__restrict lat , const size_t smiters , const int SIGN , const smearing_types SM_TYPE , const GLU_bool memcheap ) 28 | @brief wilson flow using the Runge-Kutta used in Luescher's follow up paper and by BMW. 29 | @param lat :: lattice gauge field 30 | @param smiters :: number of smearing iterations 31 | @param SIGN :: of type #GLU_direction 32 | @param SM_TYPE :: will accept SM_STOUT or SM_LOG from #smearing_types 33 | @warning this one is the fastest but also the most memory expensive this is checked in the functions defined in GLU_memcheck.h 34 | **/ 35 | int 36 | flow_RK3( struct site *__restrict lat , 37 | const size_t smiters , 38 | const int SIGN , 39 | const smearing_types SM_TYPE , 40 | const GLU_bool memcheap ) ; 41 | 42 | #endif 43 | -------------------------------------------------------------------------------- /src/Headers/MMULdag_SUNC.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2013-2025 Renwick James Hudspith 3 | 4 | This file (MMULdag_SUNC.h) is part of GLU. 5 | 6 | GLU is free software: you can redistribute it and/or modify 7 | it under the terms of the GNU General Public License as published by 8 | the Free Software Foundation, either version 3 of the License, or 9 | (at your option) any later version. 10 | 11 | GLU is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | GNU General Public License for more details. 15 | 16 | You should have received a copy of the GNU General Public License 17 | along with GLU. If not, see . 18 | */ 19 | /** 20 | @file MMULdag.h 21 | @brief prototype functions for multiplication for \f$ a = b^{\dagger}\times c\f$ 22 | */ 23 | #ifndef GLU_MMULDAG_SUNC_H 24 | #define GLU_MMULDAG_SUNC_H 25 | 26 | #ifndef GLU_BGQ // dirty, force inlining for the Q 27 | 28 | #if NC < 4 29 | /** 30 | @fn void multabdag_suNC( GLU_complex a[ NCNC ] , const GLU_complex b[ NCNC ] , const GLU_complex c[ NCNC ] ) 31 | @brief Computes general Nc x Nc matrix multiplication with \f$ a = b^{\dagger}\times c \f$ 32 | 33 | sped up for suNC by computing the signed minors for the bottom row and hand-expanded complex-complex multiplications 34 | 35 | @warning only use-able for \f$ a,b,c \in SU(NC) \f$ 36 | **/ 37 | void 38 | multabdag_suNC( GLU_complex a[ NCNC ] , 39 | const GLU_complex b[ NCNC ] , 40 | const GLU_complex c[ NCNC ] ) ; 41 | #else 42 | #define multabdag_suNC multabdag 43 | #endif 44 | 45 | #else 46 | 47 | // inline BGQmacros 48 | #include "BGQ_mmuldag.h" 49 | 50 | #endif // BGQ inline 51 | 52 | #endif 53 | -------------------------------------------------------------------------------- /src/Headers/BGQ_mmul.h: -------------------------------------------------------------------------------- 1 | /** 2 | @file BGQ_mmul.h 3 | @brief inlined macros for BGQ matrix multiplies 4 | */ 5 | #ifndef BGQ_MMUL_H 6 | #define BGQ_MMUL_H 7 | 8 | // Inlined matrix multiplies 9 | #if NC==3 10 | #define multab( a , b , c ) \ 11 | a[0] = b[0] * c[0] + b[1] * c[3] + b[2] * c[6] ; \ 12 | a[1] = b[0] * c[1] + b[1] * c[4] + b[2] * c[7] ; \ 13 | a[2] = b[0] * c[2] + b[1] * c[5] + b[2] * c[8] ; \ 14 | a[3] = b[3] * c[0] + b[4] * c[3] + b[5] * c[6] ; \ 15 | a[4] = b[3] * c[1] + b[4] * c[4] + b[5] * c[7] ; \ 16 | a[5] = b[3] * c[2] + b[4] * c[5] + b[5] * c[8] ; \ 17 | a[6] = b[6] * c[0] + b[7] * c[3] + b[8] * c[6] ; \ 18 | a[7] = b[6] * c[1] + b[7] * c[4] + b[8] * c[7] ; \ 19 | a[8] = b[6] * c[2] + b[7] * c[5] + b[8] * c[8] ; 20 | #elif NC==2 21 | #define multab( a , b , c ) \ 22 | a[0] = b[0] * c[0] + b[1] * c[2] ; \ 23 | a[1] = b[0] * c[1] + b[1] * c[3] ; \ 24 | a[2] = b[2] * c[0] + b[3] * c[2] ; \ 25 | a[3] = b[2] * c[1] + b[3] * c[3] ; 26 | #endif 27 | 28 | #if NC==3 29 | #define multab_suNC( a , b , c ) \ 30 | a[0] = b[0] * c[0] + b[1] * c[3] + b[2] * c[6] ; \ 31 | a[1] = b[0] * c[1] + b[1] * c[4] + b[2] * c[7] ; \ 32 | a[2] = b[0] * c[2] + b[1] * c[5] + b[2] * c[8] ; \ 33 | a[3] = b[3] * c[0] + b[4] * c[3] + b[5] * c[6] ; \ 34 | a[4] = b[3] * c[1] + b[4] * c[4] + b[5] * c[7] ; \ 35 | a[5] = b[3] * c[2] + b[4] * c[5] + b[5] * c[8] ; \ 36 | a[6] = conj( a[1] * a[5] - a[2] * a[4] ) ; \ 37 | a[7] = conj( a[2] * a[3] - a[0] * a[5] ) ; \ 38 | a[8] = conj( a[0] * a[4] - a[1] * a[3] ) ; 39 | #elif NC==2 40 | #define multab_suNC( a , b , c ) \ 41 | a[0] = b[0] * c[0] + b[1] * c[2] ; \ 42 | a[1] = b[0] * c[1] + b[1] * c[3] ; \ 43 | a[2] = -conj( a[1] ) ; \ 44 | a[3] = conj( a[0] ) ; 45 | #else 46 | #define multab_suNC multab 47 | #endif 48 | 49 | #endif 50 | -------------------------------------------------------------------------------- /src/Headers/log_derivs.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2013-2025 Renwick James Hudspith 3 | 4 | This file (log_derivs.h) is part of GLU. 5 | 6 | GLU is free software: you can redistribute it and/or modify 7 | it under the terms of the GNU General Public License as published by 8 | the Free Software Foundation, either version 3 of the License, or 9 | (at your option) any later version. 10 | 11 | GLU is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | GNU General Public License for more details. 15 | 16 | You should have received a copy of the GNU General Public License 17 | along with GLU. If not, see . 18 | */ 19 | /** 20 | @file log_derivs.h 21 | @brief function definitions for the lattice derivatives used 22 | */ 23 | #ifndef GLU_LOG_DERIVS_H 24 | #define GLU_LOG_DERIVS_H 25 | 26 | /** 27 | @fn double log_deriv( GLU_complex sum[ HERMSIZE ] , const struct site *__restrict lat , const size_t i , const size_t MAX_DIR ) 28 | @brief The logarithmic lattice derivative 29 | @param sum :: The sum of the derivative \f$ \partial_\mu A_\mu(x) \f$ 30 | @param functional :: evaluation of the log-functional 31 | @param lat :: The lattice field \f$ U_\mu(x) = e^{iaA_\mu(x)} \f$ 32 | @param i :: The site index. 33 | @param MAX_DIR :: The number of directions we take the derivative of. 34 | 35 | @return returns the accuracy which is defined as
36 | \f$ Tr\left( | \partial_\mu A_\mu(x) |^2 \right) \f$ 37 | **/ 38 | double 39 | log_deriv( GLU_complex sum[ HERMSIZE ] , 40 | double *functional , 41 | const struct site *__restrict lat , 42 | const size_t i , 43 | const size_t MAX_DIR ) ; 44 | 45 | #endif 46 | -------------------------------------------------------------------------------- /src/Headers/crc.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2013-2025 Renwick James Hudspith 3 | 4 | This file (crc.h) is part of GLU. 5 | 6 | GLU is free software: you can redistribute it and/or modify 7 | it under the terms of the GNU General Public License as published by 8 | the Free Software Foundation, either version 3 of the License, or 9 | (at your option) any later version. 10 | 11 | GLU is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | GNU General Public License for more details. 15 | 16 | You should have received a copy of the GNU General Public License 17 | along with GLU. If not, see . 18 | */ 19 | /** 20 | @file crc.h 21 | @brief the crc for the scidac checksum 22 | */ 23 | #ifndef GLU_CRC_H 24 | #define GLU_CRC_H 25 | 26 | /** 27 | @fn uint32_t crc32( uint32_t crc , const unsigned char *buf , size_t len ) 28 | @brief takes the crc checksum of buf 29 | @param crc :: previous CRC checksum 30 | @param buf :: the data having its CRC taken 31 | @param len :: number of bytes 32 | */ 33 | uint32_t 34 | crc32( uint32_t crc , 35 | const unsigned char *buf , 36 | size_t len ) ; 37 | 38 | /** 39 | @fn void CKSUM_ADD( void *memptr , const uint32_t nbytes ) 40 | @brief BQCD's crc accumulator 41 | @param memptr :: start of the memory that we crc 42 | @param nbytes :: total number of bytes allocated in memptr 43 | */ 44 | void 45 | CKSUM_ADD( const void *memptr , 46 | const uint32_t nbytes ) ; 47 | 48 | /** 49 | @fn void CKSUM_GET( uint32_t *total_crc, uint32_t *total_bytes ) ; 50 | @brief BQCD's crc 51 | */ 52 | void 53 | CKSUM_GET( uint32_t *total_crc, 54 | uint32_t *total_bytes ) ; 55 | 56 | #endif 57 | -------------------------------------------------------------------------------- /src/Headers/HIREP.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2013-2025 Renwick James Hudspith 3 | 4 | This file (HIREP.h) is part of GLU. 5 | 6 | GLU is free software: you can redistribute it and/or modify 7 | it under the terms of the GNU General Public License as published by 8 | the Free Software Foundation, either version 3 of the License, or 9 | (at your option) any later version. 10 | 11 | GLU is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | GNU General Public License for more details. 15 | 16 | You should have received a copy of the GNU General Public License 17 | along with GLU. If not, see . 18 | */ 19 | /** 20 | @file HIREP.h 21 | @brief function defs for IO with HiRep configuration files 22 | */ 23 | #ifndef GLU_HIREP_H 24 | #define GLU_HIREP_H 25 | 26 | /** 27 | @fn int read_gauge_field( struct site *__restrict lat , FILE *__restrict in , uint32_t *chksum ) 28 | @brief reads in a configuration from a HiRep format file 29 | @param lat :: lattice gauge fields 30 | @param in :: file to be read in 31 | @param chksum :: compute the checksum of the data for no reason whatsoever 32 | @return #GLU_SUCCESS or #GLU_FAILURE 33 | **/ 34 | int 35 | read_gauge_field( struct site *__restrict lat , 36 | FILE *__restrict in , 37 | uint32_t *chksum ) ; 38 | 39 | /** 40 | @fn void write_gauge_field( const struct site *__restrict lat , FILE *__restrict outfile ) 41 | @brief writes out a configuration file in the HiRep order 42 | @param lat :: lattice gauge field 43 | @param outfile :: file we are outputting to 44 | **/ 45 | void 46 | write_gauge_field( const struct site *__restrict lat , 47 | FILE *__restrict outfile ) ; 48 | 49 | #endif 50 | -------------------------------------------------------------------------------- /src/Headers/MOMggg.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2013-2025 Renwick James Hudspith 3 | 4 | This file (MOMggg.h) is part of GLU. 5 | 6 | GLU is free software: you can redistribute it and/or modify 7 | it under the terms of the GNU General Public License as published by 8 | the Free Software Foundation, either version 3 of the License, or 9 | (at your option) any later version. 10 | 11 | GLU is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | GNU General Public License for more details. 15 | 16 | You should have received a copy of the GNU General Public License 17 | along with GLU. If not, see . 18 | */ 19 | /** 20 | @file MOMggg.h 21 | @brief gluon propagator and non-exceptional three point prototype function 22 | @ingroup Cuts 23 | non-exceptional scheme from paper 24 | */ 25 | #ifndef GLU_MOMGGG_h 26 | #define GLU_MOMGGG_h 27 | 28 | /** 29 | @fn int write_nonexceptional_g2g3( FILE *__restrict Ap , const struct site *__restrict A , const struct veclist *__restrict list , size_t num_mom[ 1 ] , const size_t nnmax ) 30 | @brief computes the nonexceptional three point function and the gluon propagator 31 | @param Ap :: file we write out to 32 | @param A :: lie-algebra field 33 | @param list :: applicable momentum list after cuts 34 | @param num_mom :: size of list 35 | @param nnmax :: maximum "p^2" allowed 36 | 37 | @return #GLU_SUCCESS or #GLU_FAILURE 38 | **/ 39 | int 40 | write_nonexceptional_g2g3( FILE *__restrict Ap , 41 | const struct site *__restrict A , 42 | const struct veclist *__restrict list , 43 | size_t num_mom[ 1 ] , 44 | const size_t nnmax ) ; 45 | 46 | #endif 47 | -------------------------------------------------------------------------------- /src/Headers/LU_SSE.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2013-2025 Renwick James Hudspith 3 | 4 | This file (LU_SSE.h) is part of GLU. 5 | 6 | GLU is free software: you can redistribute it and/or modify 7 | it under the terms of the GNU General Public License as published by 8 | the Free Software Foundation, either version 3 of the License, or 9 | (at your option) any later version. 10 | 11 | GLU is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | GNU General Public License for more details. 15 | 16 | You should have received a copy of the GNU General Public License 17 | along with GLU. If not, see . 18 | */ 19 | /** 20 | @file LU_SSE.h 21 | @brief LU decomposition determinant of an complex matrix (SSE2 variant) 22 | */ 23 | #ifndef GLU_LU_SSE_H 24 | #define GLU_LU_SSE_H 25 | 26 | #if ( defined HAVE_IMMINTRIN_H ) && !( defined SINGLE_PREC ) && (NC>3) 27 | 28 | /** 29 | @fn double complex LU_det( const size_t N , const GLU_complex U[ N*N ] ) 30 | @brief computes the determinant of a matrix U 31 | @param N :: Side length of the square matrix 32 | @param U :: Matrix having its determinant taken 33 | @return the determinant 34 | */ 35 | double complex 36 | LU_det( const size_t N , 37 | const GLU_complex U[ N*N ] ) ; 38 | 39 | /** 40 | @fn double complex LU_det_overwrite( const size_t N , GLU_complex U[ N*N ] ) 41 | @brief computes the determinant of a matrix U 42 | @param N :: Side length of the square matrix 43 | @param U :: Matrix having its determinant taken, overwritten 44 | @return the determinant 45 | @warning overwrites space in U 46 | */ 47 | double complex 48 | LU_det_overwrite( const size_t N , 49 | GLU_complex U[ N*N ] ) ; 50 | 51 | #endif 52 | 53 | #endif 54 | -------------------------------------------------------------------------------- /src/Headers/MMUL_dag_SUNC.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2013-2025 Renwick James Hudspith 3 | 4 | This file (MMUL_dag_SUNC.h) is part of GLU. 5 | 6 | GLU is free software: you can redistribute it and/or modify 7 | it under the terms of the GNU General Public License as published by 8 | the Free Software Foundation, either version 3 of the License, or 9 | (at your option) any later version. 10 | 11 | GLU is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | GNU General Public License for more details. 15 | 16 | You should have received a copy of the GNU General Public License 17 | along with GLU. If not, see . 18 | */ 19 | /** 20 | @file MMUL_dag_SUNC.h 21 | @brief prototype functions for computing the matrix product \f$ a = b \times c^{\dagger} \f$ 22 | */ 23 | #ifndef GLU_MMUL_DAG_SUNC_H 24 | #define GLU_MMUL_DAG_SUNC_H 25 | 26 | #ifndef GLU_BGQ // inlining matrix multiplies for the Q 27 | 28 | #if NC < 4 29 | /** 30 | @fn void multab_dag_suNC( GLU_complex a[ NCNC ] , const GLU_complex b[ NCNC ] , const GLU_complex c[ NCNC ] ) 31 | @brief SU( Nc ) - tuned matrix multiply \f$ a = b \times c^{\dagger}\f$ 32 | 33 | computes \f$ a = b \times c^{\dagger} \f$ tuned for suNC by computing the signed minors for the bottom row and hand written complex-complex multiplications 34 | 35 | @warning only use-able for \f$ a,b,c \in SU(NC) \f$ 36 | */ 37 | void 38 | multab_dag_suNC( GLU_complex a[ NCNC ] , 39 | const GLU_complex b[ NCNC ] , 40 | const GLU_complex c[ NCNC ] ) ; 41 | #else 42 | #define multab_dag_suNC multab_dag 43 | #endif 44 | 45 | #else 46 | 47 | // include the macros 48 | #include "BGQ_mmul_dag.h" 49 | 50 | #endif // end of the inline loop 51 | 52 | #endif 53 | -------------------------------------------------------------------------------- /src/Headers/invert.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2013-2025 Renwick James Hudspith 3 | 4 | This file (invert.h) is part of GLU. 5 | 6 | GLU is free software: you can redistribute it and/or modify 7 | it under the terms of the GNU General Public License as published by 8 | the Free Software Foundation, either version 3 of the License, or 9 | (at your option) any later version. 10 | 11 | GLU is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | GNU General Public License for more details. 15 | 16 | You should have received a copy of the GNU General Public License 17 | along with GLU. If not, see . 18 | */ 19 | /** 20 | @file invert.h 21 | @brief function definition for taking the naive numerical inverse of a matrix 22 | Uses Gauss-Jordan with pivoting unless specified otherwise or lapacke.h is used 23 | */ 24 | #ifndef GLU_INVERT_H 25 | #define GLU_INVERT_H 26 | 27 | /** 28 | @fn int inverse( GLU_complex M_1[ NCNC ] , const GLU_complex M[ NCNC ] ) 29 | @brief inverts a matrix using the usual minors definition dividing the determinant 30 | @param M_1 :: the inverse of the matrix "M" 31 | @param M :: the matrix being inverted 32 | 33 | @return #GLU_SUCCESS or #GLU_FAILURE 34 | */ 35 | int 36 | inverse( GLU_complex M_1[ NCNC ] , 37 | const GLU_complex M[ NCNC ] ) ; 38 | 39 | /** 40 | @fn void newton_approx_inverse( GLU_complex Zinv[ NCNC ] , const GLU_complex Z[ NCNC ] ) 41 | @brief computes a newton iteration for the inverse, it is not very good 42 | @param Zinv :: the matrix inverse 43 | @param Z :: the matrix that is having its inverse taken 44 | */ 45 | void 46 | newton_approx_inverse( GLU_complex Zinv[ NCNC ] , 47 | const GLU_complex Z[ NCNC ] ) ; 48 | 49 | #endif 50 | -------------------------------------------------------------------------------- /src/Headers/MMULdagdag_SUNC.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2013-2025 Renwick James Hudspith 3 | 4 | This file (MMULdagdag_SUNC.h) is part of GLU. 5 | 6 | GLU is free software: you can redistribute it and/or modify 7 | it under the terms of the GNU General Public License as published by 8 | the Free Software Foundation, either version 3 of the License, or 9 | (at your option) any later version. 10 | 11 | GLU is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | GNU General Public License for more details. 15 | 16 | You should have received a copy of the GNU General Public License 17 | along with GLU. If not, see . 18 | */ 19 | /** 20 | @file MMULdagdag_SUNC.h 21 | @brief prototype functions for matrix multiplication of SU(NC) only 22 | */ 23 | #ifndef GLU_MMULDAGDAG_SUNC_H 24 | #define GLU_MMULDAGDAG_SUNC_H 25 | 26 | #ifndef GLU_BGQ 27 | 28 | #if NC < 4 29 | 30 | /** 31 | @fn void multab_dagdag_suNC( GLU_complex a[ NCNC ] , const GLU_complex b[ NCNC ] , const GLU_complex c[ NCNC ] ) 32 | @brief computes \f$ a = b^{\dagger} \times c^{\dagger}\f$ sped up for suNC 33 | 34 | This relies on the fact that computing the bottom row's minor's requires 35 | less operations than computing the full matrix multiply also uses hand unrolled complex-complex multiply 36 | 37 | @warning only use-able for \f$ a,b,c \in SU(NC) \f$ 38 | **/ 39 | void 40 | multab_dagdag_suNC( GLU_complex a[ NCNC ] , 41 | const GLU_complex b[ NCNC ] , 42 | const GLU_complex c[ NCNC ] ) ; 43 | 44 | #else 45 | #define multab_dagdag_suNC multab_dagdag 46 | #endif 47 | 48 | #else // GLU_BGQ ifdef 49 | 50 | // inline macros 51 | #include "BGQ_mmuldagdag.h" 52 | 53 | #endif // end of the BGQ inlining loop ... 54 | 55 | #endif 56 | -------------------------------------------------------------------------------- /src/Headers/LU.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2013-2025 Renwick James Hudspith 3 | 4 | This file (LU.h) is part of GLU. 5 | 6 | GLU is free software: you can redistribute it and/or modify 7 | it under the terms of the GNU General Public License as published by 8 | the Free Software Foundation, either version 3 of the License, or 9 | (at your option) any later version. 10 | 11 | GLU is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | GNU General Public License for more details. 15 | 16 | You should have received a copy of the GNU General Public License 17 | along with GLU. If not, see . 18 | */ 19 | /** 20 | @file LU.h 21 | @brief LU decomposition determinant 22 | */ 23 | #ifndef GLU_LU_H 24 | #define GLU_LU_H 25 | 26 | #if ( defined HAVE_IMMINTRIN_H ) && !( defined SINGLE_PREC ) && (NC>3) 27 | 28 | // include the SSE version 29 | #include "LU_SSE.h" 30 | 31 | #else 32 | 33 | /** 34 | @fn double complex LU_det( const size_t N , const GLU_complex U[ N*N ] ) 35 | @brief computes the determinant of a matrix U 36 | @param N :: Side length of the square matrix 37 | @param U :: Matrix having its determinant taken 38 | @return the determinant 39 | */ 40 | double complex 41 | LU_det( const size_t N , 42 | const GLU_complex U[ N*N ] ) ; 43 | 44 | /** 45 | @fn double complex LU_det_overwrite( const size_t N , GLU_complex U[ N*N ] ) 46 | @brief computes the determinant of a matrix U 47 | @param N :: Side length of the square matrix 48 | @param U :: Matrix having its determinant taken, overwritten 49 | @return the determinant 50 | @warning overwrites space in U 51 | */ 52 | double complex 53 | LU_det_overwrite( const size_t N , 54 | GLU_complex U[ N*N ] ) ; 55 | 56 | 57 | #endif 58 | 59 | #endif 60 | -------------------------------------------------------------------------------- /src/Headers/MOMgg.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2013-2025 Renwick James Hudspith 3 | 4 | This file (MOMgg.h) is part of GLU. 5 | 6 | GLU is free software: you can redistribute it and/or modify 7 | it under the terms of the GNU General Public License as published by 8 | the Free Software Foundation, either version 3 of the License, or 9 | (at your option) any later version. 10 | 11 | GLU is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | GNU General Public License for more details. 15 | 16 | You should have received a copy of the GNU General Public License 17 | along with GLU. If not, see . 18 | */ 19 | /** 20 | @file MOMgg.h 21 | @brief calculation of the gluon propagator and the exceptional three point function 22 | @ingroup Cuts 23 | The projection is taken from paper 24 | */ 25 | #ifndef GLU_MOMGG_H 26 | #define GLU_MOMGG_H 27 | 28 | /** 29 | @fn int write_exceptional_g2g3_MOMgg( FILE *__restrict Ap , const struct site *__restrict A , const struct veclist *__restrict list , size_t num_mom[1] ) 30 | @brief gluon propagator and exceptional three point 31 | @param Ap :: file we write out to 32 | @param A :: lie-algebra field 33 | @param list :: applicable momentum list after cuts 34 | @param num_mom :: maximum number of momenta 35 | Includes the calculation of the gluonic two point correlation 36 | functions and the three point function with the MOMgg kinematics/projector. 37 | 38 | @return #GLU_SUCCESS or #GLU_FAILURE 39 | **/ 40 | int 41 | write_exceptional_g2g3_MOMgg( FILE *__restrict Ap , 42 | const struct site *__restrict A , 43 | const struct veclist *__restrict list , 44 | size_t num_mom[1] ) ; 45 | 46 | #endif 47 | -------------------------------------------------------------------------------- /src/Headers/draughtboard.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2013-2025 Renwick James Hudspith 3 | 4 | This file (draughtboard.h) is part of GLU. 5 | 6 | GLU is free software: you can redistribute it and/or modify 7 | it under the terms of the GNU General Public License as published by 8 | the Free Software Foundation, either version 3 of the License, or 9 | (at your option) any later version. 10 | 11 | GLU is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | GNU General Public License for more details. 15 | 16 | You should have received a copy of the GNU General Public License 17 | along with GLU. If not, see . 18 | */ 19 | /** 20 | @file draughtboard.h 21 | @brief prototype functions for setting the draughtboard 22 | */ 23 | #ifndef DRAUGHTBOARD_H 24 | #define DRAUGHTBOARD_H 25 | 26 | /** 27 | @fn void free_cb( struct draughtboard *db ) 28 | @brief free the draughtboard 29 | @param db :: draughtboard structure 30 | */ 31 | void 32 | free_cb( struct draughtboard *db ) ; 33 | 34 | /** 35 | @fn void init_cb( struct draughtboard *db , const size_t LENGTH , const size_t DIR ) 36 | @brief initialise the draughtboard 37 | @param db :: draughtboard structure 38 | @param LENGTH :: total length of the thing we are draughtboarding 39 | @param DIR :: number of directions in the geometry we are using 40 | @return #GLU_SUCCESS or #GLU_FAILURE 41 | */ 42 | int 43 | init_cb( struct draughtboard *db , 44 | const size_t LENGTH , 45 | const size_t DIR ) ; 46 | 47 | /** 48 | @fn void init_improved_cb( struct draughtboard *db ) 49 | @brief initialise the improved draughtboard 50 | @param db :: draughtboard structure 51 | @return #GLU_SUCCESS or #GLU_FAILURE 52 | */ 53 | int 54 | init_improved_cb( struct draughtboard *db ) ; 55 | 56 | #endif 57 | -------------------------------------------------------------------------------- /src/Headers/vandermonde.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2013-2025 Renwick James Hudspith 3 | 4 | This file (vandermonde.h) is part of GLU. 5 | 6 | GLU is free software: you can redistribute it and/or modify 7 | it under the terms of the GNU General Public License as published by 8 | the Free Software Foundation, either version 3 of the License, or 9 | (at your option) any later version. 10 | 11 | GLU is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | GNU General Public License for more details. 15 | 16 | You should have received a copy of the GNU General Public License 17 | along with GLU. If not, see . 18 | */ 19 | /** 20 | @file vandermonde.h 21 | @brief prototype function for solving a complex vandermonde system with real eigenvalues 22 | */ 23 | #ifndef GLU_VANDERMONDE_H 24 | #define GLU_VANDERMONDE_H 25 | 26 | /** 27 | \fn void solvandermonde( double complex f[ NC ] , const double x[ NC ] ) 28 | \brief solves the vandermonde system using interpolating polynomials 29 | @param f :: the f constants 30 | @param x :: the real eigenvalues 31 | @warning numerically pretty unstable, f's overwritten 32 | see e.g Gloub and van Loan book 33 | */ 34 | void 35 | solvandermonde( double complex f[ NC ] , 36 | const double x[ NC ] ) ; 37 | 38 | 39 | /** 40 | \fn void solvandermonde_new( const double q[ NC ] , double complex f[ NC ] ) 41 | \brief solves the vandermonde system using interpolating polynomials 42 | @param q :: the real eigenvalues 43 | @param f :: the f constants 44 | @warning numerically quasi-unstable, f's overwritten 45 | */ 46 | void 47 | solvandermonde_new( const double q[ NC ] , 48 | double complex f[ NC ] ) ; 49 | #endif 50 | -------------------------------------------------------------------------------- /src/Headers/adaptive_flow.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2013-2025 Renwick James Hudspith 3 | 4 | This file (adaptive_flow.h) is part of GLU. 5 | 6 | GLU is free software: you can redistribute it and/or modify 7 | it under the terms of the GNU General Public License as published by 8 | the Free Software Foundation, either version 3 of the License, or 9 | (at your option) any later version. 10 | 11 | GLU is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | GNU General Public License for more details. 15 | 16 | You should have received a copy of the GNU General Public License 17 | along with GLU. If not, see . 18 | */ 19 | /** 20 | @file adaptive_flow.h 21 | @brief prototype function defs for the adaptive routine 22 | */ 23 | #ifndef GLU_ADAPTIVE_FLOW_H 24 | #define GLU_ADAPTIVE_FLOW_H 25 | 26 | /** 27 | @fn int flow_adaptive_RK3( struct site *__restrict lat , const int smiters , const int DIR , const int SIGN , const smearing_types SM_TYPE ) ; 28 | @brief this code performs a two-step adaptive RK integration of the flow equation 29 | @param lat :: lattice gauge field 30 | @param smiters :: number of smearing iterations 31 | @param SIGN :: of type #GLU_direction 32 | @param SM_TYPE :: will accept SM_APE , SM_STOUT or SM_LOG from #smearing_types 33 |
34 | it is expensive in memory (two lattice fields needed to compare) and uses the same static functions as void flow4d_RK_fast( struct site *lat , const size_t smiters , const int SIGN , const smearing_types SM_TYPE ) and so is comparable in speed. The code also shortens the time step when we get close to WFLOW_STOP, so we can measure W0 accurately. 35 | **/ 36 | int 37 | flow_adaptive_RK3( struct site *__restrict lat , 38 | const size_t smiters , 39 | const int SIGN , 40 | const smearing_types SM_TYPE ) ; 41 | 42 | #endif 43 | -------------------------------------------------------------------------------- /src/Headers/givens.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2013-2025 Renwick James Hudspith 3 | 4 | This file (givens.h) is part of GLU. 5 | 6 | GLU is free software: you can redistribute it and/or modify 7 | it under the terms of the GNU General Public License as published by 8 | the Free Software Foundation, either version 3 of the License, or 9 | (at your option) any later version. 10 | 11 | GLU is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | GNU General Public License for more details. 15 | 16 | You should have received a copy of the GNU General Public License 17 | along with GLU. If not, see . 18 | */ 19 | /** 20 | @file givens.h 21 | @brief prototype functions for the trace maximisation using givens rotations 22 | 23 | some credit should go to Urs Wenger and ETMC and Edwards and Chroma 24 | */ 25 | #ifndef GLU_GIVENS_H 26 | #define GLU_GIVENS_H 27 | 28 | /** 29 | @fn void givens_reunit( double complex U[ NCNC ] ) ; 30 | @brief reunitarises a matrix with trace maximisation 31 | @param U :: matrix being reunitarised 32 | 33 | @warning overwrites the matrix U 34 | */ 35 | void 36 | givens_reunit( GLU_complex U[ NCNC ] ) ; 37 | 38 | /** 39 | @fn void OrRotation( GLU_complex *s0 , GLU_complex *s1 , const GLU_complex U[ NCNC ] , const double OrParam , const int su2_index ) 40 | @brief compute the two defining parameters of the su(2) representation 41 | @param U :: matrix whose subgroup is computed 42 | @param s0 :: top left su(2) element 43 | @param s1 :: top right su(2) element 44 | @param OrParam :: overrelaxation parameter 45 | @param su2_index :: su(2) subgroup index 46 | */ 47 | void 48 | OrRotation( GLU_complex *s0 , 49 | GLU_complex *s1 , 50 | const GLU_complex U[ NCNC ] , 51 | const double OrParam , 52 | const size_t su2_index ) ; 53 | 54 | #endif 55 | -------------------------------------------------------------------------------- /src/Headers/CERN.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2013-2025 Renwick James Hudspith 3 | 4 | This file (CERN.h) is part of GLU. 5 | 6 | GLU is free software: you can redistribute it and/or modify 7 | it under the terms of the GNU General Public License as published by 8 | the Free Software Foundation, either version 3 of the License, or 9 | (at your option) any later version. 10 | 11 | GLU is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | GNU General Public License for more details. 15 | 16 | You should have received a copy of the GNU General Public License 17 | along with GLU. If not, see . 18 | */ 19 | /** 20 | @file CERN.h 21 | @brief prototype declarations for reading an OpenQCD configuration 22 | */ 23 | #ifndef GLU_CERN_H 24 | #define GLU_CERN_H 25 | 26 | /** 27 | @fn int read_CLS_field( struct site *lat , FILE *in , uint32_t *chksum , const char *config_in ) 28 | @param lat :: lattice gauge links 29 | @param in :: infile to be read 30 | @param chksum :: dummy parameter not used 31 | @param config_in :: filename 32 | @brief read in a CERN gauge field 33 | */ 34 | int 35 | read_CLS_field( struct site *lat , 36 | const char *config_in , 37 | uint32_t *chksum ) ; 38 | 39 | /** 40 | @fn void write_CLS_field( const struct site *lat , const char *outfile ) 41 | @param lat :: lattice gauge field 42 | @param outfile :: string we are writing out to 43 | @brief write a CERN gauge field 44 | */ 45 | void 46 | write_CLS_field_mmap( const struct site *lat , 47 | const char *outfile ) ; 48 | 49 | /** 50 | @fn void write_CLS_field( const struct site *lat , FILE *outfile ) 51 | @param lat :: lattice gauge field 52 | @param outfile :: file we are writing out to 53 | @brief write a CERN gauge field 54 | */ 55 | void 56 | write_CLS_field( const struct site *lat , 57 | const FILE *outfile ) ; 58 | 59 | #endif 60 | -------------------------------------------------------------------------------- /src/Headers/smear.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2013-2025 Renwick James Hudspith 3 | 4 | This file (smear.h) is part of GLU. 5 | 6 | GLU is free software: you can redistribute it and/or modify 7 | it under the terms of the GNU General Public License as published by 8 | the Free Software Foundation, either version 3 of the License, or 9 | (at your option) any later version. 10 | 11 | GLU is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | GNU General Public License for more details. 15 | 16 | You should have received a copy of the GNU General Public License 17 | along with GLU. If not, see . 18 | */ 19 | /** 20 | @file smear.h 21 | @brief function prototypes for simple smearing algorithms here, calls staples in staples.h 22 | */ 23 | #ifndef GLU_SMEAR_H 24 | #define GLU_SMEAR_H 25 | 26 | /** 27 | @fn int smear3D( struct site *__restrict lat , const size_t smiters , const smearing_types type ) 28 | @brief ND-1 link smearing without blocking transforms 29 | @param lat :: lattice gauge fields 30 | @param smiters :: number of smearing iterations 31 | @param type :: type of smearing projection 32 | 33 | calls staples() and projectors.h. Heavily. 34 | @return #GLU_SUCCESS or #GLU_FAILURE 35 | **/ 36 | int 37 | smear3D( struct site *__restrict lat , 38 | const size_t smiters , 39 | const smearing_types type ) ; 40 | 41 | /** 42 | @fn int smear4D( struct site *__restrict lat , const size_t smiters , const smearing_types type ) 43 | @brief ND link smearing without blocking transforms 44 | @param lat :: lattice gauge fields 45 | @param smiters :: number of smearing iterations 46 | @param type :: type of smearing projection 47 | 48 | calls staples() and projectors.h . Heavily. 49 | @return #GLU_SUCCESS or #GLU_FAILURE 50 | **/ 51 | int 52 | smear4D( struct site *__restrict lat , 53 | const size_t smiters , 54 | const smearing_types type ) ; 55 | 56 | #endif 57 | -------------------------------------------------------------------------------- /src/Headers/Landau.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2013-2025 Renwick James Hudspith 3 | 4 | This file (Landau.h) is part of GLU. 5 | 6 | GLU is free software: you can redistribute it and/or modify 7 | it under the terms of the GNU General Public License as published by 8 | the Free Software Foundation, either version 3 of the License, or 9 | (at your option) any later version. 10 | 11 | GLU is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | GNU General Public License for more details. 15 | 16 | You should have received a copy of the GNU General Public License 17 | along with GLU. If not, see . 18 | */ 19 | /** 20 | @file Landau.h 21 | @brief prototype functions for the Landau gauge fixing 22 | */ 23 | #ifndef GLU_LANDAU_H 24 | #define GLU_LANDAU_H 25 | 26 | /** 27 | @fn int grab_file( struct site *__restrict lat , GLU_complex *__restrict *__restrict gauge , FILE *__restrict infile ) 28 | @brief reread the configuration file and perform a random transform using gauge 29 | @param lat :: lattice links, overwritten 30 | @param gauge :: gauge transformation matrices 31 | @param infile :: input file 32 | 33 | @return #GLU_SUCCESS or #GLU_FAILURE 34 | */ 35 | int 36 | grab_file( struct site *lat , 37 | GLU_complex **gauge , 38 | const char *infile ) ; 39 | 40 | /** 41 | @fn size_t Landau( struct site *lat , const double accuracy , const size_t iter , FILE *infile ) 42 | @brief fast landau gauge fixing 43 | @param lat :: gauge field 44 | @param accuracy :: accuracy we wish to converge our algorithm to 45 | @param iter :: maximum number of iterations before we restart 46 | @param infile :: need the configuration file in case we have to start over 47 | our fastest smearing routine, memory expensive 48 | @return the number of iterations the routine took 49 | **/ 50 | size_t 51 | Landau( struct site *lat , 52 | const double accuracy , 53 | const size_t iter , 54 | const char *infile ) ; 55 | 56 | #endif 57 | -------------------------------------------------------------------------------- /src/Headers/smearing_param.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2013-2025 Renwick James Hudspith 3 | 4 | This file (smearing_param.h) is part of GLU. 5 | 6 | GLU is free software: you can redistribute it and/or modify 7 | it under the terms of the GNU General Public License as published by 8 | the Free Software Foundation, either version 3 of the License, or 9 | (at your option) any later version. 10 | 11 | GLU is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | GNU General Public License for more details. 15 | 16 | You should have received a copy of the GNU General Public License 17 | along with GLU. If not, see . 18 | */ 19 | /** 20 | @file smearing_param.h 21 | @brief computes an unsmeared and a smeared gluon propagator for the computation of the momentum space smearing parameter f(q) 22 | @ingroup Cuts 23 | */ 24 | #ifndef GLU_SMEARING_PARAM_H 25 | #define GLU_SMEARING_PARAM_H 26 | 27 | /** 28 | @fn int cuts_struct_smeared( struct site *__restrict A , const struct cut_info CUTINFO , const struct sm_info SMINFO ) 29 | @brief computes an unsmeared and a smeared gluon propagator file 30 | @param A :: momentum space gluon fields 31 | @param CUTINFO :: cutting information struct 32 | @param SMINFO :: smearing information struct 33 | */ 34 | int 35 | cuts_struct_smeared( struct site *__restrict A , 36 | const struct cut_info CUTINFO , 37 | const struct sm_info SMINFO ) ; 38 | 39 | /** 40 | @fn int cuts_struct_smeared( struct site *__restrict A , const struct cut_info CUTINFO , const struct sm_info SMINFO ) 41 | @brief computes the Landau condition for each momentum and outputs to a prop file 42 | @param A :: momentum space gluon fields 43 | @param CUTINFO :: cutting information struct 44 | @param SMINFO :: smearing information struct 45 | */ 46 | int 47 | cuts_struct_smeared_Lcondition( struct site *__restrict A , 48 | const struct cut_info CUTINFO , 49 | const struct sm_info SMINFO ) ; 50 | 51 | #endif 52 | -------------------------------------------------------------------------------- /src/Headers/gramschmidt.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2013-2025 Renwick James Hudspith 3 | 4 | This file (gramschmidt.h) is part of GLU. 5 | 6 | GLU is free software: you can redistribute it and/or modify 7 | it under the terms of the GNU General Public License as published by 8 | the Free Software Foundation, either version 3 of the License, or 9 | (at your option) any later version. 10 | 11 | GLU is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | GNU General Public License for more details. 15 | 16 | You should have received a copy of the GNU General Public License 17 | along with GLU. If not, see . 18 | */ 19 | /** 20 | \file gramschmidt.h 21 | @brief Perform a gram-schmidt reunitarisation of out gauge matrices 22 | http://en.wikipedia.org/wiki/Gram-Schmidt_process 23 | */ 24 | #ifndef GLU_GRAMSCHMIDT_H 25 | #define GLU_GRAMSCHMIDT_H 26 | 27 | /** 28 | @fn void gram_reunit( GLU_complex *__restrict U ) 29 | @brief reunitarises U into itself 30 | @param U :: overwritten with a reunitarised version of itself 31 | */ 32 | void 33 | gram_reunit( GLU_complex *__restrict U ) ; 34 | 35 | /** 36 | @fn void reunit_latt( GLU_complex *__restrict *__restrict U ) 37 | @brief reunitarise a lattice gauge field U 38 | @param U :: field that lives on the sites, e.g. gauge transform matrices. 39 | */ 40 | void 41 | reunit_latt( GLU_complex *__restrict *__restrict U ) ; 42 | 43 | /** 44 | @fn void Sunitary_gen( GLU_complex Z[ NCNC ] , const uint32_t thread ) 45 | @brief generate a random special-unitary matrix "Z" 46 | @param Z :: (pseudo) random special-unitary matrix Z 47 | */ 48 | void 49 | Sunitary_gen( GLU_complex Z[ NCNC ] , 50 | const uint32_t thread ) ; 51 | 52 | /** 53 | @fn void unitary_gen( GLU_complex Z[ NCNC ] ) 54 | @brief generate a random unitary matrix "Z" 55 | @param Z :: (pseudo) random unitary matrix Z 56 | */ 57 | void 58 | unitary_gen( GLU_complex Z[ NCNC ] ) ; 59 | 60 | #endif 61 | -------------------------------------------------------------------------------- /src/Headers/par_MWC_4096.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2013-2025 Renwick James Hudspith 3 | 4 | This file (par_MWC_4096.h) is part of GLU. 5 | 6 | GLU is free software: you can redistribute it and/or modify 7 | it under the terms of the GNU General Public License as published by 8 | the Free Software Foundation, either version 3 of the License, or 9 | (at your option) any later version. 10 | 11 | GLU is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | GNU General Public License for more details. 15 | 16 | You should have received a copy of the GNU General Public License 17 | along with GLU. If not, see . 18 | */ 19 | /** 20 | @file par_MWC_4096.h 21 | @brief prototype declarations for the MWC 4096 22 | */ 23 | #ifndef GLU_PAR_MWC_4096_H 24 | #define GLU_PAR_MWC_4096_H 25 | 26 | /** 27 | @fn void free_par_MWC_4096( void ) 28 | @brief free the RNG table 29 | */ 30 | void 31 | free_par_MWC_4096( void ) ; 32 | 33 | /** 34 | @fn void GLU_set_par_MWC_4096_table( const uint32_t seed[ Latt.Nthreads ] ) 35 | @brief set the parallel table 36 | @param seed :: seeds for the RNG 37 | */ 38 | void 39 | GLU_set_par_MWC_4096_table( const uint32_t seed[ Latt.Nthreads ] ) ; 40 | 41 | /** 42 | @fn double par_MWC_4096_dbl( const uint32_t thread ) 43 | @brief create a double precision random number 44 | @param thread :: parallel thread index 45 | */ 46 | double 47 | par_MWC_4096_dbl( const uint32_t thread ) ; 48 | 49 | /** 50 | @fn int read_par_MWC_4096_table( FILE *rng_file ) 51 | @brief read the Well RNG table from rng_file 52 | @param rng_file :: file to read the table from 53 | @return #GLU_SUCCSS or #GLU_FAILURE 54 | */ 55 | int 56 | read_par_MWC_4096_table( FILE *rng_file ) ; 57 | 58 | /** 59 | @fn void write_par_MWC_4096_table( FILE *rng_file ) 60 | @brief write the WELL RNG table to rng_file 61 | @param rng_file :: file to write out the table 62 | */ 63 | void 64 | write_par_MWC_4096_table( FILE *rng_file ) ; 65 | 66 | #endif 67 | -------------------------------------------------------------------------------- /src/Headers/par_WELL_512.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2013-2025 Renwick James Hudspith 3 | 4 | This file (par_WELL_512.h) is part of GLU. 5 | 6 | GLU is free software: you can redistribute it and/or modify 7 | it under the terms of the GNU General Public License as published by 8 | the Free Software Foundation, either version 3 of the License, or 9 | (at your option) any later version. 10 | 11 | GLU is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | GNU General Public License for more details. 15 | 16 | You should have received a copy of the GNU General Public License 17 | along with GLU. If not, see . 18 | */ 19 | /** 20 | @file par_WELL_512.h 21 | @brief prototype declarations for the WELL 512 22 | */ 23 | #ifndef GLU_PAR_WELL_512_H 24 | #define GLU_PAR_WELL_512_H 25 | 26 | /** 27 | @fn void free_par_WELL_512( void ) 28 | @brief free the RNG table 29 | */ 30 | void 31 | free_par_WELL_512( void ) ; 32 | 33 | /** 34 | @fn void GLU_set_par_WELL_512_table( const uint32_t seed[ Latt.Nthreads ] ) 35 | @brief set the parallel table 36 | @param seed :: seeds for the RNG 37 | */ 38 | void 39 | GLU_set_par_WELL_512_table( const uint32_t seed[ Latt.Nthreads ] ) ; 40 | 41 | /** 42 | @fn double par_WELL_512_dbl( const uint32_t thread ) 43 | @brief create a double precision random number 44 | @param thread :: parallel thread index 45 | */ 46 | double 47 | par_WELL_512_dbl( const uint32_t thread ) ; 48 | 49 | /** 50 | @fn int read_par_WELL_512_table( FILE *rng_file ) 51 | @brief read the Well RNG table from rng_file 52 | @param rng_file :: file to read the table from 53 | @return #GLU_SUCCSS or #GLU_FAILURE 54 | */ 55 | int 56 | read_par_WELL_512_table( FILE *rng_file ) ; 57 | 58 | /** 59 | @fn void write_par_WELL_512_table( FILE *rng_file ) 60 | @brief write the WELL RNG table to rng_file 61 | @param rng_file :: file to write out the table 62 | */ 63 | void 64 | write_par_WELL_512_table( FILE *rng_file ) ; 65 | 66 | #endif 67 | -------------------------------------------------------------------------------- /src/Headers/par_XOR_1024.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2013-2025 Renwick James Hudspith 3 | 4 | This file (par_XOR_1024.h) is part of GLU. 5 | 6 | GLU is free software: you can redistribute it and/or modify 7 | it under the terms of the GNU General Public License as published by 8 | the Free Software Foundation, either version 3 of the License, or 9 | (at your option) any later version. 10 | 11 | GLU is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | GNU General Public License for more details. 15 | 16 | You should have received a copy of the GNU General Public License 17 | along with GLU. If not, see . 18 | */ 19 | /** 20 | @file par_XOR_1024.h 21 | @brief prototype functions for the XOR_1024 rng 22 | */ 23 | #ifndef GLU_PAR_XOR_1024_H 24 | #define GLU_PAR_XOR_1024_H 25 | 26 | /** 27 | @fn void free_par_XOR_1024( void ) 28 | @brief free the RNG table 29 | */ 30 | void 31 | free_par_XOR_1024( void ) ; 32 | 33 | /** 34 | @fn void GLU_set_par_XOR_1024_table( const uint32_t seed[ Latt.Nthreads ] ) 35 | @brief set the parallel table 36 | @param seed :: seeds for the RNG 37 | */ 38 | void 39 | GLU_set_par_XOR_1024_table( const uint32_t seed[ Latt.Nthreads ] ) ; 40 | 41 | /** 42 | @fn double par_XOR_1024_dbl( const uint32_t thread ) 43 | @brief create a double precision random number 44 | @param thread :: parallel thread index 45 | */ 46 | double 47 | par_XOR_1024_dbl( const uint32_t thread ) ; 48 | 49 | /** 50 | @fn int read_par_XOR_1024_table( FILE *rng_file ) 51 | @brief read the Well RNG table from rng_file 52 | @param rng_file :: file to read the table from 53 | @return #GLU_SUCCSS or #GLU_FAILURE 54 | */ 55 | int 56 | read_par_XOR_1024_table( FILE *rng_file ) ; 57 | 58 | /** 59 | @fn void write_par_XOR_1024_table( FILE *rng_file ) 60 | @brief write the WELL RNG table to rng_file 61 | @param rng_file :: file to write out the table 62 | */ 63 | void 64 | write_par_XOR_1024_table( FILE *rng_file ) ; 65 | 66 | #endif 67 | -------------------------------------------------------------------------------- /src/Headers/par_MWC_1038.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2013-2025 Renwick James Hudspith 3 | 4 | This file (par_MWC_1038.h) is part of GLU. 5 | 6 | GLU is free software: you can redistribute it and/or modify 7 | it under the terms of the GNU General Public License as published by 8 | the Free Software Foundation, either version 3 of the License, or 9 | (at your option) any later version. 10 | 11 | GLU is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | GNU General Public License for more details. 15 | 16 | You should have received a copy of the GNU General Public License 17 | along with GLU. If not, see . 18 | */ 19 | /** 20 | @file par_MWC_1038.h 21 | @brief parallel multiply with carry generator of Marsaglia 22 | */ 23 | #ifndef GLU_PAR_MWC_1038 24 | #define GLU_PAR_MWC_1038 25 | 26 | /** 27 | @fn void free_par_MWC_1038( void ) 28 | @brief free the RNG table 29 | */ 30 | void 31 | free_par_MWC_1038( void ) ; 32 | 33 | /** 34 | @fn void GLU_set_par_MWC_1038_table( const uint32_t seed[ Latt.Nthreads ] ) 35 | @brief set the parallel table 36 | @param seed :: seeds for the RNG 37 | */ 38 | void 39 | GLU_set_par_MWC_1038_table( const uint32_t seed[ Latt.Nthreads ] ) ; 40 | 41 | /** 42 | @fn double par_MWC_1038_dbl( const uint32_t thread ) 43 | @brief create a double precision random number 44 | @param thread :: parallel thread index 45 | */ 46 | double 47 | par_MWC_1038_dbl( const uint32_t thread ) ; 48 | 49 | /** 50 | @fn int read_par_MWC_1038_table( FILE *rng_file ) 51 | @brief read the Well RNG table from rng_file 52 | @param rng_file :: file to read the table from 53 | @return #GLU_SUCCSS or #GLU_FAILURE 54 | */ 55 | int 56 | read_par_MWC_1038_table( FILE *rng_file ) ; 57 | 58 | /** 59 | @fn void write_par_MWC_1038_table( FILE *rng_file ) 60 | @brief write the WELL RNG table to rng_file 61 | @param rng_file :: file to write out the table 62 | */ 63 | void 64 | write_par_MWC_1038_table( FILE *rng_file ) ; 65 | 66 | #endif 67 | -------------------------------------------------------------------------------- /src/Headers/evalues.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2013-2025 Renwick James Hudspith 3 | 4 | This file (evalues.h) is part of GLU. 5 | 6 | GLU is free software: you can redistribute it and/or modify 7 | it under the terms of the GNU General Public License as published by 8 | the Free Software Foundation, either version 3 of the License, or 9 | (at your option) any later version. 10 | 11 | GLU is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | GNU General Public License for more details. 15 | 16 | You should have received a copy of the GNU General Public License 17 | along with GLU. If not, see . 18 | */ 19 | /** 20 | @file evalues.h 21 | @brief function protypes used for calculating eigenvalues of small matrices 22 | */ 23 | #ifndef GLU_EVALUES_H 24 | #define GLU_EVALUES_H 25 | 26 | /** 27 | @fn void Eigenvalues( GLU_complex z[ NC ] , const GLU_complex *__restrict U ) 28 | @brief general eigenvalue calculator fo NCxNC small matrices 29 | @param U :: some complex square matrix 30 | @param z :: its eigenvalues 31 | */ 32 | void 33 | Eigenvalues( double complex z[ NC ] , 34 | const GLU_complex *__restrict U ) ; 35 | 36 | /** 37 | @fn void Eigenvalues_suNC( double complex z[ NC ] , const GLU_complex U[ NCNC ] ) 38 | @brief general eigenvalue calculator fo SU(NC) small matrices 39 | @param U :: some link matrix 40 | @param z :: its eigenvalues 41 | @warning U must be special unitary 42 | @return a flag saying whether we are close to eigenvlue degeneracy 43 | */ 44 | int 45 | Eigenvalues_suNC( double complex z[ NC ] , 46 | const GLU_complex U[ NCNC ] ) ; 47 | 48 | 49 | /** 50 | @fn void Eigenvalues_hermitian( double z[ NC ] , const GLU_complex U[ NCNC ] ) 51 | @brief general eigenvalue calculator for hermitian small matrices 52 | @param U :: some link matrix 53 | @param z :: its eigenvalues 54 | @warning U must be hermitian 55 | */ 56 | void 57 | Eigenvalues_hermitian( double z[ NC ] , 58 | const GLU_complex U[ NCNC ] ) ; 59 | 60 | #endif 61 | -------------------------------------------------------------------------------- /src/Headers/read_config.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2013-2025 Renwick James Hudspith 3 | 4 | This file (read_config.h) is part of GLU. 5 | 6 | GLU is free software: you can redistribute it and/or modify 7 | it under the terms of the GNU General Public License as published by 8 | the Free Software Foundation, either version 3 of the License, or 9 | (at your option) any later version. 10 | 11 | GLU is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | GNU General Public License for more details. 15 | 16 | You should have received a copy of the GNU General Public License 17 | along with GLU. If not, see . 18 | */ 19 | /** 20 | @file read_config.h 21 | @brief prototype functions for header reading and checksum calculating 22 | */ 23 | #ifndef GLU_READ_CONFIG 24 | #define GLU_READ_CONFIG 25 | 26 | /** 27 | @fn int checks( struct site *__restrict lat , uint32_t chksum , struct head_data HEAD_DATA ) 28 | @brief perform a calculation/check of some checksums against the header ... 29 | @param lat :: lattice gauge field 30 | @param chksum :: the checksum 31 | @param HEAD_DATA :: the header data we compare to 32 | 33 | @warning I am optimistic here, I only claim we are a #GLU_FAILURE if all the checksums fail 34 | @returns the #GLU_SUCCESS or #GLU_FAILURE 35 | **/ 36 | int 37 | checks( struct site *__restrict lat , 38 | uint32_t chksum , 39 | struct head_data HEAD_DATA ) ; 40 | 41 | /** 42 | @fn int get_config_SUNC( FILE *__restrict CONFIG , struct site *__restrict lat , const struct head_data HEAD_DATA , const char *config_in ) 43 | @brief wrapper for reading a configuration 44 | @param CONFIG :: our configuration file 45 | @param lat :: the lattice gauge field being read 46 | @param HEAD_DATA :: uses the header data 47 | @param config_in :: file 48 | @returns #GLU_SUCCESS or #GLU_FAILURE 49 | **/ 50 | int 51 | get_config_SUNC( FILE *__restrict CONFIG , 52 | struct site *__restrict lat , 53 | const struct head_data HEAD_DATA , 54 | const char *config_in ) ; 55 | 56 | #endif 57 | -------------------------------------------------------------------------------- /src/Headers/MMULdag.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2013-2025 Renwick James Hudspith 3 | 4 | This file (MMULdag.h) is part of GLU. 5 | 6 | GLU is free software: you can redistribute it and/or modify 7 | it under the terms of the GNU General Public License as published by 8 | the Free Software Foundation, either version 3 of the License, or 9 | (at your option) any later version. 10 | 11 | GLU is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | GNU General Public License for more details. 15 | 16 | You should have received a copy of the GNU General Public License 17 | along with GLU. If not, see . 18 | */ 19 | /** 20 | @file MMULdag.h 21 | @brief prototype functions for multiplication for \f$ a = b^{\dagger}\times c\f$ 22 | */ 23 | #ifndef GLU_MMULDAG_H 24 | #define GLU_MMULDAG_H 25 | 26 | #ifndef GLU_BGQ // dirty, force inlining for the Q 27 | 28 | /** 29 | @fn void multabdag( GLU_complex a[ NCNC ] , const GLU_complex b[ NCNC ] , const GLU_complex c[ NCNC ] ) 30 | @brief Computes general Nc x Nc matrix multiplication with \f$ a = b^{\dagger}\times c \f$ 31 | 32 | general and slow, uses the complex multiplication defined in complex.h 33 | **/ 34 | void 35 | multabdag( GLU_complex a[ NCNC ] , 36 | const GLU_complex b[ NCNC ] , 37 | const GLU_complex c[ NCNC ] ) ; 38 | 39 | #if NC < 4 40 | 41 | /** 42 | @fn void multabdag_suNC( GLU_complex a[ NCNC ] , const GLU_complex b[ NCNC ] , const GLU_complex c[ NCNC ] ) 43 | @brief Computes general Nc x Nc matrix multiplication with \f$ a = b^{\dagger}\times c \f$ 44 | 45 | sped up for suNC by computing the signed minors for the bottom row and hand-expanded complex-complex multiplications 46 | 47 | @warning only use-able for \f$ a,b,c \in SU(NC) \f$ 48 | **/ 49 | void 50 | multabdag_suNC( GLU_complex a[ NCNC ] , 51 | const GLU_complex b[ NCNC ] , 52 | const GLU_complex c[ NCNC ] ) ; 53 | 54 | #else 55 | #define multabdag_suNC multabdag 56 | #endif 57 | 58 | #else 59 | 60 | // inline BGQmacros 61 | #include "BGQ_mmuldag.h" 62 | 63 | #endif 64 | 65 | #endif 66 | -------------------------------------------------------------------------------- /src/Headers/cut_routines.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2013-2025 Renwick James Hudspith 3 | 4 | This file (cut_routines.h) is part of GLU. 5 | 6 | GLU is free software: you can redistribute it and/or modify 7 | it under the terms of the GNU General Public License as published by 8 | the Free Software Foundation, either version 3 of the License, or 9 | (at your option) any later version. 10 | 11 | GLU is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | GNU General Public License for more details. 15 | 16 | You should have received a copy of the GNU General Public License 17 | along with GLU. If not, see . 18 | */ 19 | /** 20 | @file cut_routines.h 21 | @brief Cutting of extreme momenta from our data 22 | @ingroup Cuts 23 | */ 24 | #ifndef GLU_CUT_ROUTINES_H 25 | #define GLU_CUT_ROUTINES_H 26 | 27 | /** 28 | @param rats :: Anisotropy ratios 29 | */ 30 | extern GLU_real rats[ ND ] ; 31 | 32 | /** 33 | @fn void simorb_ratios( const size_t DIMS ) 34 | @brief compute the ratio of the smallest to the largest lattice direction 35 | @param DIMS :: dimensions of the problem 36 | 37 | This function computes the ratios of anisotropy so that we can keep 38 | momenta on an equivalent standing. This is very important for the 39 | non-exceptional schemes as otherwise we would not conserve the correct 40 | momenta. 41 | **/ 42 | void 43 | simorb_ratios( const size_t DIMS ) ; 44 | 45 | /** 46 | @fn struct veclist* compute_veclist( int *__restrict list_size , const struct cut_info CUTINFO , const size_t DIMS , const GLU_bool CONFIGSPACE ) ; 47 | @brief compute the list of momenta, or read it if possible 48 | @param list_size :: size of the veclist struct 49 | @param CUTINFO :: momentum cut information 50 | @param DIMS :: dimensions of the problem 51 | @param CONFIGSPACE :: Qsusc and Statpot have different momenta look-up 52 | */ 53 | struct veclist* 54 | compute_veclist( size_t *__restrict list_size , 55 | const struct cut_info CUTINFO , 56 | const size_t DIMS , 57 | const GLU_bool CONFIGSPACE ) ; 58 | 59 | #endif 60 | -------------------------------------------------------------------------------- /src/Headers/readers.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2013-2025 Renwick James Hudspith 3 | 4 | This file (readers.h) is part of GLU. 5 | 6 | GLU is free software: you can redistribute it and/or modify 7 | it under the terms of the GNU General Public License as published by 8 | the Free Software Foundation, either version 3 of the License, or 9 | (at your option) any later version. 10 | 11 | GLU is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | GNU General Public License for more details. 15 | 16 | You should have received a copy of the GNU General Public License 17 | along with GLU. If not, see . 18 | */ 19 | /** 20 | @file readers.h 21 | @brief configuration file readers 22 | */ 23 | #ifndef GLU_READERS_H 24 | #define GLU_READERS_H 25 | 26 | /** 27 | @fn uint32_t lattice_reader_suNC( struct site *__restrict lat , FILE *__restrict in , const struct head_data HEAD_DATA ) 28 | @brief reads in a NERSC configuration ... 29 | @param lat :: lattice gauge field 30 | @param in :: NERSC configuration being read 31 | @param HEAD_DATA :: the header data 32 | 33 | @returns #GLU_SUCCESS or #GLU_FAILURE 34 | **/ 35 | uint32_t 36 | lattice_reader_suNC( struct site *__restrict lat , 37 | FILE *__restrict in , 38 | const struct head_data HEAD_DATA ) ; 39 | 40 | /** 41 | @fn uint32_t lattice_reader_suNC_cheaper( struct site *__restrict lat , FILE *__restrict in , const struct head_data HEAD_DATA ) 42 | @brief reads in a NERSC configuration, cheaper and a little slower than the other needed for the Q. 43 | @param lat :: lattice gauge field 44 | @param in :: NERSC configuration being read 45 | @param HEAD_DATA :: the header data 46 | 47 | @returns #GLU_SUCCESS or #GLU_FAILURE 48 | **/ 49 | uint32_t 50 | lattice_reader_suNC_cheaper( struct site *__restrict lat , 51 | FILE *__restrict in , 52 | const struct head_data HEAD_DATA ) ; 53 | 54 | uint32_t 55 | lattice_reader_suNC_posix( struct site *lat , 56 | const char *config_in , 57 | FILE *__restrict in , 58 | const struct head_data HEAD_DATA ) ; 59 | 60 | #endif 61 | -------------------------------------------------------------------------------- /src/Headers/Scidac.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2013-2025 Renwick James Hudspith 3 | 4 | This file (Scidac.h) is part of GLU. 5 | 6 | GLU is free software: you can redistribute it and/or modify 7 | it under the terms of the GNU General Public License as published by 8 | the Free Software Foundation, either version 3 of the License, or 9 | (at your option) any later version. 10 | 11 | GLU is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | GNU General Public License for more details. 15 | 16 | You should have received a copy of the GNU General Public License 17 | along with GLU. If not, see . 18 | */ 19 | /** 20 | @file Scidac.h 21 | @brief function prototypes for the reading of SCIDAC files 22 | */ 23 | #ifndef GLU_SCIDAC_H 24 | #define GLU_SCIDAC_H 25 | 26 | /** 27 | @fn int get_header_data_SCIDAC( FILE *infile , struct head_data *HEAD_DATA ) 28 | @brief gets the configuration data from the Scidac or ILDG header 29 | @param infile :: configuration file 30 | @param HEAD_DATA :: contains the necessary header data 31 | 32 | @warning overwrites the struct Latt's dimensions 33 | */ 34 | int 35 | get_header_data_SCIDAC( FILE *infile , 36 | struct head_data *HEAD_DATA ) ; 37 | 38 | /** 39 | @fn void write_header_ILDG( FILE *__restrict out ) 40 | @brief function for writing out an ILDG header 41 | @param out :: output file 42 | */ 43 | void 44 | write_header_ILDG( FILE *__restrict out ) ; 45 | 46 | /** 47 | @fn void write_header_SCIDAC( FILE *__restrict out ) ; 48 | @brief function for writing out a SCIDAC configuration 49 | @param out :: the output file 50 | */ 51 | void 52 | write_header_SCIDAC( FILE *__restrict out ) ; 53 | 54 | /** 55 | @fn void write_trailing_header_SCIDAC( FILE *__restrict out , const uint32_t cksuma , const uint32_t cksumb ) 56 | @brief writes the checksums for the configuration file 57 | @param cksuma :: the computed CRC checksum (rank29) 58 | @param cksumb :: the CRC checksum (rank31) 59 | */ 60 | void 61 | write_trailing_header_SCIDAC( FILE *__restrict out , 62 | const uint32_t cksuma , 63 | const uint32_t cksumb ) ; 64 | 65 | #endif 66 | -------------------------------------------------------------------------------- /src/Headers/Or.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2013-2025 Renwick James Hudspith 3 | 4 | This file (OrLandau.h) is part of GLU. 5 | 6 | GLU is free software: you can redistribute it and/or modify 7 | it under the terms of the GNU General Public License as published by 8 | the Free Software Foundation, either version 3 of the License, or 9 | (at your option) any later version. 10 | 11 | GLU is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | GNU General Public License for more details. 15 | 16 | You should have received a copy of the GNU General Public License 17 | along with GLU. If not, see . 18 | */ 19 | /** 20 | @file OrLandau.h 21 | @brief protype functions for Over-relaxed gauge fixing routines, too relaxed in my opinion! 22 | */ 23 | #ifndef GLU_ORLANDAU_H 24 | #define GLU_ORLANDAU_H 25 | 26 | /** 27 | @fn size_t OrCoulomb( struct site *__restrict lat , double *theta , const size_t MAX_ITERS , const double ACC , const double OrParam ) 28 | @brief Over-relaxation Coulomb gauge fixing code 29 | @param lat :: lattice gauge fields 30 | @param theta :: gauge fixing accuracy attained 31 | @param MAX_ITERS :: maximum number of iterations before complaint 32 | @param ACC :: accuracy intended to be fixed to 33 | @param OrParam :: Over-relaxation parameter 34 | */ 35 | size_t 36 | OrCoulomb( struct site *__restrict lat , 37 | double *theta , 38 | const size_t MAX_ITERS , 39 | const double ACC , 40 | const double OrParam ) ; 41 | 42 | /** 43 | @fn size_t OrLandau( struct site *__restrict lat , double *theta , const size_t MAX_ITERS , const double ACC , const double OrParam ) 44 | @brief Over-relaxation Landau gauge fixing code 45 | @param lat :: lattice gauge fields 46 | @param theta :: gauge fixing accuracy attained 47 | @param MAX_ITERS :: maximum number of iterations before complaint 48 | @param ACC :: accuracy intended to be fixed to 49 | @param OrParam :: Over-relaxation parameter 50 | */ 51 | size_t 52 | OrLandau( struct site *__restrict lat , 53 | double *theta , 54 | const size_t MAX_ITERS , 55 | const double ACC , 56 | const double OrParam ) ; 57 | 58 | #endif 59 | -------------------------------------------------------------------------------- /src/Headers/MMUL.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2013-2025 Renwick James Hudspith 3 | 4 | This file (MMUL.h) is part of GLU. 5 | 6 | GLU is free software: you can redistribute it and/or modify 7 | it under the terms of the GNU General Public License as published by 8 | the Free Software Foundation, either version 3 of the License, or 9 | (at your option) any later version. 10 | 11 | GLU is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | GNU General Public License for more details. 15 | 16 | You should have received a copy of the GNU General Public License 17 | along with GLU. If not, see . 18 | */ 19 | /** 20 | @file MMUL.h 21 | @brief prototype functions for matrix multiplication routines 22 | */ 23 | #ifndef GLU_MMUL_H 24 | #define GLU_MMUL_H 25 | 26 | /** 27 | @fn void multab_atomic_left( GLU_complex a[ NCNC ] , const GLU_complex b[ NCNC ] ) 28 | @brief NC x NC matrix multiply a = b * a 29 | 30 | computes \f$ a = b \times a \f$ general NC x NC matrix multiply does not require specific types of matrices 31 | @warning overwrites the matix @a 32 | **/ 33 | void 34 | multab_atomic_left( GLU_complex a[ NCNC ] , 35 | const GLU_complex b[ NCNC ] ) ; 36 | 37 | /** 38 | @fn void multab_atomic_right( GLU_complex a[ NCNC ] , const GLU_complex b[ NCNC ] ) 39 | @brief NC x NC matrix multiply a = a * b 40 | 41 | computes \f$ a = a \times b \f$ general NC x NC matrix multiply does not require specific types of matrices 42 | @warning overwrites the matix @a 43 | **/ 44 | void 45 | multab_atomic_right( GLU_complex a[ NCNC ] , 46 | const GLU_complex b[ NCNC ] ) ; 47 | 48 | #ifndef GLU_BGQ // turns on the inline matrix multiplies 49 | 50 | /** 51 | @fn void multab( GLU_complex a[ NCNC ] , const GLU_complex b[ NCNC ] , const GLU_complex c[ NCNC ] ) 52 | @brief NC x NC matrix multiply 53 | 54 | computes \f$ a = b \times c \f$ general Nc x Nc matrix multiply does not require specific types of matrices 55 | **/ 56 | void 57 | multab( GLU_complex a[ NCNC ] , 58 | const GLU_complex b[ NCNC ] , 59 | const GLU_complex c[ NCNC ] ) ; 60 | 61 | #else // else we inline the matrix multiplies ... 62 | #include "BGQ_mmuls.h" 63 | #endif 64 | 65 | #endif 66 | -------------------------------------------------------------------------------- /src/Headers/BGQ_mmuldag.h: -------------------------------------------------------------------------------- 1 | /** 2 | @file BGQ_mmul_dag.h 3 | @brief inline matrix multiply macros 4 | */ 5 | #ifndef BGQ_MMULDAG_H 6 | #define BGQ_MMULDAG_H 7 | 8 | #if NC==3 9 | #define multabdag( a , b , c ) \ 10 | a[0] = conj( b[0] ) * c[0] + conj( b[3] ) * c[3] + conj( b[6] ) * c[6] ; \ 11 | a[1] = conj( b[0] ) * c[1] + conj( b[3] ) * c[4] + conj( b[6] ) * c[7] ; \ 12 | a[2] = conj( b[0] ) * c[2] + conj( b[3] ) * c[5] + conj( b[6] ) * c[8] ; \ 13 | a[3] = conj( b[1] ) * c[0] + conj( b[4] ) * c[3] + conj( b[7] ) * c[6] ; \ 14 | a[4] = conj( b[1] ) * c[1] + conj( b[4] ) * c[4] + conj( b[7] ) * c[7] ; \ 15 | a[5] = conj( b[1] ) * c[2] + conj( b[4] ) * c[5] + conj( b[7] ) * c[8] ; \ 16 | a[6] = conj( b[2] ) * c[0] + conj( b[5] ) * c[3] + conj( b[8] ) * c[6] ; \ 17 | a[7] = conj( b[2] ) * c[1] + conj( b[5] ) * c[4] + conj( b[8] ) * c[7] ; \ 18 | a[8] = conj( b[2] ) * c[2] + conj( b[5] ) * c[5] + conj( b[8] ) * c[8] ; 19 | #elif NC==2 20 | #define multabdag( a , b , c ) \ 21 | a[0] = conj( b[0] ) * c[0] + conj( b[2] ) * c[2] ; \ 22 | a[1] = conj( b[0] ) * c[1] + conj( b[2] ) * c[3] ; \ 23 | a[2] = conj( b[1] ) * c[0] + conj( b[3] ) * c[2] ; \ 24 | a[3] = conj( b[1] ) * c[1] + conj( b[3] ) * c[3] ; 25 | #else 26 | void 27 | multabdag( GLU_complex a[ NCNC ] , 28 | const GLU_complex b[ NCNC ] , 29 | const GLU_complex c[ NCNC ] ) ; 30 | #endif 31 | 32 | #if NC==3 33 | #define multabdag_suNC( a , b , c ) \ 34 | a[0] = conj( b[0] ) * c[0] + conj( b[3] ) * c[3] + conj( b[6] ) * c[6] ; \ 35 | a[1] = conj( b[0] ) * c[1] + conj( b[3] ) * c[4] + conj( b[6] ) * c[7] ; \ 36 | a[2] = conj( b[0] ) * c[2] + conj( b[3] ) * c[5] + conj( b[6] ) * c[8] ; \ 37 | a[3] = conj( b[1] ) * c[0] + conj( b[4] ) * c[3] + conj( b[7] ) * c[6] ; \ 38 | a[4] = conj( b[1] ) * c[1] + conj( b[4] ) * c[4] + conj( b[7] ) * c[7] ; \ 39 | a[5] = conj( b[1] ) * c[2] + conj( b[4] ) * c[5] + conj( b[7] ) * c[8] ; \ 40 | a[6] = conj( a[1] * a[5] - a[2] * a[4] ) ; \ 41 | a[7] = conj( a[2] * a[3] - a[0] * a[5] ) ; \ 42 | a[8] = conj( a[0] * a[4] - a[1] * a[3] ) ; 43 | #elif NC==2 44 | #define multabdag_suNC( a , b , c ) \ 45 | a[0] = conj( b[0] ) * c[0] + conj( b[2] ) * c[2] ; \ 46 | a[1] = conj( b[0] ) * c[1] + conj( b[2] ) * c[3] ; \ 47 | a[2] = -conj( a[1] ) ; \ 48 | a[3] = conj( a[0] ) ; 49 | #else 50 | #define multabdag_suNC multabdag 51 | #endif 52 | 53 | #endif 54 | -------------------------------------------------------------------------------- /src/Headers/MAG.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2013-2025 Renwick James Hudspith 3 | 4 | This file (MAG.h) is part of GLU. 5 | 6 | GLU is free software: you can redistribute it and/or modify 7 | it under the terms of the GNU General Public License as published by 8 | the Free Software Foundation, either version 3 of the License, or 9 | (at your option) any later version. 10 | 11 | GLU is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | GNU General Public License for more details. 15 | 16 | You should have received a copy of the GNU General Public License 17 | along with GLU. If not, see . 18 | */ 19 | /** 20 | @file MAG.h 21 | @brief fixing to the Maximal Axial Gauge, Axial gauge, or residual (after Coulomb) is performed here 22 | */ 23 | #ifndef GLU_MAG_H 24 | #define GLU_MAG_H 25 | 26 | /** 27 | @fn void axial_gauge( struct site *lat , const size_t DIR ) 28 | @brief Fixes to the axial gauge i.e \f$ A_{DIR} = 0. \f$ 29 | @param lat :: lattice fields 30 | @param DIR :: direction to set fields to unity 31 | 32 | \f[ 33 | A_{DIR}(x) = 0. 34 | \f] 35 | @return #GLU_SUCCESS or #GLU_FAILURE 36 | **/ 37 | int 38 | axial_gauge( struct site *lat , 39 | const size_t DIR ) ; 40 | 41 | /** 42 | @fn void mag( struct site *lat ) 43 | @brief wrapper for the maximal axial gauge (MAG) fixing 44 | @param lat :: lattice fields 45 | @warning has a reunitarization method included, to sharpen the links a little. 46 | @return #GLU_SUCCESS or #GLU_FAILURE 47 | **/ 48 | int 49 | mag( struct site *lat ) ; 50 | 51 | 52 | /** 53 | @fn void residual_fix( struct site *lat ) 54 | @brief fixes the extra degree of freedom left from fixing to Coulomb gauge 55 | @param lat :: the lattice links 56 | This function computes 57 | \f[ 58 | U_t(x,t) = g(t) U_t(x,t) g^{\dagger}(t+1) \qquad U_i(x,t) = g(t) U_i(x,t) g^{\dagger}(t) 59 | \f] 60 | <\br> 61 | where the gauge transformation matrices are defined as 62 | \f[ 63 | g(t) = g(t-1)\frac{1}{\prod_{i. 18 | */ 19 | /** 20 | @file GLU_bswap.h 21 | @brief prototype functions for byte-swapping of different size objects 22 | @warning The byte swapping routines use OpenMP be warned 23 | */ 24 | #ifndef GLU_BSWAP_H 25 | #define GLU_BSWAP_H 26 | 27 | /** 28 | @fn void bswap_16( const size_t n , void *u ) 29 | @brief swaps the bytes of a 16 bit array 30 | @param n :: length of the array 31 | @param u :: pointer to memory 32 | */ 33 | void 34 | bswap_16( const size_t n , 35 | void *u ) ; 36 | 37 | /** 38 | @fn void bswap_32( const size_t n , void *u ) 39 | @brief swaps the bytes of a 32 bit array 40 | @param n :: length of the array 41 | @param u :: pointer to memory 42 | */ 43 | void 44 | bswap_32( const size_t n , 45 | void *u ) ; 46 | 47 | /** 48 | @fn void bswap_32_par( const size_t n , void *u ) 49 | @brief swaps the bytes of a 32 bit array parallel loop over n 50 | @param n :: length of the array 51 | @param u :: pointer to memory 52 | */ 53 | void 54 | bswap_32_par( const size_t n , 55 | void *u ) ; 56 | 57 | /** 58 | @fn void bswap_64( const size_t n , void *u ) 59 | @brief swaps the bytes of a 64 bit array 60 | @param n :: length of the array 61 | @param u :: pointer to memory 62 | */ 63 | void 64 | bswap_64( const size_t n , 65 | void *u ) ; 66 | 67 | /** 68 | @fn void bswap_64_par( const size_t n , void *u ) 69 | @brief swaps the bytes of a 64 bit array parallel loop over n 70 | @param n :: length of the array 71 | @param u :: pointer to memory 72 | */ 73 | void 74 | bswap_64_par( const size_t n , 75 | void *u ) ; 76 | 77 | #endif 78 | -------------------------------------------------------------------------------- /src/Headers/write_headers.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2013-2025 Renwick James Hudspith 3 | 4 | This file (write_headers.h) is part of GLU. 5 | 6 | GLU is free software: you can redistribute it and/or modify 7 | it under the terms of the GNU General Public License as published by 8 | the Free Software Foundation, either version 3 of the License, or 9 | (at your option) any later version. 10 | 11 | GLU is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | GNU General Public License for more details. 15 | 16 | You should have received a copy of the GNU General Public License 17 | along with GLU. If not, see . 18 | */ 19 | /** 20 | @file write_headers.h 21 | @brief prototypes for writing the header information of MILC and NERSC type configuration files 22 | */ 23 | #ifndef GLU_WRITE_HEADERS_H 24 | #define GLU_WRITE_HEADERS_H 25 | 26 | /** 27 | @fn void write_header_MILC( FILE *__restrict out , const uint32_t milc_cksum29 , const uint32_t milc_cksum31 ) ; 28 | @brief writes the MILC configuration header to the start of out 29 | @param out :: the output file being written to 30 | @param milc_cksum29 :: the bit-shifted by index (mod 29) checksum 31 | @param milc_cksum29 :: the bit-shifted by index (mod 29) checksum 32 | */ 33 | void 34 | write_header_MILC( FILE *__restrict out , 35 | const uint32_t milc_cksum29 , 36 | const uint32_t milc_cksum31 ) ; 37 | 38 | /** 39 | @fn void write_header_NERSC( FILE *__restrict out , const double tr , const double plaq , const uint32_t chksum , const char *details , const int type ) ; 40 | @brief writes the NERSC header format to the top of "out" 41 | @param out :: file to be written in 42 | @param tr :: average trace of the lattice links 43 | @param plaq :: average plaquette of the lattice fields 44 | @param chksum :: NERSC checksum is a sum of the data cast to uint32_t 45 | @param details :: what goes in the INFO part of the header 46 | @param type :: can be #OUTPUT_NCxNC,#OUTPUT_GAUGE or #OUTPUT_SMALL 47 | */ 48 | void 49 | write_header_NERSC( FILE *__restrict out , 50 | const double tr , 51 | const double plaq , 52 | const uint32_t chksum , 53 | const char *details , 54 | const int type ) ; 55 | 56 | #endif 57 | -------------------------------------------------------------------------------- /src/Headers/expMat.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2013-2025 Renwick James Hudspith 3 | 4 | This file (expMat.h) is part of GLU. 5 | 6 | GLU is free software: you can redistribute it and/or modify 7 | it under the terms of the GNU General Public License as published by 8 | the Free Software Foundation, either version 3 of the License, or 9 | (at your option) any later version. 10 | 11 | GLU is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | GNU General Public License for more details. 15 | 16 | You should have received a copy of the GNU General Public License 17 | along with GLU. If not, see . 18 | */ 19 | /** 20 | @file expMat.h 21 | @brief prototype functions for expMat.c 22 | */ 23 | #ifndef GLU_EXPMAT_H 24 | #define GLU_EXPMAT_H 25 | 26 | #if !( defined HAVE_LAPACKE_H || defined HAVE_GSL ) && ( NC > 3 ) 27 | /** 28 | @fn void init_factorial( void ) 29 | @brief allocates the memory of our (inverse) factorial for our brute force matrix exponentiation routine 30 | */ 31 | void 32 | init_factorial( void ) ; 33 | 34 | /** 35 | @fn void free_factorial( void ) 36 | @brief frees the precomputed factorial for the brute-force exponentiation routines 37 | */ 38 | void 39 | free_factorial( void ) ; 40 | #endif 41 | 42 | /** 43 | @fn void exponentiate( GLU_complex U[ NCNC ] , const GLU_complex Q[ NCNC ] ) 44 | @brief Our old exact exponentiation routine of Q into U. e.g. \f$ U_\mu(x) = e^{Q_\mu(x)}\f$ 45 | @param U :: Link matrix 46 | @param Q :: Lie matrix 47 | MP exponentiation using the full (redundant) Q uses inlined eigenvalue and f calculations instead of those in solver.h and effs.h 48 | **/ 49 | void 50 | exponentiate( GLU_complex U[ NCNC ] , 51 | const GLU_complex Q[ NCNC ] ) ; 52 | 53 | /** 54 | @fn void exponentiate_short( GLU_complex U[ NCNC ] , const GLU_complex Q[ HERMSIZE ] ) 55 | @brief Our old exact exponentiation routine of Q into U. e.g. \f$ U_\mu(x) = e^{Q_\mu(x)}\f$ 56 | @param U :: Link matrix 57 | @param Q :: Lie matrix 58 | MP exponentiation using the shortened version of Q. uses inlined eigenvalue and f calculations instead of those in solver.h and effs.h 59 | **/ 60 | void 61 | exponentiate_short( GLU_complex U[ NCNC ] , 62 | const GLU_complex Q[ HERMSIZE ] ) ; 63 | 64 | #endif 65 | -------------------------------------------------------------------------------- /src/Headers/BGQ_mmul_dag.h: -------------------------------------------------------------------------------- 1 | /** 2 | @file BGQ_mmul_dag.h 3 | @brief BGQ inlined macros for matrix multiplies 4 | */ 5 | #ifndef BGQ_MMUL_DAG_H 6 | #define BGQ_MMUL_DAG_H 7 | 8 | #if NC==3 9 | #define multab_dag( a , b , c ) \ 10 | a[0] = b[0] * conj( c[0] ) + b[1] * conj( c[1] ) + b[2] * conj( c[2] ) ; \ 11 | a[1] = b[0] * conj( c[3] ) + b[1] * conj( c[4] ) + b[2] * conj( c[5] ) ; \ 12 | a[2] = b[0] * conj( c[6] ) + b[1] * conj( c[7] ) + b[2] * conj( c[8] ) ; \ 13 | a[3] = b[3] * conj( c[0] ) + b[4] * conj( c[1] ) + b[5] * conj( c[2] ) ; \ 14 | a[4] = b[3] * conj( c[3] ) + b[4] * conj( c[4] ) + b[5] * conj( c[5] ) ; \ 15 | a[5] = b[3] * conj( c[6] ) + b[4] * conj( c[7] ) + b[5] * conj( c[8] ) ; \ 16 | a[6] = b[6] * conj( c[0] ) + b[7] * conj( c[1] ) + b[8] * conj( c[2] ) ; \ 17 | a[7] = b[6] * conj( c[3] ) + b[7] * conj( c[4] ) + b[8] * conj( c[5] ) ; \ 18 | a[8] = b[6] * conj( c[6] ) + b[7] * conj( c[7] ) + b[8] * conj( c[8] ) ; 19 | #elif NC==2 20 | #define multab_dag( a , b , c ) \ 21 | a[0] = b[0] * conj( c[0] ) + b[1] * conj( c[1] ) ; \ 22 | a[1] = b[0] * conj( c[2] ) + b[1] * conj( c[3] ) ; \ 23 | a[2] = b[2] * conj( c[0] ) + b[3] * conj( c[1] ) ; \ 24 | a[3] = b[2] * conj( c[2] ) + b[3] * conj( c[3] ) ; 25 | #else // instead of inlining we have a function call 26 | void 27 | multab_dag( GLU_complex a[ NCNC ] , 28 | const GLU_complex b[ NCNC ] , 29 | const GLU_complex c[ NCNC ] ) ; 30 | #endif 31 | 32 | #if NC==3 33 | #define multab_dag_suNC( a , b , c ) \ 34 | a[0] = b[0] * conj( c[0] ) + b[1] * conj( c[1] ) + b[2] * conj( c[2] ) ; \ 35 | a[1] = b[0] * conj( c[3] ) + b[1] * conj( c[4] ) + b[2] * conj( c[5] ) ; \ 36 | a[2] = b[0] * conj( c[6] ) + b[1] * conj( c[7] ) + b[2] * conj( c[8] ) ; \ 37 | a[3] = b[3] * conj( c[0] ) + b[4] * conj( c[1] ) + b[5] * conj( c[2] ) ; \ 38 | a[4] = b[3] * conj( c[3] ) + b[4] * conj( c[4] ) + b[5] * conj( c[5] ) ; \ 39 | a[5] = b[3] * conj( c[6] ) + b[4] * conj( c[7] ) + b[5] * conj( c[8] ) ; \ 40 | a[6] = conj( a[1] * a[5] - a[2] * a[4] ) ; \ 41 | a[7] = conj( a[2] * a[3] - a[0] * a[5] ) ; \ 42 | a[8] = conj( a[0] * a[4] - a[1] * a[3] ) ; 43 | #elif NC==2 44 | #define multab_dag_suNC( a , b , c ) \ 45 | a[0] = b[0] * conj( c[0] ) + b[1] * conj( c[1] ) ; \ 46 | a[1] = b[0] * conj( c[2] ) + b[1] * conj( c[3] ) ; \ 47 | a[2] = -conj( a[1] ) ; \ 48 | a[3] = conj( a[0] ) ; 49 | #else 50 | #define multab_dag_suNC multab_dag 51 | #endif 52 | 53 | #endif 54 | -------------------------------------------------------------------------------- /src/Headers/FACG.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2013-2025 Renwick James Hudspith 3 | 4 | This file (FACG.h) is part of GLU. 5 | 6 | GLU is free software: you can redistribute it and/or modify 7 | it under the terms of the GNU General Public License as published by 8 | the Free Software Foundation, either version 3 of the License, or 9 | (at your option) any later version. 10 | 11 | GLU is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | GNU General Public License for more details. 15 | 16 | You should have received a copy of the GNU General Public License 17 | along with GLU. If not, see . 18 | */ 19 | /** 20 | @file FACG.h 21 | @brief protype functions for the Fourier Accelerated Conjugate Gradient Landau gauge fixing routine 22 | */ 23 | #ifndef GLU_FACG_H 24 | #define GLU_FACG_H 25 | 26 | /** 27 | @fn size_t FACG( struct site *lat , struct fftw_stuff *FFTW , double *th , const double acc , const size_t max_iters ) 28 | @brief Fourier-accelerated conjugate gradient routine for Landau gauge fixing 29 | @param lat :: lattice gauge links 30 | @param FFTW :: fftw temporary arrays and plans 31 | @param th :: FFT accuracy when finished 32 | @param acc :: accuracy we are trying to achieve 33 | @param max_iters :: maximum iterations we allow the routine to perform 34 | @return the number of iterations the routine took to achieve "th" accuracy 35 | */ 36 | size_t 37 | FACG( struct site *lat , 38 | struct fftw_stuff *FFTW , 39 | double *th , 40 | const double acc , 41 | const size_t max_iters ) ; 42 | 43 | /** 44 | @fn size_t FASD( struct site *lat , struct fftw_stuff *FFTW , double *th , const double acc , const size_t max_iters ) 45 | @brief Fourier-accelerated steepest descent routine for Landau gauge fixing 46 | @param lat :: lattice gauge links 47 | @param FFTW :: fftw temporary arrays and plans 48 | @param th :: FFT accuracy when finished 49 | @param acc :: accuracy we are trying to achieve 50 | @param max_iters :: maximum iterations we allow the routine to perform 51 | @return the number of iterations the routine took to achieve "th" accuracy 52 | */ 53 | size_t 54 | FASD( struct site *lat , 55 | struct fftw_stuff *FFTW , 56 | double *th , 57 | const double acc , 58 | const size_t max_iters ) ; 59 | 60 | #endif 61 | -------------------------------------------------------------------------------- /src/Headers/POLY.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2013-2025 Renwick James Hudspith 3 | 4 | This file (POLY.h) is part of GLU. 5 | 6 | GLU is free software: you can redistribute it and/or modify 7 | it under the terms of the GNU General Public License as published by 8 | the Free Software Foundation, either version 3 of the License, or 9 | (at your option) any later version. 10 | 11 | GLU is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | GNU General Public License for more details. 15 | 16 | You should have received a copy of the GNU General Public License 17 | along with GLU. If not, see . 18 | */ 19 | /** 20 | @file POLY.h 21 | @brief polyakov loop measurements, coulomb gauge fixed static potential meas 22 | */ 23 | #ifndef GLU_POLY_H 24 | #define GLU_POLY_H 25 | 26 | /** 27 | @fn int Coul_staticpot( struct site *lat , const struct cut_info CUTINFO , const struct sm_info SMINFO ) 28 | @brief static potential calculator 29 | @param lat :: lattice gauge fields 30 | @param CUTINFO :: cutting information such as what type of cut to perform 31 | @param SMINFO :: do we want to smear this thing? 32 | @warning gauge configurations must be in Coulomb gauge, calls the smearing routines 33 | @return #GLU_SUCCESS or #GLU_FAILURE 34 | */ 35 | int 36 | Coul_staticpot( struct site *lat , 37 | const struct cut_info CUTINFO , 38 | const struct sm_info SMINFO ) ; 39 | 40 | /** 41 | @fn double complex poly( const struct site *lat , size_t dir ) 42 | @brief computes the polyakov loop in the direction "dir" 43 | @param lat :: lattice fields 44 | @param dir :: direction to measure in 45 | The measurement starts at the logical first sub-hypercube and traverses in 46 | the direction "dir" taking the product of the matrices from that point. 47 | 48 | @warning prints results to stdout. changes dir if not suitable 49 | **/ 50 | double complex 51 | poly( const struct site *lat , 52 | size_t dir ) ; 53 | 54 | /** 55 | @fn void poly_th( double *red , const struct site *lat , size_t dir ) ; 56 | @brief threaded polyakov loop evaluation 57 | @param red :: reduction array 58 | @param lat :: lattice gauge links 59 | @param dir :: direction to measure in between 0 and ND-1 60 | */ 61 | void 62 | poly_th( double *red , 63 | const struct site *lat , 64 | size_t dir ) ; 65 | 66 | #endif 67 | -------------------------------------------------------------------------------- /src/Headers/GLU_sums.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2013-2025 Renwick James Hudspith 3 | 4 | This file (GLU_sums.h) is part of GLU. 5 | 6 | GLU is free software: you can redistribute it and/or modify 7 | it under the terms of the GNU General Public License as published by 8 | the Free Software Foundation, either version 3 of the License, or 9 | (at your option) any later version. 10 | 11 | GLU is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | GNU General Public License for more details. 15 | 16 | You should have received a copy of the GNU General Public License 17 | along with GLU. If not, see . 18 | */ 19 | /** 20 | @file GLU_sums.h 21 | @brief prototype declarations for robust summations 22 | */ 23 | #ifndef GLU_SUMS_H 24 | #define GLU_SUMS_H 25 | 26 | /** 27 | @fn double dandc_sum( const double *a , const size_t lo , const size_t hi ) 28 | @brief recursive divide and conquer sum 29 | @param a :: array of values 30 | @param lo :: lower index of values (i.e. 0) 31 | @param hi :: length of the array @a 32 | @return the sum of the values in @a 33 | Note:: Error should go like hi.log( hi ) 34 | */ 35 | double 36 | dandc_sum( const double *a , 37 | const size_t lo , 38 | const size_t hi ) ; 39 | 40 | /** 41 | @fn double kahan_summation( const double *a , const size_t LENGTH ) 42 | @brief kahan summation algorithm 43 | @param a :: array of values 44 | @param LENGTH :: length of array a 45 | @return the sum of the values in @a 46 | */ 47 | double 48 | kahan_summation( const double *a , 49 | const size_t LENGTH ) ; 50 | 51 | /** 52 | @fn double knuth_average( const double *a , const size_t LENGTH ) 53 | @brief (more) stable average attributed to knuth 54 | @param a :: array of values 55 | @param LENGTH :: length of array a 56 | @return the average of the values stored in @a 57 | */ 58 | double 59 | knuth_average( const double *a , 60 | const size_t LENGTH ) ; 61 | 62 | /** 63 | @fn double par_dandc_sum( const double *a , const size_t N ) 64 | @brief recursive parralelised divide and conquer sum 65 | @param a :: array of values 66 | @param N :: length of array a 67 | @return the sum of the values in @a 68 | Note:: Error should go like Nlog(N) 69 | */ 70 | double 71 | par_dandc_sum( const double *a , 72 | const size_t N ) ; 73 | 74 | #endif 75 | -------------------------------------------------------------------------------- /src/Utils/GLU_timer.c: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2013-2025 Renwick James Hudspith 3 | 4 | This file (GLU_timer.c) is part of GLU. 5 | 6 | GLU is free software: you can redistribute it and/or modify 7 | it under the terms of the GNU General Public License as published by 8 | the Free Software Foundation, either version 3 of the License, or 9 | (at your option) any later version. 10 | 11 | GLU is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | GNU General Public License for more details. 15 | 16 | You should have received a copy of the GNU General Public License 17 | along with GLU. If not, see . 18 | */ 19 | /** 20 | @file GLU_timer.c 21 | @brief timing functions 22 | */ 23 | #include "Mainfile.h" 24 | 25 | #ifdef HAVE_TIME_H 26 | #include 27 | #endif 28 | 29 | #ifdef HAVE_SYS_TIME_H 30 | #include 31 | #endif 32 | 33 | // functions for the elapsed time of a process 34 | #ifdef HAVE_SYS_TIME_H 35 | 36 | /** 37 | @struct GLUtimer 38 | @brief the timer from sys/time.h 39 | 40 | @var t1 41 | @brief the time in microseconds in double precision 42 | */ 43 | static struct timeval GLUtimer ; 44 | static double t1 ; 45 | 46 | // print to stdout the time elapsed in seconds 47 | double 48 | print_time( void ) 49 | { 50 | gettimeofday( &GLUtimer , NULL ) ; 51 | double diff = GLUtimer.tv_sec + ( GLUtimer.tv_usec/ 1E6 ) - t1 ; 52 | fprintf( stdout , "\n[TIMER] elapsed :: %e s \n", diff ) ; 53 | return diff ; 54 | } 55 | 56 | // start the timer 57 | void 58 | start_timer( void ) 59 | { 60 | gettimeofday( &GLUtimer , NULL ) ; 61 | t1 = GLUtimer.tv_sec + ( GLUtimer.tv_usec / 1E6 ) ; 62 | return ; 63 | } 64 | #else // do nothing 65 | 66 | double 67 | print_time( void ) { return 0.0 ; } 68 | 69 | void 70 | start_timer( void ) { return ; } 71 | 72 | #endif 73 | 74 | // functions for the date 75 | #ifdef HAVE_TIME_H 76 | 77 | // gives us GMT, why? Because I am british 78 | char* 79 | get_date( void ) 80 | { 81 | // Puts a newline at the end of the char! Why? 82 | time_t today = time( NULL ) ; 83 | char *test2 = asctime( gmtime( &today ) ) ; 84 | test2[ strlen( test2 ) - 1 ] = '\0' ; // dirty strip the trailing newline 85 | return test2 ; 86 | } 87 | 88 | #else 89 | 90 | // seems like a reasonable date 91 | char* 92 | get_date( void ) 93 | { 94 | return "Mon Jan 0 00:00:00 1970" ; 95 | } 96 | 97 | #endif 98 | -------------------------------------------------------------------------------- /src/Headers/GLU_malloc.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2013-2025 Renwick James Hudspith 3 | 4 | This file (GLU_malloc.h) is part of GLU. 5 | 6 | GLU is free software: you can redistribute it and/or modify 7 | it under the terms of the GNU General Public License as published by 8 | the Free Software Foundation, either version 3 of the License, or 9 | (at your option) any later version. 10 | 11 | GLU is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | GNU General Public License for more details. 15 | 16 | You should have received a copy of the GNU General Public License 17 | along with GLU. If not, see . 18 | */ 19 | /** 20 | @file GLU_malloc.h 21 | @brief prototype declarations for memory allocations in GLU 22 | */ 23 | #ifndef GLU_MALLOC_H 24 | #define GLU_MALLOC_H 25 | 26 | /** 27 | @fn int GLU_malloc( void **memptr , const size_t alignment , const size_t size ) 28 | @brief memory allocation wrapper 29 | @param memptr :: pointer to memory 30 | @param alignment :: memory offset 31 | @param size :: number of elements in array 32 | */ 33 | int 34 | GLU_malloc( void **memptr , 35 | const size_t alignment , 36 | const size_t size ) ; 37 | 38 | /** 39 | @fn struct site * allocate_lat( void ) 40 | @brief allocate the lattice gauge fields 41 | @return the lattice gauge fields 42 | */ 43 | struct site * 44 | allocate_lat( void ) ; 45 | 46 | /** 47 | @fn struct s_site * allocate_spt_site( const size_t LENGTH1 , const size_t LENGTH2 , const size_t LENGTH3 ) 48 | @brief allocate an spt_site struct lat[LENGTH1].O[LENGTH2][LENGTH3] 49 | @param lat :: the lattice structure 50 | @param LENGTH1 :: the first length 51 | @param LENGTH2 :: the second 52 | @param LENGTH3 :: the third 53 | @return #GLU_SUCCESS or #GLU_FAILURE 54 | */ 55 | struct s_site * 56 | allocate_s_site( const size_t LENGTH1 , 57 | const size_t LENGTH2 , 58 | const size_t LENGTH3 ) ; 59 | 60 | /** 61 | @fn void free_spt_site( struct s_site *lat , const size_t LENGTH1 , const size_t LENGTH2 ) 62 | @brief free the spt_size 63 | */ 64 | void 65 | free_s_site( struct s_site *lat , 66 | const size_t LENGTH1 , 67 | const size_t LENGTH2 ) ; 68 | 69 | /** 70 | @fn void free_lat( struct site *lat ) 71 | @brief free the lattice gauge fields 72 | @param lat :: the lattice gauge fields 73 | */ 74 | void 75 | free_lat( struct site *lat ) ; 76 | 77 | #endif 78 | -------------------------------------------------------------------------------- /src/Headers/trace_abc.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2013-2025 Renwick James Hudspith 3 | 4 | This file (trace_abc.h) is part of GLU. 5 | 6 | GLU is free software: you can redistribute it and/or modify 7 | it under the terms of the GNU General Public License as published by 8 | the Free Software Foundation, either version 3 of the License, or 9 | (at your option) any later version. 10 | 11 | GLU is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | GNU General Public License for more details. 15 | 16 | You should have received a copy of the GNU General Public License 17 | along with GLU. If not, see . 18 | */ 19 | /** 20 | @file trace_abc.h 21 | @brief prototype declarations for the trace of product of 3 matrices 22 | */ 23 | #ifndef GLU_TRACE_ABC_H 24 | #define GLU_TRACE_ABC_H 25 | 26 | /** 27 | @fn double Re_trace_abc_dag_suNC( const GLU_complex a[ NCNC ] , const GLU_complex b[ NCNC ] , const GLU_complex c[ NCNC ] ) 28 | @brief real part of the trace of the product of 3 SU(N) matrices 29 | */ 30 | double 31 | Re_trace_abc_dag_suNC( const GLU_complex a[ NCNC ] , 32 | const GLU_complex b[ NCNC ] , 33 | const GLU_complex c[ NCNC ] ) ; 34 | 35 | /** 36 | @fn void trace_abc( GLU_complex *__restrict tr , const GLU_complex a[ NCNC ] , const GLU_complex b[ NCNC ] , const GLU_complex c[ NCNC ] ) 37 | @brief trace of the product of 3 #NCNC matrices 38 | */ 39 | void 40 | trace_abc( GLU_complex *__restrict tr , 41 | const GLU_complex a[ NCNC ] , 42 | const GLU_complex b[ NCNC ] , 43 | const GLU_complex c[ NCNC ] ) ; 44 | 45 | /** 46 | @fn void trace_abc_dag( GLU_complex *__restrict tr , const GLU_complex a[ NCNC ] , const GLU_complex b[ NCNC ] , const GLU_complex c[ NCNC ] ) 47 | @brief trace of abc where c is daggered 48 | */ 49 | void 50 | trace_abc_dag( GLU_complex *__restrict tr , 51 | const GLU_complex a[ NCNC ] , 52 | const GLU_complex b[ NCNC ] , 53 | const GLU_complex c[ NCNC ] ) ; 54 | 55 | /** 56 | @fn void trace_abc_dag_Re( GLU_real *__restrict tr , const GLU_complex a[ NCNC ] , const GLU_complex b[ NCNC ] , const GLU_complex c[ NCNC ] ) 57 | @brief real part of the trace of abc where c is daggered 58 | */ 59 | void 60 | trace_abc_dag_Re( GLU_real *__restrict tr , 61 | const GLU_complex a[ NCNC ] , 62 | const GLU_complex b[ NCNC ] , 63 | const GLU_complex c[ NCNC ] ) ; 64 | 65 | #endif 66 | -------------------------------------------------------------------------------- /src/Wrappers/CUT_wrap.c: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2013-2025 Renwick James Hudspith 3 | 4 | This file (CUT_wrap.c) is part of GLU. 5 | 6 | GLU is free software: you can redistribute it and/or modify 7 | it under the terms of the GNU General Public License as published by 8 | the Free Software Foundation, either version 3 of the License, or 9 | (at your option) any later version. 10 | 11 | GLU is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | GNU General Public License for more details. 15 | 16 | You should have received a copy of the GNU General Public License 17 | along with GLU. If not, see . 18 | */ 19 | /** 20 | @file CUT_wrap.c 21 | @brief this wraps the momentum cutting routines and what have you. 22 | */ 23 | #include "Mainfile.h" 24 | 25 | #include "3Dcuts.h" // instantaneous spatial and temporal props 26 | #include "config_gluons.h" // configuration space gluon propagators 27 | #include "cuts.h" // alpha_s measurements 28 | #include "GLU_timer.h" // for the timer 29 | #include "POLY.h" // for the static potential 30 | #include "Qsusc.h" // for the topological susceptibility correlator 31 | #include "smearing_param.h" // smeared gluon propagator 32 | 33 | // wrapper for the variousfa momentum-cutting and other measurement options 34 | void 35 | cuts_wrap_struct( struct site *__restrict lat , 36 | const struct cut_info CUTINFO , 37 | const struct sm_info SMINFO ) 38 | { 39 | start_timer( ) ; 40 | 41 | ///////////// CREATE CUTS //////////// 42 | switch( CUTINFO.dir ) { 43 | case INSTANTANEOUS_GLUONS : 44 | cuts_spatial( lat , CUTINFO ) ; 45 | break ; 46 | case CONFIGSPACE_GLUONS : 47 | cuts_struct_configspace( lat , CUTINFO , SMINFO ) ; 48 | break ; 49 | case SMEARED_GLUONS : 50 | cuts_struct_smeared( lat , CUTINFO , SMINFO ) ; 51 | break ; 52 | case STATIC_POTENTIAL : 53 | Coul_staticpot( lat , CUTINFO , SMINFO ) ; 54 | break ; 55 | case TOPOLOGICAL_CORRELATOR : 56 | case TOPOLOGICAL_MOMENTS : 57 | case TOPOLOGICAL_SUSCEPTIBILITY : 58 | compute_Qsusc_step( lat , CUTINFO , SMINFO ) ; 59 | break ; 60 | case GLUON_PROPS : 61 | case EXCEPTIONAL : 62 | case NONEXCEPTIONAL : 63 | case FIELDS : 64 | // all of the other momentum space routines are in here 65 | cuts_struct( lat , CUTINFO ) ; 66 | break ; 67 | default : 68 | return ; 69 | } 70 | 71 | print_time( ) ; 72 | 73 | return ; 74 | } 75 | -------------------------------------------------------------------------------- /src/Headers/CGalloc.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2018 Renwick James Hudspith 3 | 4 | This file (CGalloc.h) is part of GLU. 5 | 6 | GLU is free software: you can redistribute it and/or modify 7 | it under the terms of the GNU General Public License as published by 8 | the Free Software Foundation, either version 3 of the License, or 9 | (at your option) any later version. 10 | 11 | GLU is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | GNU General Public License for more details. 15 | 16 | You should have received a copy of the GNU General Public License 17 | along with GLU. If not, see . 18 | */ 19 | /** 20 | @fn CGalloc.h 21 | @brief prototype declarations for the CG allocations 22 | */ 23 | #ifndef GLU_CGALLOC_H 24 | #define GLU_CGALLOC_H 25 | 26 | /** 27 | @fn int allocate_temp_cg( struct gauges *G , struct CGtemps *CG , const GLU_bool FACG ) 28 | @brief allocate temporaries for Coulomb gauge fixing 29 | @param gauges :: gauge transformation matrices 30 | @param CG :: CG temporaries 31 | @param FACG :: are we using the FACG algorithm? 32 | @return #GLU_SUCCESS or #GLU_FAILURE 33 | */ 34 | int 35 | allocate_temp_cg( struct gauges *G , 36 | struct CGtemps *CG , 37 | const GLU_bool FACG ) ; 38 | 39 | /** 40 | @fn void free_temp_cg( struct gauges G , struct CGtemps CG , const GLU_bool FACG ) 41 | @brief free the temporaries for Coulomb gauge fixing set by allocate_temp_cg() 42 | @param G :: gauge transformation matrices 43 | @param CG :: CG temporaries 44 | @param FACG :: did we use the FACG algorithm? 45 | */ 46 | void 47 | free_temp_cg( struct gauges G , 48 | struct CGtemps CG , 49 | const GLU_bool FACG ) ; 50 | 51 | /** 52 | @fn int allocate_temp_lg( struct CGtemps *CG , const GLU_bool FACG ) 53 | @brief allocate the temporaries for Landau gauge fixing 54 | @param CG :: Conjugate gradient temporaries Landau gauge 55 | @param FACG :: did we use the FACG algorithm? 56 | @return #GLU_SUCCESS or #GLU_FAILURE 57 | */ 58 | int 59 | allocate_temp_lg( struct CGtemps *CG , 60 | const GLU_bool FACG ) ; 61 | 62 | /** 63 | @fn void free_temp_lg( struct CGtemps CG , const GLU_bool FACG ) 64 | @brief free the temporaries allocated by allocate_temp_lg() 65 | @param CG :: allocated conjugate gradient temporaries for Landau gauge 66 | @param FACG :: did we use the FACG algorithm? 67 | */ 68 | void 69 | free_temp_lg( struct CGtemps CG , 70 | const GLU_bool FACG ) ; 71 | 72 | #endif 73 | -------------------------------------------------------------------------------- /src/Headers/triplet_gen.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2013-2025 Renwick James Hudspith 3 | 4 | This file (triplet_gen.h) is part of GLU. 5 | 6 | GLU is free software: you can redistribute it and/or modify 7 | it under the terms of the GNU General Public License as published by 8 | the Free Software Foundation, either version 3 of the License, or 9 | (at your option) any later version. 10 | 11 | GLU is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | GNU General Public License for more details. 15 | 16 | You should have received a copy of the GNU General Public License 17 | along with GLU. If not, see . 18 | */ 19 | /** 20 | @file triplet_gen.h 21 | @brief prototype functions for generating triplets of external momenta for the non-exceptional scheme 22 | @ingroup Cuts 23 | */ 24 | #ifndef GLU_TRIPLET_GEN_H 25 | #define GLU_TRIPLET_GEN_H 26 | 27 | /** 28 | @fn int read_trip( int *__restrict trip , const size_t nnmax ) 29 | @brief read the size of the triplets for each p^2 30 | */ 31 | int 32 | read_trip( int *__restrict trip , 33 | const size_t nnmax ) ; 34 | 35 | /** 36 | @fn int read_triplet_and_proj( int *__restrict *__restrict triplet , double *__restrict *__restrict proj , const int *__restrict *__restrict momentum , const size_t nnmax , const size_t count , const size_t nmom ) 37 | @brief computes the triplet and projector 38 | @param triplet :: is of the form triplet[ triplet_index ][ 0,1,2 ] as there are three of them 39 | @param proj :: projector for obtaining the non-exceptional scalar three point function 40 | @param momentum :: a list of the momentum in integer rep of the form momentum[ index ][ 0,1,2 .. ND ] 41 | @param nnmax :: maximum \f$p^2\f$ 42 | @param count :: the number of all triplets 43 | @param nmom :: the number of momentum after cutting 44 | @warning nnmax must be even 45 | @bug nnmax which is not even breaks this for some reason 46 | 47 |
48 | Either reads/generates a file if "NOT_CONDOR_MODE" is defined, then computes 49 | both the triplet's places in the momentum configuration and the projector 50 | that we are using. 51 |
52 | 53 | @return #GLU_SUCCESS or #GLU_FAILURE 54 | **/ 55 | int 56 | read_triplet_and_proj( int *__restrict *__restrict triplet , 57 | double *__restrict *__restrict proj , 58 | const int *__restrict *__restrict momentum , 59 | const size_t nnmax , 60 | const size_t count , 61 | const size_t nmom ) ; 62 | 63 | #endif 64 | -------------------------------------------------------------------------------- /src/Matrix_Ops/vandermonde.c: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2013-2025 Renwick James Hudspith 3 | 4 | This file (vandermonde.c) is part of GLU. 5 | 6 | GLU is free software: you can redistribute it and/or modify 7 | it under the terms of the GNU General Public License as published by 8 | the Free Software Foundation, either version 3 of the License, or 9 | (at your option) any later version. 10 | 11 | GLU is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | GNU General Public License for more details. 15 | 16 | You should have received a copy of the GNU General Public License 17 | along with GLU. If not, see . 18 | */ 19 | /** 20 | @file vandermonde.c 21 | @brief Iterative solution to the vandermonde system Va=f, which overwrites f with a 22 | */ 23 | #include "Mainfile.h" 24 | 25 | // this code computes the solutions of a Vandermonde system overwritten in c[]// 26 | // where the elements of the matrix are real and the solution f in Va=f are complex -> e^(iq_n)// 27 | void 28 | solvandermonde( double complex f[ NC ] , 29 | const double x[ NC ] ) 30 | { 31 | /// compute the "newton representation" of interpolating polynomial /// 32 | size_t i , k ; 33 | for( k = 0 ; k < NC - 1 ; k++ ) { 34 | for( i = NC - 1 ; i > k ; i-- ) { 35 | f[i] = ( f[i] - f[i-1] ) / ( x[i] - x[i-k-1] ) ; 36 | } 37 | } 38 | /// plug in values for the interpolator /// 39 | for( k = NC - 1 ; k != 0 ; k-- ) { 40 | for(i = k ; i < NC - 1 ; i++ ) { 41 | f[i] = f[i] - ( f[ i + 1 ] * x[k] ) ; 42 | } 43 | } 44 | return; 45 | } 46 | 47 | /* 48 | SOLVES THE SYSTEM 49 | 50 | | 1 q0 q0^2 ... q0^n | | f0 | | e^{iq0} | 51 | | 1 q1 q1^2 ... q1^n | | f1 | | e^{iq1} | 52 | | . . . ... . | | . | = | . | 53 | | . . . ... . | | . | = | . | 54 | | . . . ... . | | . | | . | 55 | | 1 qn qn^2 ... qn^n | | fn | | e^{iqn} | 56 | 57 | Where fn is expected to be e^{iqn} when this function is called 58 | */ 59 | void 60 | solvandermonde_new( const double q[ NC ] , 61 | double complex f[ NC ] ) 62 | { 63 | /// compute the "newton representation" of interpolating polynomial /// 64 | size_t i , k ; 65 | for( k = 0 ; k < NC - 1 ; k++ ) { 66 | for( i = NC - 1 ; i > k ; i-- ) { 67 | f[i] = ( f[i] - f[i-1] ) / ( q[i] - q[i-k-1] ) ; 68 | } 69 | } 70 | /// plug in values for the interpolator /// 71 | for( k = NC - 1 ; k != 0 ; k-- ) { 72 | for(i = k ; i < NC - 1 ; i++ ) { 73 | f[ i ] -= ( f[ i + 1 ] * q[k] ) ; 74 | } 75 | } 76 | return; 77 | } 78 | -------------------------------------------------------------------------------- /src/Matrix_Ops/MMUL/MMULdag.c: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2013-2018 Renwick James Hudspith 3 | 4 | This file (MMULdag.c) is part of GLU. 5 | 6 | GLU is free software: you can redistribute it and/or modify 7 | it under the terms of the GNU General Public License as published by 8 | the Free Software Foundation, either version 3 of the License, or 9 | (at your option) any later version. 10 | 11 | GLU is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | GNU General Public License for more details. 15 | 16 | You should have received a copy of the GNU General Public License 17 | along with GLU. If not, see . 18 | */ 19 | /** 20 | @file MMULdag.c 21 | @brief computes \f$ a = b^{\dagger}\times c \f$ 22 | */ 23 | #include "Mainfile.h" 24 | 25 | #if !( defined HAVE_IMMINTRIN_H ) || ( defined SINGLE_PREC ) 26 | 27 | #ifndef multabdag 28 | // 3x3 mult a=b^{\dagger}.c// 29 | void 30 | multabdag( GLU_complex a[ NCNC ] , 31 | const GLU_complex b[ NCNC ] , 32 | const GLU_complex c[ NCNC ] ) 33 | { 34 | #if NC==3 35 | a[0] = conj( b[0] ) * c[0] + conj( b[3] ) * c[3] + conj( b[6] ) * c[6] ; \ 36 | a[1] = conj( b[0] ) * c[1] + conj( b[3] ) * c[4] + conj( b[6] ) * c[7] ; \ 37 | a[2] = conj( b[0] ) * c[2] + conj( b[3] ) * c[5] + conj( b[6] ) * c[8] ; \ 38 | a[3] = conj( b[1] ) * c[0] + conj( b[4] ) * c[3] + conj( b[7] ) * c[6] ; \ 39 | a[4] = conj( b[1] ) * c[1] + conj( b[4] ) * c[4] + conj( b[7] ) * c[7] ; \ 40 | a[5] = conj( b[1] ) * c[2] + conj( b[4] ) * c[5] + conj( b[7] ) * c[8] ; \ 41 | a[6] = conj( b[2] ) * c[0] + conj( b[5] ) * c[3] + conj( b[8] ) * c[6] ; \ 42 | a[7] = conj( b[2] ) * c[1] + conj( b[5] ) * c[4] + conj( b[8] ) * c[7] ; \ 43 | a[8] = conj( b[2] ) * c[2] + conj( b[5] ) * c[5] + conj( b[8] ) * c[8] ; 44 | #elif NC==2 45 | a[0] = conj( b[0] ) * c[0] + conj( b[2] ) * c[2] ; \ 46 | a[1] = conj( b[0] ) * c[1] + conj( b[2] ) * c[3] ; \ 47 | a[2] = conj( b[1] ) * c[0] + conj( b[3] ) * c[2] ; \ 48 | a[3] = conj( b[1] ) * c[1] + conj( b[3] ) * c[3] ; 49 | #else 50 | size_t i , j , m ; 51 | register GLU_complex sum ; 52 | register GLU_real REB , IMB , REC , IMC ; 53 | for( i = 0 ; i < NC ; i++ ) { 54 | for( j = 0 ; j < NC ; j++ ) { 55 | sum = 0.0 ; 56 | for( m = 0 ; m < NC ; m++ ) { 57 | REB = creal( b[ i + NC*m ] ) ; IMB = cimag( b[ i + NC*m ] ) ; 58 | REC = creal( c[ j + NC*m ] ) ; IMC = cimag( c[ j + NC*m ] ) ; 59 | sum += REB * REC + IMB * IMC + I * ( REB * IMC - IMB * REC ) ; 60 | } 61 | a[ j + NC*i ] = sum ; 62 | } 63 | } 64 | #endif 65 | return ; 66 | } 67 | #endif // !defined multabdag 68 | 69 | #endif // immintrin.h 70 | -------------------------------------------------------------------------------- /src/Headers/taylor_logs.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2013-2025 Renwick James Hudspith 3 | 4 | This file (taylor_logs.h) is part of GLU. 5 | 6 | GLU is free software: you can redistribute it and/or modify 7 | it under the terms of the GNU General Public License as published by 8 | the Free Software Foundation, either version 3 of the License, or 9 | (at your option) any later version. 10 | 11 | GLU is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | GNU General Public License for more details. 15 | 16 | You should have received a copy of the GNU General Public License 17 | along with GLU. If not, see . 18 | */ 19 | /** 20 | @file taylor_logs.h 21 | @brief Taylor series approximations to the logarithm of an SU(#NC) matrix. 22 | */ 23 | #ifndef GLU_TAYLOR_LOGS_H 24 | #define GLU_TAYLOR_LOGS_H 25 | 26 | /** 27 | @fn int asinh_log( GLU_complex *__restrict Q , const GLU_complex *__restrict U ) 28 | @brief computes the logarithm of a Unitary matrix 29 | @param Q :: the logarithm of U 30 | @param U :: Unitary or special unitary matrix 31 | 32 | The series of asinh goes as 33 | 34 | asinh(x) = x*( 1 - x^2/6 + 3x^4/40 .... ) 35 | 36 | I use a [5,5] pade approximation of the bracketed series 37 | 38 | asinh(x) = x*( 1 + ( -x^2/6 + ... ) / ( 1 + ... ) ) 39 | 40 | Here, we use x = ( U - U^{\dagger} ) / 2 41 | 42 | @return #GLU_FAILURE or #GLU_SUCCESS 43 | */ 44 | int 45 | asinh_log( GLU_complex *__restrict Q , 46 | const GLU_complex *__restrict U ) ; 47 | 48 | /** 49 | @fn int brute_force_log( GLU_complex *Q , const GLU_complex *U , const size_t NROOTS ) ; 50 | @brief computes the logarithm of a matrix using accelerated Taylor series approximations 51 | @param Q :: the principal logarithm of Q 52 | @param U :: the matrix having its log taken 53 | @param NROOTS :: the number of nested roots we use for convergence 54 | This code is as near as possible generic for any matrix arguments. As it is 55 | based on series expansions it is dreadfully slow, but it is useful. 56 | @return #GLU_FAILURE or #GLU_SUCCESS 57 | */ 58 | int 59 | brute_force_log( GLU_complex *Q , 60 | const GLU_complex *U , 61 | const size_t NROOTS ) ; 62 | 63 | /** 64 | @fn free_taylors( void ) 65 | @brief frees the Taylor expansion coefficients for the log 66 | */ 67 | void 68 | free_taylors( void ) ; 69 | 70 | /** 71 | @fn void nape_reunit( GLU_complex *__restrict U ) 72 | @brief reunitarizes a matrix to SU(N) using the n-APE projection 73 | @param U :: matrix being reunitarised 74 | */ 75 | void 76 | nape_reunit( GLU_complex *__restrict U ) ; 77 | 78 | 79 | #endif 80 | -------------------------------------------------------------------------------- /src/Headers/plan_ffts.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2013-2025 Renwick James Hudspith 3 | 4 | This file (plan_ffts.h) is part of GLU. 5 | 6 | GLU is free software: you can redistribute it and/or modify 7 | it under the terms of the GNU General Public License as published by 8 | the Free Software Foundation, either version 3 of the License, or 9 | (at your option) any later version. 10 | 11 | GLU is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | GNU General Public License for more details. 15 | 16 | You should have received a copy of the GNU General Public License 17 | along with GLU. If not, see . 18 | */ 19 | /** 20 | @file plan_ffts.h 21 | @brief prototype function wrappers for the ffts used 22 | */ 23 | #ifndef GLU_PLAN_FFTS_H 24 | #define GLU_PLAN_FFTS_H 25 | 26 | #ifdef HAVE_FFTW3_H 27 | 28 | /** 29 | @fn void clean_up_fftw( struct fftw_stuff FFTW , const size_t ARR_SIZE ) 30 | @brief memory deallocations for fftw_stuff struct allocated in create_plans_DFT() 31 | @param FFTW :: collection of temporary arrays 32 | @param ARR_SIZE :: corresponds to ARR_SIZE in create_plans_DFT 33 | */ 34 | void 35 | clean_up_fftw( struct fftw_stuff FFTW , 36 | const size_t ARR_SIZE ) ; 37 | 38 | /** 39 | @fn void create_plans_DFT( struct fftw_stuff *FFTW , const size_t dims[ ND ] , const int ARR_SIZE , const size_t DIR ) 40 | @brief create the plans and allocate arrays for the DFT 41 | @param FFTW :: temporary arrays 42 | @param dims :: dimensions of the fft 43 | @param ARR_SIZE :: first index length of FFTW.**in and FFTW.**out 44 | @param DIR :: number of dimensions of the FFT, need not be #ND 45 | */ 46 | void 47 | create_plans_DFT( struct fftw_stuff *FFTW , 48 | const size_t dims[ ND ] , 49 | const size_t ARR_SIZE , 50 | const size_t DIR ) ; 51 | 52 | /** 53 | @fn void small_clean_up_fftw( struct fftw_small_stuff FFTW ) 54 | @brief deallocate memory and free plans created by small_create_plans_DFT() 55 | @param FFTW :: temporary array allocations 56 | */ 57 | void 58 | small_clean_up_fftw( struct fftw_small_stuff FFTW ) ; 59 | 60 | /** 61 | @fn void small_create_plans_DFT( struct fftw_small_stuff *FFTW , const size_t dims[ ND ] , const size_t DIR ) 62 | @brief create plans and allocate arrays of FFTW.*in etc 63 | @param FFTW :: temporary fft arrays 64 | @param dims :: dimensions of the FFT in GLU order 65 | @param DIR :: dimensionality of the FFT, need not be #ND 66 | */ 67 | void 68 | small_create_plans_DFT( struct fftw_small_stuff *FFTW , 69 | const size_t dims[ ND ] , 70 | const size_t DIR ) ; 71 | 72 | #endif // HAVE_FFTW_H 73 | #endif 74 | -------------------------------------------------------------------------------- /src/Headers/staples.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2013-2025 Renwick James Hudspith 3 | 4 | This file (staples.h) is part of GLU. 5 | 6 | GLU is free software: you can redistribute it and/or modify 7 | it under the terms of the GNU General Public License as published by 8 | the Free Software Foundation, either version 3 of the License, or 9 | (at your option) any later version. 10 | 11 | GLU is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | GNU General Public License for more details. 15 | 16 | You should have received a copy of the GNU General Public License 17 | along with GLU. If not, see . 18 | */ 19 | /** 20 | @file staples.h 21 | @brief prototype declarations for staple calculations 22 | */ 23 | #ifndef GLU_STAPLES_H 24 | #define GLU_STAPLES_H 25 | 26 | /** 27 | @fn void all_staples( GLU_complex stap[ NCNC ] , const struct site *__restrict lat , const size_t i , const size_t mu , const size_t dir , const smearing types type ) 28 | @brief the computation of the basic unimproved staple. 29 | @param stap :: sum of the contributing mu-nu staples 30 | @param lat :: lattice gauge field 31 | @param i :: site index 32 | @param mu :: direction of the link we are improving 33 | @param dir :: number of directions we smear in 34 | @param type :: smearing projection type 35 | **/ 36 | void 37 | all_staples( GLU_complex stap[ NCNC ] , 38 | const struct site *__restrict lat , 39 | const size_t i , 40 | const size_t mu , 41 | const size_t dir , 42 | const smearing_types type ) ; 43 | 44 | /** 45 | @fn void all_staples_improve( GLU_complex stap[ NCNC ] , const struct site *__restrict lat , const size_t i , const size_t mu , const size_t dir , const size_t type ) 46 | @brief he computation of the (over)improved staple(s) 47 | @param stap :: sum of the contributing mu-nu staples 48 | @param lat :: lattice gauge field 49 | @param i :: site index 50 | @param mu :: direction of the link we are improving 51 | @param dir :: number of directions we smear in 52 | @param type :: smearing projection type 53 | 54 | for the improvement strategies
55 | > SYMANZIK = Tree level Symanzik improvement
56 | > IWASAKI/DBW2 = Change in the coefficients c0 and c1
57 | > SYMANZIK_ONE_LOOP = Tadpole improved action
58 | 59 | @warning requires the #IMPROVED_SMEARING definition to be compiled in 60 | **/ 61 | void 62 | all_staples_improve( GLU_complex stap[ NCNC ] , 63 | const struct site *__restrict lat , 64 | const size_t i , 65 | const size_t mu , 66 | const size_t dir , 67 | const size_t type ) ; 68 | 69 | #endif 70 | -------------------------------------------------------------------------------- /README: -------------------------------------------------------------------------------- 1 | Overview and dependencies 2 | ------------------------- 3 | 4 | GLU is a thread-parallel NC and ND generic gluonic observable code 5 | for lattice field theory calculations. 6 | 7 | It does not generate configurations or compute Fermionic quantities. 8 | 9 | It does do gauge fixing, smearing, gluon propagators ... 10 | 11 | More on my --enable flags 12 | ------------------------- 13 | 14 | ./configure --help is probably your friend here 15 | 16 | I have a handful of flags that one can enable at configure time. 17 | 18 | 1) --enable-fastsmear 19 | 20 | This throws caution to the wind, and for STOUT and LOG dramatically speeds 21 | up the time taken to smear gauge fields. For the STOUT case and approximate 22 | set of Taylor expansions to the smooth functions in Morningside and Peardon's 23 | paper are used. For the LOG a general Vandermonde solver is used to calculate 24 | the f-constants used. Both of these work OK. 25 | 26 | 3) --enable-notcondor 27 | 28 | This enable turns on the saving of FFTW's planned DFTs giving decent speed-up, 29 | this can be quite useful but is heavily architecture dependent. Do not turn this 30 | on and then try and run the binary on different machines as it is detrimental. 31 | I think this also turns on the saving of (p,-p) doublets for the generation of 32 | the A_{\mu}(p) (Gluonic fields in momentum space), in cuts.c. 33 | 34 | Some little extras 35 | ------------------ 36 | 37 | The makefile compiles the shared library, and then creates the binary "GLU" 38 | from this in the ${Path to installation}/bin/ directory. 39 | 40 | This needs to be run with 41 | 42 | ./GLU -i input_file -c NERSC_config_file *{-o NERSC_output_file} 43 | 44 | *is optional 45 | 46 | The most up to date versioning of the input_file as well as a couple of test 47 | configs are to be found in ./CONF/. 48 | 49 | Otherwise, what this code could be considered quite useful for is its extension 50 | to some of the library UKhadron. If you are linking this then good luck, I have 51 | written around bits to accomadate this library but who knows what creative 52 | ways people will find to crush my spirits. 53 | 54 | GLU help 55 | -------- 56 | 57 | You can access help on the iput file for the binary GLU with the command, 58 | 59 | ./GLU --help 60 | 61 | Will bring up the possible options 62 | 63 | ./GLU --help={options} 64 | 65 | Then provides some information on what the options in the input file do 66 | 67 | GLU's input file 68 | ----------------- 69 | 70 | If you run 71 | 72 | ./GLU --autoin={options} 73 | 74 | It will print to stdout a readable version of the input file. Again, 75 | 76 | ./GLU --help 77 | 78 | will provide a list of the available options for the code. 79 | 80 | 81 | CONTACTS 82 | -------- 83 | 84 | This library was written by Renwick James Hudspith (Jamie). You can contact him 85 | at renwick.james.hudspith@gmail.com, he will probably not enjoy this experience. -------------------------------------------------------------------------------- /src/Headers/BGQ_mmuldagdag.h: -------------------------------------------------------------------------------- 1 | /** 2 | @file BGQ_mmuldagdag.h 3 | @brief inline dagger-dagger matrix multiply 4 | */ 5 | #ifndef BGQ_MMULDAGDAG_H 6 | #define BGQ_MMULDAGDAG_H 7 | 8 | #if NC==3 9 | #define multab_dagdag( a , b , c ) \ 10 | a[0] = conj( b[0] ) * conj( c[0] ) + conj( b[3] ) * conj( c[1] ) + conj( b[6] ) * conj( c[2] ) ; \ 11 | a[1] = conj( b[0] ) * conj( c[3] ) + conj( b[3] ) * conj( c[4] ) + conj( b[6] ) * conj( c[5] ) ; \ 12 | a[2] = conj( b[0] ) * conj( c[6] ) + conj( b[3] ) * conj( c[7] ) + conj( b[6] ) * conj( c[8] ) ; \ 13 | a[3] = conj( b[1] ) * conj( c[0] ) + conj( b[4] ) * conj( c[1] ) + conj( b[7] ) * conj( c[2] ) ; \ 14 | a[4] = conj( b[1] ) * conj( c[3] ) + conj( b[4] ) * conj( c[4] ) + conj( b[7] ) * conj( c[5] ) ; \ 15 | a[5] = conj( b[1] ) * conj( c[6] ) + conj( b[4] ) * conj( c[7] ) + conj( b[7] ) * conj( c[8] ) ; \ 16 | a[6] = conj( b[2] ) * conj( c[0] ) + conj( b[5] ) * conj( c[1] ) + conj( b[8] ) * conj( c[2] ) ; \ 17 | a[7] = conj( b[2] ) * conj( c[3] ) + conj( b[5] ) * conj( c[4] ) + conj( b[8] ) * conj( c[5] ) ; \ 18 | a[8] = conj( b[2] ) * conj( c[6] ) + conj( b[5] ) * conj( c[7] ) + conj( b[8] ) * conj( c[8] ) ; 19 | #elif NC==2 20 | #define multab_dagdag( a , b , c ) \ 21 | a[0] = conj( b[0] ) * conj( c[0] ) + conj( b[2] ) * conj( c[1] ) ; \ 22 | a[1] = conj( b[0] ) * conj( c[2] ) + conj( b[2] ) * conj( c[3] ) ; \ 23 | a[2] = conj( b[1] ) * conj( c[0] ) + conj( b[3] ) * conj( c[1] ) ; \ 24 | a[3] = conj( b[1] ) * conj( c[2] ) + conj( b[3] ) * conj( c[3] ) ; 25 | #else 26 | void 27 | multab_dagdag( GLU_complex a[ NCNC ] , 28 | const GLU_complex b[ NCNC ] , 29 | const GLU_complex c[ NCNC ] ) ; 30 | #endif 31 | 32 | // SUNC variants 33 | #if NC==3 34 | #define multab_dagdag_suNC( a , b , c ) \ 35 | a[0] = conj( b[0] ) * conj( c[0] ) + conj( b[3] ) * conj( c[1] ) + conj( b[6] ) * conj( c[2] ) ; \ 36 | a[1] = conj( b[0] ) * conj( c[3] ) + conj( b[3] ) * conj( c[4] ) + conj( b[6] ) * conj( c[5] ) ; \ 37 | a[2] = conj( b[0] ) * conj( c[6] ) + conj( b[3] ) * conj( c[7] ) + conj( b[6] ) * conj( c[8] ) ; \ 38 | a[3] = conj( b[1] ) * conj( c[0] ) + conj( b[4] ) * conj( c[1] ) + conj( b[7] ) * conj( c[2] ) ; \ 39 | a[4] = conj( b[1] ) * conj( c[3] ) + conj( b[4] ) * conj( c[4] ) + conj( b[7] ) * conj( c[5] ) ; \ 40 | a[5] = conj( b[1] ) * conj( c[6] ) + conj( b[4] ) * conj( c[7] ) + conj( b[7] ) * conj( c[8] ) ; \ 41 | a[6] = conj( a[1] * a[5] - a[2] * a[4] ) ; \ 42 | a[7] = conj( a[2] * a[3] - a[0] * a[5] ) ; \ 43 | a[8] = conj( a[0] * a[4] - a[1] * a[3] ) ; 44 | #elif NC==2 45 | #define multab_dagdag_suNC( a , b , c ) \ 46 | a[0] = conj( b[0] ) * conj( c[0] ) + conj( b[2] ) * conj( c[1] ) ; \ 47 | a[1] = conj( b[0] ) * conj( c[2] ) + conj( b[2] ) * conj( c[3] ) ; \ 48 | a[2] = -conj( a[1] ) ; \ 49 | a[3] = conj( a[0] ) ; 50 | #else 51 | #define multab_dagdag_suNC multab_dagdag 52 | #endif 53 | 54 | #endif 55 | -------------------------------------------------------------------------------- /docs/SUNxU1_info.tex: -------------------------------------------------------------------------------- 1 | \documentclass[12pt]{article} 2 | 3 | \usepackage[english]{babel} 4 | \usepackage{times} 5 | \usepackage[T1]{fontenc} 6 | \usepackage{blindtext} 7 | \usepackage{mathptmx} 8 | \usepackage{amsmath,mathtools,amsfonts} 9 | 10 | % the following commands control the margins: 11 | \topmargin=-1in % Make letterhead start about 1 inch from top of page 12 | \textheight=20cm % text height can be bigger for a longer letter 13 | \oddsidemargin=0pt % leftmargin is 1 inch 14 | \textwidth=6.5in % textwidth of 6.5in leaves 1 inch for right margin 15 | \usepackage{hyperref} 16 | 17 | \begin{document} 18 | 19 | Hi, this short document discusses the computation of $SU(NC)\times U(1)$ configurations, where the U(1) is quenched, i.e. No dynamical fermion loops within travelling photons. 20 | 21 | This option is turned on by the option in the input file, 22 | \begin{verbatim} 23 | MODE = SUNxU1 24 | \end{verbatim} 25 | 26 | \section{What the code does} 27 | 28 | The code computes a non-compact Gaussian-distributed Feynmann-gauge U(1) configuration by Fourier transform. It does so by having the complex-valued momentum space configurations gaussian distributed with $P,-P$ symmetry. It divides the fields by $\frac{1}{\sqrt{\beta}}\sqrt{p_\mu p_\mu}$ and Fourier transforms them to configuration space. 29 | 30 | The coupling $\beta$ is related to the coupling value $\alpha$ by, 31 | \begin{equation} 32 | \beta = \frac{1}{(ND)\pi \alpha} 33 | \end{equation} 34 | The value $\alpha$ is set in the input file with the flag, 35 | \begin{verbatim} 36 | U1_ALPHA = {} 37 | \end{verbatim} 38 | 39 | You can also change the charge of the U(1) field ``e''. Set in the input file with, 40 | \begin{verbatim} 41 | U1_CHARGE = {} 42 | \end{verbatim} 43 | 44 | What we end up with is, 45 | \begin{equation} 46 | U_\mu(x) = e^{ie\frac{1}{\sqrt{\beta}}A_\mu(x)} 47 | \end{equation} 48 | Where $A_\mu(x)$ is the non compact field. 49 | 50 | We must then compactify the (Real) non-compact gauge-fixed fields to U(1) by exponentiation. We then multiply each polarisation of SU(NC) gauge field with the compact U(1) field. This overwrites the SU(NC) gauge field, and it is no-longer SU(NC) but rather U(NC). 51 | 52 | \subsection{Measurements} 53 | 54 | The U(1) field measurements are set in the input file by the tag, 55 | \begin{verbatim} 56 | U1_MEAS = {U1_PLAQUETTE,U1_RECTANGLE,U1_TOPOLOGICAL} 57 | \end{verbatim} 58 | The measurement \verb\U1_PLAQUETTE\ is the default behaviour and measures the non compact plaquette and the compact plaquette. The rectangle measurement computes the 2x1 compact rectangle coefficient. And \verb\U1_TOPOLOGICAL\ computes some weird stuff like the number of windings of the noncompact field. 59 | 60 | \textbf{Warning} 61 | 62 | I imagine you will want to write the fields to some output file. That's cool. The SU(NC)xU(1) fields are Unitary, not special unitary. The only available NERSC output type is the \verb\NCxNC\ type (\verb|SCIDAC|, \verb|ILDG_SCIDAC|, \verb|ILDG_BQCDZ, \verb|HIREP| and \verb|MILC| save the whole matrix). The code uses will change to the applicable NERSC variant automatically. 63 | 64 | \end{document} 65 | -------------------------------------------------------------------------------- /src/Geometry/init.c: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2013-2017 Renwick James Hudspith 3 | 4 | This file (init.c) is part of GLU. 5 | 6 | GLU is free software: you can redistribute it and/or modify 7 | it under the terms of the GNU General Public License as published by 8 | the Free Software Foundation, either version 3 of the License, or 9 | (at your option) any later version. 10 | 11 | GLU is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | GNU General Public License for more details. 15 | 16 | You should have received a copy of the GNU General Public License 17 | along with GLU. If not, see . 18 | */ 19 | /** 20 | @file init.c 21 | @brief initialise the lattice 22 | */ 23 | #include "Mainfile.h" 24 | 25 | #include "geometry.h" // init_navig() 26 | #include "SU2_rotate.h" // compute_pertinent_indices 27 | 28 | // initialises the navigation for our lattice fields 29 | void 30 | init_navig( struct site *__restrict lat ) 31 | { 32 | size_t i ; 33 | #pragma omp parallel for private(i) 34 | for( i = 0 ; i < LVOLUME ; i++ ) { 35 | size_t mu ; 36 | for( mu = 0 ; mu < ND ; mu++ ) { 37 | lat[i].neighbor[mu] = gen_shift( i , mu ) ; 38 | lat[i].back[mu] = gen_shift( i , -mu - 1 ) ; 39 | } 40 | } 41 | return ; 42 | } 43 | 44 | // initialise the lattice information stored in Latt 45 | void 46 | init_latt( void ) 47 | { 48 | // tell us our gauge group 49 | fprintf( stdout , "[INIT] GLU is Compiled for SU(%d)\n" , NC ) ; 50 | // these are neccessary for geometry and stuff :: x,y,z,t geometry 51 | size_t mu ; 52 | fprintf( stdout , "\n[DIMENSIONS] ( %zu x" , Latt.dims[0] ) ; 53 | #if ND == 2 54 | Latt.Lcu = Latt.dims[0] ; 55 | Latt.Volume = Latt.Lcu * Latt.dims[1] ; 56 | fprintf( stdout , " %zu )\n\n" , Latt.dims[1] ) ; 57 | #else 58 | Latt.Lsq = Latt.dims[0] ; // defined :: LSQ 59 | for( mu = 1 ; mu < ND-2 ; mu++ ) { 60 | fprintf( stdout , " %zu x" , Latt.dims[ mu ] ) ; 61 | Latt.Lsq *= Latt.dims[mu] ; 62 | } 63 | Latt.Lcu = Latt.Lsq * Latt.dims[ ND - 2 ] ; // defined :: LCU 64 | Latt.Volume = Latt.Lcu * Latt.dims[ ND - 1 ] ; // defined :: LVOLUME 65 | fprintf( stdout , " %zu x %zu )\n\n" , Latt.dims[mu] , Latt.dims[ mu+1 ] ) ; 66 | #endif 67 | // precompute the twiddle factors 68 | for( mu = 0 ; mu < ND ; mu++ ) { 69 | Latt.twiddles[ mu ] = TWOPI / (double)Latt.dims[ mu ] ; 70 | } 71 | // set the global number of threads we will use 72 | #if (defined _OPENMP ) && (defined HAVE_OMP_H) 73 | #pragma omp parallel 74 | { Latt.Nthreads = omp_get_num_threads( ) ; } 75 | #else 76 | Latt.Nthreads = 1 ; 77 | #endif 78 | fprintf( stdout , "[INIT] using %u thread(s) \n" , Latt.Nthreads ) ; 79 | // compute su2 indices 80 | fprintf( stdout , "[INIT] allocating su(2) subgroup indices\n" ) ; 81 | compute_pertinent_indices() ; 82 | return ; 83 | } 84 | 85 | // free anything allocated in the latt struct 86 | void 87 | free_latt( void ) 88 | { 89 | free( Latt.su2_data ) ; 90 | } 91 | -------------------------------------------------------------------------------- /src/Run/Mainfile.c: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2013-2025 Renwick James Hudspith 3 | 4 | This file (Mainfile.c) is part of GLU. 5 | 6 | GLU is free software: you can redistribute it and/or modify 7 | it under the terms of the GNU General Public License as published by 8 | the Free Software Foundation, either version 3 of the License, or 9 | (at your option) any later version. 10 | 11 | GLU is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | GNU General Public License for more details. 15 | 16 | You should have received a copy of the GNU General Public License 17 | along with GLU. If not, see . 18 | */ 19 | /** 20 | @file Mainfile.c 21 | @brief the driver for the rest of the code 22 | */ 23 | #include "Mainfile.h" 24 | 25 | #include "GLUlib_wrap.h" // wrappers for general code functionality 26 | #include "input_help.h" // help about the input file 27 | #include "input_reader.h" // reading the input file 28 | 29 | // Lattice geometry is an important global, used everywhere 30 | struct latt_info Latt ; 31 | 32 | // main file 33 | int 34 | main( const int argc , 35 | const char *argv[] ) 36 | { 37 | // for the input file help 38 | if( argc == 2 ) { 39 | return GLU_helps_those_who_help_themselves( argv[1] ) ; 40 | } 41 | 42 | // bit of control here 43 | if( argc < READ || !(argc%2) ) { return GLUsage() ; } 44 | 45 | // set this 46 | Latt.argc = argc ; 47 | 48 | // initialise GLU, its so sticky 49 | attach_GLU( ) ; 50 | 51 | // parse the input file into a nice big struct 52 | struct infile_data infile_struct ; 53 | if( get_input_data( &infile_struct , argv[ INPUT_FILE ] ) == GLU_FAILURE ) { 54 | fprintf( stderr , "[INPUT] error reading input file %s\n" , 55 | argv[ INPUT_FILE ] ) ; 56 | return GLU_FAILURE ; 57 | } 58 | 59 | // and make the input data constant 60 | const struct infile_data INFILE = infile_struct ; 61 | 62 | // and the options 63 | switch( INFILE.mode ) { 64 | case MODE_GF : 65 | read_and_fix( argv[ READ ] , INFILE.rtrans , INFILE.GFINFO , 66 | argv[ WRITE ] , INFILE.storage , INFILE.output_details ) ; 67 | break ; 68 | case MODE_CUTS : 69 | read_and_cut( argv[ READ ] , INFILE.CUTINFO , INFILE.SMINFO ) ; 70 | break ; 71 | case MODE_SMEARING : 72 | read_and_smear( argv[ READ ] , INFILE.rtrans , INFILE.SMINFO , 73 | argv[ WRITE ] , INFILE.storage , INFILE.output_details ) ; 74 | break ; 75 | case MODE_CROSS_U1 : 76 | read_and_U1( argv[ READ ] , INFILE.rtrans , INFILE.U1INFO , 77 | argv[ WRITE ] , INFILE.storage , INFILE.output_details ) ; 78 | break ; 79 | case MODE_HEATBATH : 80 | heatbath( argv[ READ ] , INFILE.HBINFO , INFILE.storage , 81 | INFILE.output_details ) ; 82 | break ; 83 | default : 84 | read_and_check( argv[ READ ] , INFILE.rtrans , argv[ WRITE ] , 85 | INFILE.storage , INFILE.output_details ) ; 86 | break ; 87 | } 88 | 89 | // un-initialise GLU 90 | unstick_GLU( ) ; 91 | 92 | return GLU_SUCCESS ; 93 | } 94 | -------------------------------------------------------------------------------- /src/Utils/GLU_sums.c: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2013-2017 Renwick James Hudspith 3 | 4 | This file (GLU_sums.c) is part of GLU. 5 | 6 | GLU is free software: you can redistribute it and/or modify 7 | it under the terms of the GNU General Public License as published by 8 | the Free Software Foundation, either version 3 of the License, or 9 | (at your option) any later version. 10 | 11 | GLU is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | GNU General Public License for more details. 15 | 16 | You should have received a copy of the GNU General Public License 17 | along with GLU. If not, see . 18 | */ 19 | /** 20 | @file GLU_sums.c 21 | @brief round-off resistant summations and averages 22 | */ 23 | #include 24 | 25 | #ifdef HAVE_OMP_H 26 | #include 27 | #endif 28 | 29 | // divide and conquer summation 30 | double 31 | dandc_sum( const double *a , 32 | const size_t lo , 33 | const size_t hi ) 34 | { 35 | return ( hi - lo ) < 2 ? a[lo] : \ 36 | dandc_sum( a , lo , (hi+lo)/2 ) +\ 37 | dandc_sum( a , (hi+lo)/2 , hi ) ; 38 | } 39 | 40 | // kahan summation 41 | double 42 | kahan_summation( const double *a , 43 | const size_t LENGTH ) 44 | { 45 | size_t i ; 46 | register double sum = 0.0 , c = 0.0 , y , t ; 47 | for( i = 0 ; i < LENGTH ; i++ ) { 48 | y = a[i] - c ; 49 | t = sum + y ; 50 | c = ( t - sum ) - y ; 51 | sum = t ; 52 | } 53 | return sum ; 54 | } 55 | 56 | // numerically more friendly average? 57 | double 58 | knuth_average( const double *a , 59 | const size_t LENGTH ) 60 | { 61 | size_t i ; 62 | register double ave = 0.0 ; 63 | for( i = 0 ; i < LENGTH ; i++ ) { 64 | ave += ( a[i] - ave ) / ( 1.0 + i ) ; 65 | } 66 | return ave ; 67 | } 68 | 69 | // computes the variance as well as the average 70 | void 71 | knuth_average_err( double *ave , 72 | double *err , 73 | const double *data , 74 | const size_t N ) 75 | { 76 | size_t i ; 77 | *err = *ave = 0.0 ; 78 | for( i = 0 ; i < N ; i++ ) { 79 | const double delta = data[i] - *ave ; 80 | *ave += delta / ( i + 1.0 ) ; 81 | *err += delta * ( data[i] - *ave ) ; 82 | } 83 | *err /= ( N - 1 ) ; 84 | return ; 85 | } 86 | 87 | // parallel divide and conquer sum 88 | #ifdef HAVE_OMP_H 89 | double 90 | par_danc_sum( const double *a , 91 | const size_t N ) 92 | { 93 | size_t i , Nth = 1 ; 94 | // open a parallel environment to get number of threads 95 | #pragma omp parallel 96 | { 97 | Nth = omp_get_num_threads() ; 98 | } 99 | const size_t split = ( N + Nth - 1 ) / Nth ; 100 | register double sum = 0 ; 101 | // anything less than the division goes to the last thread 102 | #pragma omp parallel for private(i) reduction(+:sum) 103 | for( i = 0 ; i < Nth ; i++ ) { 104 | sum = sum + (double)dandc_sum( a , i * split , 105 | (i+1)*split> N ? N : (i+1)*split ) ; 106 | } 107 | return sum ; 108 | } 109 | #endif 110 | -------------------------------------------------------------------------------- /src/Headers/effs.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2013-2025 Renwick James Hudspith 3 | 4 | This file (effs.h) is part of GLU. 5 | 6 | GLU is free software: you can redistribute it and/or modify 7 | it under the terms of the GNU General Public License as published by 8 | the Free Software Foundation, either version 3 of the License, or 9 | (at your option) any later version. 10 | 11 | GLU is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | GNU General Public License for more details. 15 | 16 | You should have received a copy of the GNU General Public License 17 | along with GLU. If not, see . 18 | */ 19 | /** 20 | @file effs.h 21 | @brief Function definitions for the exact exponentiation of lie fields 22 | */ 23 | #ifndef GLU_EFFS_H 24 | #define GLU_EFFS_H 25 | 26 | /** 27 | @fn void calculate_effs_VDM_herm( double complex *__restrict f , const double *__restrict z ) 28 | @brief computes the f-constants from the general Vandermonde system 29 | @param f [out] :: f-constants 30 | @param z [in] :: Eigenvalues 31 | 32 | Takes the eigenvalues as input and returns the f's. Adapted from Golub and Van Loan 33 | */ 34 | void 35 | calculate_effs_VDM_herm( double complex *__restrict f , 36 | const double *__restrict z ) ; 37 | 38 | /** 39 | @fn void calculate_effs_VDM_suNC( double complex *__restrict f , const double complex *__restrict z ) 40 | @brief computes the f-constants from the general Vandermonde system 41 | @param f [out] :: f-constants 42 | @param z [in] :: Eigenvalues 43 | 44 | Takes the eigenvalues as input and returns the f's. Adapted from Golub and Van Loan 45 | */ 46 | void 47 | calculate_effs_VDM_suNC( double complex *__restrict f , 48 | const double complex *__restrict z ) ; 49 | 50 | 51 | /** 52 | @fn void f_hermitian_log_suNC( double complex f[NC] , const double complex z[NC] ) 53 | @param f :: The fs 54 | @param z :: The eigenvalues of the U matrix 55 | 56 | SU3 only. Function for taking the log of an SU(#NC) matrix by calculating its 57 | f's which are the same as the lie-matrix's. 58 | 59 | @warning I provide a cut off at the ulp of GLU_real precision to limit numerical instability 60 | 61 | @warning SU(NC) ONLY! 62 | */ 63 | #if NC == 2 64 | /** 65 | @fn void f_hermitian_log_suNC( double complex f[NC] , const double z ) 66 | @param f :: The fs 67 | @param z :: The eigenvalue of the U matrix, su2 so +/- 68 | @warning I provide a cut off at the ulp of GLU_real precision to limit numerical instability 69 | void 70 | */ 71 | void 72 | f_hermitian_log_suNC( double complex f[NC] , 73 | const double z ) ; 74 | #else 75 | /** 76 | @fn void f_hermitian_log_suNC( double complex f[NC] , const double complex z[NC] ) 77 | @param f :: The fs 78 | @param z :: The eigenvalues of the U matrix 79 | @warning I provide a cut off at the ulp of GLU_real precision to limit numerical instability 80 | */ 81 | void 82 | f_hermitian_log_suNC( double complex f[NC] , 83 | const double complex z[NC] ) ; 84 | #endif 85 | 86 | #endif 87 | -------------------------------------------------------------------------------- /src/Cuts/pspace_landau.c: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2013-2025 Renwick James Hudspith 3 | 4 | This file (pspace_landau.c) is part of GLU. 5 | 6 | GLU is free software: you can redistribute it and/or modify 7 | it under the terms of the GNU General Public License as published by 8 | the Free Software Foundation, either version 3 of the License, or 9 | (at your option) any later version. 10 | 11 | GLU is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | GNU General Public License for more details. 15 | 16 | You should have received a copy of the GNU General Public License 17 | along with GLU. If not, see . 18 | */ 19 | /** 20 | @file pspace_landau.c 21 | @brief momentum space landau condition corrections 22 | */ 23 | #include "Mainfile.h" 24 | 25 | #include "geometry.h" // for the 0 -> 2Pi to -Pi -> Pi BZ calc 26 | 27 | // momentum space landau factor 28 | // writing not the whole lattice 29 | void 30 | correct_pspace_landau( struct site *__restrict A , 31 | const struct veclist *__restrict list , 32 | const size_t *__restrict in , 33 | const size_t DIMS ) 34 | { 35 | double ave_err = 0. ; 36 | size_t i ; 37 | #pragma omp parallel for private(i) reduction(+:ave_err) 38 | for( i = 0 ; i < in[0] ; i++ ) { 39 | 40 | const size_t list_idx = list[ i ].idx ; 41 | 42 | // this is for the p-space test 43 | register double complex sum = 0.0 ; 44 | 45 | // Loop over polarisations ... 46 | size_t mu , j ; 47 | for( mu = 0 ; mu < DIMS ; mu++ ) { 48 | 49 | const double cache = 0.5 * list[i].MOM[ mu ] * Latt.twiddles[ mu ] ; 50 | const double p_mu = 2.0 * sin( cache ) ; 51 | 52 | #if ( defined deriv_linn ) || ( defined deriv_fulln ) 53 | const double p_mu_nn = 2.0 * ( nn1 * sin( cache ) + nn2 *\ 54 | sin( cache * 3.0 ) ) ; 55 | #elif defined deriv_fullnn 56 | const double p_mu_nn = 2.0 * ( nnn1 * sin( cache ) + nnn2 *\ 57 | sin( cache * 3.0 ) + nnn3 *\ 58 | sin( cache * 5.0 ) ) ; 59 | #endif 60 | 61 | // FFTWS forward cut has the conventional e^{-ipx} 62 | #ifdef CUT_FORWARD 63 | // e^{-ip_\mu / 2 } 64 | const double complex exp_cache = cos( cache ) - I * 0.5 * p_mu ; 65 | #else 66 | // e^{ip_\mu / 2 } 67 | const double complex exp_cache = cos( cache ) + I * 0.5 * p_mu ; 68 | #endif 69 | 70 | // write over every element of A with this extra factor 71 | for( j = 0 ; j < NCNC ; j++ ) { 72 | A[ list_idx ].O[ mu ][ j ] *= exp_cache ; 73 | #if ( defined deriv_linn ) || ( defined deriv_fulln ) || ( defined deriv_fullnn ) 74 | sum += ( A[ list_idx ].O[ mu ][ j ] * p_mu_nn ) ; 75 | #else 76 | sum += ( A[ list_idx ].O[ mu ][ j ] * p_mu ) ; 77 | #endif 78 | } 79 | } 80 | // and finally do the reduction on ave_err 81 | ave_err = ave_err + (double)( cabs( sum ) / (double)NCNC ) ; 82 | } 83 | fprintf( stdout , "\n[CUTS] P-Space gauge fixing error :: %1.5e \n\n" , 84 | ave_err / (double)in[0] ) ; 85 | return ; 86 | } 87 | --------------------------------------------------------------------------------