# tree_d_3d.kernels.quadtree_moments_upward.quadtree_moments_upward_pyccel

*module*

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

``quadtree_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/quadtree_moments_upward/quadtree_moments_upward_pyccel.py#L1-L1)

## tree_d_3d.kernels.quadtree_moments_upward.quadtree_moments_upward_pyccel.quadtree_moments_upward

*function*

```python
def quadtree_moments_upward(pos: float[:, :], charge: float[:], perm: int64[:], levels: int64[:], node_center: float[:, :], node_start: int64[:], node_end: int64[:], node_child: int64[:], node_q: float[:], node_qabs: float[:], node_p: float[:, :], node_s: float[:, :]) -> None
```

Signed moments of every node about its centre; ``node_s`` is xx, xy, yy.

``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``:
``p += p_c + q_c s`` and ``S += S_c + p_c s^T + s p_c^T + q_c s s^T``. 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/quadtree_moments_upward/quadtree_moments_upward_pyccel.py#L13-L83)
