classmethod graphicle.data.MomentumArray.from_spherical_uniform(size: int, max_energy: float, massless: float = 0.0, seed: int | None = None) MomentumArray[source]

Returns a MomentumArray whose elements are sampled from uniform distributions of energy and 3-momentum.

New in version 0.4.0.

Parameters:
size : int

Number of elements.

max_energy : float

Upper bound for the energy of the momenta.

massless : float

Probability for any given momentum element to be massless. Default is 0.0.

seed : int, optional

Random number generator seed. Use the same seed for consistent results.

Returns:

Set of momenta, sampled uniformly in the energy component, and with uniform probability density over the surface of a 3-sphere for the spatial components.

Return type:

MomentumArray

Raises:

ValueError – If massless is not within the interval [0.0, 1.0].

Notes

Some ‘massless’ particles may have small, but finite masses. This is due to numerical errors associated with floating point calculations.


Last update: Jun 27, 2025