Repository navigation
Description
The docs and docstrings describe SpinParameter as the Bullock et al. (2001) spin parameter, but for spherical-overdensity apertures it is computed as
λ = |L| / (√2 M V_max R_SO):
SOAP/SOAP/particle_selection/SO_properties.py
Lines 533 to 548 in 8178f55
| def spin_parameter(self) -> unyt.unyt_quantity: | |
| """ | |
| Spin parameter of all particles in the spherical overdensity. | |
| Computed as in Bullock et al. (2001): | |
| lambda = |Ltot| / (sqrt(2) * M * v_max * R) | |
| """ | |
| if self.Mtotpart == 0: | |
| return None | |
| if self.Vmax_soft > 0: | |
| vrel = self.velocity - self.vcom[None, :] | |
| Ltot = np.linalg.norm( | |
| (self.mass[:, None] * np.cross(self.position, vrel)).sum(axis=0) | |
| ) | |
| return Ltot / (np.sqrt(2.0) * self.Mtotpart * self.SO_r * self.Vmax_soft) | |
| return None |
Bullock et al. define
λ′ = J / (√2 M V R)
for a sphere of radius R, with V = √(GM/R) the circular velocity at R (not the peak), and evaluate it at the virial radius, i.e. with V = V_vir.
SOAP's BN98 aperture is exactly that virial radius, so there SpinParameter should reproduce Bullock's λ′, but it differs by V_vir/V_max. The same definition applied to the other SO apertures gives
λ = |L| / √(2 G M³ R_SO).
The V_max normalisation looks like it was carried over from the subhalo definition (39350cf → 22c3830), where R = R_vmax and V_circ(R) = V_max, so the two coincide:
SOAP/SOAP/particle_selection/subhalo_properties.py
Lines 1019 to 1045 in 8178f55
| def spin_parameter(self) -> unyt.unyt_quantity: | |
| """ | |
| Spin parameter of all particles in the subhalo. | |
| Computed as in Bullock et al. (2001): | |
| lambda = |Ltot| / (sqrt(2) * M * v_max * R) | |
| Since a subhalo does not have a characteristic radius, R, we instead use | |
| the radius at which v_max is reached (and the corresponding mass). | |
| """ | |
| if self.Mtot == 0: | |
| return None | |
| if self.R_vmax_soft > 0 and self.Vmax_soft > 0: | |
| mask_r_vmax = self.radius <= self.R_vmax_soft | |
| vrel = self.velocity[mask_r_vmax, :] - self.vcom[None, :] | |
| Ltot = np.linalg.norm( | |
| ( | |
| self.mass[mask_r_vmax, None] | |
| * np.cross(self.position[mask_r_vmax, :], vrel) | |
| ).sum(axis=0) | |
| ) | |
| M_r_vmax = self.mass[mask_r_vmax].sum() | |
| if M_r_vmax > 0: | |
| return Ltot / ( | |
| np.sqrt(2.0) * M_r_vmax * self.Vmax_soft * self.R_vmax_soft | |
| ) | |
| return None |
For SO haloes they don't: V_max is reached well inside R_SO, and SpinParameter = λ_B × V_circ(R_SO) / V_max. For an NFW halo V_max/V_vir depends only on concentration (≈1.06 at c = 5, ≈1.20 at c = 10). So the SO spin is biased low by ~0.03–0.08 dex, by an amount that tracks concentration, which adds spurious trends with mass, redshift and cosmology. In a DMO suite we see a ~0.07 dex offset from Rockstar Spin_Bullock at the virial radius until we rescale by V_max/V_vir.
The documentation states the V_max form without noting the difference from Bullock et al.:
SOAP/documentation/footnotes/spin.rst
Lines 1 to 10 in 8178f55
| **The spin parameter** is computed following `Bullock et al. (2001) <https://ui.adsabs.harvard.edu/abs/2001ApJ...555..240B>`__: | |
| .. math:: | |
| \lambda{} = \frac{|\vec{L}_{\rm{}tot}|}{\sqrt{2}M v_{\rm{}max} R}, | |
| where :math:`\vec{L}_{\rm{}tot}` is the total angular momentum of all particles within radius :math:`R`, and :math:`M` their | |
| total mass. The angular momentum is computed relative to the halo centre and the total centre of mass | |
| velocity. Since subhalos do not have a natural radius associated with them, we use the radius where the softened | |
| :math:`v_{\rm{}max}` is reached. |
I'm unclear what to suggest. Either we use a different definition for SO apertures, e.g. V_circ(R_SO) = √(G M_SO / R_SO), i.e. λ = |L| / √(2 G M³ R_SO), and leave the subhalo definition as it is. Or, if backwards compatibility matters, keep the current quantity under a new name (e.g. SpinParameterVmax), or at least document the V_max normalisation.
Happy to open a PR if this is welcome.
Activity
robjmcgibbon commentedon Nov 19, 2026
Hi Chris, thanks for flagging this. I'm inclined to update the spherical overdensity calculation to use the definition in the Bullock paper. Let me check with Joop to see what he thinks before I update it though.
robjmcgibbon commentedon Nov 30, 2026
Closed by #256