PHANTOM: A MATLAB and Octave Toolbox Connecting Linear Field Statistics to Dark Matter Halo Observables
Pith reviewed 2026-06-26 19:43 UTC · model grok-4.3
The pith
PHANTOM supplies MATLAB and Octave users with a validated set of routines that link linear density field statistics directly to dark matter halo observables through a reusable cosmology structure.
A machine-rendered reading of the paper's core claim, the machinery that carries it, and where it could break.
Core claim
PHANTOM provides a single-entry-point interface where a cosmology structure carries background expansion, growth factors, and linear power spectrum handles, allowing users to compute field statistics, halo statistics, and halo observables on arbitrary grids while maintaining internal consistency for cold, warm, and fuzzy dark matter models.
What carries the argument
The cosmology structure that stores background expansion, growth, and linear power-spectrum handles and is passed through the call graph to enforce consistency.
If this is right
- Halo statistics and structure calculations remain consistent by design when the input cosmology is updated.
- Users obtain field statistics, halo statistics, and halo observables on arbitrary user-defined grids from one entry point.
- The same interface supports cold, warm, and fuzzy dark matter scenarios without separate code paths.
- Enclosed mass, circular velocity, projected density, and lensing convergence become available directly alongside the linear field quantities.
Where Pith is reading between the lines
- MATLAB-based analysis pipelines can incorporate these calculations without switching languages or relying on external calls.
- The single-structure design could reduce bookkeeping errors during systematic variation of cosmological parameters.
- New observables could be added by writing functions that accept the existing cosmology structure, preserving consistency automatically.
Load-bearing premise
Sub-percent agreement with existing Python implementations on selected quantities is sufficient to confirm correctness of the MATLAB and Octave implementations across all user-defined grids and dark matter scenarios.
What would settle it
A statistically significant mismatch on a grid or dark matter model outside the validated set when compared to independent analytic expectations or higher-precision simulations.
Figures
read the original abstract
We present phantom (Profile and Halo Analysis for Numerous Theoretical dark Matter Observables), a public MATLAB toolbox and Octave package for calculations that connect the linear density field to dark matter halo observables. The package combines a flexible cosmology module with linear power spectrum, variance, and correlation function solvers, and a halo module that covers mass functions, linear bias, density profiles, and concentration-mass relations for cold, warm, and fuzzy dark matter scenarios. All core routines are validated against the Python package colossus, hmf, and halomod, yielding sub-percent agreement for shared models across distances, power spectra, variance, correlation functions, halo mass functions, and density profiles. Phantom is organised around a cosmology structure that stores background expansion, growth, and linear power-spectrum handles; this object is constructed once and passed through the call graph, so that halo statistics and halo structure calculations remain consistent by design. From this single entry point, users can obtain field statistics (power spectrum, variance, correlation function), halo statistics (mass functions, linear bias), and halo observables (enclosed mass, circular velocity, projected density, and lensing convergence) on arbitrary user-defined grids. The toolbox targets users whose analysis pipelines are written in MATLAB or Octave, where a validated native implementation of these models has been absent. The code is released under the MIT licence at phantom(https://github.com/matc-thaher/PHANTOM).
Editorial analysis
A structured set of objections, weighed in public.
Referee Report
Summary. The manuscript presents PHANTOM, a public MATLAB and Octave toolbox for connecting linear density field statistics (power spectra, variance, correlation functions) to dark matter halo observables (mass functions, linear bias, density profiles, concentration-mass relations) for cold, warm, and fuzzy dark matter. The package is built around a single cosmology structure that stores background, growth, and power-spectrum handles and is passed through the call graph to ensure consistency. All core routines are stated to have been validated against colossus, hmf, and halomod, yielding sub-percent agreement on shared models; the code is released under the MIT licence.
Significance. If the implementations hold, the toolbox fills a documented gap by supplying validated native routines for MATLAB/Octave users who require consistent linear-to-halo calculations on arbitrary grids. The single-entry-point cosmology object is a clear design strength that enforces internal consistency across field statistics and halo modules. The reported sub-percent agreement with three independent Python packages on shared CDM quantities provides concrete evidence of correctness for those cases.
major comments (1)
- [Abstract] Abstract: the validation statement is explicitly limited to 'shared models' against colossus, hmf, and halomod. These packages do not implement the WDM transfer-function cut-off or FDM Jeans-scale suppression used in PHANTOM; therefore the halo-mass-function, bias, and concentration modules for WDM and FDM rest only on the authors' internal implementation and lack the same external sub-percent benchmark. This directly affects the central claim that the toolbox supplies correct implementations across all three dark-matter scenarios.
minor comments (1)
- [Abstract] The GitHub link in the abstract is written as 'phantom(https://github.com/matc-thaher/PHANTOM)', which appears to be a formatting or typesetting error.
Simulated Author's Rebuttal
We thank the referee for the positive assessment of the toolbox design and the careful identification of the validation scope. We address the single major comment below.
read point-by-point responses
-
Referee: [Abstract] Abstract: the validation statement is explicitly limited to 'shared models' against colossus, hmf, and halomod. These packages do not implement the WDM transfer-function cut-off or FDM Jeans-scale suppression used in PHANTOM; therefore the halo-mass-function, bias, and concentration modules for WDM and FDM rest only on the authors' internal implementation and lack the same external sub-percent benchmark. This directly affects the central claim that the toolbox supplies correct implementations across all three dark-matter scenarios.
Authors: We agree that the external sub-percent benchmarks are restricted to CDM quantities present in colossus, hmf, and halomod. The manuscript already qualifies the validation statement with the phrase 'for shared models', which correctly signals this limitation. For WDM and FDM the modules implement standard transfer-function cut-offs and Jeans-scale suppressions drawn from the literature (with explicit references provided in the paper and code). Internal consistency across all three scenarios is enforced by the single cosmology object. To improve clarity we will revise the abstract to state explicitly that external validation applies only to CDM shared models and will add a short paragraph in the validation section describing the literature-based implementation and consistency checks used for WDM/FDM. This revision addresses the referee's concern without altering the reported results. revision: yes
Circularity Check
No circularity; toolbox implements standard models with external validation
full rationale
The paper presents a computational toolbox for standard linear-field-to-halo calculations in CDM, WDM and FDM scenarios. Core routines are validated against independent external packages (colossus, hmf, halomod) for all shared models, with sub-percent agreement reported on power spectra, variance, mass functions and profiles. The cosmology structure is passed consistently through the call graph, but this is an implementation detail, not a self-definitional reduction. No self-citations are invoked as load-bearing premises, no fitted parameters are relabeled as predictions, and no uniqueness theorems or ansatzes are smuggled in. The derivation chain consists of established cosmological relations implemented in MATLAB/Octave; external benchmarks make the presentation self-contained against independent codes.
Axiom & Free-Parameter Ledger
axioms (1)
- domain assumption Standard cosmological background expansion, linear growth, and power spectrum calculations.
Reference graph
Works this paper leans on
-
[1]
Angulo, R. E., Springel, V., White, S. D. M., et al. 2012, MNRAS, 426, 2046, doi:10.1111/j.1365-2966.2012.21830.x
-
[2]
Arcs from a Universal Dark-Matter Halo Profile
Bartelmann, M. 1996, A&A, 313, 697, doi:10.48550/arXiv.astro-ph/9602053
work page internal anchor Pith review Pith/arXiv arXiv doi:10.48550/arxiv.astro-ph/9602053 1996
-
[3]
2022, Cosmology, doi:10.1017/9781108937092
Baumann, D. 2022, Cosmology, doi:10.1017/9781108937092
-
[4]
2011, Galacticus: A Semi-Analytic Model of Galaxy
Benson, A. 2011, Galacticus: A Semi-Analytic Model of Galaxy
2011
-
[5]
2013, ApJ, 766, 32, doi:10.1088/0004-637X/766/1/32
Bhattacharya, S., Habib, S., Heitmann, K., & Vikhlinin, A. 2013, ApJ, 766, 32, doi:10.1088/0004-637X/766/1/32
-
[6]
2011, ApJ, 732, 122, doi:10.1088/0004-637X/732/2/122
Bhattacharya, S., Heitmann, K., White, M., et al. 2011, ApJ, 732, 122, doi:10.1088/0004-637X/732/2/122
-
[7]
2008, Galactic Dynamics: Second Edition
Binney, J., & Tremaine, S. 2008, Galactic Dynamics: Second Edition
2008
-
[8]
Bocquet, S., Saro, A., Dolag, K., & Mohr, J. J. 2016, MNRAS, 456, 2361, doi:10.1093/mnras/stv2657
-
[9]
Bode, P., Ostriker, J. P., & Turok, N. 2001, ApJ, 556, 93, doi:10.1086/321541
-
[10]
Bond, J. R., Cole, S., Efstathiou, G., & Kaiser, N. 1991, ApJ, 379, 440, doi:10.1086/170520
-
[11]
Statistical Properties of X-ray Clusters: Analytic and Numerical Comparisons
Bryan, G. L., & Norman, M. L. 1998, ApJ, 495, 80, doi:10.1086/305262
work page internal anchor Pith review doi:10.1086/305262 1998
-
[12]
Bullock, J. S., Kolatt, T. S., Sigad, Y., et al. 2001, MNRAS, 321, 559, doi:10.1046/j.1365-8711.2001.04068.x
-
[13]
Chan, H. Y. J., Ferreira, E. G. M., May, S., Hayashi, K., & Chiba, M. 2022, MNRAS, 511, 943, doi:10.1093/mnras/stac063
-
[14]
Chevallier, M., & Polarski, D. 2001, International Journal of Modern Physics D, 10, 213, doi:10.1142/S0218271801000822
-
[15]
L., Habib, S., Heitmann, K., et al
Child, H. L., Habib, S., Heitmann, K., et al. 2018, ApJ, 859, 55, doi:10.3847/1538-4357/aabf95
-
[16]
1989, MNRAS, 237, 1127, doi:10.1093/mnras/237.4.1127
Cole, S., & Kaiser, N. 1989, MNRAS, 237, 1127, doi:10.1093/mnras/237.4.1127
-
[17]
2017, MNRAS, 469, 4157, doi:10.1093/mnras/stx1183
Comparat, J., Prada, F., Yepes, G., & Klypin, A. 2017, MNRAS, 469, 4157, doi:10.1093/mnras/stx1183
-
[18]
Cooray, A. 2004, MNRAS, 348, 250, doi:10.1111/j.1365-2966.2004.07358.x
-
[19]
A., Schnurr O., Hirschi R., Yusof N., Parker R
Courtin, J., Rasera, Y., Alimi, J.-M., et al. 2011, MNRAS, 410, 1911, doi:10.1111/j.1365-2966.2010.17573.x
-
[20]
Crocce, M., Fosalba, P., Castander, F. J., & Gazta˜ naga, E. 2010, MNRAS, 403, 1353, doi:10.1111/j.1365-2966.2009.16194.x
-
[21]
Dalal, N., & Kochanek, C. S. 2002, ApJ, 572, 25, doi:10.1086/340303 de Salas, P. F., & Pastor, S. 2016, J. Cosmology Astropart. Phys., 2016, 051, doi:10.1088/1475-7516/2016/07/051
-
[22]
Dentler, M., Marsh, D. J. E., Hloˇ zek, R., et al. 2022, MNRAS, 515, 5646, doi:10.1093/mnras/stac1946
-
[23]
Despali, G., Giocoli, C., Angulo, R. E., et al. 2016, MNRAS, 456, 2486, doi:10.1093/mnras/stv2842
-
[24]
2018, ApJS, 239, 35, doi:10.3847/1538-4365/aaee8c —
Diemer, B. 2018, ApJS, 239, 35, doi:10.3847/1538-4365/aaee8c —. 2020, ApJ, 903, 87, doi:10.3847/1538-4357/abbf52
-
[25]
2019, ApJ, 871, 168, doi:10.3847/1538-4357/aafad6
Diemer, B., & Joyce, M. 2019, ApJ, 871, 168, doi:10.3847/1538-4357/aafad6
-
[26]
Diemer, B., & Kravtsov, A. V. 2014, ApJ, 789, 1, doi:10.1088/0004-637X/789/1/1 —. 2015, ApJ, 799, 108, doi:10.1088/0004-637X/799/1/108
-
[27]
2003, Modern Cosmology
Dodelson, S. 2003, Modern Cosmology
2003
-
[28]
Du, X., Behrens, C., & Niemeyer, J. C. 2016, Monthly Notices of the Royal Astronomical Society, 465, 941–951, doi:10.1093/mnras/stw2724
-
[29]
title The XMM-Newton long look of NGC 1365: uncovering of the obscured X-ray source
Duffy, A. R., Schaye, J., Kay, S. T., & Dalla Vecchia, C. 2008, MNRAS, 390, L64, doi:10.1111/j.1745-3933.2008.00537.x
-
[30]
Dutton, A. A., & Macci` o, A. V. 2014, MNRAS, 441, 3359, doi:10.1093/mnras/stu742
-
[31]
1965, Trudy Astrofizicheskogo Instituta Alma-Ata, 5, 87
Einasto, J. 1965, Trudy Astrofizicheskogo Instituta Alma-Ata, 5, 87
1965
-
[32]
Eisenstein, D. J., & Hu, W. 1998, ApJ, 496, 605, doi:10.1086/305424 —. 1999, ApJ, 511, 5, doi:10.1086/306640
-
[33]
Er, X.-Z. 2013, Research in Astronomy and Astrophysics, 13, 517, doi:10.1088/1674-4527/13/5/003 Fern´ andez-Garc´ ıa, E., Betancort-Rijo, J. E., Prada, F., et al. 2026, A&A, 707, L4, doi:10.1051/0004-6361/202558431
-
[34]
Fiorilli, A., Ruiz, A. N., Sanchez, A. G., & Esposito, M. 2025, arXiv e-prints, arXiv:2511.16730, doi:10.48550/arXiv.2511.16730
-
[35]
Fixsen, D. J. 2009, ApJ, 707, 916, doi:10.1088/0004-637X/707/2/916
-
[36]
Gao, L., Navarro, J. F., Cole, S., et al. 2008, MNRAS, 387, 536, doi:10.1111/j.1365-2966.2008.13277.x
-
[37]
Gnedin, N. Y., Semenov, V. A., & Kravtsov, A. V. 2018, Journal of Computational Physics, 359, 93, doi:10.1016/j.jcp.2018.01.008
-
[38]
Grin, D., Marsh, D. J. E., & Hlozek, R. 2022, axionCAMB: Modification of the CAMB Boltzmann code, Astrophysics Source Code Library, record ascl:2203.026. http://ascl.net/2203.026
2022
-
[39]
Hamilton, A. J. S. 2000, MNRAS, 312, 257, doi:10.1046/j.1365-8711.2000.03071.x
-
[40]
Heath, D. J. 1977, MNRAS, 179, 351, doi:10.1093/mnras/179.3.351
-
[41]
Hernquist, L. 1990, ApJ, 356, 359, doi:10.1086/168845
-
[42]
Nine-Year Wilkinson Microwave Anisotropy Probe (WMAP) Observations: Cosmological Parameter Results
Hinshaw, G., Larson, D., Komatsu, E., et al. 2013, ApJS, 208, 19, doi:10.1088/0067-0049/208/2/19
work page internal anchor Pith review doi:10.1088/0067-0049/208/2/19 2013
-
[43]
Hlozek, R., Grin, D., Marsh, D. J. E., & Ferreira, P. G. 2015, Phys. Rev. D, 91, 103512, doi:10.1103/PhysRevD.91.103512
-
[44]
Hogg, D. W. 2000, Distance measures in cosmology. https://arxiv.org/abs/astro-ph/9905116
Pith/arXiv arXiv 2000
-
[45]
Hu, W., Barkana, R., & Gruzinov, A. 2000, Phys. Rev. Lett., 85, 1158, doi:10.1103/PhysRevLett.85.1158
-
[46]
Hui, L., Ostriker, J. P., Tremaine, S., & Witten, E. 2017, Phys. Rev. D, 95, 043541, doi:10.1103/PhysRevD.95.043541
-
[47]
Ishiyama, T., Prada, F., Klypin, A. A., et al. 2021, MNRAS, 506, 4210, doi:10.1093/mnras/stab1755
-
[48]
Jing, Y. P. 1998, ApJ, 503, L9, doi:10.1086/311530
-
[49]
Kawai, H., Kamada, A., Kamada, K., & Yoshida, N. 2024, Phys. Rev. D, 110, 023519, doi:10.1103/PhysRevD.110.023519
-
[50]
2016, MNRAS, 457, 4340, doi:10.1093/mnras/stw248
Klypin, A., Yepes, G., Gottl¨ ober, S., Prada, F., & Heß, S. 2016, MNRAS, 457, 4340, doi:10.1093/mnras/stw248
-
[51]
A., Trujillo-Gomez, S., & Primack, J
Klypin, A. A., Trujillo-Gomez, S., & Primack, J. 2011, ApJ, 740, 102, doi:10.1088/0004-637X/740/2/102
-
[52]
, archivePrefix = "arXiv", eprint =
Komatsu, E., Dunkley, J., Nolta, M. R., et al. 2009, ApJS, 180, 330, doi:10.1088/0067-0049/180/2/330
-
[53]
Seven-Year Wilkinson Microwave Anisotropy Probe (WMAP) Observations: Cosmological Interpretation
Komatsu, E., Smith, K. M., Dunkley, J., et al. 2011, ApJS, 192, 18, doi:10.1088/0067-0049/192/2/18
work page internal anchor Pith review doi:10.1088/0067-0049/192/2/18 2011
-
[54]
Laroche, A., Gilman, D., Li, X., Bovy, J., & Du, X. 2022, MNRAS, 517, 1867, doi:10.1093/mnras/stac2677
-
[55]
Lelli, F., McGaugh, S. S., & Schombert, J. M. 2016, AJ, 152, 157, doi:10.3847/0004-6256/152/6/157
-
[56]
Leo, M., Baugh, C. M., Li, B., & Pascoli, S. 2018, J. Cosmology Astropart. Phys., 2018, 010, doi:10.1088/1475-7516/2018/04/010
-
[57]
doi:10.1086/309179 , keywords =
Lewis, A., Challinor, A., & Lasenby, A. 2000, ApJ, 538, 473, doi:10.1086/309179
-
[58]
Linder, E. V., & Jenkins, A. 2003, MNRAS, 346, 573, doi:10.1046/j.1365-2966.2003.07112.x
-
[59]
Lovell, M. R., Frenk, C. S., Eke, V. R., et al. 2014, MNRAS, 439, 300, doi:10.1093/mnras/stt2431
-
[60]
Ludlow, A. D., Bose, S., Angulo, R. E., et al. 2016, MNRAS, 460, 1214, doi:10.1093/mnras/stw1046 Macci` o, A. V., Dutton, A. A., & van den Bosch, F. C. 2008, MNRAS, 391, 1940, doi:10.1111/j.1365-2966.2008.14029.x
-
[61]
2002, Physics Letters B, 534, 8, doi:10.1016/S0370-2693(02)01622-2
Mangano, G., Miele, G., Pastor, S., & Peloso, M. 2002, Physics Letters B, 534, 8, doi:10.1016/S0370-2693(02)01622-2
-
[62]
Marsh, D. J. E. 2016, Phys. Rep., 643, 1, doi:10.1016/j.physrep.2016.06.005
-
[63]
Marsh, D. J. E., & Silk, J. 2014, MNRAS, 437, 2652, doi:10.1093/mnras/stt2079
-
[64]
McClintock, T., Varga, T. N., Gruen, D., et al. 2019, MNRAS, 482, 1352, doi:10.1093/mnras/sty2711
-
[65]
W., Moore, B., Diemand, J., & Terzi´ c, B
Merritt, D., Graham, A. W., Moore, B., Diemand, J., & Terzi´ c, B. 2006, AJ, 132, 2685, doi:10.1086/508988
-
[66]
Galaxy Formation and Evolution , ISBN =
Mo, H., van den Bosch, F. C., & White, S. 2010, Galaxy Formation and Evolution, doi:10.1017/CBO9780511807244
-
[67]
Mocz, P., Vogelsberger, M., Robles, V. H., et al. 2017, Monthly Notices of the Royal Astronomical Society, 471, 4559, doi:10.1093/mnras/stx1887
-
[68]
G., Diemer, B., Chen, Z., et al
Murray, S. G., Diemer, B., Chen, Z., et al. 2021, Astronomy and Computing, 36, 100487, doi:10.1016/j.ascom.2021.100487
-
[69]
Murray, S. G., Power, C., & Robotham, A. S. G. 2013, Astronomy and Computing, 3, 23, doi:10.1016/j.ascom.2013.11.001 20
-
[70]
Navarro, J. F., Frenk, C. S., & White, S. D. M. 1997, ApJ, 490, 493, doi:10.1086/304888
-
[71]
Oguri, M., & Kubo, N. 2026, arXiv e-prints, arXiv:2601.15718, doi:10.48550/arXiv.2601.15718
work page internal anchor Pith review Pith/arXiv arXiv doi:10.48550/arxiv.2601.15718 2026
-
[72]
Peebles, P. J. E. 1980, The large-scale structure of the universe
1980
-
[73]
Pillepich, A., Porciani, C., & Hahn, O. 2010, MNRAS, 402, 191, doi:10.1111/j.1365-2966.2009.15914.x Planck Collaboration, Ade, P. A. R., Aghanim, N., et al. 2014, A&A, 571, A16, doi:10.1051/0004-6361/201321591 —. 2016, A&A, 594, A13, doi:10.1051/0004-6361/201525830 Planck Collaboration, Aghanim, N., Akrami, Y., et al. 2020, A&A, 641, A6, doi:10.1051/0004-...
-
[74]
Primack, J. 2012, MNRAS, 423, 3018, doi:10.1111/j.1365-2966.2012.21007.x
-
[75]
, year = 1974, month = feb, volume =
Press, W. H., & Schechter, P. 1974, ApJ, 187, 425, doi:10.1086/152650
-
[76]
Reed, D., Gardner, J., Quinn, T., et al. 2003, MNRAS, 346, 565, doi:10.1046/j.1365-2966.2003.07113.x
-
[77]
Reed, D. S., Bower, R., Frenk, C. S., Jenkins, A., & Theuns, T. 2007, MNRAS, 374, 2, doi:10.1111/j.1365-2966.2006.11204.x
-
[78]
2012, A&A, 540, A70, doi:10.1051/0004-6361/201118543
Frutos-Alfaro, F. 2012, A&A, 540, A70, doi:10.1051/0004-6361/201118543
-
[79]
Robles, V. H., Bullock, J. S., & Boylan-Kolchin, M. 2018, Monthly Notices of the Royal Astronomical Society, 483, 289, doi:10.1093/mnras/sty3190 Rocamora Martorell, A. 2026, arXiv e-prints, arXiv:2602.01320, doi:10.48550/arXiv.2602.01320 Rodr´ ıguez-Puebla, A., Behroozi, P., Primack, J., et al. 2016, MNRAS, 462, 893, doi:10.1093/mnras/stw1705
-
[80]
2026, Living Reviews in Computational Astrophysics, 12, 1, doi:10.1007/s41115-026-00027-5
Schive, H.-Y. 2026, Living Reviews in Computational Astrophysics, 12, 1, doi:10.1007/s41115-026-00027-5
discussion (0)
Sign in with ORCID, Apple, or X to comment. Anyone can read and Pith papers without signing in.