# tree_d_3d.kernels.log_moments_upward.log_moments_upward_pyccel

*module*

The Pyccel version (CPU) of the ``log_moments_upward`` kernel of the tree.

``log_moments_upward_numpy.py`` next to this file is the version for machines without
Pyccel, with the same arguments; the folder's ``__init__.py`` declares the kernel (see
`tree_d_3d.kernels`). The flat quadtree is described in `tree_d_3d.flat_tree`.

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

## tree_d_3d.kernels.log_moments_upward.log_moments_upward_pyccel.log_moments_upward

*function*

```python
def log_moments_upward(pos: float[:, :], charge: float[:], perm: int64[:], levels: int64[:], node_center: float[:, :], node_start: int64[:], node_end: int64[:], node_child: int64[:], binomial: float[:, :], node_qabs: float[:], moment_re: float[:, :], moment_im: float[:, :]) -> None
```

Complex multipole moments ``a_n = sum_j q_j (z_j - c)**n``, n = 0 ... p, of every node.

``levels[d]:levels[d + 1]`` are the nodes at depth ``d``. Leaves sum their
particles; a parent adds each child's moments shifted by ``s = c_child - c``,
``a_n += sum_m C(n, m) a_m(child) s**(n - m)``. Levels are done from the deepest
up; the nodes of a level are independent.

[View source](https://github.com/max-models/tree-d-3d/blob/devel/src/tree_d_3d/kernels/log_moments_upward/log_moments_upward_pyccel.py#L14-L93)
