mirror of
https://igit.ific.uv.es/alramos/latticegpu.jl.git
synced 2025-05-15 03:33:42 +02:00
Working HMC for one scalar coupled to SU(2)
This commit is contained in:
parent
bd88c213d7
commit
4f9ddb7026
7 changed files with 192 additions and 34 deletions
|
@ -9,7 +9,7 @@
|
|||
### created: Tue Oct 5 11:53:49 2021
|
||||
###
|
||||
|
||||
function scalar_action(U, Phi, lp::SpaceParm, sp::ScalarParam, ymws::YMworkspace{T}) where {T <: AbstractFloat}
|
||||
function scalar_action(U, Phi, lp::SpaceParm, sp::ScalarParm, ymws::YMworkspace{T}) where {T <: AbstractFloat}
|
||||
|
||||
CUDA.@sync begin
|
||||
CUDA.@cuda threads=lp.bsz blocks=lp.rsz krnl_act!(ymws.rm, U, Phi, sp, lp)
|
||||
|
@ -19,7 +19,7 @@ function scalar_action(U, Phi, lp::SpaceParm, sp::ScalarParam, ymws::YMworkspace
|
|||
return S
|
||||
end
|
||||
|
||||
function krnl_act!(act, U::AbstractArray{TG}, Phi::AbstractArray{TS}, sp::ScalarParam{NP,T}, lp::SpaceParm{N,M,D}) where {TG,TS,NP,T,N,M,D}
|
||||
function krnl_act!(act, U::AbstractArray{TG}, Phi::AbstractArray{TS}, sp::ScalarParm{NP,T}, lp::SpaceParm{N,M,D}) where {TG,TS,NP,T,N,M,D}
|
||||
|
||||
|
||||
b, r = CUDA.threadIdx().x, CUDA.blockIdx().x
|
||||
|
@ -39,14 +39,14 @@ function krnl_act!(act, U::AbstractArray{TG}, Phi::AbstractArray{TS}, sp::Scalar
|
|||
for id in 1:N
|
||||
bu, ru = up((b, r), id, lp)
|
||||
|
||||
if ru == r
|
||||
Pup = ntuple(i -> Psh[bu,i], NP)
|
||||
else
|
||||
Pup = ntuple(i -> Phi[bu,i,ru], NP)
|
||||
end
|
||||
|
||||
for i in 1:NP
|
||||
act[b,r] += -2*sp.kap[i]*dot(Psh[b,i],Ush[b,id]*Pup[i])
|
||||
if ru == r
|
||||
Pup = Psh[bu,i]
|
||||
else
|
||||
Pup = Phi[bu,i,ru]
|
||||
end
|
||||
|
||||
act[b,r] += -2*sp.kap[i]*dot(Psh[b,i],Ush[b,id]*Pup)
|
||||
end
|
||||
end
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue