# tree_d_3d.kernels.pair_energy.pair_energy_pyccel

*module*

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

``pair_energy_cuda.cu`` next to this file is the CUDA version (GPU) and ``pair_energy_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/pair_energy/pair_energy_pyccel.py#L1-L1)

## tree_d_3d.kernels.pair_energy.pair_energy_pyccel.pair_energy

*function*

```python
def pair_energy(pos: float[:, :], charge: float[:], softening: float, status: int64[:], energy: float[:]) -> None
```

Add the exact sum of q_i q_j / sqrt(r**2 + eps**2) over pairs, without
``k_e``, to ``energy[0]``; ``status[0]`` is 1 for coincident unsoftened charges.

[View source](https://github.com/max-models/tree-d-3d/blob/devel/src/tree_d_3d/kernels/pair_energy/pair_energy_pyccel.py#L15-L56)
