AxioNyx: Simulating Mixed Fuzzy and Cold

Bodo Schwabe,1, ∗ Mateja Gosenca,2, † Christoph Behrens,1, ‡ Jens C. Niemeyer,1, 2, § and Richard Easther2, ¶ 1Institut f¨urAstrophysik, Universit¨atG¨ottingen,Germany 2Department of , University of Auckland, New Zealand (Dated: July 17, 2020) The distinctive effects of fuzzy dark matter are most visible at non-linear galactic scales. We present the first simulations of mixed fuzzy and , obtained with an extended version of the Nyx code. Fuzzy (or ultralight, or -like) dark matter dynamics are governed by the comoving Schr¨odinger-Poisson equation. This is evolved with a pseudospectral algorithm on the root grid, and with finite differencing at up to six levels of adaptive refinement. Cold dark matter is evolved with the existing N-body implementation in Nyx. We present the first investigations of spherical collapse in mixed dark matter models, focusing on radial density profiles, velocity spectra and soliton formation in collapsed halos. We find that the effective granule masses decrease in proportion to the fraction of fuzzy dark matter which quadratically suppresses soliton growth, and that a central soliton only forms if the fuzzy dark matter fraction is greater than 10%. The Nyx framework supports baryonic physics and key astrophysical processes such as star formation. Consequently, AxioNyx will enable increasingly realistic studies of fuzzy dark matter astrophysics.

I. INTRODUCTION Small-scale differences open the possibility of observa- tional comparisons of FDM and CDM. Moreover, the ob- The physical nature of dark matter is a major open served small scale properties of galaxies may be in tension question for both astrophysics and particle physics. with simple CDM scenarios, and FDM appears to amelio- Axion-like particles (ALPs) are viable candidates [1–12]; rate some of these issues [17, 20–24]. On the other hand, see Refs [13, 14] for recent reviews. Among them, ultra- FDM solitons alone may not explain the observed radial light predict the strongest differences from cold density profiles of galactic cores [25–28]. However, these dark matter (CDM) on galactic scales. String theory mo- scales are also heavily influenced by baryonic physics, star tivates the existence of large numbers of scalar fields aris- formation, supernovae, environmental effects and galaxy- ing from the compactification of extra dimensions with galaxy interactions, all of which operate in the collapsed, inherently low masses and weak interactions [15, 16]. Sce- nonlinear regime. Consequently, obtaining accurate pre- narios with more than a single species of dark matter, or dictions for FDM dynamics in realistic astrophysical en- mixed dark matter (MDM) models, arise naturally from vironments is a challenging task even for state-of-the-art this perspective. simulations on modern supercomputers. Independent of their fundamental origin, extremely FDM is composed of non-relativistic scalar matter de- light scalar particles with negligible interactions pro- scribed by a wavefunction ψ, which both sources and in- duced in a coherent non-thermal state via the misalign- teracts with the Newtonian gravitational potential. Con- ment mechanism are typically referred to as Fuzzy Dark sequently, FDM is governed by the coupled Schr¨odinger- Matter (FDM) [4] or Ultralight Dark Matter (ULDM) [5]. Poisson equation. The local FDM velocity is represented Unlike QCD axions, their masses can be low enough to by the gradient of the phase of the complex-valued wave- exhibit wave-like behaviour on astrophysical scales, up function. Extracting this from simulations requires that to distances on the order of a kiloparsec given current their spatial resolution is fine enough to resolve λdB, not bounds on the axion mass. Chaotic interference struc- only in small high-density regions, but also in exten- tures with strong, short-lived density variations and ha- sive low density regions if high-speed flows are present. los with gravitationally-bound central solitons are among This makes full cosmological simulations with FDM sig- the potentially observable wave-like phenomena [17]. nificantly more challenging than their CDM analogues, These structures have no direct analogues in CDM. How- which can be efficiently evolved in phase space with N- arXiv:2007.08256v1 [astro-ph.CO] 16 Jul 2020 ever, on scales greater than the de Broglie wavelength, body algorithms. λdB = h/mv, the properties of collapsed structures are Several different approaches for solving the indistinguishable from those of pressureless CDM, via the Schr¨odinger-Poisson equations numerically have been Schr¨odinger-Vlasov correspondence [18, 19]. employed in the context of cosmology, see [14] for an overview. In very large volumes that fail to resolve λdB, N-body simulations with FDM initial conditions adequately reproduce the suppression of small-scale ∗ [email protected] clustering [29–33]. Modified hydro solvers including a † [email protected] “quantum pressure” term motivated by the Madelung ‡ [email protected] transformation of the Schr¨odingerequation have been § [email protected] used in the weakly nonlinear regime [33–37].However, ¶ [email protected] only methods that solve the Schr¨odinger equation 2 directly, capture the fully nonlinear wave-like dynamics α 2nd order 6th order in collapsed FDM structures, either in the entire com- cα dα cα dα putational domain [17, 38–40] or in small subvolumes of 1 0.5 1.0 0.39225680523878 0.784513610477560 a hybrid N-body-Schr¨odingerscheme [41]. Recently, the 2 0.5 0.0 0.51004341191846 0.235573213359359 3 -0.47105338540976 -1.17767998417887 first hydrodynamical simulations with FDM including 4 0.06875316825251 1.3151863206839023 baryonic feedback on galactic scales were presented in 5 0.06875316825251 -1.17767998417887 Refs. [42, 43]. 6 -0.47105338540976 0.235573213359359 7 0.51004341191846 0.784513610477560 1 This paper introduces AxioNyx, a Schr¨odinger- 8 0.39225680523878 0.0 Poisson solver on adaptively refined regular meshes to facilitate detailed explorations of the astrophysical con- TABLE I. Weights used for higher order SP solver. sequences of FDM. Built within the existing cosmology code Nyx [44], it inherits support for CDM and baryonic matter by means of a particle-mesh N-body scheme and a II. NUMERICAL METHODS higher-order unsplit Godunov method for the gas dynam- ical equations, respectively. Nyx itself is built upon AM- The dynamics of FDM is well described by the ReX, a powerful framework for block-structured adaptive Schr¨odinger-Poisson equation mesh refinement (AMR) applications on massively par- allel supercomputers [45], boosting resolution in regions ∂ψ 2 i = − ~ ∇2ψ + mV ψ , (1) of interest and allowing the modeling of structure for- ~ ∂t 2ma2 mation over many length scales. AxioNyx implements 4πG ∇2V = ρ , ρ = |ψ|2 . (2) both pseudospectral and finite-difference methods for the a Schr¨odinger-Poisson equation on the root grid, and uses a finite-difference method in refined regions. Here, ψ is the FDM wave function, V denotes the grav- itational potential, and a is the scale factor. The con- We examine the collapse of a spherical overdensity in stants ~, m, and G stand for the Planck’s constant, the a universe containing a mixture of cold and fuzzy dark mass of the axion, and Newton’s gravitational constant, matter as a test problem for AxioNyx. This scenario respectively. is motivated by the many naturally light and weakly- We employ the Nyx2 code [44], modified to handle interacting scalar particles predicted by string theory FDM physics. Nyx is an adaptive mesh refinement code [15]. In our setup, they are represented by two dark mat- with an MPI/OpenMP parallelization scheme, based on ter components, one assumed to be sufficiently massive the AMReX [45] library, that is known to scale well, even to be well-described by the standard N-body method and over thousands of distributed CPUs. It encompasses rou- the other exhibiting wave-like behavior governed by the tines for hydrodynamics and an N-body solver for CDM Schr¨odinger-Poisson equation. physics. If periodic boundary conditions are applicable, which is AxioNyx is a cosmological solver but the Schr¨odinger- often the case in cosmological scenarios, a pseudospectral Poisson equation arises in several contexts, including bo- solver is the fastest and most accurate algorithm to evolve son stars [39, 40, 46] and QCD axion miniclusters [47]. the system of equations 1 and 2 on the Eulerian root AxioNyx can easily be adapted to address these cases, grid. However, the refined regions will be aperiodic and and boson star condensation [48] is one of the tests we thus use a finite-difference scheme on subgrids. used to verify the code (see Appendix A 3). Further, in The finite differencing scheme uses a fourth order many early-universe scenarios the post-inflationary uni- Runge-Kutta solver to evolve equations 1 and 2, and had verse can host the formation of transient, gravitationally previously been integrated with Nyx [39]. As an explicit collapsed overdensities, whose evolution is governed by algorithm, it suffers from stringent time-step constraints the Schr¨odinger-Poisson equation [49, 50]. that scale quadratically with resolution, motivating the implementation of a pseudospectral solver. The paper is organized as follows. In Section II we The public AMReX3 repository already includes introduce our numerical methods, which are validated the stand-alone version of HACC’s distributed-memory, against a suite of test cases in the Appendices. We then pencil-decomposed, parallel 3D FFT routines and wrap- investigate spherical collapse of MDM in Section III and pers linking those routines to the AMReX framework.4 conclude in Section IV. We optimized the HACC libraries for OpenMP paral- lelization and obtain good weak scaling at up to 512

2 https://github.com/AMReX-Astro/Nyx 3 https://github.com/AMReX-Codes/amrex 1 https://github.com/axionyx 4 https://xgitlab.cels.anl.gov/hacc/SWFFT 3

512 kpc

16 kpc

4 kpc

FIG. 1. Slice through the final FDM density field with 30% FDM and 70% CDM. The central region is highly refined, and resolves the FDM granules which form after shell crossing. Rectangular boxes show regions with the same level of refinement – the box edges are coloured such that they are darker at higher levels of refinement. cores, quantified by the negligible dependence of the so- Eulerian grids used to deposit information from N- lution time with respect to the number of processors for body particles in cloud-in-cell simulations appropriate for a fixed problem size per processor. We implement two CDM are typically only adaptively refined in over-dense different pseudospectral schemes, one at second order regions to correctly capture the strong dynamics in fila- and the other at sixth order. The second order scheme ments and halos. Conversely, in FDM simulations the ve- matches that implemented in PyUltraLight5 [51]. The locity is inferred from the gradient of the wave function’s sixth order scheme replicates the method described in complex phase; even low density regions may have to be Ref [48] refined if they contain high-speed flows. Consequently, we employ the L¨ohner error estimator [52], which is also

α implemented in Enzo [53] and FLASH [54] and was also Y 2 2 ψ(t + ∆t) = e−imdα∆tVα(x)/~e−i~cα∆tk /2ma ψ(t) , used with FDM cosmological simulations in Refs [17, 55]. However, as in Ref. [17], we prohibit grid refinement in (3) regions below a certain density, chosen so that their de- tailed behaviour does not significantly alter the overall with weights summarized in Table I. Other higher-order dynamics. algorithms could easily be implemented. The power of adaptive refinement is demonstrated in Figure 1, which shows the final snapshot of a spherical collapse with 30% FDM and 70% CDM. Six levels of re- 5 https://github.com/auckland-cosmo/PyUltraLight finement were used, increasing the resolution by a factor 4

tive simulations are shown in Figure 1. 10 1 1.0

III. SPHERICAL COLLAPSE OF MIXED DARK 0.8 MATTER

0.6 In this section we extend the spherical collapse to a 10 2 MDM scenario comprised of FDM and CDM with the 0.4 FDM fraction fraction of FDM defined as

max. CDM overdensity ρ 0.2 f = FDM . (4) ρFDM + ρCDM

10 3 0.0 10 2 10 1 100 For FDM, we use the sixth order Schr¨odinger-Poisson scale factor solver on the root grid and the finite difference algorithm

FIG. 2. Evolution of the maximum CDM over-density during 10 2 1.0 spherical collapse for different CDM fractions (1 − f). The numerically obtained power law growth (solid lines) is well 0.8 approximated by Equation 6 (dashed lines). 10 3

0.6 of 2 with each level. 10 4 0.4

We conducted a number of tests of the validity and FDM fraction accuracy of , as described in the Appendix. 5 AxioNyx max. FDM overdensity 10 These begin with comparisons of the pseudospectral 0.2 Schr¨odingersolver with static potentials for which exact solutions are known, verifying the scaling with timestep 10 6 0.0 10 2 10 1 100 size. In A 2 we verify that isolated solitons in a static scale factor background behave as expected, showing small depar- tures from perfectly static solutions on small grids. In FIG. 3. Evolution of the maximum FDM over-density during A 3 we replicate simulations of boson star condensation spherical collapse for different f. The initially homogeneous from random Gaussian initial conditions [48]. Since all FDM fields (solid line) contract according to linear theory regions are equally important, this problem is particu- (dotted lines). The power law growth at low redshifts is inde- larly suitable for a pseudospectral solver which allows pendent of FDM initial conditions as small initial FDM over- the use of significantly larger time steps and lower spa- densities (dashed line) show the same late time behaviour. tial resolution than finite difference methods. The cosmological dynamics are verified by following the linear evolution of a one-dimensional, self-gravitating, on higher levels, for the CDM we make use of the N-body sinusoidal over-density as it crosses the FDM Jeans scale scheme as implemented in Nyx. in a comoving box (A 4). Finally, in A 5 we investigate support against spherical gravitational collapse near the Jeans scale. This setup is useful to test the L¨ohnerre- A. The linear regime finement criterion and subcycling; even extreme cases with more than 100 sub-steps between root and first level The linear evolution of MDM is governed by the fol- yields well converged results. Results from a representa- lowing system of coupled differential equations:

 k4 2  δ¨ + 2Hδ˙ + ~ − 4πGfρ δ = 4πG(1 − f)ρδ , (5a) FDM FDM 4m2a4 FDM CDM ¨ ˙ δCDM + 2HδCDM − 4πG(1 − f)ρδCDM = 4πGfρδFDM . (5b)

We choose a box size an order of magnitude below pressed in the FDM sector. It is therefore reasonable the FDM Jeans scale. Accordingly, the growth of any to start with δFDM(zini) = 0. In contrast, we intro- local deviation from the critical density is highly sup- duce a Gaussian overdensity with maximum amplitude 5

100 f = 0.01 FDM 3 10 CDM 6 10 f = 0.01 0 f = 0.10 10 10 3 6 10 f = 0.10 0 f = 0.30 10 ]

3 3 c 10 p / 6 10 f = 0.30 M

[ 0 10 f = 0.50 y t i

s 10 3 n

e 6 d 10 f = 0.50

normalized distribution 0 f = 0.75 10 10 3 6 10 f = 0.75 0 f = 1.00 10 10 3 6 10 f = 1.00

0 20 40 60 80 10 1 100 101 102

velocity [km/s] radius [kpc]

FIG. 4. (Left) Normalized velocity spectra of the FDM and CDM components for various f. For large f they are well fitted by Maxwell-Boltzmann distributions shown in black. Dashed horizontal lines indicate soliton velocities as defined in Equation 8. (Right) Radial density profiles of the FDM and CDM components for various f. For large f central FDM profiles are well fit by solitonic profiles shown in black. Dashed vertical lines indicate soliton radii while solid vertical lines represent virial radii.

δCDM(zini) = 0.001 on top of a CDM background at an maximum amplitude δFDM(zini) = δCDM(zini) = 0.001. initial redshift zini = 99. The time evolution of δCDM is As seen in Figure 3, the initial overdensity rapidly dis- shown in Figure 2. As expected, it is suppressed relative perses. The emerging fluctuations only start to grow once to a pure CDM simulation [56], via the potential well formed by the increasing CDM over- √ density is deep enough and exhibit the same polynomial ( 1+24(1−f)−1)/4 δCDM(a) ∝ a . (6) growth as found previously.

Equation 6 can be obtained by setting δFDM = 0 in Equation 5b. In Figure 3 we show the numerically ob- B. The non-linear regime tained maximum FDM overdensity. It is well approx- imated by the solution of Equation 5a for δCDM(a) as given in Equation 6. The late time evolution of modes Employing adaptive mesh refinement with a 10243 root k  kJ (a) follows a single power law grid and up to 6 levels of refinement, we investigate spher- √ ical collapse all the way into the highly non-linear regime ( 1+24(1−f)+3)/4 after shell crossing. We ran simulations with 11 different δFDM(a) ∝ a . (7) mixed dark matter fractions f in a 2 Mpc comoving box. We verify that the growth is not an artifact of the ho- The typical mass of the collapsed halo is 3.5 × 109 solar mogeneous FDM initial conditions by running the same masses. The AMR structure of one of our simulations simulation with an added FDM overdensity with initial can be seen in Figure 1, which depicts slices through the 6

1.0 8 10 1.0 40 FDM 107 0.8 CDM 35 106 0.8 30 105 0.6 25 0.6 104 20 3 0.4 10 FDM fraction 0.4 15 FDM fraction 2 velocity [km/s] max. FDM overdensity 10 0.2 10 101 0.2 5 100 0.0 0.2 0.4 0.6 0.8 1.0 0 0.0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 2.95 scale factor radius [kpc]

FIG. 5. Maximum central FDM densities normalized by ini- FIG. 6. Peaks of the final FDM (diamonds) and CDM tial values. Soliton formation breaks the degenerate evolution (crosses) velocity spectra in the inner halo region as presented around a scale factor a = 0.4 corresponding to roughly one in Figure 4 as a function of soliton radii for different f. FDM and a half free-fall time. velocitiy peaks tightly follow Equation 8 indicated by the solid black line. For comparison, the dashed line indicates the halo’s virial velocity. final FDM density. Focusing on the central halo region we see the expected granular structure in FDM as a result of interfering plane waves. averaged FDM density drops to half its central value. The corresponding soliton velocities [40] In Figure 4 we show velocity distributions on the left side and density profiles on the right. Due to FDM ex- 2π ~ hibiting oscillations in time, we show six different snap- vc = (8) 7.5 mr shots, extracted from the final stages of our simulations. c They are shown in transparent blue or red lines for CDM are represented by the dashed lines on the left. They and FDM, respectively. The thick red (blue) lines show align well with the peaks of the Maxwell-Boltzmann-like profiles averaged over time. distributed, normalized FDM velocity spectra [41] In the outer NFW-like halo f remains constant even Z 2 after non-linear collapse and velocity spectra are only 1 3 f(v) = d x exp [−imv · x/~] ψ(x) . (9) mildly sensitive to different f. This demonstrates that N the Schr¨odinger-Vlasov correspondence also holds for mixed dark matter, i.e. that FDM averaged over multiple We integrated the final FDM state in the central 8 kpc de Broglie wavelengths behaves as CDM. This excludes cubed box, which encompasses at least dozens of gran- formation of solitons which have no CDM analog. The ules apart from the soliton. The tight correlation be- intriguing conclusion is that analytic estimates of con- tween maxima in FDM velocity spectra and soliton ve- densation [48], heating and cooling [57], and relaxation locities shown in Figure 6 suggests that the soliton is in processes [16] in the FDM sector which depend on the ef- kinetic equilibrium with its surrounding. During soliton fective granule mass can be straightforwardly generalized formation central velocities both in the FDM and CDM to mixed dark matter scenarios by re-scaling the effective component decouple from the virial velocity of the halo granule mass by f. indicated by the dashed, horizontal line in Figure 6. In Within the central region of a pure FDM halo, sim- contrast, in simulations with insufficient FDM content for ulations reveal the formation of solitonic ground state soliton formation (f . 0.1), both the CDM and FDM ve- locity spectra peak close to the virial velocity of the halo. solutions. These solutions are present only if f & 0.1. In this case the inner part of the FDM radial density profiles As can be seen in Figure 7, the maximum soliton am- can be well approximated by a soliton profile as depicted plitude in Figure 4. For lower f we see strong fluctuations in the 1/2 central FDM density profiles, which cannot be fitted by A(t) = A1 · (t − t0)/τgr + A0f (10) the original or the modified soliton profiles [43]. We thus with conclude that for mixed dark matter soliton formation √ only occurs if f & 0.1. In that case the central density ρc 0.7 2 m3v6 t τ = c ' 0.015 c (11) significantly increases beyond the initial collapse, break- gr 12π3 G2ρ2Λ Λ ing its initially degenerate evolution, as seen in Figure 5. c

The vertical dashed lines on the right side of Figure 4 grows linearly in time. Here, Λ = log(rvir/rc) is the indicate the soliton radius rc at which the spherically Coulomb logarithm, rvir the virial radius, and in the last 7

1e9 in the non-linear regime after shell-crossing confirm that 3.0 1.0 data the Schr¨odinger-Vlasov correspondence holds even in the ] 2

/ fit

1 case of mixed dark matter. Averaging over multiple de ) 2.5 3 0.8 c

p Broglie wavelengths we see a confluent evolution of cold M / 2.0 and fuzzy dark matter due to both species responding M (

[ 0.6

to the same gravitational potential. Analytic estimates e d

u 1.5 of fuzzy dark matter soliton condensation, heating and t i l p 0.4 cooling, and relaxation processes all depend on the effec- m FDM fraction a 1.0 tive granule mass. They can thus be straightforwardly M D F

. 0.2 generalized to mixed dark matter scenarios by re-scaling x a 0.5 the effective granule mass by the fuzzy dark matter frac- m tion. 0.0 0.0 0 1 2 3 4 The degeneracy between FDM and CDM is broken by free-fall time the soliton formation which occurs in the center of col- lapsing overdensities if the fraction of fuzzy dark matter FIG. 7. Linear growth of maximum FDM amplitudes well is sufficiently large, f & 0.1. While staying in kinetic described by Equation 10. equilibrium, the linearly growing soliton heats up its sur- rounding inner halo region. Our adaptively refined simulations demonstrate that step we used soliton identities as listed in the Appendix B cosmological simulations with an effective resolution ∼ 3 1/2 5 of [16]. Numerically, we found A1 = 1350 (M /Mpc ) , 10 are feasible with AxioNyx. Assuming maximum 8 3 1/2 A0 = 10 (M /Mpc ) , and t0 = 1.5tff with free-fall velocities of ∼ 100 km/s comparable to those in Figure 4 −22 time tff = 0.003 s Mpc/km. Since vc only mildly de- and a FDM mass ∼ 10 eV, we are able to resolve pends on the FDM fraction while density scales linearly the minimum de Broglie wavelength with at least 6 cells with f, growth in soliton amplitude is suppressed roughly when allowing for grid resolutions ∼ 100 pc in a ∼ 10 Mpc quadratically with f. comoving box.

IV. CONCLUSIONS ACKNOWLEDGMENTS

We developed the highly-parallelised numerical code We thank Benedikt Eggemeier, Oliver Hahn, Shaun AxioNyx for simulations of self-gravitating mixed fuzzy Hotchkiss, Emily Kendall, Doddy Marsh, Nathan Mu- and cold dark matter. The code features adaptive mesh soke, and Jan Veltmaat for important discussions, and refinement which allows tremendous effective resolution the AMReX code development team, especially Ann in regions of interest, while remaining relatively cheap on Almgren and Guy Moore, for their assistance. Computa- the largest scales. We used a 6th order pseudospectral tions described in this work were mainly performed with solver on the root grid and a 4th order finite-difference resources provided by the North-German Supercomput- solver on the refined subgrids. We employ the Poisson ing Alliance (HLRN). Additionally, the authors wish to solver available in Nyx. An exhaustive test suite of pro- acknowledge the use of New Zealand eScience Infrastruc- gressively more complex problems demonstrates the cor- ture (NeSI) high performance computing facilities, con- rectness and efficiency of AxioNyx and highlights its sulting support and/or training services as part of this vast range of potential applications. research. New Zealand’s national facilities are provided With mixed dark matter spherical collapse simulations by NeSI and funded jointly by NeSI’s collaborator institu- we show that below the Jeans scale fuzzy dark mat- tions and through the Ministry of Business, Innovation & ter overdensities δFDM(a) are supported against gravita- Employment’s Research Infrastructure programme. We tional collapse by gradient energy. In turn, cold dark acknowledge the yt [58] toolkit that was used for the matter collapse is increasingly suppressed with higher analysis of numerical data. BS acknowledges support fractions of fuzzy dark matter. The deepening gravita- by the Deutsche Forschungsgemeinschaft. JCN acknowl- tional potential shrinks the Jeans scale and results in late edges funding by a Julius von Haast Fellowship Award time fuzzy dark matter collapse. We provide analytic es- provided by the New Zealand Ministry of Business, Inno- timates for the evolution of δFDM(a) and δCDM(a) in the vation and Employment and administered by the Royal linear regime. Society of New Zealand. We acknowledge support from Adaptively refined spherical collapse simulations well the Marsden Fund of the Royal Society of New Zealand.

[1] M. S. Turner, Phys. Rev. D 28, 1243 (1983). [2] M. I. Khlopov, B. A. Malomed, and I. B. Zeldovich, Monthly Notices of the Royal Astronomical Society 215, 8

575 (1985). [30] E. Armengaud, N. Palanque-Delabrouille, C. Y`eche, [3] W. H. Press, B. S. Ryden, and D. N. Spergel, Phys. Rev. D. J. E. Marsh, and J. Baur, Monthly Notices Lett. 64, 1084 (1990). of the Royal Astronomical Society 471, 4606 (2017), [4] W. Hu, R. Barkana, and A. Gruzinov, Physical Review arXiv:1703.09126 [astro-ph.CO]. Letters 85, 1158–1161 (2000). [31] H.-Y. Schive, T. Chiueh, T. Broadhurst, and K.-W. [5] S.-J. Sin, Physical Review D 50, 3650–3654 (1994). Huang, The Astrophysical Journal 818, 89 (2016). [6] V. Sahni and L. Wang, Physical Review D 62, 103517 [32] Y. Ni, M.-Y. Wang, Y. Feng, and T. Di Matteo, Monthly (2000), arXiv:astro-ph/9910097 [astro-ph]. Notices of the Royal Astronomical Society 488, 5551 [7] T. Matos, F. S. Guzm´an, and L. A. Ure˜na-L´opez, Clas- (2019), arXiv:1904.01604 [astro-ph.CO]. sical and Quantum Gravity 17, 1707 (2000), arXiv:astro- [33] X. Li, L. Hui, and G. L. Bryan, Physical Review D 99, ph/9908152 [astro-ph]. 063509 (2019), arXiv:1810.01915 [astro-ph.CO]. [8] F. S. Guzm´anand T. Matos, Classical and Quantum [34] P. Mocz and S. Succi, Physical Review E 91, 053304 Gravity 17, L9 (2000), arXiv:gr-qc/9810028 [gr-qc]. (2015), arXiv:1503.03869 [physics.comp-ph]. [9] J. Goodman, New Astronomy 5, 103–107 (2000). [35] J. Veltmaat and J. C. Niemeyer, Physical Review D 94, [10] P. J. E. Peebles, The Astrophysical Journal 534, 123523 (2016), arXiv:1608.00802 [astro-ph.CO]. L127–L129 (2000). [36] M. Nori and M. Baldi, Monthly Notices of the Royal As- [11] L. Amendola and R. Barbieri, Physics Letters B 642, tronomical Society 478, 3935 (2018), arXiv:1801.08144 192–196 (2006). [astro-ph.CO]. [12] J.-C. Hwang and H. Noh, Physics Letters B 680, 1 [37] P. F. Hopkins, Monthly Notices of the Royal Astronom- (2009), arXiv:0902.4738 [astro-ph.CO]. ical Society 489, 2367 (2019), arXiv:1811.05583 [astro- [13] D. J. E. Marsh, Physics Reports 643, 1 (2016). ph.CO]. [14] J. C. Niemeyer, Progress in Particle and Nuclear Physics [38] T.-P. Woo and T. Chiueh, The Astrophysical Journal 113, 103787 (2020). 697, 850 (2009). [15] A. Arvanitaki, S. Dimopoulos, S. Dubovsky, N. Kaloper, [39] B. Schwabe, J. C. Niemeyer, and J. F. Engels, Physical and J. March-Russell, Physical Review D 81, 123530 Review D 94 (2016), 10.1103/physrevd.94.043513. (2010). [40] P. Mocz, M. Vogelsberger, V. H. Robles, J. Zavala, [16] L. Hui, J. P. Ostriker, S. Tremaine, and E. Witten, Phys. M. Boylan-Kolchin, A. Fialkov, and L. Hernquist, Rev. D 95, 043541 (2017). Monthly Notices of the Royal Astronomical Society 471, [17] H.-Y. Schive, T. Chiueh, and T. Broadhurst, Nature 4559 (2017). Physics 10, 496 (2014), arXiv:1406.6586. [41] J. Veltmaat, J. C. Niemeyer, and B. Schwabe, Physical [18] L. M. Widrow and N. Kaiser, The Astrophysical Journal Review D 98 (2018), 10.1103/physrevd.98.043509. 416, L71 (1993). [42] P. Mocz, A. Fialkov, M. Vogelsberger, F. Becerra, M. A. [19] C. Uhlemann, M. Kopp, and T. Haugg, Phys. Rev. D Amin, S. Bose, M. Boylan-Kolchin, P.-H. Chavanis, 90, 023517 (2014). L. Hernquist, L. Lancaster, F. Marinacci, V. H. Robles, [20] D. J. E. Marsh and J. Silk, Monthly Notices of the Royal and J. Zavala, Phys. Rev. Lett. 123, 141301 (2019). Astronomical Society 437, 2652 (2014). [43] J. Veltmaat, B. Schwabe, and J. C. Niemeyer, Phys. [21] D. J. E. Marsh and A.-R. Pop, Monthly Notices Rev. D 101, 083518 (2020). of the Royal Astronomical Society 451, 2479 (2015), [44] A. S. Almgren, . B. Bell, M. J. Lijewski, Z. Luki´c, and arXiv:1502.03456 [astro-ph.CO]. E. V. Andel, The Astrophysical Journal 765, 39 (2013). [22] A. X. Gonz´alez-Morales,D. J. E. Marsh, J. Pe˜narrubia, [45] A. Almgren, V. Beckner, J. Blaschke, C. Chan, M. Day, and L. A. Ure˜na-L´opez, Monthly Notices of the Royal B. Friesen, K. Gott, D. Graves, M. Katz, A. Myers, Astronomical Society 472, 1346 (2017), arXiv:1609.05856 T. Nguyen, A. Nonaka, M. Rosso, S. Williams, W. Zhang, [astro-ph.CO]. and M. Zingale, (2019), 10.5281/zenodo.2555438. [23] T. Bernal, L. M. Fern´andez-Hern´andez,T. Matos, and [46] F. S. Guzm´anand L. A. Ure˜naL´opez, Phys. Rev. D 69, M. A. Rodr´ıguez-Meza, Monthly Notices of the Royal As- 124033 (2004). tronomical Society 475, 1447 (2018), arXiv:1701.00912 [47] B. Eggemeier and J. C. Niemeyer, Phys. Rev. D 100, [astro-ph.GA]. 063528 (2019). [24] E. Kendall and R. Easther, arXiv e-prints , [48] D. Levkov, A. Panin, and I. Tkachev, Physical Review arXiv:1908.02508 (2019), arXiv:1908.02508 [astro- Letters 121 (2018), 10.1103/physrevlett.121.151301. ph.CO]. [49] N. Musoke, S. Hotchkiss, and R. Easther, Phys. [25] H. Deng, M. P. Hertzberg, M. H. Namjoo, and Rev. Lett. 124, 061301 (2020), arXiv:1909.11678 [astro- A. Masoumi, Physical Review D 98, 023513 (2018), ph.CO]. arXiv:1804.05921 [astro-ph.CO]. [50] J. C. Niemeyer and R. Easther, (2019), arXiv:1911.01661 [26] N. Bar, D. Blas, K. Blum, and S. Sibiryakov, Physical [astro-ph.CO]. Review D 98, 083027 (2018), arXiv:1805.00122 [astro- [51] F. Edwards, E. Kendall, S. Hotchkiss, and R. Easther, ph.CO]. JCAP 10, 027 (2018), arXiv:1807.04037 [astro-ph.CO]. [27] V. H. Robles, J. S. Bullock, and M. Boylan-Kolchin, [52] R. L¨ohner,Computer Methods in Applied Mechanics and Monthly Notices of the Royal Astronomical Society 483, Engineering 61, 323 (1987). 289 (2019), arXiv:1807.06018 [astro-ph.CO]. [53] G. L. Bryan, M. L. Norman, B. W. O’Shea, T. Abel, [28] A. Burkert, arXiv e-prints , arXiv:2006.11111 (2020), J. H. Wise, M. J. Turk, D. R. Reynolds, D. C. Collins, arXiv:2006.11111 [astro-ph.GA]. P. Wang, S. W. Skillman, B. Smith, R. P. Harkness, [29] V. Irsic, M. Viel, M. G. Haehnelt, J. S. Bolton, and J. Bordner, J.-h. Kim, M. Kuhlen, H. Xu, N. Goldbaum, G. D. Becker, Physical Review Letters 119, 1 (2017). C. Hummels, A. G. Kritsuk, E. Tasker, S. Skory, C. M. Simpson, O. Hahn, J. S. Oishi, G. C. So, F. Zhao, R. Cen, 9

101 6th order 10 1 2nd order M W K E 6 10 3

10 5 4

10 7 2 9

10 rel. change [%] average relative error

10 11 0

10 13 10 3 10 2 10 1 100 t 0.0 0.5 1.0 1.5 2.0 2.5 3.0 3.5 4.0 time

FIG. 8. Spatially averaged error of the final state as a function FIG. 9. Relative changes of global quantities over time during of the time step for the two solvers. Each point is a separate the simulation of a single soliton. Due to discreteness errors, simulation with a fixed time step. The fitted slopes of the line it is slightly ringing with a mass dependent frequency as can accurated reproduce the expected scalings. At sixth order be inferred from the potential energy W and kinetic energy with ∆t > 10−2 the error is dominated by numerical noise K (see, e.g., [39] for the definition of conserved quantities). due to finite precision floating point numbers. Total mass and energy are well conserved even in the depicted low resolution run.

Y. Li, and The Enzo Collaboration, apjs 211, 19 (2014), arXiv:1307.2265 [astro-ph.IM]. where the initial width σ(t0) = σ0 and x(t) = 0. The [54] B. Fryxell, K. Olson, P. Ricker, F. X. Timmes, M. Zin- maximum relative errors are smaller then 10−12 until gale, D. Q. Lamb, P. MacNeice, R. Rosner, J. W. Tru- σ(t ) = 2σ even for a low resolution grid spacing, ran, and H. Tufo, Astrophysical Journal, Supplement f 0 ∆x = 0.5σ . Placing the Gaussian over-density in an 131, 273 (2000). 0 [55] M. Mina, D. F. Mota, and H. A. Winther, “Scalar: an external harmonic oscillator potential amr code to simulate axion-like dark matter models,” (2019), arXiv:1906.12160 [physics.comp-ph]. 1  2 V (x) = − ~ x2 , (A3) [56] W. Hu and D. J. Eisenstein, The Astrophysical Journal 2 2mσ2 498, 497 (1998). 0 [57] D. J. E. Marsh and J. C. Niemeyer, Phys. Rev. Lett. 123, 051103 (2019). we likewise verify that σ(tf ) = σ0 with similar numerical [58] M. J. Turk, B. D. Smith, J. S. Oishi, S. Skory, S. W. error. If the overdensity is initially displaced by x0 from Skillman, T. Abel, and M. L. Norman, The As- the origin, as expected the center oscillates within the trophysical Journal Supplement Series 192, 9 (2011), potential well as arXiv:1011.3514 [astro-ph.IM]. [59] D. J. E. Marsh, (2016), arXiv:1605.05973 [astro-ph.CO].   (t − t0)~ x(t) = x0 cos 2 . (A4) 2mσ0 Appendix A: Code Verification We confirm the ideal temporal convergence of both nu- merical schemes by comparing spatially averaged devi- We tested the code with a suite of increasingly chal- ations to the analytical solution after one oscillation, lenging computations. shown in Figure 8. Note that ∆t = 10−2 corresponds to the maximum time step allowed by stability criteria for a comparable finite difference simulation. 1. Static potential tests

Setting the gravitational potential V = 0, an initially Gaussian FDM overdensity broadens via diffusion. The 2. Isolated soliton dynamics can be solved exactly, As the ground state of the Schr¨odinger-Poisson sys- 1  (x − x(t))2  ρ(x, t) = exp − , (A1) tem, a soliton is stationary in time. However, any initial p 2 2πσ2(t) 2σ (t) or numerically evolved configuration can only approach "  2# the analytical ground state. Figure 9 shows that small 2 2 (t − t0)~ σ (t) = σ 1 + , (A2) perturbations result in a periodic ringing of the soliton, 0 2mσ2 0 which contracts and expands. While we recover the cor- 10 rect quasinormal frequency [41] 4. Linear mode evolution

 ρ 1/2 ν = 10.94 c Gyr−1 , (A5) A one-dimensional, self-gravitating, sinusoidal over- 9 −3 10 M kpc density in a universe containing 100% FDM obeys equa- the relative change in potential and kinetic energy de- tion 5a with the RHS set to zero. We observe the ex- pends on the size of the perturbation and thus on reso- pected evolution of different growing modes [13] lution. Here, ρc is the central soliton density.   3 ˜2 3 ˜2 δ+(k, a) = sin k + − 1 cos k , (A6) k˜2 k˜4 3. Boson Star Condensation ˜ p√ where k = k/ amH0/~ ∝ k/kJ(a) is inversely propor- tional to the Jeans scale kJ(a). While modes with wave The condensation of a Boson star from random Gaus- number k < kJ grow linearly with scale factor a, modes sian initial fluctuations, as first investigated in [48], pro- with k > kJ oscillate in time. Intermediate modes just vides a stringent test of the code. The initial conditions below k oscillate until they cross the Jeans scale after 3 J were set up on a 64 grid with a side length of L = 30λdB. which they start to grow linearly. All three scenarios can The overall amplitude of the fluctuations was scaled such be seen in Figure 11. that the total mass in the simulation box is N = 10; we refer the reader to the original paper for details [48]. Fig- ure 10 shows the expected linear increase in maximum 5. Spherical collapse of fuzzy dark matter amplitude after one condensation time. We investigated the spherical collapse of a Gaussian over-density with initial maximum density contrast δ = 0.1 above the critical density of a flat, matter dominated data universe. For all runs, the over-density was placed cen- 0.16 fit trally in a comoving box containing the 8σ region of the

0.14 Gaussian perturbation. We thus scale the over-density by changing the box size. The Jeans mass below which 0.12 collapse is suppressed can be approximated as [59]

1/4 0.10 −3/2  2  8  m  Ωmh max. amplitude MJ (a) =3.4 × 10 −22 0.08 10 eV 0.14 −1 −3/4 × h a M 0.06 8 −3/4 '1.7 × 10 a M , (A7) 0.0 0.2 0.4 0.6 0.8 1.0 1.2 1.4 condensation time −22 where we used Ωm = 1, h = 0.7, m = 2.5 × 10 eV. From Figure 12 we see that collapse occurs once the mass FIG. 10. Linear growth of the maximum amplitude due to inside the box starts to exceed M (a). the condensation of a Boson star. J

100 high k 102 medium k ac<0.01 low k ac=0.0123

ac=0.1965 1 101 10 ac>1.0

100 10 2 max. overdensity

1 max. FDM overdensity 10

10 3 10 2 10 1 100 10 2 scale factor 10 2 10 1 100 scale factor FIG. 11. Time evolution of different self-gravitating modes in an expanding background. Modes with wave numbers larger FIG. 12. Evolution of the maximum FDM over-density during than the Jeans scale are stabilized by wave coherence effects. spherical collapse beginning as soon as the mass inside the simulation box exceeds the Jeans mass at a scale factor ac.