LatticeYangMills
energydensity.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 
35 #include "Observables/observable.h"
36 #include "Math/su3.h"
37 #include "Math/lattice.h"
38 #include <cstdio>
39 #include <cmath>
40 
45  m_name = "Energy Dens.";
46 }
47 
52  m_lat = lattice;
53  m_size = m_lat->getSize();
54 }
55 
60  // loop through the sublattice
61  m_value = 0;
62  SU3 A;
63  for(int x = 0; x < m_size[0]; x++){
64  for(int y = 0; y < m_size[1]; y++){
65  for(int z = 0; z < m_size[2]; z++){
66  for(int t = 0; t < m_size[3]; t++){
67  for(int mu = 0; mu < 4; mu++){
68  for(int nu = mu+1; nu < 4; nu++){
69  // compute G_mu_nu
70  Gmn = (*m_lat)(x,y,z,t)[mu]
71  * m_lat->shift(x,y,z,t,nu, mu, 1)
72  * ~(m_lat->shift(x,y,z,t,mu, nu, 1))
73  * ~(*m_lat)(x,y,z,t)[nu];
74 
75  Gmn += (*m_lat)(x,y,z,t)[nu]
76  * ~(m_lat->shift2 (x,y,z,t,mu,nu,1,mu,-1))
77  * ~(m_lat->shift(x,y,z,t,nu, mu, -1))
78  * (m_lat->shift(x,y,z,t,mu, mu, -1));
79 
80  Gmn += ~(m_lat->shift(x,y,z,t,mu, mu, -1))
81  * ~(m_lat->shift2 (x,y,z,t,nu,nu,-1,mu,-1))
82  * (m_lat->shift2 (x,y,z,t,mu,nu,-1,mu,-1))
83  * (m_lat->shift(x,y,z,t,nu, nu, -1));
84 
85  Gmn += ~(m_lat->shift(x,y,z,t,nu, nu, -1))
86  * (m_lat->shift(x,y,z,t,mu, nu, -1))
87  * (m_lat->shift2 (x,y,z,t,nu,nu,-1,mu,1))
88  * ~(*m_lat)(x,y,z,t)[mu];
89 
90  Gmn*=0.25;
91  for(int i = 0; i < 18; i+=2)
92  Gmn.mat[i] = 0;
93  m_value += (Gmn*Gmn).realTrace();
94  }}
95  }}}}
96 
97  gatherResults();
98 }
99 
100 
Contains the definition of the Lattice class.
Implementation of a class to perform arithmetics between links.
Definition: su3.h:53
Contains the definition of the Observable prototype.
void compute()
computes the EnergyDensity value using the clover definition of the field strength tensor ...
Basic library to implement SU3 matrix arithmetics and functions.
void gatherResults()
MPI reduction of the observable value.
Definition: observable.cpp:47
void initObservable(GluonField *lattice)
initializer of the EnergyDensity class
Contains the definition of the EnergyDensity observable.
Template class to store an array with 4 dimensional indices of a given datatype. Includes functionali...
Definition: action.h:38
Prototype for the Observable class group.
Definition: observable.h:52
EnergyDensity()
constructor of the EnergyDensity class