Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Correlated noise #3343

Closed
fweik opened this issue Nov 26, 2019 · 1 comment · Fixed by #3355
Closed

Correlated noise #3343

fweik opened this issue Nov 26, 2019 · 1 comment · Fixed by #3355
Assignees

Comments

@fweik
Copy link
Contributor

fweik commented Nov 26, 2019

The langevin thermostat uses maximally correlated noise for the translation and rotation thermalization.

@RudolfWeeber RudolfWeeber added this to the Espresso 4.1.2 milestone Dec 4, 2019
@RudolfWeeber
Copy link
Contributor

A different RNG salt has to be used for translation and rotation.

Test fragment

    def test_correlations(self):
        """Checks that velocity components are uncorrelated"""

        system=self.system
        system.time_step=0.01
        system.cell_system.skin=0.1
        system.part.add(id=(1,2),pos=np.zeros((2,3)))
        vel_obs = ParticleVelocities(ids=system.part[:].id)
        vel_series = TimeSeries(obs=vel_obs)
        system.auto_update_accumulators.add(vel_series)
        
        if espressomd.has_features("ROTATION"):
            system.part[:].rotation=(1,1,1)
            omega_obs = ParticleBodyAngularVelocities(ids=system.part[:].id)
            omega_series=TimeSeries(obs=omega_obs)
            system.auto_update_accumulators.add(omega_series)
        kT=3.2
        system.thermostat.set_langevin(kT=kT,gamma=2.1,seed=17)
        steps=int(1E5)
        system.integrator.run(steps)

        vel = np.array(vel_series.time_series())
        for i in range(6):
          for j in range(i+1,6):
            print(i,j,np.sum(vel[:,i]*vel[:,j]/steps))
            #self.assertAlmostEqual(np.sum(vel[:,i]*vel[:,j]),0)
        if espressomd.has_features("ROTATION"): 
            omega = np.array(omega_series.time_series())
            for i in range(6):
              for j in range(i+1,6):
                #self.assertClose(np.dot(omega[:,i],omega[:,j]),0)
                print(i,j,np.sum(omega[:,i]*omega[:,j]))
            for i in range(6):
              for j in range(6):
                #self.assertAlmostEqual(np.dot(vel[:,i],omega[:,j]),0)
                print(i,j,np.sum(vel[:,i]*omega[:,j])/steps/kT)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants