subroutine displace implicit none include 'pimc.par' integer il,l,js,i,is,nj,mi,ik,js1,is1,k,mover(mmovers) real*8 eps,xold(mdim,mslices),dx(mdim),ronf real*8 delta12,deltac,pold12,pnew12,cold,cnew real*8 pwold(mnkv2,mparts,mslices),deltaew,ewold,ewnew real*8 cpotold(mslices),epewold(mslices,mslices) real*8 epold,epnew,depew real*8 phonon,coulomb,phonon3 parameter (eps=1.d-32) external phonon,coulomb,phonon3 include 'pimc.cm' c do an attempt to displace the entire path as a rigid body do nj=1,np c loops recursively over electrons do l=1,ndim call rmar(ronf) dx(l)=hop*(ronf-0.5d0) do js=1,nslices xold(l,js)=x(l,nj,js) x(l,nj,js)=x(l,nj,js)+dx(l) ! hop*(ronf-0.5) enddo enddo cold=0.d0 cnew=0.d0 do js=1,nslices js1=iwrap(js-1) do mi=1,np if (mi.ne.nj) then cold=cold+coulomb(xold(1,js),x(1,mi,js), & xold(1,js1),x(1,mi,js1),ndim) cnew=cnew+coulomb(x(1,nj,js),x(1,mi,js), & x(1,nj,js1),x(1,mi,js1),ndim) endif enddo do mi=1,2 cold=cold-coulomb(xold(1,js),proton(l,mi), & xold(1,js1),proton(l,mi),ndim) cnew=cnew-coulomb(x(1,nj,js),proton(l,mi), & x(1,nj,js1),proton(l,mi),ndim) enddo enddo deltac=-cnew+cold ntrydsp=ntrydsp+1 call rmar(ronf) ronf=dlog(max(eps,ronf)) c write (*,*) delta,ronf if ( deltac .ge. ronf ) then c ** .. accept ** naccdsp = naccdsp + 1 c update the action cpot=cpot-deltac action=cpot else c ** .. reject and replace ** do js=1,nslices do l=1,ndim x(l,nj,js) = xold(l,js) enddo enddo endif enddo ! over particles return end