CompPhysics / ComputationalPhysics2

Advanced course in Computational Physics, see texbook at http://compphysics.github.io/ComputationalPhysics2/doc/LectureNotes/_build/html/ with an emphasis on computational quantum mechanics, machine learning and quantum computing.
http://compphysics.github.io/ComputationalPhysics2/doc/web/course
Creative Commons Zero v1.0 Universal
169 stars 68 forks source link

Issues in python code #10

Open aromanro opened 4 years ago

aromanro commented 4 years ago

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.