Colossus Comparison Notes¶
This note documents the known causes of differences between hmf and
Colossus for the native
Tinker08 halo mass function.
In versions pre-3.6.1, a major difference was the growth factor computation, which was
definitively less accurate in hmf than in Colossus. However, after
fixing the growth factor implementation in
this PR for v3.6.0, and then tightening
the growth-selector threshold in v3.6.1, some small residual differences remain,
particularly at high redshift.
The goal of this note is not to argue that either code is definitively “more correct”. Instead, it records the main implementation choices that explain the observed residual differences so that users and developers understand where agreement is expected and where small systematic offsets are normal.
Setup of the comparison¶
The comparisons discussed here were made with:
the native
200mform ofTinker08,matched flat cosmologies with
H0 = 67.74,Om0 = 0.3089,Ob0 = 0.0486,sigma8 = 0.8159, andns = 0.9667,the
EHtransfer model inhmf, anddirect comparisons of
dndlnmat representative masses \(10^{11}\), \(10^{12}\), and \(10^{13}\,M_\odot/h\).
With this setup, the mismatch is small at low redshift and grows toward high redshift, particularly in the rare-halo tail.
What is not driving the mismatch¶
Several obvious suspects were checked and found not to be the dominant cause:
Mass-definition conversion: this comparison uses native
200mTinker08predictions, so it does not rely on the mass-definition conversion path.Transfer-function normalization at \(z=0\):
hmfand Colossus agree on \(\sigma(M,0)\) at about the \(10^{-4}\) level for the matched setup.Slope term: the logarithmic slope entering
dndlnm, \(d \ln \sigma / d \ln R\), agrees at the sub-\(0.1\%\) level.
The main causes of the residual difference¶
Two effects dominate the remaining mismatch.
High-redshift growth implementation¶
After the selector update, hmf uses the full ODE growth solution whenever
the radiation fraction exceeds the calibrated threshold (essentially for z>1.5).
Colossus uses a different hybrid approach for LCDM cosmologies:
an analytic matter-radiation approximation at high redshift, and
an integral solution at low redshift,
with a transition regime between them.
These are both reasonable algorithmic choices, but they do not produce exactly
the same high-redshift growth history. In the matched comparison used here,
hmf ends up with a slightly larger \(\sigma(M, z)\) than Colossus at
high redshift, typically by about \(0.26\)–\(0.34\%\) over
z = 6–10 for the masses tested.
That difference is tiny in \(\sigma\) itself, but it is evaluated in the exponential tail of the halo mass function, where very small shifts in \(\sigma\) can produce multi-percent shifts in abundance.
Tinker08 coefficient precision¶
The two codes also do not use numerically identical Tinker08 coefficients.
hmf stores the more precise coefficient values, for example:
A_200 = 0.1858659a_200 = 1.466904b_200 = 2.571104c_200 = 1.193958
Colossus uses the rounded table values:
A_200 = 0.186a_200 = 1.47b_200 = 2.57c_200 = 1.19
At fixed \(\sigma\), this coefficient rounding changes \(f(\sigma)\) by only a little at low redshift, but by several percent in the high-redshift tail. In the matched tests performed here, the coefficient choice alone accounts for approximately:
\(2\)–\(6\%\) at
z = 6,\(3\)–\(10\%\) at
z = 8, and\(4\)–\(15\%\) at
z = 10,
depending on mass.
How the effects combine¶
The two dominant effects push in opposite directions:
the slightly larger high-redshift \(\sigma(M, z)\) in
hmftends to increase the abundance relative to Colossus, whilethe more precise
Tinker08coefficients inhmftend to decrease the abundance relative to Colossus’ rounded table.
Because these effects partially cancel, the final mismatch is significantly
smaller than either ingredient by itself. For the matched setup used in the
external regression test, the resulting hmf versus Colossus difference is
typically of order:
z = 6: \(\sim 0.1\%\) to \(2.7\%\),z = 8: \(\sim 1\%\) to \(7\%\),z = 10: \(\sim 2\%\) to \(14\%\),
over the range \(10^{11}\)–\(10^{13}\,M_\odot/h\).