Particle sampling

SpinGEMPIC.sample!Method
sample!( rng, pg, df, mesh, method)

Sample from a Particle sampler

  • rnd : Random generator
  • pg : Particle group
  • df : Distribution function
  • mesh : Domain
  • method : weighted or quietstart with weigth = 1
source
SpinGEMPIC.sample_quietstart!Method
sample_quietsart!( rng, pg, df, mesh)

Sample from a Particle sampler

  • rnd : Random generator
  • pg : Particle group
  • df : Distribution function
  • mesh : Domain

Input r is a random number $\in [0,1]$

\[ f(x) = 1 + \alpha cos(k x)\]

on some domain $[0, 2\pi/k]$

Solve the equation $P(x)-r=0$ with Newton’s method

\[ x^{n+1} = x^n – (P(x)-(2\pi r / k)/f(x) \]

with

\[P(x) = \int_0^x (1 + \alpha cos(k y)) dy\]

\[P(x) = x + \frac{\alpha}{k} sin (k x)\]

source
SpinGEMPIC.sample_weighted!Method
sample_weighted!( rng, pg, df, mesh)

Sample from a Particle sampler

  • rnd : Random generator
  • pg : Particle group
  • df : Distribution function
  • mesh : Domain
source