mirror of
https://igit.ific.uv.es/alramos/latticegpu.jl.git
synced 2025-05-14 19:23:42 +02:00
Updated tests
This commit is contained in:
parent
263ae07361
commit
3a251dd1b8
7 changed files with 46 additions and 37 deletions
|
@ -1,13 +1,8 @@
|
||||||
using CUDA
|
using CUDA, LatticeGPU
|
||||||
|
|
||||||
using Pkg
|
println(" # Consistency condition for backflow")
|
||||||
|
|
||||||
Pkg.activate("/home/fperez/Git/LGPU_fork_ferflow")
|
|
||||||
|
|
||||||
using LatticeGPU
|
|
||||||
|
|
||||||
lp = SpaceParm{4}((4,4,4,4),(2,2,2,2),0,(0,0,0,0,0,0));
|
|
||||||
|
|
||||||
|
lp = SpaceParm{4}((16,16,16,16), (4,4,4,4), BC_PERIODIC, (0,0,0,0,0,0))
|
||||||
pso = scalar_field(Spinor{4,SU3fund{Float64}},lp);
|
pso = scalar_field(Spinor{4,SU3fund{Float64}},lp);
|
||||||
psi = scalar_field(Spinor{4,SU3fund{Float64}},lp);
|
psi = scalar_field(Spinor{4,SU3fund{Float64}},lp);
|
||||||
psi2 = scalar_field(Spinor{4,SU3fund{Float64}},lp);
|
psi2 = scalar_field(Spinor{4,SU3fund{Float64}},lp);
|
||||||
|
@ -19,24 +14,27 @@ int = wfl_rk3(Float64, 0.01, 1.0)
|
||||||
|
|
||||||
gp = GaugeParm{Float64}(SU3{Float64},6.0,1.0,(1.0,0.0),(0.0,0.0),lp.iL)
|
gp = GaugeParm{Float64}(SU3{Float64},6.0,1.0,(1.0,0.0),(0.0,0.0),lp.iL)
|
||||||
|
|
||||||
dpar = DiracParam{Float64}(SU3fund,1.3,0.9,(1.0,1.0,1.0,1.0),0.0)
|
dpar = DiracParam{Float64}(SU3fund,1.3,0.9,(1.0,1.0,1.0,1.0),0.0,0.0)
|
||||||
|
|
||||||
randomize!(ymws.mom, lp, ymws)
|
randomize!(ymws.mom, lp, ymws)
|
||||||
U = exp.(ymws.mom);
|
U = exp.(ymws.mom);
|
||||||
|
|
||||||
pfrandomize!(psi,lp)
|
pfrandomize!(psi,lp)
|
||||||
for L in 4:19
|
for L in 10:20:210
|
||||||
pso .= psi
|
pso .= psi
|
||||||
V = Array(U)
|
V = Array(U)
|
||||||
a,b = flw_adapt(U, psi, int, L*int.eps, gp,dpar, lp, ymws,dws)
|
#a,b = flw_adapt(U, psi, int, L*int.eps, gp,dpar, lp, ymws,dws)
|
||||||
|
flw(U, psi, int, L,int.eps, gp,dpar, lp, ymws,dws)
|
||||||
# for i in 1:a
|
# for i in 1:a
|
||||||
# flw(U, psi, int, 1 ,b[i], gp, dpar, lp, ymws, dws)
|
# flw(U, psi, int, 1 ,b[i], gp, dpar, lp, ymws, dws)
|
||||||
# end
|
# end
|
||||||
pfrandomize!(psi2,lp)
|
pfrandomize!(psi2,lp)
|
||||||
|
|
||||||
foo = sum(dot.(psi,psi2))# field_dot(psi,psi2,sumf,lp)
|
foo = sum(dot.(psi,psi2))
|
||||||
copyto!(U,V);
|
copyto!(U,V);
|
||||||
backflow(psi2,U,L*int.eps,7,gp,dpar,lp, ymws,dws)
|
backflow(psi2,U,L*int.eps,20,gp,dpar,lp, ymws,dws)
|
||||||
println("Error:",(sum(dot.(pso,psi2))-foo)/foo)
|
println("# Consistency backflow test for t=",L*int.eps)
|
||||||
|
println("Relative error:",abs((sum(dot.(pso,psi2))-foo)/foo))
|
||||||
psi .= pso
|
psi .= pso
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -3,13 +3,14 @@ using LatticeGPU, CUDA, TimerOutputs
|
||||||
#Test for the relation K(t,y;0,n)^+ Dw(n|m)^{-1} e^(ipm) = D(p)^{-1} exp(4t sin^2(p/2)) e^{ipn} with a given momenta (if p=0 its randomized), spin and color
|
#Test for the relation K(t,y;0,n)^+ Dw(n|m)^{-1} e^(ipm) = D(p)^{-1} exp(4t sin^2(p/2)) e^{ipn} with a given momenta (if p=0 its randomized), spin and color
|
||||||
#Kernel en 1207.2096
|
#Kernel en 1207.2096
|
||||||
|
|
||||||
|
println(" # Free fermion propagator for backflow")
|
||||||
|
|
||||||
@timeit "Plw backflow test" begin
|
@timeit "Plw backflow test" begin
|
||||||
|
|
||||||
function Dwpw_test(;p=0,s=1,c=1)
|
function Dwpw_test(;p=0,s=1,c=1)
|
||||||
lp = SpaceParm{4}((16,16,16,16), (4,4,4,4), 0, (0,0,0,0,0,0))
|
lp = SpaceParm{4}((16,16,16,16), (4,4,4,4), 0, (0,0,0,0,0,0))
|
||||||
gp = GaugeParm{Float64}(SU3{Float64}, 6.0, 1.0)
|
gp = GaugeParm{Float64}(SU3{Float64}, 6.0, 1.0)
|
||||||
dpar = DiracParam{Float64}(SU3fund,1.3,0.0,(1.0,1.0,1.0,1.0),0.0)
|
dpar = DiracParam{Float64}(SU3fund,1.3,0.0,(1.0,1.0,1.0,1.0),0.0,0.0)
|
||||||
dws = DiracWorkspace(SU3fund,Float64,lp);
|
dws = DiracWorkspace(SU3fund,Float64,lp);
|
||||||
ymws = YMworkspace(SU3,Float64,lp);
|
ymws = YMworkspace(SU3,Float64,lp);
|
||||||
|
|
||||||
|
@ -89,9 +90,7 @@ using LatticeGPU, CUDA, TimerOutputs
|
||||||
g5Dw!(prop,U,pwave,dpar,dws,lp)
|
g5Dw!(prop,U,pwave,dpar,dws,lp)
|
||||||
CG!(prop,U,DwdagDw!,dpar,lp,dws,10000,1.0e-14)
|
CG!(prop,U,DwdagDw!,dpar,lp,dws,10000,1.0e-14)
|
||||||
|
|
||||||
for _ in 1:Nsteps
|
backflow(prop,U,Nsteps*int.eps,20,gp,dpar,lp, ymws,dws)
|
||||||
backflow(U,prop,1,int.eps,gp,dpar,lp, ymws,dws)
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
@ -103,15 +102,15 @@ using LatticeGPU, CUDA, TimerOutputs
|
||||||
|
|
||||||
|
|
||||||
begin
|
begin
|
||||||
dif = 0.0
|
global diff = 0.0
|
||||||
for i in 1:3 for j in 1:4
|
for i in 1:3 for j in 1:4
|
||||||
dif += Dwpw_test(c=i,s=j)
|
global diff += Dwpw_test(c=i,s=j)
|
||||||
end end
|
end end
|
||||||
|
|
||||||
if dif < 1.0e-5
|
if diff < 1.0e-5
|
||||||
print("Backflow_tl test passed with average error ", dif/12,"!\n")
|
print("Backflow_tl test passed with average error ", diff/12,"\n")
|
||||||
else
|
else
|
||||||
error("Backflow_tl test failed with difference: ",dif,"\n")
|
error("Backflow_tl test failed with difference: ",diff,"\n")
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1,15 +1,16 @@
|
||||||
using LatticeGPU, CUDA, TimerOutputs
|
using LatticeGPU, CUDA, TimerOutputs
|
||||||
|
|
||||||
#Test for the relation K(t,y;0,n) Dw(n|m)^{-1} e^(ipm) = D(p)^{-1} exp(-4t sin^2(p/2)) e^{ipn} with a given momenta (if p=0 its randomized), spin and color
|
#Test for the relation K(t,y;0,n) Dw(n|m)^{-1} e^(ipm) = D(p)^{-1} exp(-4t sin^2(p/2)) e^{ipn} with a given momenta (if p=0 its randomized), spin and color
|
||||||
#Kernel en 1207.2096
|
#Kernel from 1207.2096
|
||||||
|
|
||||||
|
println(" # Free fermion propagator for frontflow")
|
||||||
|
|
||||||
@timeit "Plw flow test" begin
|
@timeit "Plw flow test" begin
|
||||||
|
|
||||||
function Dwpw_test(;p=0,s=1,c=1)
|
function Dwpw_test(;p=0,s=1,c=1)
|
||||||
lp = SpaceParm{4}((16,16,16,16), (4,4,4,4), 0, (0,0,0,0,0,0))
|
lp = SpaceParm{4}((16,16,16,16), (4,4,4,4), 0, (0,0,0,0,0,0))
|
||||||
gp = GaugeParm{Float64}(SU3{Float64}, 6.0, 1.0)
|
gp = GaugeParm{Float64}(SU3{Float64}, 6.0, 1.0)
|
||||||
dpar = DiracParam{Float64}(SU3fund,1.3,0.0,(1.0,1.0,1.0,1.0),0.0)
|
dpar = DiracParam{Float64}(SU3fund,1.3,0.0,(1.0,1.0,1.0,1.0),0.0,0.0)
|
||||||
dws = DiracWorkspace(SU3fund,Float64,lp);
|
dws = DiracWorkspace(SU3fund,Float64,lp);
|
||||||
ymws = YMworkspace(SU3,Float64,lp);
|
ymws = YMworkspace(SU3,Float64,lp);
|
||||||
|
|
||||||
|
@ -103,15 +104,15 @@ using LatticeGPU, CUDA, TimerOutputs
|
||||||
|
|
||||||
|
|
||||||
begin
|
begin
|
||||||
dif = 0.0
|
global diff = 0.0
|
||||||
for i in 1:3 for j in 1:4
|
for i in 1:3 for j in 1:4
|
||||||
dif += Dwpw_test(c=i,s=j)
|
global diff += Dwpw_test(c=i,s=j)
|
||||||
end end
|
end end
|
||||||
|
|
||||||
if dif < 1.0e-4
|
if diff < 1.0e-4
|
||||||
print("Flow_tl test passed with average error ", dif/12,"!\n")
|
print("Flow_tl test passed with average error ", diff/12,"\n")
|
||||||
else
|
else
|
||||||
error("Flow_tl test failed with difference: ",dif,"\n")
|
error("Flow_tl test failed with difference: ",diff,"\n")
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -2,6 +2,8 @@ using LatticeGPU
|
||||||
using CUDA
|
using CUDA
|
||||||
using TimerOutputs
|
using TimerOutputs
|
||||||
|
|
||||||
|
println(" # Free solution for SF correlation functions")
|
||||||
|
|
||||||
@timeit "fA_fP test" begin
|
@timeit "fA_fP test" begin
|
||||||
|
|
||||||
|
|
||||||
|
@ -115,7 +117,7 @@ using TimerOutputs
|
||||||
elseif difP > 1.0e-15
|
elseif difP > 1.0e-15
|
||||||
error("fP test failed with error ", difP)
|
error("fP test failed with error ", difP)
|
||||||
else
|
else
|
||||||
print("fA & fP tests passed with errors: ", difA," and ",difP,"!\n")
|
print("fA & fP tests passed with errors: ", difA," and ",difP,"\n")
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
|
@ -2,6 +2,8 @@ using LatticeGPU, CUDA, TimerOutputs
|
||||||
|
|
||||||
#Test for the relation Dw(n|m)^{-1} e^(ipm) = D(p)^{-1} e^{ipn} with a given momenta (if p=0 its randomized), spin and color
|
#Test for the relation Dw(n|m)^{-1} e^(ipm) = D(p)^{-1} e^{ipn} with a given momenta (if p=0 its randomized), spin and color
|
||||||
|
|
||||||
|
println(" # Test for free fermion propagator")
|
||||||
|
|
||||||
@timeit "Plw test" begin
|
@timeit "Plw test" begin
|
||||||
|
|
||||||
function Dwpw_test(;p=0,s=1,c=1)
|
function Dwpw_test(;p=0,s=1,c=1)
|
||||||
|
@ -84,12 +86,12 @@ end
|
||||||
|
|
||||||
dif = sum(norm2.(prop - prop_th))
|
dif = sum(norm2.(prop - prop_th))
|
||||||
|
|
||||||
if dif > 1.0e-15
|
if dif > 1.0e-7
|
||||||
error("Dwpl test for s=",s,", c=",c," failed with difference: ",dif,"\n")
|
error("Dwpl test for s=",s,", c=",c," failed with difference: ",dif,"\n")
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
return dif
|
return sqrt(dif)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
@ -101,8 +103,8 @@ for i in 1:3 for j in 1:4
|
||||||
global diff += Dwpw_test(c=i,s=j)
|
global diff += Dwpw_test(c=i,s=j)
|
||||||
end end
|
end end
|
||||||
|
|
||||||
if diff < 1.0e-15
|
if diff < 1.0e-7
|
||||||
print("Dwpl test passed with average error ", diff/12,"!\n")
|
print("Dwpl test passed with average error ", diff/12,"\n")
|
||||||
else
|
else
|
||||||
error("Dwpl test failed with difference: ",diff,"\n")
|
error("Dwpl test failed with difference: ",diff,"\n")
|
||||||
end
|
end
|
||||||
|
|
|
@ -2,6 +2,9 @@ using CUDA, LatticeGPU, TimerOutputs
|
||||||
|
|
||||||
#Check that Dw ( (DwdagDw)^{-1} g5 Dw g5 ) psi = psi for random fields
|
#Check that Dw ( (DwdagDw)^{-1} g5 Dw g5 ) psi = psi for random fields
|
||||||
|
|
||||||
|
println(" # Test for the consistency of the solver")
|
||||||
|
|
||||||
|
|
||||||
@timeit "Rand solver test" begin
|
@timeit "Rand solver test" begin
|
||||||
|
|
||||||
@timeit "Generate random fields" begin
|
@timeit "Generate random fields" begin
|
||||||
|
@ -46,7 +49,7 @@ res = sum(norm2.(rpsi-dws.sp))
|
||||||
|
|
||||||
|
|
||||||
if res < 1.0e-6
|
if res < 1.0e-6
|
||||||
print("Drand test passed with ",res,"% error!\n")
|
print("Drand test passed with ",res,"% error\n")
|
||||||
|
|
||||||
else
|
else
|
||||||
error("Drand test failed with difference: ",res,"\n")
|
error("Drand test failed with difference: ",res,"\n")
|
||||||
|
|
|
@ -1,6 +1,10 @@
|
||||||
|
|
||||||
include("SAD/test_sad.jl")
|
#include("SAD/test_sad.jl")
|
||||||
include("flow/test_adapt.jl")
|
include("flow/test_adapt.jl")
|
||||||
include("dirac/test_fp_fa.jl")
|
include("dirac/test_fp_fa.jl")
|
||||||
include("dirac/test_solver_plw.jl")
|
include("dirac/test_solver_plw.jl")
|
||||||
include("dirac/test_solver_rand.jl")
|
include("dirac/test_solver_rand.jl")
|
||||||
|
include("dirac/test_flow_tl.jl")
|
||||||
|
include("dirac/test_backflow_tl.jl")
|
||||||
|
include("dirac/test_backflow.jl")
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue