LatticeYangMills
puregauge.cpp
Go to the documentation of this file.
1 /******************************************************************************
2 *
3 * MIT License
4 *
5 * Copyright (c) 2018 Giovanni Pederiva
6 *
7 * Permission is hereby granted, free of charge, to any person obtaining a copy
8 * of this software and associated documentation files (the "Software"), to deal
9 * in the Software without restriction, including without limitation the rights
10 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11 * copies of the Software, and to permit persons to whom the Software is
12 * furnished to do so, subject to the following conditions:
13 *
14 * The above copyright notice and this permission notice shall be included in
15 * all copies or substantial portions of the Software.
16 *
17 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
23 * SOFTWARE.
24 ******************************************************************************/
25 
33 #include <cstdio>
34 #include <cmath>
35 #include "Actions/puregauge.h"
36 #include "Math/latticemath.h"
37 #include "Utils/latticeunits.h"
38 #include "ParallelTools/parallel.h"
39 #include "Utils/clusterspecifier.h"
40 #ifndef LACONIA
41 #include <mpi/mpi.h>
42 #else
43 #include <mpi.h>
44 #endif
45 
47 
50 PureGauge::PureGauge(double beta){
51  m_beta = beta;
52  m_staplesLattice = new GluonField(Parallel::latticeSubSize());
53  m_constPart = new GluonField(Parallel::latticeSubSize());
54  m_omega.allocate(Parallel::latticeSubSize());
55  trace.allocate(Parallel::latticeSubSize());
56  LatticeUnits::initialize(m_beta);
57 }
58 
59 double PureGauge::compute(int x, int y, int z, int t, int mu, SU3& newLink){
60  //return -m_beta / 3.0 * getMultSumTrace(newLink - (*m_lat)(x,y,z,t)[mu], m_constPart);
61 }
62 
63 
65 
69  setToZero(m_omega);
70  Lattice<SU3> shiftmu, tempStaple;
71  for(int nu = 0; nu < 4; nu++){
72  if(nu != mu){
73  shiftmu = shift((*m_lat)[nu],mu,1);
74  tempStaple = shiftmu;
75  tempStaple *= adj( shift((*m_lat)[mu],nu,1));
76  tempStaple *= adj( (*m_lat)[nu]);
77  m_omega += tempStaple;
78 
79  tempStaple = adj(shiftmu);
80  tempStaple *= adj( (*m_lat)[mu]);
81  tempStaple *= (*m_lat)[nu];
82 
83  m_omega += shift(tempStaple, nu, -1);
84  }
85  }
86 }
87 
88 
90 
95  computeStaples(mu);
96  m_omega = adj(m_omega) * (adj((*m_lat)[mu]));
97  m_omega = (adj(m_omega)-m_omega);
98 
99  for(int site = 0; site < m_omega.sites; site++){
100  double tr = m_omega.at(site).imagTrace()/3.0;
101  for(int i = 1; i < 18; i+=8)
102  m_omega.at(site).mat[i] -= tr;
103 
104  for(int i = 0; i < 18; i+=2){
105  double temp = m_omega.at(site).mat[i];
106  m_omega.at(site).mat[i] = -m_omega.at(site).mat[i+1]*0.5;
107  m_omega.at(site).mat[i+1] = temp*0.5;
108  }
109  }
110  return m_omega;
111 }
112 
113 
114 
115 void PureGauge::computeStaplez(GluonField* lattice){
116 }
Implementation of a class to perform arithmetics between links.
Definition: su3.h:53
Class that represents the QCD field as an array of 4 SU3 lattices.
Definition: field.h:53
double compute(int x, int y, int z, int t, int mu, SU3 &newLink)
Computes the action difference around a given link for a suggested move.
Definition: puregauge.cpp:59
Lattice< SU3 > computeDerivative(int mu)
Computes the derivative of all links along the given direction.
Definition: puregauge.cpp:94
GluonField * m_lat
The GluonField object the action is linked to.
Definition: action.h:67
Utilities for parallelization.
void setToZero(Lattice< SU3 > &su3lat)
sets a lattice object to all zero matrices
Definition: lattice.cpp:71
void computeStaples(int mu)
Computes the staples along the given directionfor all links in the given direction.
Definition: puregauge.cpp:68
Field< SU3, 4 > GluonField
Definition: field.h:76
Contains the definition of the PureGauge action derived class.