Skip to content

Commit

Permalink
replaced mu and v matrices with arithmetic
Browse files Browse the repository at this point in the history
  • Loading branch information
joott committed May 19, 2022
1 parent 8ed6672 commit 2f6bf54
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions modelB.jl
Original file line number Diff line number Diff line change
@@ -1,20 +1,19 @@
cd(@__DIR__)

using Plots
using LaTeXStrings
using Distributions
using Printf
using BenchmarkTools
using StaticArrays

const L = 4 # must be a multiple of 4
const L = 8 # must be a multiple of 4
const λ = 4.0f0
const Γ = 1.0f0
const T = 1.0f0

const Δt = 0.04f0/Γ
const Rate = Float32(sqrt(2.0*Δt*Γ))

const v = [0 0 0; 1 0 0; 0 1 0; 1 1 0]
const μ = [1 0 0; 0 1 0; 0 0 1]

function hotstart(n)
rand(Normal(), n, n, n)
Expand Down Expand Up @@ -54,8 +53,11 @@ function sweep(m², ϕ)
Threads.@threads for k in 1:L
for i in 1:L÷4, j in 1:L
idx = [(3-n)%3+1, (4-n)%3+1, (5-n)%3+1]
x1 = transition(i,j,k)[idx] + v[m,idx]
x2 = x1 + μ[n+1,:]
x1 = transition(i,j,k)[idx]
x1[idx[1]] += m%2
x1[idx[2]] += m<2
x2 = x1
x2[n+1] += 1
step(m², ϕ, x1.%L.+1, x2.%L.+1)
end
end
Expand All @@ -70,9 +72,10 @@ end

M(ϕ) = sum(ϕ)/L^3

ϕ = hotstart(L)
= -2.285

ϕ = hotstart(L)

thermalize(m², ϕ, 100*L^2)

maxt = L^2*25
Expand Down

0 comments on commit 2f6bf54

Please sign in to comment.