-
Notifications
You must be signed in to change notification settings - Fork 0
/
gi_dcovi.qlua
55 lines (40 loc) · 2.25 KB
/
gi_dcovi.qlua
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
--[[
function gi_dcovi (u, v)
local L = v.lattice
s = tostring(v)
if string.find(s, "^QDP:DiracFermion") then
dv = L:DiracFermion()
dv = gamma{mu=1} * ( u[1] * v:shift(1, "from_forward") - u[1]:shift(1,"from_backward"):adjoin() * v:shift(1, "from_backward") ) +
gamma{mu=2} * ( u[2] * v:shift(2, "from_forward") - u[2]:shift(2,"from_backward"):adjoin() * v:shift(2, "from_backward") ) +
gamma{mu=3} * ( u[3] * v:shift(3, "from_forward") - u[3]:shift(3,"from_backward"):adjoin() * v:shift(3, "from_backward") )
elseif string.find(s, "^QDP:DiracPropagator") then
dv = L:DiracPropagator()
dv = gamma{mu=1} * ( u[1] * v:shift(1, "from_forward") - u[1]:shift(1,"from_backward"):adjoin() * v:shift(1, "from_backward") ) +
gamma{mu=2} * ( u[2] * v:shift(2, "from_forward") - u[2]:shift(2,"from_backward"):adjoin() * v:shift(2, "from_backward") ) +
gamma{mu=3} * ( u[3] * v:shift(3, "from_forward") - u[3]:shift(3,"from_backward"):adjoin() * v:shift(3, "from_backward") )
else
printf("# [] Error, need a DiracFermion or DiracPropagator")
os.exit(1)
end
return dv * 0.5
end
--]]
function gi_dcovi (u, v)
local L = v.lattice
s = tostring(v)
if string.find(s, "^QDP:DiracFermion") then
dv = L:DiracFermion()
dv = gamma{mu=0} * ( u[1] * v:shift(0, "from_forward") - u[1]:shift(0,"from_backward"):adjoin() * v:shift(0, "from_backward") ) +
gamma{mu=1} * ( u[2] * v:shift(1, "from_forward") - u[2]:shift(1,"from_backward"):adjoin() * v:shift(1, "from_backward") ) +
gamma{mu=2} * ( u[3] * v:shift(2, "from_forward") - u[3]:shift(2,"from_backward"):adjoin() * v:shift(2, "from_backward") )
elseif string.find(s, "^QDP:DiracPropagator") then
dv = L:DiracPropagator()
dv = gamma{mu=0} * ( u[1] * v:shift(0, "from_forward") - u[1]:shift(0,"from_backward"):adjoin() * v:shift(0, "from_backward") ) +
gamma{mu=1} * ( u[2] * v:shift(1, "from_forward") - u[2]:shift(1,"from_backward"):adjoin() * v:shift(1, "from_backward") ) +
gamma{mu=2} * ( u[3] * v:shift(2, "from_forward") - u[3]:shift(2,"from_backward"):adjoin() * v:shift(2, "from_backward") )
else
printf("# [gi_dcovi] Error, need a DiracFermion or DiracPropagator")
os.exit(1)
end
return dv * 0.5
end