forked from jcosborn/qhmc
-
Notifications
You must be signed in to change notification settings - Fork 0
/
heatbath.lua
58 lines (47 loc) · 1.04 KB
/
heatbath.lua
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
require 'Lattice'
require 'Action'
require 'Evolver'
require 'topo'
--profile(1)
--verbosity(1)
--trace(1)
nx = 8
nt = 8
beta = 20
--L = Lattice{nx,nx,nt}
L = Lattice{nx,nx,nx,nt}
L:Seed(987654321)
G = L:GaugeField{nc=3}
G:Set("unit")
GA = Action{kind="gauge",style="plaquette",beta=beta,field=G}
E = Evolver{kind="heatbath",actions={GA},
nRepetitions=10,nHeatbath=1,nOverrelax=1}
function plaq()
local a = GA:Action()
local b = a/beta
local p = GA.act0 - b
local s = 1/GA.act0
return p*s
end
function ploop()
local nd = #L
local pl = {}
local i = nd-1
local plpath = {}
--for j=1,L[i] do plpath[j] = -i end -- changed convention
for j=1,L[i] do plpath[j] = i end
pl = G.field:loop(plpath)
return pl
end
function topo()
local tr,ti = pathDo(G.field, #L.latsize, paths0, coeffs0)
return tr
end
printf("initial plaq: %g\n", plaq())
printf("initial ploop: %s\n", tostring(ploop()))
for i=1,10 do
E:Run()
printf("plaq: %g\n", plaq())
printf("ploop: %s\n", tostring(ploop()))
--printf("topo: %s\n", tostring(topo()))
end