This paper was converted on www.awesomepapers.org from LaTeX by an anonymous user.
Want to know more? Visit the Converter page.

Summation of certain locally bilinear forms and its applications to the Fast Multipole Method

Yasuhiro Kajima [email protected], Β [email protected] Nagoya Zokei University, Komaki, Aichi 485-8563, Japan
Abstract

The Fast Multipole Method (FMM) reduces the computation of pairwise two-body interactions among NN-particles to order NN, whose computation cost should be of order N2N^{2} by brute force. However, its implementation is somewhat complicated and requires a considerable amount of time to write the code. In this paper, I show a method that enables us to implement and write FMM algorithm code simply and briefly. FMM algorithm is composed of several steps. The main steps are Upward Pass and Downward Pass. Both the Upward Pass and Downward Pass include shift processes by which we move the centers of local expansions and multipole expansions. In this paper, I show a method that enables us to get rid of these processes. As a result of this simplification, the coding of FMM becomes much easier, and we can save considerable computation time. I compared the accuracy and time required to calculate potential fields with that of the existing FMM code.
Keywords:Fast Multipole Method, Parallel computation

1 Introduction

The fast multipole algorithm developed by Greengard and Rokhlin [1] enables us to calculate NN-particles interaction of particles such as gravitational or electrostatic forces with π’ͺ​(N)\mathcal{O}(N) operations with predictable error bounds and considered as one of the top 10 algorithms of the 20th century [2]. Thus, a large amount of papers were published relating to this theory (such as [3]-[7]). The interaction is divided into two parts; near interaction and the rest (not near) interaction. The near interaction part is the interaction of particles each two of which are within a given distance (or within some boxes). This is calculated directly with π’ͺ​(N)\mathcal{O}(N) operations. The rest part is calculated by the FMM also with π’ͺ​(N)\mathcal{O}(N) operations. Thanks to the FMM algorithm, we can perform large-scale simulation ([8]). However, its implementation is not necessarily easy and the time needed to perform simulation is not necessarily short. In [8], we spent about half the computation time for the computation of forces, even though we employed FMM. Therefore, I propose a less time-consuming and easier to implement FMM in this paper.

2 Theory

2.1 Greengard’s Fast Multipole Method

In the following, I describe a two-dimensional case, which is simpler than three-dimensional cases but would be sufficient to understand more general cases intuitively. Unlike Greengard’s FMM, our method for two-dimensional cases can be applied to three dimensional cases straightforwardly. We use the following notation:

  1. I.

    ”The (computation) box” is a (two-dimensional) square with sides of length five. We say the box is at level-zero. The size of the square can be chosen arbitrarily, but I set it five for convenience.

  2. II.

    The box contains NN-charged particles.

  3. III.

    The box is composed of four same-size regular squares, and we call them level-one squares. Here, the ”four” is because we are dealing with a two-dimensional case for simplicity. For a three-dimensional case, it should be ”nine”.

  4. IV.

    Each level-one square is composed of four same squares, and we say the squares are at level-two. We repeat this procedure up to a given level ll. If a square mm is at level kk, we write mm as mkm^{k} to indicate its level kk if necessary. m0m^{0} is the computation box (Fig.1).

    Refer to caption
    Figure 1: Squares at level 0, 1, 2.
  5. V.

    For mikm_{i}^{k} with kβ‰₯2k\geq 2, there is a list of squares around mikm_{i}^{k} called ”interaction list” (see Fig.2,[1]). If mjm_{j} is on the interaction list of mim_{i}, we denote mj∈I​L​(mi)m_{j}\in IL(m_{i}). We call same-sized squares well-separated if the distance between the squares is >> length of the sides of them.

Refer to caption
Figure 2: Interaction list for square i. We say that x’s are in the interaction list of i.

The method I describe in this paper (and Greengard’s method as well) is not restricted to cases where computation boxes are regular squares, nor two-dimensional. We can apply our method to three-dimensional cases. However, for the sake of depicting figures, I restrict myself to two-dimensional cases. The method I describe here for two-dimensional cases can be straightforwardly applied to higher-dimensional cases.

Now, we recall some basic steps composing the Greengard’s FMM briefly and then compare the steps of our method with that. For details, please refer to [1]. FMM is composed of the following steps:

Upward Pass:

  1. U-1

    Form multipole expansions Ξ¦mil\Phi_{m^{l}_{i}} of the potential field due to charged particles in each finest level square milm_{i}^{l} about the square center using spherical harmonics (associated Legendre functions).

  2. U-2

    Form multipole expansions about the centers of all squares at all coarser levels. This step is done by shifting the multipole expansions Ξ¦mik\Phi_{m^{k}_{i}} at level kk to the center of squares mjkβˆ’1m_{j}^{k-1} containing mikm_{i}^{k}. Then add the four resulting multipole expansions to obtain Ξ¦mjkβˆ’1\Phi_{m^{k-1}_{j}}. Repeating this from k=lk=l to k=1k=1, we obtain all Ξ¦mik\Phi_{m^{k}_{i}}’s. The ”shift” is a translation of associated Legendre functions.

Downward Pass:

  1. D-1

    Form a local expansion Ξ¨~m\tilde{\Psi}_{m} about the center of each square mm at each level k<lk<l.

    This is done by first converting multipole expansions Ξ¦mi\Phi_{m_{i}} for squares mi∈I​L​(m)m_{i}\in IL(m) to a local expansion about the center of mm. We denote this by Ξ¨~m,​m​i\tilde{\Psi}_{m_{,}mi}

    Then, adding these multipole expansions Ξ¨~m,​m​i\tilde{\Psi}_{m_{,}mi}, we obtain Ξ¨~m\tilde{\Psi}_{m}:

    Ξ¨~m=βˆ‘mi∈I​L​(m)Ξ¨~m,​m​i.\tilde{\Psi}_{m}=\sum_{m_{i}\in IL(m)}\tilde{\Psi}_{m_{,}mi}.
  2. D-2

    Form a local expansion Ξ¨m\Psi_{m} and compute interactions at the finest level ll.

    Let Ξ¨m=0\Psi_{m}=0 for the square mm at level 0. We shift the center of local expansion Ξ¨mk\Psi_{m^{k}} of level kk to the centers of m1m_{1}, m2m_{2}, m3m_{3}, m4m_{4} in mm, where they are at level k+1k+1 (now, we have made four local expansions). Then, we define Ξ¨mik+1\Psi_{m_{i}^{k+1}} by adding these local expansions to Ξ¨~mik+1\tilde{\Psi}_{m_{i}^{k+1}}. Repeating this procedure inductively, we obtain local expansions at the finest level ll.

Evaluate:

  1. E-1

    For each charge c∈milc\in m_{i}^{l} evaluate the potential (or force) due to not near (not contained in milm_{i}^{l} nor adjacent eight squares mjlm_{j}^{l}) particles.

  2. E-2

    Compute potential due to charges not contained in E-1 directly and add it to the results of E-1.

2.2 Our Method

As mentioned above, the Greengard’s Fast Multipole Method first evaluates the total action of charged particles in a square toward a charged particle in another same-sized square in its interaction list, and sums up the total actions in a specific way so that the order of the calculation to be N. Greengard’s FMM represented this total action using spherical harmonics. In our method, we represent total actions of charges in a square mikm_{i}^{k} by charges fixed in position in the square mikm_{i}^{k}.

We first describe our method in some general manner as ”summation of locally bilinear forms”, and apply it to the computation of the potential of charges.

2.2.1 Locally bilinear forms

I describe here some results on ”summation of locally bilinear forms”.

We assume that there are NN points cic_{i} (1≀i≀N)(1\leq i\leq N) in the computation box m0m^{0}. Each of these point cic_{i} is tagged to a different vector viv_{i} in a 𝚍\mathtt{d}-dimensional vector space 𝐕\bf{V}. We denote this relation by ciβ†’vic_{i}\rightarrow v_{i}. If ciβ†’vic_{i}\rightarrow v_{i} and ci∈mkc_{i}\in m_{k}, we write as vi∈mkv_{i}\in m_{k} by abuse of language. vi∈m0v_{i}\in m^{0} always holds. We will define the map explicitly for charges in two dimensional space later, where the image vv of cc is determined by combining positions and electric charges of cc.

We also assume that there are bilinear forms Bmi,mj​(vk,vl)B_{m_{i},m_{j}}(v_{k},v_{l}) for mi∈I​L​(mj)m_{i}\in IL(m_{j}). They are bilinear with respect to vectors vkv_{k}, vl∈Vv_{l}\in V, however, the bilinear forms have specific meanings only for vk∈miv_{k}\in m_{i} and vl∈mjv_{l}\in m_{j} and vectors spanned by them (spanned by vectors in each square). In this sense, we call them locally bilinear forms.

Then, we compute the summation of the locally bilinear forms for vv by

F​(v)=βˆ‘vk∈mj,v∈m, 1≀k≀NBm,mj​(v,vk).F(v)=\sum_{v_{k}\in m_{j},\ v\in m,\ 1\leq k\leq N}B_{m,m_{j}}(v,v_{k}).

Note that Bmi,mj​(vk,vl)B_{m_{i},m_{j}}(v_{k},v_{l}) is not defined for vkv_{k} near vlv_{l} (i.e., in the inside of adjacent or same square of mjm_{j}), we understand as Bmi,mj​(vk,vl)=0B_{m_{i},m_{j}}(v_{k},v_{l})=0 in this case. We can compute interactions of well-separated NN particles (i.e., interaction between points in well-separated squares) using F​(v)F(v) later.

The main result of this paper is that we can compute the function F​(v)F(v) in a π’ͺ​(N)\mathcal{O}(N) computation without ”shift” procedure.

To show that the computation above is π’ͺ​(N)\mathcal{O}(N), we proceed as follows:

Upward Pass:

  1. UΒ―\rm\bar{U}-1

    Form vectors vmilv_{m_{i}^{l}} for all milm_{i}^{l} by vmil=βˆ‘vk∈milvkv_{m_{i}^{l}}=\sum_{v_{k}\in m_{i}^{l}}v_{k}, where milm_{i}^{l} are squares at level ll (the finest level).

  2. UΒ―\rm\bar{U}-2

    Form vectors vmjv_{m_{j}} from finest squares to coarser squares inductively by

    vmjk=βˆ‘mik+1βŠ‚mjkvmik+1,(k+1≀l)v_{m_{j}^{k}}=\sum_{{m_{i}^{k+1}}\subset m_{j}^{k}}v_{m_{i}^{k+1}},\ \ (k+1\leq l)

Downward Pass:

  1. DΒ―\rm\bar{D}-1

    We form locally linear forms L~m​(v)\tilde{L}_{m}(v) for each square mkm^{k} at each level k<lk<l. For a square mm, we add Bmi,m​(vmi,v)B_{m_{i},m}(v_{m_{i}},v) for squares mi∈I​L​(m)m_{i}\in IL(m), v∈mv\in m and denote the resulting bilinear form by L~m​(v)\tilde{L}_{m}(v):

    L~m​(v)=βˆ‘mi∈I​L​(m)Bmi,m​(vmi,v).\tilde{L}_{m}(v)=\sum_{m_{i}\in IL(m)}B_{m_{i},m}(v_{m_{i}},v).
  2. DΒ―\rm\bar{D}-2

    Compute interactions at the finest level ll. Let Lm​(v)=0L_{m}(v)=0 for the square mm at level 0. We add the linear forms Lmk​(v)L_{m^{k}}(v) of level kk to L~mik+1​(v)\tilde{L}_{m_{i}^{k+1}}(v)’s (i∈{1,2,3,4}i\in\{1,2,3,4\}), where m1m_{1},m2m_{2},m3m_{3},m4m_{4} are the (level k+1k+1) four squares in mkm^{k}. We denote the resulting linear forms by Lmik+1​(v)L_{m_{i}^{k+1}}(v). Repeating this procedure inductively, we obtain the linear forms at the finest level ll.

For v∈mlv\in m^{l} (a finest level square), put F​(v)=Lml​(v)F(v)=L_{m^{l}}(v). This is the same as previously defined F​(v)F(v). Each of these additions (appeared in DΒ―\rm\bar{D}-1 and DΒ―\rm\bar{D}-2) is essentially addition of 𝚍\mathtt{d}-dimensional dual vectors. The reason why this method is π’ͺ​(N)\mathcal{O}(N) is almost the same as Greengard’s FMM.

2.2.2 Applications to FMM

To apply the results obtained above, we proceed as follows. For details, see the appendix.

  1. I.

    First, we fix a one-to-one correspondence between a charged particle and vβˆˆπ•v\in\bf{V}

  2. II.

    Second, we construct bilinear forms Bmi,mj​(vk,vl)B_{m_{i},m_{j}}(v_{k},v_{l}) such that a interaction (such as Coulomb interaction) between ck∈mic_{k}\in m_{i} and cl∈mjc_{l}\in m_{j} is equal to Bmi,mj​(vk,vl)B_{m_{i},m_{j}}(v_{k},v_{l}) within a predictable error bound, where ckβ†’vkc_{k}\rightarrow v_{k} and clβ†’vlc_{l}\rightarrow v_{l}. In the following, an ”error is predictable” means that the value ||errorΓ—du|\times d^{u}| is bounded where dd is the distance between the squares and we know the exponent uu. uu becomes large if we increase the dimension 𝚍\mathtt{d}. The error would be estimated more specifically, but we do not pursue this issue.

  3. III.

    Lastly, we compute the interaction from nearby particles (which are not well-separated) directly.

Note: The map β†’\rightarrow does not depend on the choice of squares containing a charge cc, i.e., if c∈m1c\in m_{1} and c∈m2c\in m_{2} (here the level of m1m_{1} and m2m_{2} should be different), the image of the map is the same. Because of this fact, we can get rid of ”shift”’s in Upward Pass and Downward Pass.

3 Results

I have prepared a Fortran program by modifying existing FMM program developed by Prof. Shuji Ogata (FMMP[9]) to test execution time and accuracy. In the computation, I fixed 4Γ—4Γ—4=644\times 4\times 4=64 positions in each cube precisely the same as Fig.2 in the appendix (The lengths of the sides are five. We are now dealing with three-dimensional cases, so I use a cube instead of a box). The computations were performed in double precision, compiled with Intel Fortran compiler version 19.1, the CPU used is Core i7-9700.

Here, in this section, we compare the computation timings and accuracies of our program with that of FMMP. In FMMP, the maximum order of multipoles is set to five except for a test case shown in the last row in Table 2 which is added to see how the maximum order of multipoles influences the results. Our method can be applied to parallel computing as with Prof. Ogata’s FMMP. However, I have coded for one node this time.

In the following tests, I scattered charges randomly in a cubic box. The charges are +1+1 or βˆ’1-1.

Table 1: Computation timings averaged over 1010 measurements for the case where
number of particles=80000, and maximum level ll=3

[h] program t_up1 t_down2 t_pfs3 total (sec) accuracy4 FMMP 9.1Γ—10βˆ’4\times 10^{-4} 1.4Γ—10βˆ’1\times 10^{-1} 2.9Γ—10βˆ’2\times 10^{-2} 1.7Γ—10βˆ’11.7\times 10^{-1} 0.14Γ—10βˆ’20.14\times 10^{-2} program based on our method 2.2Γ—10βˆ’4\times 10^{-4} 8.5Γ—10βˆ’2\times 10^{-2} 9.0Γ—10βˆ’3\times 10^{-3} 9.4Γ—10βˆ’29.4\times 10^{-2} 0.18Γ—10βˆ’20.18\times 10^{-2}

  • 1

    time for upward pass

  • 2

    time for downward pass

  • 3

    time for computing potential field and force field

  • 4

    averaged values of the relative errors (average of βˆ‘P​FF​M​Mβˆ’P​Fd​i​r​e​c​tP​Fd​i​r​e​c​t\sum\frac{PF_{FMM}-PF_{direct}}{PF_{direct}})

Table 2: number of particles=200000, and maximum level ll=3
program t_up t_down t_pfs total (sec) accuracy
FMMP 9.4Γ—10βˆ’4\times 10^{-4} 1.7Γ—10βˆ’1\times 10^{-1} 7.3Γ—10βˆ’2\times 10^{-2} 2.4Γ—10βˆ’12.4\times 10^{-1} 0.35Γ—10βˆ’20.35\times 10^{-2}
program based on our method 2.3Γ—10βˆ’4\times 10^{-4} 9.1Γ—10βˆ’2\times 10^{-2} 2.3Γ—10βˆ’2\times 10^{-2} 1.1Γ—10βˆ’11.1\times 10^{-1} 0.40Γ—10βˆ’20.40\times 10^{-2}
FMMP(maximum order
of multipoles is four) 5.3Γ—10βˆ’4\times 10^{-4} 8.1Γ—10βˆ’2\times 10^{-2} 5.6Γ—10βˆ’2\times 10^{-2} 1.4Γ—10βˆ’11.4\times 10^{-1} 1.1Γ—10βˆ’21.1\times 10^{-2}
Table 3: number of particles=80000, and maximum level ll=2
program t_up t_down t_pfs total (sec) accuracy
FMMP 1.9Γ—10βˆ’4\times 10^{-4} 9.7Γ—10βˆ’3\times 10^{-3} 2.9Γ—10βˆ’2\times 10^{-2} 3.9Γ—10βˆ’23.9\times 10^{-2} 0.093Γ—10βˆ’20.093\times 10^{-2}
program based on our method 7.8Γ—10βˆ’5\times 10^{-5} 6.4Γ—10βˆ’3\times 10^{-3} 8.0Γ—10βˆ’3\times 10^{-3} 1.4Γ—10βˆ’21.4\times 10^{-2} 0.15Γ—10βˆ’20.15\times 10^{-2}

4 Discussions

(1) We first replaced spherical harmonics by charges fixed in position using Lagrange interpolation. However, there may be other interpolation suitable for FMM. Such a method had been already invented by William Fong and Eric Darve [3]. They used Chebyshev polynomials to interpolate. Their accuracies seem to be better than ours. However, since I have already coded my program before I knew their results and this paper aims to introduce a method that can remove ”shift” in FMM, I left as it was. It seems likely that the method introduced in this paper can be applied to Chebyshev polynomials.

(2) It takes time to compute the bilinear forms Bmi,mj​(vk,vl)B_{m_{i},m_{j}}(v_{k},v_{l}). However, since it does not depend on vkv_{k} and vlv_{l}, we can compute and store the bilinear forms in the memory in advance. It requires only once, so I ignored the time required to compute the bilinear forms. For the case of FMMP, some computation may be done in advance and shorten the computation time.

(3) The bilinear forms Bmi,mj​(vk,vl)B_{m_{i},m_{j}}(v_{k},v_{l}) are essentially matrices. The computations to obtain the matrices go through computation with large numbers and end up with relatively small number entries. Thus, the computation of Bmi,mj​(vk,vl)B_{m_{i},m_{j}}(v_{k},v_{l}) should not be done in a single precision.

(4) As shown in the tables in the previous section, we could save computation time substantially (about half). However, the accuracy of our method is slightly worse than that obtained by the FMMP program. It may become more accurate if we increase the dimension 𝚍\mathtt{d} of 𝐕\bf{V} or employ the method of William Fong and Eric Darve [3]. We find that if we set the maximum order of multipoles equal to four in FMM, the accuracy becomes considerably worse (>1%>1\%), but not so fast.

(5) Since the array data Bmi,mj​(vk,vl)B_{m_{i},m_{j}}(v_{k},v_{l}) is very large, the time required to access memory storing the array is a crucial factor to determine computation time. If we find a good way to manage the memory, it is probable that the computation time would become less.

Appendix A Appendix

In this appendix, I will give a construction of the bilinear forms Bmi,mj​(vk,vl)B_{m_{i},m_{j}}(v_{k},v_{l}) introduced in §​2.2.1\S 2.2.1 in more detail in the following steps. I also provide here descriptions for I\rm{\,I\,} and II\rm{II} in §​2.2.2\S 2.2.2. We assume that the dimension 𝚍\mathtt{d} of 𝐕\bf{V} is equal to 16 for the sake of description. We denote by Ο•(c,cβ€²)\phi(c,c\prime) a function determined by charges cc and cβ€²c\prime such as Coulomb potential. We also write aβ‰ˆba\thickapprox b if aβˆ’ba-b is within a predictable error.

  1. STEP1

    We define 16 (=𝚍\mathtt{d}) positions in each square at every level (Fig.3).

  2. STEP2

    Let a charge c∈mkc\in m^{k} with kβ‰₯0k\geq 0. We define a map hmh_{m} from cc to 16 point-charges on the fixed 16 positions in mm. For k=0k=0 this map is the map introduced in §​2.2.1\S 2.2.1. The map hmh_{m} has the following property (for detail, see A.2.2): If charges c1∈m1kc_{1}\in m_{1}^{k} and c2∈m2kc_{2}\in m_{2}^{k} with kβ‰₯1k\geq 1 and m1m_{1} and m2m_{2} are well-separated, then

    ϕ​(c1,c2)β‰ˆβˆ‘i16ϕ​(c1i,c2)\phi(c_{1},c_{2})\thickapprox\sum^{16}_{i}\phi(c_{1}^{i},c_{2})

    where hm1​(c1)h_{m_{1}}(c_{1})={c1ic_{1}^{i}, (1≀i≀161\leq i\leq 16)}. By assigning the electric charges of the 16 point charges to the coordinate of 16 dimensional vector space, the image of the map hm1h_{m_{1}} can be regarded as a column vector in a 16-dimensional space. We also denote this column vector by hm1​(c)h_{m_{1}}(c). We identify the vector space 𝐕\bf{V} with the values of the 16 point-charges in m0m^{0}.

  3. STEP3

    We define a bilinear form bm1,m2​(v1,v2)β‰ˆΟ•β€‹(c1,c2)b_{m_{1},m_{2}}(v_{1},v_{2})\thickapprox\phi(c_{1},c_{2}) for v1∈m1v_{1}\in m_{1} and v2∈m2v_{2}\in m_{2} by

    bm1,m2​(v1,v2)=βˆ‘i16βˆ‘j16ϕ​(c1i,c2j)b_{m_{1},m_{2}}(v_{1},v_{2})=\sum^{16}_{i}\sum^{16}_{j}\phi(c_{1}^{i},c_{2}^{j})

    where c1β†’v1c_{1}\rightarrow v_{1} and c2β†’v2c_{2}\rightarrow v_{2}, hm1​(c1)h_{m_{1}}(c_{1})={c1ic_{1}^{i}, (1≀i≀161\leq i\leq 16)}, and hm2​(c2)h_{m_{2}}(c_{2})={c2jc_{2}^{j}, (1≀j≀161\leq j\leq 16)}.

  4. STEP4

    By the STEP2 above, we can map a charge c∈mc\in m to 16 point charges hm​(c)h_{m}(c) ∈m\in m. Let pi∈m0p_{i}\in m^{0} (1≀i≀16)(1\leq i\leq 16) be the 16 point charges of m0m^{0} arranged as in Fig.3. We assume C​h​g​(pi)=1Chg(p_{i})=1 (1≀i≀16)(1\leq i\leq 16), where C​h​g​(p)Chg(p) denote the electric charge of pp. We can transform each of the 16 point charges pi∈m0p_{i}\in m^{0} in m0m^{0} to the 16 point charges in mikm^{k}_{i} by hmikh_{m^{k}_{i}}. Then, we define a 16Γ—1616\times 16 matrix Mm1M_{m_{1}} by

    Mm1=(hmi(p1),hmi(p2),,,hmi(p16)).M_{m_{1}}=(h_{m_{i}}(p_{1}),h_{m_{i}}(p_{2}),,,h_{m_{i}}(p_{16})).

    Mm1M_{m_{1}} transforms the 16 charges of m0m^{0} to the 16 charges in m1m_{1}.

  5. STEP5

    We define bilinear forms Bmi,mj​(vk,vl)B_{m_{i},m_{j}}(v_{k},v_{l}) by

    Bmi,mj​(vk,vl)=bmi,mj​(Mmi​vk,Mmj​v2).B_{m_{i},m_{j}}(v_{k},v_{l})=b_{m_{i},m_{j}}(M_{m_{i}}v_{k},M_{m_{j}}v_{2}).

    Writing bm1,m2​(v1,v2)=v1T​Mb​v2b_{m_{1},m_{2}}(v_{1},v_{2})=v_{1}^{T}M_{b}v_{2} with a suitable matrix MbM_{b}, the matrix for Bmi,mj​(vk,vl)B_{m_{i},m_{j}}(v_{k},v_{l}) is

    MmiT​Mb​Mmj,M_{m_{i}}^{T}M_{b}M_{m_{j}},

    where TT denotes its transpose.

In the following, I describe the steps above in more detail.

A.1 STEP1

We fix 16 points as illustrated in Fig.3. The number of points should be n2n^{2} and n3n^{3} for 2-dimensional case and 3-dimensional case, respectively.

Refer to caption
Figure 3: 16 points in a square. We can arbitrarily choose the number of points as long as it is a squared integer. For the case of three-dimensional cases, it should be cubed integer. We can choose other arrangements of points than the above.

A.2 STEP2

A.2.1 Lagrange interpolation

For any polynomial g​(x)g(x) with deg⁑(g)<n\deg(g)<n, we have

βˆ‘infi​(x)​gi​(ai)βˆ’g​(x)=0\sum^{n}_{i}f_{i}(x)g_{i}(a_{i})-g(x)=0 (1)

for arbitrarily chosen distinct mm-numbers {aia_{i}}, where fi​(x)=Fi​(x)Fi​(ai),Fk​(x)=∏iβ‰ kn(xβˆ’ai)=∏i=1n(xβˆ’ai)(xβˆ’ak)f_{i}(x)=\frac{F_{i}(x)}{F_{i}(a_{i})},\ F_{k}(x)=\prod^{n}_{i\neq k}(x-a_{i})=\frac{\prod^{n}_{i=1}(x-a_{i})}{(x-a_{k})}.

If d​e​g​(g​(x))β‰₯ndeg(g(x))\geq n or g​(x)g(x) is a power series, βˆ‘jnfj​(x)​g​(aj)βˆ’g​(x)=xnΓ—(power​series)\sum^{n}_{j}f_{j}(x)g(a_{j})-g(x)=x^{n}\times({\rm power\ series}). Thus potential field is approximated with a predictable error.

A.2.2 Approximation of a charge by charges fixed in position

Let us assume that a charged particle is located at a point PP. We represent the field of charge due to this particle at point AA by four charges located at P2,P1,Pβˆ’1,Pβˆ’2P_{2},P_{1},P_{-1},P_{-2} by applying the results above. Let ϕ​(P,A)\phi(P,A) be a function determined by charges PP and AA. For instance, ϕ​(P,A)=C​h​g​(P)Γ—C​h​g​(A)|Pβˆ’A|\phi(P,A)=\frac{Chg(P)\times Chg(A)}{|P-A|} where C​h​g​(X)Chg(X) denote the electric charge of the point charge XX.

Let A,BA,\ B be points shown in Fig.4, ϕ​(P,A)\phi(P,A) can be written as

ϕ​(P,A)β‰ˆβˆ‘i,j∈{2,1,βˆ’1,βˆ’2}fi​(x)​fj​(y)​ϕ​(Li,j,A)\phi(P,A)\thickapprox\sum_{i,j\in\{2,1,-1,-2\}}f_{i}(x)f_{j}(y)\phi(L_{i,j},A) (2)

where fif_{i} is the function defined in the previous section for n=4n=4 and ai={2,1,βˆ’1,βˆ’2}a_{i}=\{2,1,-1,-2\}, and (x,y)(x,y) is the coordinate of the point PP as depicted in the figure. Putting P=c1P=c_{1}, A=c2A=c_{2}, and {c1k, 1≀k≀16}={fi(x)fj(y)Chg(P), 1≀i≀4, 1≀j≀4}\{c_{1}^{k},\ 1\leq k\leq 16\}=\{f_{i}(x)f_{j}(y)Chg(P),\ 1\leq i\leq 4,\ 1\leq j\leq 4\} as hm1​(c1)h_{m_{1}}(c_{1})={c1ic_{1}^{i}, (1≀i≀161\leq i\leq 16)} described in STEP2, we get the relation ϕ​(c1,c2)β‰ˆβˆ‘i16ϕ​(c1i,c2)\phi(c_{1},c_{2})\thickapprox\sum^{16}_{i}\phi(c_{1}^{i},c_{2}).

Refer to caption
Figure 4: Points A and B

References

  • [1] Leslie F. Greengard, The Rapid Evaluation of Potential Fields in Particle Systems, The MIT Press, Cambridge, Massachusetts, 1988
  • [2] The Best of the 20th Century: Editors Name Top 10 Algorithms, SIAM News, 33, 1 (2000)
  • [3] William Fong, Eric Darve, The black-box fast multipole method, J. Comp. Phys. 228, 8712-8725 (2009)
  • [4] Board, J. and Schulten, K. ,The fast multipole algorithm, Comput. Sci. Eng. 2, 76-79 (2000)
  • [5] C.A. White and M. Head-Gordon, Derivation and efficient implementation of the fast multipole method, J. Chem. Phys., 101, 6593-6605 (1994)
  • [6] H. Fujiwara, The fast multipole method for solving integral equations of three-dimensional topography and basin problems, Geophys. Int. J.,140, 198-210 (2000)
  • [7] T. Hrycak and V. Rokhlin, An improved fast multipole algorithm for potential fields,SIAM J. Sci. Comput., 19, 1804-1826 (1998)
  • [8] Y. Kajima, S. Ogata, R. Kobayashi, M. Hiyama, and T. Tamura, Fluctuating Local Recrystallization of Quasi-Liquid Layer of Sub-Micrometer-Scale Ice: A Molecular Dynamics Study, J. Phys. Soc. Jpn. 83, 83601 (2014)
  • [9] Shuji Ogata, Timothy J. Campbell, Rajiv K. Kalia, Aiichiro Nakano, Priya Vashishta, and Satyavani Vemparala, Scalable and portable implementation of the fast multipole method on parallel computers, Comp. Phys. Comm., 153, 445-461 (2003)