- #1
Ramil
- 2
- 1
Homework Statement
[/B]
I'm trying to write a program for caclulating Green's function using Monte Carlo method (Metropolis algorithm) in scalar field theory with a potential λφ4 in 4D. I'm writing it in python.
N_t, N_x, N_y, N_z - total number of lattice sites in each directions.
Field fi(i,j,k,l). Here (i, j, k, l) corresponds to (t, x, y, z).
I want to calculate two-point Green's function G(0) in the coincident limit. I want to get the dependency of G(0) on x coordinate.
Homework Equations
G(r,r')=<φ(r)φ(r')>, r→r'. (Here r is a space-time point r=(t,x,y,z))
G(0)=<φ2>
The Attempt at a Solution
Using Metropolis algorithm i do the following:
1. Generate an arbitrary configuration of the field fi, let it, for instance, be all zeros:
fi=np.zeros(N_t, N_x, N_y, N_z)
2. Then, using standard procedure I thermalise my configurations of the field, to get configurations fi(i, j, k, l) that satisfy a minima of an action.
3. Using obtained configurations fi(i, j, k, l) I want to calculate two-point Green's function G(0) in the coincident limit.
An excerpt of my code:
...
def Grin_0(fi):
N_x=10
N_y=10
N_z=10
N_t=60
for i in range(0,N_t):
for j in range(0,N_x):
for k in range(0,N_y):
for l in range(0,N_z):
G_0[i,j,k,l]=fi[i,j,k,l]*fi[i,j,k,l]
return G_0
...
Then i summirize G_0 along i,k,l indices and get the dependency of G_0 on index j.
Is it correct? How to find G_0 and its dependency on x correctly?