Computation of PPtilde and PPhat. IO still in dev.

parent cd7287a0
......@@ -30,11 +30,11 @@ while RUN_ON
@timeit "HMC" Gauge_update()
@timeit "Two point function" begin
two_pt()
two_pt_rnd()
Frontflow_pt()
two_pt_lagrange()
end
@timeit "One point function" one_pt()
@timeit "One point function" Backflow_pt()
@timeit "Saving" save_data()
......
......@@ -112,7 +112,7 @@ end
function save_data()
ihdr = [convert(Int32,0608686513)]
ihdr = [convert(Int32,1730280201)]
fname = "./output/"*params["Run"]["name"]*".bdio"
if isfile(fname)
......@@ -151,7 +151,8 @@ function save_data()
BDIO_write!(fb,pp_corr_t[:,noi,fl])
BDIO_write!(fb,ap_corr_t[:,noi,fl])
BDIO_write!(fb,[phat_t[noi,fl]])
BDIO_write!(fb,pp_hat_t[:,noi,fl])
BDIO_write!(fb,pptilde_t[:,noi,fl])
end
end
......
......@@ -19,16 +19,18 @@ function load_fields()
global pp_corr_t0 = fill(zero(Float64),(lp.iL[4],params["Frontflow"]["N_noise"]));
global ap_corr_t0 = fill(zero(ComplexF64),(lp.iL[4],params["Frontflow"]["N_noise"]));
global pp_corr_t = fill(zero(Float64),(lp.iL[4],params["Frontflow"]["N_noise"],params["Frontflow"]["nsteps"]+1));
global ap_corr_t = fill(zero(ComplexF64),(lp.iL[4],params["Frontflow"]["N_noise"],params["Frontflow"]["nsteps"]+1));
global pp_corr_t = fill(zero(Float64),(lp.iL[4],params["Frontflow"]["N_noise"],params["Frontflow"]["nsteps"] + 1));
global ap_corr_t = fill(zero(ComplexF64),(lp.iL[4],params["Frontflow"]["N_noise"],params["Frontflow"]["nsteps"] + 1));
global pp_corr_tfl = fill(zero(Float64),(lp.iL[4],params["Backflow"]["N_noise"],length(flow_times)));
global ap_corr_tfl = fill(zero(ComplexF64),(lp.iL[4],params["Backflow"]["N_noise"],length(flow_times)));
global Eoft = Array{Complex{Float64}}(undef,2+ffnsteps,lp.iL[4]);
global pphat_t = Array{Float64}(undef,lp.iL[4],params["Frontflow"]["N_noise"],params["Frontflow"]["nsteps"] + 1);
global pptilde_t = Array{Complex{Float64}}(undef,lp.iL[4],params["Frontflow"]["N_noise"],params["Frontflow"]["nsteps"] + 1);
global Eoft = Array{Complex{Float64}}(undef,2 + params["Frontflow"]["nsteps"],lp.iL[4]);
global Eofpla = Array{Complex{Float64}}(undef,lp.iL[4],lp.npls);
global phat_t = Array{Float64}(undef,params["Frontflow"]["N_noise"],length(flow_times));
global Quark_cond = Array{Complex{Float64}}(undef,lp.iL[4],params["Backflow"]["N_noise"],length(flow_times));
global Quark_cond_cfl = Array{Complex{Float64}}(undef,lp.iL[4],params["Backflow"]["N_noise"],length(flow_times));
......@@ -43,9 +45,11 @@ end
"""
function two_pt()
Computes the correlation functions involving Frontflow of fermionic fields.
Stores the two point function in the variables 'pp_corr_t0', 'ap_corr_t0', 'pp_corr_t' and 'ap_corr_t'
"""
function two_pt() # Will be Frontflow
function Frontflow_pt() # Will be Frontflow
println(log_file,"\nMeasuring 2pt...")
flush(log_file)
......@@ -73,7 +77,11 @@ function two_pt() # Will be Frontflow
end end end
end
if params["Frontflow"]["t_zero"]>0.0
_,epslist = flw_adapt(U, psi, int, params["Frontflow"]["t_zero"], gp, dpar, lp, ymws, dws)
println(log_file,"Flowed correlator to t = ",params["Frontflow"]["t_zero"]," with last stepsize ",epslist[end-1])
flush(log_file)
end
for tstep in 1:params["Frontflow"]["nsteps"]
......@@ -124,12 +132,14 @@ function two_pt() # Will be Frontflow
end
"""
function one_pt()
function Backflow_pt()
Computes the correlation functions involving Backflow of fermionic fields.
Stores the one point function in the variable 'Quark_cond' and 'Quark_cond_cfl'. The final result for the quark condensate is 'Quark_cond' + C_fl*'Quark_cond_cfl'.
The two point function with source in possitive flow time is also stored in 'pp_corr_tfl' and 'ap_corr_tfl'
The two point function with source in possitive flow time is also stored in 'pp_corr_tfl' and 'ap_corr_tfl'. The correlation function 'ChiDchi' is also updated, as well as a second computation of the condensate.
"""
function one_pt() # Will be backflow
function Backflow_pt() # Will be backflow
@timeit "CPU to GPU" copyto!(U,U_CPU)
......@@ -165,7 +175,7 @@ function one_pt() # Will be backflow
for t in 1:lp.iL[4]
for i in 1:lp.iL[1] for j in 1:lp.iL[2] for k in 1:lp.iL[3]
b,r = point_index(CartesianIndex{lp.ndim}((i,j,k,t)),lp)
CUDA.@allowscalar Quark_cond[t,noi,fl] += ap_density[b,r]
Quark_cond[t,noi,fl] += ap_density[b,r]
end end end
end
......@@ -174,7 +184,7 @@ function one_pt() # Will be backflow
for t in 1:lp.iL[4]
for i in 1:lp.iL[1] for j in 1:lp.iL[2] for k in 1:lp.iL[3]
b,r = point_index(CartesianIndex{lp.ndim}((i,j,k,t)),lp)
CUDA.@allowscalar Quark_cond_cfl[t,noi,fl] += -pp_density[b,r]
Quark_cond_cfl[t,noi,fl] += -pp_density[b,r]
end end end
end
......@@ -204,7 +214,7 @@ function one_pt() # Will be backflow
for t in 1:lp.iL[4]
for i in 1:lp.iL[1] for j in 1:lp.iL[2] for k in 1:lp.iL[3]
b,r = point_index(CartesianIndex{lp.ndim}((i,j,k,t)),lp)
CUDA.@allowscalar ChiDchi[t,noi,fl] += ap_density[b,r]
ChiDchi[t,noi,fl] += ap_density[b,r]
end end end
end
Dw!(dws.sp,U,dws.st,dpar,dws,lp)
......@@ -212,7 +222,7 @@ function one_pt() # Will be backflow
for t in 1:lp.iL[4]
for i in 1:lp.iL[1] for j in 1:lp.iL[2] for k in 1:lp.iL[3]
b,r = point_index(CartesianIndex{lp.ndim}((i,j,k,t)),lp)
CUDA.@allowscalar ChiDchi[t,noi,fl] += -ap_density[b,r]
ChiDchi[t,noi,fl] += -ap_density[b,r]
end end end
end
......@@ -221,7 +231,7 @@ function one_pt() # Will be backflow
for t in 1:lp.iL[4]
for i in 1:lp.iL[1] for j in 1:lp.iL[2] for k in 1:lp.iL[3]
b,r = point_index(CartesianIndex{lp.ndim}((i,j,k,t)),lp)
CUDA.@allowscalar Quark_cond2[t,noi,fl] += ap_density[b,r]
Quark_cond2[t,noi,fl] += ap_density[b,r]
end end end
end
......@@ -236,7 +246,7 @@ function one_pt() # Will be backflow
for t in 1:lp.iL[4]
for i in 1:lp.iL[1] for j in 1:lp.iL[2] for k in 1:lp.iL[3]
b,r = point_index(CartesianIndex{lp.ndim}((i,j,k,t)),lp)
CUDA.@allowscalar ChiDchi_cfl[t,noi,fl] += ap_density[b,r]
ChiDchi_cfl[t,noi,fl] += ap_density[b,r]
end end end
end
Dw!(dws.sp,U,dws.st,dpar,dws,lp)
......@@ -244,7 +254,7 @@ function one_pt() # Will be backflow
for t in 1:lp.iL[4]
for i in 1:lp.iL[1] for j in 1:lp.iL[2] for k in 1:lp.iL[3]
b,r = point_index(CartesianIndex{lp.ndim}((i,j,k,t)),lp)
CUDA.@allowscalar ChiDchi_cfl[t,noi,fl] += -ap_density[b,r]
ChiDchi_cfl[t,noi,fl] += -ap_density[b,r]
end end end
end
......@@ -253,7 +263,7 @@ function one_pt() # Will be backflow
for t in 1:lp.iL[4]
for i in 1:lp.iL[1] for j in 1:lp.iL[2] for k in 1:lp.iL[3]
b,r = point_index(CartesianIndex{lp.ndim}((i,j,k,t)),lp)
CUDA.@allowscalar Quark_cond2_cfl[t,noi,fl] += ap_density[b,r]
Quark_cond2_cfl[t,noi,fl] += ap_density[b,r]
end end end
end
......@@ -283,35 +293,93 @@ function one_pt() # Will be backflow
end
"""
function two_pt_rnd()
function two_pt_lagrange()
Computes the two point functions containing Lagrange multiplier fields using front flow.
Stores the random field evolved in flow time in the variable 'phat_t'
Stores the two point functions in the variables 'pphat_t' and 'pptilde_t'.
"""
function two_pt_rnd()
function two_pt_lagrange() # Will be 2pt lagrange mult
copyto!(U,U_CPU)
@timeit "CPU to GPU" copyto!(U,U_CPU)
println(log_file,"Measuring PhatPt correlator...")
println(log_file,"Measuring Lagrange multiplier correlators...")
flush(log_file)
for noi in 1:params["Frontflow"]["N_noise"]
pfrandomize!(psi,lp)
delta_t = flow_times .- [0.0,flow_times[1:end-1]...]
neps = int.eps_ini
for fl in 1:length(flow_times)
_,epslist = flw_adapt(U, psi, int, delta_t[fl], neps, gp, dpar, lp, ymws, dws)
neps = epslist[end]
@timeit "GPU to CPU" psi_CPU .= Array(psi)
@timeit "Inversion" begin
dws.sp .= dmul.(Gamma{5},psi)
g5Dw!(psi,U,dws.sp,dpar,dws,lp)
niter = CG!(psi,U,DwdagDw!,dpar,lp,dws,params["Fermion"]["maxiter"], params["Fermion"]["tolerance"])
end
println(log_file,"CG converged after ",niter," iterations with residue ",CUDA.mapreduce(x -> norm2(x), +, dws.sr))
flush(log_file)
_,epslist = flw_adapt(U, psi, int, params["Frontflow"]["t_zero"], gp, dpar, lp, ymws, dws)
@timeit "GPU to CPU" psit_CPU .= Array(psi)
@timeit "CPU to GPU" copyto!(U,U_CPU)
@timeit "CPU to GPU" copyto!(psi,psi_CPU)
if params["Frontflow"]["t_zero"]>0.0
_,epslist = flw_adapt(U, psi, int, params["Frontflow"]["t_zero"], gp, dpar, lp, ymws, dws)
println(log_file,"Flowed correlators to t = ",params["Frontflow"]["t_zero"]," with last stepsize ",epslist[end-1])
flush(log_file)
end
phat_t[noi,fl] = sum(norm2.(psi))
@timeit "CPU to GPU" copyto!(dws.st,psit_CPU)
for fl in 1:params["Frontflow"]["nsteps"]
pphat_t[:,noi,fl] .= zero(Float64)
pp_density .= Array(sum(norm2.(psi)))
for t in 1:lp.iL[4]
for i in 1:lp.iL[1] for j in 1:lp.iL[2] for k in 1:lp.iL[3]
b,r = point_index(CartesianIndex{lp.ndim}((i,j,k,t)),lp)
pphat_t[t,noi,fl] += pp_density[b,r]
end end end
end
pptilde_t[:,noi,fl] .= zero(Float64)
ap_density .= Array(dot.(dws.st,psi))
for t in 1:lp.iL[4]
for i in 1:lp.iL[1] for j in 1:lp.iL[2] for k in 1:lp.iL[3]
b,r = point_index(CartesianIndex{lp.ndim}((i,j,k,t)),lp)
pptilde_t[t,noi,fl] += ap_density[b,r]
end end end
end
ymws.U1 .= U
flw(U, psi, int, 1, params["Frontflow"]["epsilon"], gp, dpar, lp, ymws, dws)
U .= ymws.U1
flw(U, dws.st, int, 1, params["Frontflow"]["epsilon"], gp, dpar, lp, ymws, dws)
copyto!(U,U_CPU)
end
pphat_t[:,noi,end] .= zero(Float64)
pp_density .= Array(sum(norm2.(psi)))
for t in 1:lp.iL[4]
for i in 1:lp.iL[1] for j in 1:lp.iL[2] for k in 1:lp.iL[3]
b,r = point_index(CartesianIndex{lp.ndim}((i,j,k,t)),lp)
pphat_t[t,noi,end] += pp_density[b,r]
end end end
end
pptilde_t[:,noi,end] .= zero(Complex{Float64})
ap_density .= Array(dot.(dws.st,psi))
for t in 1:lp.iL[4]
for i in 1:lp.iL[1] for j in 1:lp.iL[2] for k in 1:lp.iL[3]
b,r = point_index(CartesianIndex{lp.ndim}((i,j,k,t)),lp)
pptilde_t[t,noi,end] += ap_density[b,r]
end end end
end
phat_t .= phat_t./V4
@timeit "CPU to GPU" copyto!(U,U_CPU)
end
println(log_file,"Finished measuring PhatPt")
println(log_file,"Finished measuring Lagrange multiplier correlators")
flush(log_file)
return nothing
......
......@@ -3,6 +3,7 @@ using ADerrors
using BDIO
## NEDS UPDATE
function read_ff(name::String)
file = BDIO_open(name,"r","FerFlow correlators")
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment