mirror of
https://igit.ific.uv.es/alramos/latticegpu.jl.git
synced 2025-05-14 19:23:42 +02:00
Correction in fA/fP test
This commit is contained in:
parent
b129e77878
commit
506e8b53cb
1 changed files with 83 additions and 127 deletions
|
@ -2,17 +2,15 @@ using LatticeGPU
|
||||||
using CUDA
|
using CUDA
|
||||||
using TimerOutputs
|
using TimerOutputs
|
||||||
|
|
||||||
|
|
||||||
@timeit "fA_fP test" begin
|
@timeit "fA_fP test" begin
|
||||||
|
|
||||||
|
|
||||||
function fP_test(;theta = (0.5,0.7,1.0,0.0), m = 1.3, size = (8,8,8,16),prec = 1.0e-16)
|
function fP_test(;theta = (0.5,0.7,1.0,0.0), m = 1.3, size = (8,8,8,16),prec = 1.0e-16)
|
||||||
|
|
||||||
@timeit "fP inversion (x12)" begin
|
@timeit "fP inversion (x12)" begin
|
||||||
|
|
||||||
lp = SpaceParm{4}(size,(4,4,4,4),1,(0,0,0,0,0,0));
|
lp = SpaceParm{4}(size,(4,4,4,4),1,(0,0,0,0,0,0));
|
||||||
exptheta = exp.(im.*theta./lp.iL);
|
exptheta = exp.(im.*theta./lp.iL);
|
||||||
|
|
||||||
dpar = DiracParam{Float64}(SU3fund,m,0.0,exptheta,0.0,1.0);
|
dpar = DiracParam{Float64}(SU3fund,m,0.0,exptheta,0.0,1.0);
|
||||||
dws = DiracWorkspace(SU3fund,Float64,lp);
|
dws = DiracWorkspace(SU3fund,Float64,lp);
|
||||||
|
|
||||||
|
@ -56,9 +54,9 @@ function fP_test(;theta = (0.5,0.7,1.0,0.0), m = 1.3, size = (8,8,8,16),prec = 1
|
||||||
end
|
end
|
||||||
return sum(abs.(res-res_th))
|
return sum(abs.(res-res_th))
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
function fA_test(;theta = (0.5,0.7,1.0,0.0), m = 1.3, size = (8,8,8,16),prec = 1.0e-16)
|
function fA_test(;theta = (0.5,0.7,1.0,0.0), m = 1.3, size = (8,8,8,16),prec = 1.0e-16)
|
||||||
|
|
||||||
@timeit "fA inversion (x12)" begin
|
@timeit "fA inversion (x12)" begin
|
||||||
|
|
||||||
|
@ -87,46 +85,6 @@ function fA_test(;theta = (0.5,0.7,1.0,0.0), m = 1.3, size = (8,8,8,16),prec = 1
|
||||||
|
|
||||||
end end
|
end end
|
||||||
|
|
||||||
lp = SpaceParm{4}(size,(4,4,4,4),1,(0,0,0,0,0,0));
|
|
||||||
exptheta = exp.(im.*theta./lp.iL);
|
|
||||||
|
|
||||||
dpar = DiracParam{Float64}(SU3fund,m,0.0,exptheta,1.0);
|
|
||||||
dws = DiracWorkspace(SU3fund,Float64,lp);
|
|
||||||
|
|
||||||
U = fill!(vector_field(SU3{Float64},lp),one(SU3{Float64}));
|
|
||||||
psi = scalar_field(Spinor{4,SU3fund{Float64}},lp);
|
|
||||||
|
|
||||||
res = im*zeros(lp.iL[4])
|
|
||||||
|
|
||||||
for s in 1:4 for c in 1:3
|
|
||||||
bndpropagator!(psi,U,dpar,dws,lp,1000,prec,c,s);
|
|
||||||
|
|
||||||
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]
|
|
||||||
i=abs(rand(Int))%lp.iL[1] +1;j=abs(rand(Int))%lp.iL[2] +1;k=abs(rand(Int))%lp.iL[3] +1;
|
|
||||||
CUDA.@allowscalar (res[t] += -dot(psi[point_index(CartesianIndex{lp.ndim}((i,j,k,t)),lp)...],dmul(Gamma{4},psi[point_index(CartesianIndex{lp.ndim}((i,j,k,t)),lp)...]))/2)
|
|
||||||
#end end end
|
|
||||||
#res[t] = res[t]/(lp.iL[1]*lp.iL[2]*lp.iL[3])
|
|
||||||
|
|
||||||
end
|
|
||||||
|
|
||||||
end end
|
|
||||||
|
|
||||||
end
|
|
||||||
#THEORETICAL SOLUTION: hep-lat/9606016 eq (2.32)
|
|
||||||
|
|
||||||
@timeit "fA analitical solution" begin
|
|
||||||
res_th = zeros(lp.iL[4])
|
|
||||||
|
|
||||||
pp3 = ntuple(i -> theta[i]/lp.iL[i],3)
|
|
||||||
omega = 2 * asinh(0.5* sqrt(( sum((sin.(pp3)).^2) + (m + 2*(sum((sin.(pp3./2)).^2) ))^2) / (1+m+2*(sum((sin.(pp3./2)).^2) )) ) )
|
|
||||||
pp = (-im*omega,pp3...)
|
|
||||||
Mpp = m + 2* sum((sin.(pp./2)).^2)
|
|
||||||
Rpp = Mpp*(1-exp(-2*omega*lp.iL[4])) + sinh(omega) * (1+exp(-2*omega*lp.iL[4]))
|
|
||||||
|
|
||||||
for i in 2:lp.iL[4]
|
|
||||||
res_th[i] = (6/(Rpp^2)) * ( 2*(Mpp - sinh(omega))*(Mpp + sinh(omega))*exp(-2*omega*lp.iL[4])
|
|
||||||
- Mpp*((Mpp + sinh(omega))*exp(-2*omega*(i-1)) + (Mpp - sinh(omega))*exp(-2*omega*(2*lp.iL[4]- (i - 1)))))
|
|
||||||
end
|
end
|
||||||
#THEORETICAL SOLUTION: hep-lat/9606016 eq (2.32)
|
#THEORETICAL SOLUTION: hep-lat/9606016 eq (2.32)
|
||||||
|
|
||||||
|
@ -145,21 +103,19 @@ end
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
return sum(abs.(res-res_th))
|
return sum(abs.(res-res_th))
|
||||||
|
end
|
||||||
end
|
|
||||||
|
|
||||||
|
|
||||||
difA = fA_test();
|
difA = fA_test();
|
||||||
difP = fP_test();
|
difP = fP_test();
|
||||||
|
|
||||||
if difA > 1.0e-15
|
if difA > 1.0e-15
|
||||||
error("fA test failed with error ", difA)
|
error("fA test failed with error ", difA)
|
||||||
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
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue