# tree_d_3d.kernels.fmm_m2l.fmm_m2l_pyccel

*module*

The Pyccel version (CPU) of the ``fmm_m2l`` kernel of the Barnes-Hut and FMM solvers.

``fmm_m2l_cuda.cu`` next to this file is the CUDA version (GPU) and ``fmm_m2l_numpy.py`` the
version for machines without Pyccel, all with the same arguments; the folder's
``__init__.py`` declares the kernel (see :mod:`tree_d_3d.kernels`). The flat
quadtree is described in :mod:`tree_d_3d.flat_tree`.

[View source](https://github.com/max-models/tree-d-3d/blob/devel/src/tree_d_3d/kernels/fmm_m2l/fmm_m2l_pyccel.py#L1-L1)

## tree_d_3d.kernels.fmm_m2l.fmm_m2l_pyccel.fmm_m2l

*function*

```python
def fmm_m2l(pairs: int64[:, :], count: int, node_center: float[:, :], moment_re: float[:, :], moment_im: float[:, :], binomial: float[:, :], symmetric: int, inv_re: float[:], inv_im: float[:], local_re: float[:, :], local_im: float[:, :]) -> None
```

Add each pair's multipole of one cell to the other's local expansion.

``symmetric`` nonzero truncates the translated series by total degree
(``k + l <= p``, Dehnen's symmetric truncation) instead of ``k <= p`` and
``l <= p``: the pair interaction then depends on ``z_i - z_j`` only, so the
forces of a mutual pair are exactly antisymmetric. ``inv_re``/``inv_im`` are
scratch buffers of length 2 p + 2.

[View source](https://github.com/max-models/tree-d-3d/blob/devel/src/tree_d_3d/kernels/fmm_m2l/fmm_m2l_pyccel.py#L17-L112)
