lab-cosmo / i-pi-dev_archive

Development version of i-PI
21 stars 12 forks source link

1 bead calculation with example/harmonic #108

Closed yantaow closed 7 years ago

yantaow commented 8 years ago

Hello,

I branched from the master branch (25fc57db1417165dc95bb27a287e21a36f0588ea). I encountered a problem when running the harmonic example with 1 bead in branch test_examplePharmonic (22cbade50b17436383c22d1a11ae6d1084bad696).

The problem is that the potential energy does not vary, which seems to mean that the bead doesn't move in the simulation.

I'm wondering if you know why this unexpected behaviour happens.

Thanks very much, Yantao Wu

ceriottm commented 8 years ago

Yep I can explain. By default the integrator is fixing the center of mass velocity. If you have one particle and one bead, that means everything is frozen.

yantaow commented 8 years ago

Thanks very much for the reply. This makes much more sense now. I have one more question. Again in the harmonic example, for a multiple-bead calculation (nbead > 1), I found that in the output file, the kinetic energy and the potential are different exactly by a constant throughout the simulation (so kinetic minus potential is conserved) , both in the nve and nvt ensemble.

Is this behavior expected? (because one would expect that the kinetic energy and potential energy to vary in different directions during the simulation)

Thanks very much! Yantao

ceriottm commented 8 years ago

I think that for a harmonic potential that might be the case, although I am not 100% sure, it should be easy to work out what the CV estimator and the potential estimator look like for V=omega^2 q^2/2

On 12 April 2016 at 18:37, Yantao Wu notifications@github.com wrote:

Thanks very much for the reply. This makes much more sense now. I have one more question. Again in the harmonic example, for a multiple-bead calculation (nbead > 1), I found that in the output file, the kinetic energy and the potential are different exactly by a constant throughout the simulation (so kinetic minus potential is conserved) , both in the nve and nvt ensemble.

Is this behavior expected? (because one would expect that the kinetic energy and potential energy to vary in different directions during the simulation)

Thanks very much! Yantao

— You are receiving this because you commented. Reply to this email directly or view it on GitHub https://github.com/ceriottm/i-pi-dev/issues/108#issuecomment-208997122

yantaow commented 8 years ago

Thanks! I worked it out and T_cv and potential energy are indeed exactly the same except an additive constant, if the centroid position stays fixed.

Thanks again.

ceriottm commented 8 years ago

In general I don't think it will be very instructive to work with a single harmonic bead. However by all means test the displaced path estimator, as we implemented it but never really used it so who knows...

On 14 April 2016 at 00:06, Yantao Wu notifications@github.com wrote:

Thanks! I worked it out and T_cv and potential energy are indeed exactly the same except an additive constant, if the centroid position stays fixed.

Thanks again.

— You are receiving this because you commented. Reply to this email directly or view it on GitHub https://github.com/ceriottm/i-pi-dev/issues/108#issuecomment-209667675

yantaow commented 8 years ago

Yes, will do.

However, I somewhat suspect that i-pi simulation will produce the correct momentum distribution, because the code takes away the center of mass motion whereas all the harmonic potential does is to drive the center of mass.

Will run the simulation and do the theory to see if the fixing-center-of-mass dynamics will still produce a momentum distribution that retains effects of the harmonic potential. I will let you know the result!

ceriottm commented 8 years ago

You can also NOT fix the COM eh, the option is False in the dynamics options. M

On 14 April 2016 at 00:26, Yantao Wu notifications@github.com wrote:

Yes, will do.

However, I somewhat suspect that i-pi simulation will produce the correct momentum distribution, because the code takes away the center of mass motion whereas all the harmonic potential does is to drive the center of mass.

Will run the simulation and do the theory to see if the fixing-center-of-mass dynamics will still produce a momentum distribution that retains effects of the harmonic potential. I will let you know the result!

— You are receiving this because you commented. Reply to this email directly or view it on GitHub https://github.com/ceriottm/i-pi-dev/issues/108#issuecomment-209673890