Skip to content

Shape Functions and PIC as Monte-Carlo Sampling

Source: PHY653B Ch. 3

Intuition

PHY653 introduced PIC as a computational trick to avoid \(\mathcal{O}(N^2)\) forces. That framing is useful and incomplete. The sharper view: PIC is Monte-Carlo sampling of the Vlasov equation. Markers are not particles and they are not "super-particles" in any physical sense — they are sample points of \(f(x,v,t)\), carried along characteristics. Everything PIC does well and everything it does badly follows from that.

Markers sample \(f\)

Write \(f\) as a sum of finite-width blobs:

\[f(x,v,t) \approx \sum_{p} w_p\,S(x - x_p)\,\delta(v - v_p)\]

with \(S\) the shape function. Moments become sums over markers, and the \(1/\sqrt{N}\) statistical error of Monte-Carlo integration is inherited directly — that is the origin of PIC noise, not a defect of the implementation.

The shape function hierarchy

Order Name Width Behaviour
0 NGP (nearest grid point) 1 cell Extremely noisy; force jumps discontinuously as a marker crosses a cell
1 CIC (cloud-in-cell) 2 cells The standard workhorse; continuous force, tolerable noise
2 TSC (triangular shaped cloud) 3 cells Smoother, less noise, ~50% more cost
3 Cubic spline 4 cells Very smooth; used where noise is critical

Higher order smooths the density and the force, reducing noise and grid heating — at the cost of more grid points touched per marker and more short-wavelength physics washed out.

The non-negotiable rule

Deposit and interpolate with the same shape function.

\[n_j = \sum_p w_p S(x_j - x_p) \qquad\qquad E(x_p) = \sum_j E_j\,S(x_j - x_p)\]

If the two differ, a marker exerts a force on itself: its own deposited charge produces a field that does not vanish at its own location. The consequence is a spurious self-force, momentum conservation is lost, and the plasma heats artificially. This is not a subtle accuracy issue — it is a systematic, energy-injecting bug that looks like physics.

Using matched shape functions guarantees the self-force cancels exactly, which is why the rule is stated so emphatically in every PIC text.

Weight, not charge

Each marker carries a weight \(w_p\) representing how much of \(f\) it stands for. Uniform weights are simplest, but variable weighting lets you place markers where the physics is rather than where the density is — crucial when the interesting population is a sparse tail (runaways, fast ions, the resonant particles in Landau damping). This is importance sampling, and it is the main reason to think of PIC as Monte-Carlo rather than as particles.

Common mistakes

  • Mismatched deposit/interpolate. See above. The single most damaging PIC bug.
  • Thinking a marker is a physical particle. It is a sample point. Asking "how many real electrons is this?" leads to confusion about noise; asking "how well does this sample \(f\)?" does not.
  • Using NGP because it is fastest. The noise costs you more markers than the smoother scheme costs in flops.

Knowledge graph position

Prerequisites: PIC method, Vlasov–Poisson, Monte-Carlo integration. Leads to: electromagnetic PIC, noise and heating, delta-f and variable-weight schemes.

Quiz

Q1 (conceptual). Why must deposition and interpolation use the same shape function?

Answer

So the field a marker generates exerts no net force on itself. With matched weights the self-force cancels identically; mismatched weights leave a residual that accelerates markers according to their own charge, breaking momentum conservation and heating the plasma artificially.

Q2 (conceptual). In what sense is PIC noise irreducible?

Answer

It is Monte-Carlo sampling error, scaling as \(1/\sqrt{N_{\rm ppc}}\). It is not an implementation flaw and cannot be removed by a better algorithm — only by more markers (expensive), smoother shape functions (limited), or variance-reduction techniques such as delta-f.

Q3 (MCQ). Moving from CIC to TSC shape functions primarily:

  • (a) makes the code faster
  • (b) reduces noise and grid heating at the cost of touching more grid points and smoothing short wavelengths
  • (c) removes the need for a field solve
  • (d) eliminates the self-force
Answer

(b). The wider, smoother cloud averages over more grid points, cutting density noise and finite-grid heating; the price is ~50% more deposit/interpolate work and the loss of some genuine short-wavelength physics. (d) is wrong: the self-force is cancelled by matching deposit and interpolate, at any order.