# - - parameters - - - - - - - - - - - 
system["saveU_dir"] = ""
system["verboselevel"] = 2
system["L"] = (4, 4, 4, 4)
system["Nwing"] = 1
system["Nsteps"] = 100
system["quench"] = true
system["logfile"] = "Heatbath_L04040404_beta5.7_quenched.txt"
system["initial"] = "cold"
system["Dirac_operator"] = nothing
system["log_dir"] = "./logs"
system["Nthermalization"] = 10
system["update_method"] = "HB"
system["randomseed"] = 111
system["NC"] = 3
system["BoundaryCondition"] = [1, 1, 1, -1]
system["saveU_format"] = nothing
system["β"] = 5.7
actions["use_autogeneratedstaples"] = false
actions["couplingcoeff"] = Any[]
actions["couplinglist"] = Any[]
md["Δτ"] = 0.05
md["N_SextonWeingargten"] = 2
md["SextonWeingargten"] = false
md["MDsteps"] = 20
measurement["measurement_methods"] = Dict[Dict{Any,Any}("fermiontype" => nothing,"measure_every" => 1,"methodname" => "Polyakov_loop"), Dict{Any,Any}("fermiontype" => nothing,"measure_every" => 1,"methodname" => "Plaquette")]
measurement["measurement_dir"] = "Heatbath_L04040404_beta5.7_quenched"
measurement["measurement_basedir"] = "./measurements"

actions["use_autogeneratedstaples"] = true
actions["couplingcoeff"] = [5.7,1.0,0.5]
#actions["couplinglist"] = ["plaq","rect","polyx"]

function makeplaq()
    loopset = []
    for μ=1:4
        for ν=μ:4
            if ν == μ
                continue
            end
            push!(loopset,[(μ,1),(ν,1),(μ,-1),(ν,-1)])
        end
    end
    return loopset
end

function makechair()
    loopset = []
    set1 = (1,2,3)
    set2 = (1,2,4)
    set3 = (2,3,4)
    set4 = (1,3,4)

    for set in (set1,set2,set3,set4)
        mu,nu,rho = set
        loop = [(mu,1),(nu,1),(rho,1),(mu,-1),(rho,-1),(nu,-1)]
        push!(loopset,loop)

        mu,rho,nu = set
        loop = [(mu,1),(nu,1),(rho,1),(mu,-1),(rho,-1),(nu,-1)]
        push!(loopset,loop)

        nu,rho,mu = set
        loop = [(mu,1),(nu,1),(rho,1),(mu,-1),(rho,-1),(nu,-1)]
        push!(loopset,loop)

        nu,mu,rho = set
        loop = [(mu,1),(nu,1),(rho,1),(mu,-1),(rho,-1),(nu,-1)]
        push!(loopset,loop)

        rho,mu,nu = set
        loop = [(mu,1),(nu,1),(rho,1),(mu,-1),(rho,-1),(nu,-1)]
        push!(loopset,loop)

        rho,nu,mu = set
        loop = [(mu,1),(nu,1),(rho,1),(mu,-1),(rho,-1),(nu,-1)]
        push!(loopset,loop)

    end
    return loopset
end

plaqloops = makeplaq()
rectloops = make_rectloops(2)
chairloops = makechair()
L = system["L"]
poly1loops = make_polyakovloops(1,L[1])
poly2loops = make_polyakovloops(2,L[2])
poly3loops = make_polyakovloops(3,L[3])
poly4loops = make_polyakovloops(4,L[4])



actions["coupling_loops"] = [plaqloops,rectloops,chairloops]








# - - - - - - - - - - - - - - - - - - -
