[MMTK] MMTK.Universe.randomPoint(), bug?

Andreas Kring akring1729 at gmail.com
Thu Nov 8 15:42:13 UTC 2007


Hi,

I just tried running the MMTK-script below, and I think there might be a 
bug (maybe?) in the MMTK.Universe.randomPoint() method. This method 
should return a random point from a uniform distribution within the 
universe, but the script below only returns coordinates with negative 
x-, y-, and z-components (see output below)?

This seems strange since the universe is equally placed in all the 8 
octants. (If 25 is change to 1000 in the loop, this is still the case!)

Is this a bug in MMTK?

Kind regards
Andreas


----- Script -----
from MMTK import *
from MMTK.ForceFields import LennardJonesForceField

L_real = 36.97   # Simulation box length (Ang)

Ar = Atom('Ar')

universe = 
CubicPeriodicUniverse(L_real*Units.Ang,LennardJonesForceField(3.5*Ar.LJ_radius))

for i in range(25):
      print universe.randomPoint()
------------------


Output:
[-3.459805187700447, -0.8171928935804017, -1.2317931988716462]
[-1.3709592510205568, -0.98807793162253277, -2.5922977333306374]
[-0.73483170401374887, -2.6532989818913872, -0.086560819763025487]
[-2.9579198929928077, -1.4977873200361351, -3.5851765342455257]
[-1.904172929179387, -2.1349234761476445, -0.64754207225197979]
[-0.84974963275866222, -0.3076676088326003, -2.2298944434363732]
[-1.0612453542062292, -0.27443912296542267, -1.5070193814870312]
[-0.70765912006413612, -0.10632641316226302, -1.0741960827532526]
[-3.6059609940886803, -0.69142476701576072, -1.9078656814099666]
[-2.7198539024062174, -0.12575665909591571, -2.5448209809838298]
[-0.34219471386874556, -0.69123015556862966, -2.1442875386741838]
[-1.7179766996011725, -2.0283211492364681, -1.6902830295102622]
[-3.0223046273352328, -2.5840515938662953, -0.9507644732479047]
[-0.085496804674930996, -0.29495931347283821, -2.5097688341177466]
[-1.8516487668504737, -2.6147414903979898, -0.3828796397966715]
[-0.49152797243717755, -1.8188906909597964, -0.31634799313412965]
[-1.0386509897159089, -1.8634441091799092, -0.66598692443901197]
[-2.6094972425676981, -3.299760087005664, -2.335619175360057]
[-3.2042592414753588, -0.64598975285298121, -2.6332246585091883]
[-3.1148466346219461, -2.5245181497147127, -1.545083400452899]
[-1.6671053736716372, -2.4841444741644993, -3.1238261502192231]
[-3.6929820009643715, -1.2271838611498627, -2.5024764612309647]
[-0.25045861139480896, -2.4259389869717221, -3.0315418136649059]
[-3.6762359304244661, -2.1388326144471175, -1.320945722765497]
[-3.2980923100657278, -3.2016716813239356, -1.4691963996431125]




More information about the mmtk mailing list