Algorithm Search⌘K

Techniqueadvanced

Multipole-to-local translation

Also called M2L translation, M2L operator.

Converts the multipole expansion of a far cell into a local Taylor expansion about a target cell; it is the costliest step of the fast multipole method.

The multipole-to-local (M2L) translation takes the multipole expansion of the charges in one box and gives a local expansion, a Taylor series, of their field about the center of a second box that is well separated from the first. It is the step of the fast multipole method that connects the two trees: the upward pass builds the multipole expansions, M2L turns them into local expansions, and the downward pass moves the local expansions down to the particles. In 2D, with pp terms, one M2L costs O(p2)O(p^2), and each box takes part in up to 27 of them, against 4 multipole shifts and 4 local shifts. In 3D the interaction list has 189 boxes and a direct M2L costs O(p4)O(p^4), so most work on faster FMMs is work on faster M2L.

In plain words

A far group of charges can be described in two ways. The first way is centered on the group: it says how the group pulls on any point far from it. The second way is centered on a region where you want the pull: it says how all far charges pull on points in that region.

The M2L step changes the first description into the second one. It takes the short list of numbers for a source box and gives a short list of numbers for a target box. Many source boxes can then add their lists into one list for the target box. After that, the particles of the target box need only this one list to feel all the sources, instead of one sum for each source box.

When it applies

M2L applies when the field of the sources has a convergent multipole expansion outside a disk (or ball) that holds them, and the target region is a disk (or ball) that lies far enough outside it. In 2D, for charges in the disk of radius RR about z0z_0 and targets in the disk of radius RR about 00, Lemma 4.7 of Beatson and Greengard needs ∣z0∣>(c+1)R|z_0| > (c + 1) R with c>1c > 1. In the uniform FMM, two boxes of side ww in each other's interaction list have centers at least 2w2w apart and radius R=w/2R = w / \sqrt{2}, so c=22−1≈1.83c = 2\sqrt{2} - 1 \approx 1.83. It does not apply to near neighbours: there, the series does not converge in the whole target box.

The kernel must have a separable expansion: the logarithm and 1/r1/r (Laplace), the Helmholtz and Yukawa kernels with Bessel functions, and in a weaker sense any smooth kernel through interpolation or equivalent densities.

The template

For the 2D logarithmic kernel in complex form, the source expansion about z0z_0 is

ϕ(z)=a0log⁡(z−z0)+∑k=1pak(z−z0)k,a0=∑iqi,ak=−∑iqi(zi−z0)kk.\phi(z) = a_0 \log(z - z_0) + \sum_{k=1}^{p} \frac{a_k}{(z - z_0)^k}, \qquad a_0 = \sum_i q_i, \quad a_k = -\sum_i \frac{q_i (z_i - z_0)^k}{k}.
  1. Expand each term about the target center. Move the target center to 00. For ∣z∣<∣z0∣|z| < |z_0|, write log⁡(z−z0)=log⁡(−z0)−∑l≥11l(zz0)l\log(z - z_0) = \log(-z_0) - \sum_{l \ge 1} \frac{1}{l} \left( \frac{z}{z_0} \right)^l and (z−z0)−k=(−z0)−k∑l≥0(l+k−1k−1)(zz0)l(z - z_0)^{-k} = (-z_0)^{-k} \sum_{l \ge 0} \binom{l + k - 1}{k - 1} \left( \frac{z}{z_0} \right)^l.
  2. Collect the powers of zz. This gives ϕ(z)=∑l≥0blzl\phi(z) = \sum_{l \ge 0} b_l z^l with
b0=a0log⁡(−z0)+∑k=1p(−1)kakz0k,bl=−a0lz0l+1z0l∑k=1p(−1)kakz0k(l+k−1k−1)(l≥1).b_0 = a_0 \log(-z_0) + \sum_{k=1}^{p} (-1)^k \frac{a_k}{z_0^k}, \qquad b_l = -\frac{a_0}{l z_0^l} + \frac{1}{z_0^l} \sum_{k=1}^{p} (-1)^k \frac{a_k}{z_0^k} \binom{l + k - 1}{k - 1} \quad (l \ge 1).
  1. Truncate. Keep b0,…,bpb_0, \ldots, b_p. The error inside the target disk is less than A4e(p+c)(c+1)+c2c(c−1)(1/c)p+1A \frac{4e(p + c)(c + 1) + c^2}{c (c - 1)} (1/c)^{p+1} with A=∑∣qi∣A = \sum |q_i| (Lemma 4.7, formula (4.20)). It decays like (1/c)p(1/c)^p, the same rate as the truncation bound with r/Rr / R replaced by 1/c1 / c.
  2. Add. M2L is linear in the aka_k, so the local expansions from all boxes of the interaction list add into one set of blb_l per target box.
  3. Precompute. In a uniform tree, the M2L operator depends only on the offset of the two boxes in units of the side. In 2D there are 72−32=407^2 - 3^2 = 40 offsets. With coefficients scaled by the box size, ak/wka_k / w^k and blwlb_l w^l, the matrices are the same at every level, apart from a log⁡w\log w term in b0b_0.

The cost of one translation by step 2 is p2p^2 multiplications. The matrix (l+k−1k−1)=(l+k−1)!l! (k−1)!\binom{l + k - 1}{k - 1} = \frac{(l + k - 1)!}{l! \, (k - 1)!} is a Hankel matrix in l+kl + k between two diagonal scalings, so an FFT gives the product in O(plog⁡p)O(p \log p).

Classic examples

One charge at the center of the source box. Take q=1q = 1 at z0=2z_0 = 2, so a0=1a_0 = 1 and ak=0a_k = 0 for k≥1k \ge 1. Then b0=log⁡(−2)b_0 = \log(-2), with real part log⁡2=0.693147\log 2 = 0.693147, and bl=−1/(l 2l)b_l = -1/(l \, 2^l): b1=−0.5b_1 = -0.5, b2=−0.125b_2 = -0.125, b3=−0.041667b_3 = -0.041667. At z=0.5z = 0.5 the exact potential is log⁡∣0.5−2∣=log⁡1.5=0.405465\log|0.5 - 2| = \log 1.5 = 0.405465. The local series with p=2p = 2 gives 0.693147−0.25−0.03125=0.4118970.693147 - 0.25 - 0.03125 = 0.411897, an error of 6.4×10−36.4 \times 10^{-3}. With p=4p = 4 and p=8p = 8 the errors are 2.5×10−42.5 \times 10^{-4} and 5.5×10−75.5 \times 10^{-7}, close to the factor ∣z∣/∣z0∣=1/4|z| / |z_0| = 1/4 per term. This case can be checked by hand.

Two charges in an FMM box. Take q1=1q_1 = 1 at 2.3+0.2i2.3 + 0.2\mathrm{i} and q2=−0.5q_2 = -0.5 at 1.8−0.3i1.8 - 0.3\mathrm{i}, in the box of side 1 about z0=2z_0 = 2, and the target box of side 1 about 00, so c=22−1c = 2\sqrt{2} - 1. The multipole coefficients for p=2p = 2 are a0=0.5a_0 = 0.5, a1=−0.4−0.35ia_1 = -0.4 - 0.35\mathrm{i} and a2=−0.0375−0.03ia_2 = -0.0375 - 0.03\mathrm{i}, and M2L gives b1=−0.159375+0.08ib_1 = -0.159375 + 0.08\mathrm{i} and b2=−0.019531+0.038125ib_2 = -0.019531 + 0.038125\mathrm{i}. At z=0.3+0.4iz = 0.3 + 0.4\mathrm{i} the exact potential is 0.4461330.446133. The errors are:

pp multipole series at zz local series after M2L bound (4.20)
2 3.1×10−33.1 \times 10^{-3} 3.5×10−33.5 \times 10^{-3} 19.6
4 5.1×10−65.1 \times 10^{-6} 1.7×10−41.7 \times 10^{-4} 8.9
8 4.2×10−84.2 \times 10^{-8} 4.0×10−74.0 \times 10^{-7} 1.3
16 1.1×10−141.1 \times 10^{-14} 9.1×10−129.1 \times 10^{-12} 1.9×10−21.9 \times 10^{-2}

These were computed with the implementation of the fast multipole method page. The local series is less accurate than the multipole series at the same point, because it must also converge in the whole target disk. The bound is far above the measured error, but it falls at the right rate.

The interaction list. In the 2D FMM, a box at level l≥2l \ge 2 receives M2L translations from the children of its parent's near neighbours that do not touch it: 27 boxes for an interior box. In 3D the same rule gives 63−33=1896^3 - 3^3 = 189 boxes.

Variations

  • 3D spherical harmonics. A pp-term 3D expansion has (p+1)2(p + 1)^2 coefficients, and the direct M2L costs O(p4)O(p^4) (Greengard 1988).
  • Rotations. Rotate the frame so that the translation is along the zz axis, translate along the axis, and rotate back. Each step costs O(p3)O(p^3).
  • Plane waves. The newer 3D FMM of Greengard and Rokhlin converts multipole expansions to exponential (plane-wave) expansions, for which translation is diagonal. Beatson and Greengard (Section 5) state that this replaces 189p4189 p^4 operations per box with about 3p3+189p23 p^3 + 189 p^2.
  • FFT. The Toeplitz or Hankel structure of the operator, in 2D and on a regular grid of equivalent points in 3D, gives O(plog⁡p)O(p \log p) per translation; the kernel-independent FMM uses FFTs for its M2L.
  • Low rank compression. The black-box FMM stores the M2L operator between Chebyshev nodes and compresses it with the singular value decomposition.
  • Adaptive trees. In the adaptive FMM, M2L is used for the V list of boxes of the same size. Boxes of different sizes use direct multipole evaluation (W list) or direct local expansions of the charges (X list) instead.

Pitfalls

  • Wrong sign of the offset. The formulas need z0z_0 as the source center minus the target center. With the other sign, the series is that of a box at the mirror position and is wrong without any error message.
  • Translating near neighbours. The local series converges only for ∣z∣<∣z0∣−R|z| < |z_0| - R. If ∣z0∣≤2R|z_0| \le 2R, it can diverge on part of the target box. Use the interaction list exactly.
  • Overflow and underflow. For large pp, the powers z0−kz_0^{-k} and the binomial coefficients become very large or very small. Use scaled coefficients.
  • The branch of log⁡(−z0)\log(-z_0). Only the real part is the potential. If the imaginary part is used, the branch cuts of all boxes must agree.
  • Trusting the bound as an estimate. The bound (4.20) is many orders of magnitude above the actual error for small pp. Choose pp from measurements against direct summation, or from a sharper bound.
  • Unequal truncation. Keeping pp terms in the multipole expansion but fewer in the local expansion (or the reverse) wastes work, since the error is set by the smaller order.

Exercises

  1. Derive the formula for blb_l in step 2 from the binomial series of (1−z/z0)−k(1 - z/z_0)^{-k}.
  2. Show that the M2L operator for the scaled coefficients a~k=ak/wk\tilde a_k = a_k / w^k and b~l=blwl\tilde b_l = b_l w^l depends only on z0/wz_0 / w, except for the term a0log⁡wa_0 \log w in b0b_0.
  3. For one unit charge at z0=2z_0 = 2, show that the error of the pp-term local series at z=0.5z = 0.5 is ∑l>p4−l/l\sum_{l > p} 4^{-l} / l, and compare it with the numbers above.
  4. Count the 2D interaction list of a box in a corner of the unit square at level 2, and at level 3.
  5. Write the M2L operator as D1HD2D_1 H D_2 with diagonal D1D_1, D2D_2 and a Hankel matrix HH, and explain how an FFT computes HaH a in O(plog⁡p)O(p \log p).

References

  1. Leslie Greengard and Vladimir Rokhlin, A fast algorithm for particle simulations, Journal of Computational Physics 73(2), 1987, 325-348, the conversion of a multipole expansion into a local expansion in 2D and its error bound
  2. Rick Beatson and Leslie Greengard, A short course on fast multipole methods, in Wavelets, Multilevel Methods and Elliptic PDEs, Oxford University Press, 1997, Lemma 4.7, formulas (4.18) to (4.20); Section 5 for the 3D interaction list of 189 boxes and the faster 3D translations
  3. Leslie Greengard, The Rapid Evaluation of Potential Fields in Particle Systems, MIT Press, 1988, the 3D translation operators in spherical harmonics

Where this leads

About this page

The build computes these levels from the evidence in the repository. Each row says what the next level needs. Read what the levels mean.

LadderLevelWhat the next level needs
Human proofH0 no proof
  • add a proof in proofs/ (06.5)
LeanL0 no Lean part
  • name a Lean module in the lean field (07)
VisualV0 none
  • add viz/scene.ts or a figure (10)
WritingW2 basic
  • three classic examples