pele-python / mcpele

Monte Carlo and parallel tempering routines built on the pele foundation
Other
20 stars 5 forks source link

Uniform sampling #71

Closed kjs73 closed 8 years ago

kjs73 commented 9 years ago

Adds uniform sampling of points in n-dimensional spheres and cubes. This is useful for some direct sampling applications.

js850 commented 9 years ago

cool, I never saw that particular method, I wonder if it's actually faster than the method I mentioned. I guess the only difference is drawing from an exponential distribution vs a power law distribution.

yeah, 3 dimensions is a marginal case. You would have to do benchmarking to be sure. But probably the takestep routine is not going to be the bottleneck for most calculations, so I would use the one that generalizes well.

kjs73 commented 8 years ago

Spherical sampling is now changed to the method described in the reference and, e.g. in Numerical Recipes, 3rd ed., p. 1129. Can this be merged?

js850 commented 8 years ago

Hi Julian, it looks good. My comments were just suggestions, so i would say pull whenever you're ready. (I didn't check whether it was correct, I'll assume it works as it's supposed to).