-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathmain.jl
42 lines (36 loc) · 1.04 KB
/
main.jl
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
# main.jl
#
# A projector QMC program for the TFIM
include("lattice.jl") #define the spatial lattice
include("updates.jl") #functions for the Monte Carlo updates
include("measurements.jl") #functions for the Monte Carlo updates
#Projector parameters
M = 300 #length of the projector operator_list is 2M
h_x = 0.5
J_ = 1.0
MCS = 10000 #the number of Monte Carlo steps
#******* Globals
spin_left = fill(1,nSpin) #left and right trail spin state
spin_right = fill(1,nSpin)
LinkList =[]
LegType =[]
Associates =[]
operator_list = fill(0,(2*M,2))
# (-2,i) is an off-diagonal site operator h(sigma^+_i + sigma^-_i)
# (-1,i) is a diagonal site operator h
# (0,0) is the identity operator I - NOT USED IN THE PROJECTOR CASE
# (i,j) is a diagonal bond operator J(sigma^z_i sigma^z_j)
#******* Globals
for i = 1:2000 #Equilibration
DiagonalUpdate()
LinkedList()
ClusterUpdate()
end
M2 = 0
for i = 1:MCS #Monte Carlo Production Steps
DiagonalUpdate()
LinkedList()
global M2 += Measure()
ClusterUpdate()
end
println(M2/(nSpin*nSpin*MCS))