# tree_d_3d.kernels.pair_energy.pair_energy_metal

*module*

The Metal version (Apple-silicon GPU, float32) of the ``pair_energy`` kernel.

``pair_energy_pyccel.py`` next to this file is the CPU version with the same
arguments. One thread per particle ``i`` sums its pairs with ``j > i`` into its own
entry of ``partial`` (float32); the host adds the sum of ``partial``, in float64,
to ``energy[0]``. See :mod:`tree_d_3d.kernels._metal`.

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

## tree_d_3d.kernels.pair_energy.pair_energy_metal.pair_energy

*function*

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

Add the pair sum of q_i q_j / sqrt(r**2 + eps**2) to ``energy[0]`` on the GPU.

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