mc.jl 1.03 KB
using LatticeGPU
using TOML
using TimerOutputs
using ArgParse
using CUDA


function thermalize()

    println(log_file,"\n Starting simulation\n")
    println(log_file,"Thermalizing...")
    flush(log_file)

    for _ in 1:params["HMC"]["nth"]
        HMC!(U,intsch,lp,gp,ymws)
    end

    return nothing
end

function Gauge_update()

    println(log_file,"Performing "*string(params["HMC"]["dmeas"])*" HMC steps...")
    flush(log_file)

    global dH = 0.0
    global acc = true

    for _ in 1:params["HMC"]["dmeas"]
        dH,acc = HMC!(U,intsch,lp,gp,ymws)
        acc ? (global Nmc_acc += 1) : println(log_file,"Rejected HCM step")
    end
    global MCid = MCid + 1
    println(log_file,"Updated to Gauge configuration n"*string(MCid))
    println(log_file,"dH   = ",dH)
    println(log_file,"acc  = ",Nmc_acc/(params["HMC"]["dmeas"] * MCid))
    println(log_file,"Plaq = ", plaquette(U, lp, gp, ymws))
    println(log_file,"Qtop = ", Qtop(U, gp, lp, ymws))

    Csw!(dws,U,gp,lp)
    U_CPU .= Array(U)

    flush(log_file)
    return nothing

end