ComputationalPhysics2 icon indicating copy to clipboard operation
ComputationalPhysics2 copied to clipboard

Issues in python code

Open aromanro opened this issue 6 years ago • 0 comments

Hi,

Related with the previous bug report, I was looking over this page: http://compphysics.github.io/ComputationalPhysics2/doc/pub/vmc/html/vmc-bs.html

I noticed some issues in the python code. I think that the gradient optimization code for the two non interacting particles case should accumulate the DeltaPsi value, so instead of:

        DeltaE = LocalEnergy(PositionOld,alpha)
        DeltaPsi = DerivativeWFansatz(PositionOld,alpha)
        energy += DeltaE
        DerivativePsiE += DeltaPsi*DeltaE

should be something like:

        DeltaE = LocalEnergy(PositionOld,alpha)
        val = DerivativeWFansatz(PositionOld,alpha)
        DeltaPsi += val
        energy += DeltaE
        DerivativePsiE += val*DeltaE

Also the computation of the GreensFunction looks suspicious at a very superficial look, as there, for example, it should be a division with the TimeStep.

aromanro avatar Feb 08 '20 13:02 aromanro