#import "importer/main.typ": *
#import "helpers.typ": *

= Impact of individual mass history modeling <results>
This section presents the outputs of the different simulation runs. We compare the effect of different accretion models on the global signal, map-level differences, and statistical properties of the 21-cm brightness temperature field. We focus on three different implementations:
- The fiducial model where the accretion rate is kept fixed, independently of the halo and the redshift. This corresponds to the original implementation of #beorn where $alpha = 0.79$.
- A model where the accretion rate is computed individually for each halo based on its mass growth history and is considered during the painting of each halo.
- A model where the accretion rate is computed individually for each halo but the considered value during the painting is set to the mean accretion rate of all halos at the respective redshift (effectively reducing the dynamic range of accretion rates).


== Impact on the global signal
#let notebook = json("../workdir/11_visualization/simulation_signals.ipynb")
#figure(
  image_cell(notebook, cell_id: "signal_comparison"),
  caption: [
    Signal comparison between full runs with the different accretion models: Single value of $alpha$ for all halos according to the mean accretion rate (blue), individual accretion rates for each halo allowing a range from $alpha = 0$ to $alpha = 5$ (green), from $alpha = 0$ to $alpha = 3$ (yellow), and the previously model fixing $alpha = 0.79$ (purple, dashed).
    From _left_ to _right_:
    Evolution of the value of the coupling coefficient $x_alpha$.
    Evolution of the mean kinetic temperature $T_k$.
    History of the mean ionization fraction $x_"HII"$.
    Global evolution of the differential brightness temperature $d T_"b"$.
    The bottom row shows the relative difference to the reference model, chosen to be the model following the mean accretion rate. The comparison of the original model with fixed $alpha = 0.79$ is omitted for clarity.
  ],
) <fig:global_signal_combined>

We first investigate the effect of the different accretion models on the global, i.e. the averaged quantities that consititute the 21-cm signal. @fig:global_signal_combined shows the evolution of the coupling coefficient $x_alpha$, the kinetic temperature $T_k$, the ionization fraction $x_"HII"$, and their combined effect on the differential brightness temperature $d T_"b"$. Moving away from the initial model where $alpha = 0.79$ for all halos, we see a clear delay in the evolution of all quantities. This is expected since the accretion rates are overall lower when computed individually for each halo. The refined signals are noticeably less stable and show more fluctuations at early times. This is due to fluctuations in the tree fitting and is inherently linked to the difficulties of the #thesan simulation to resolve the earliest halos properly.

The more interesting comparison is then between the simulation using the moving mean accretion rate and the ones using the individual accretion rates. That is the difference illustrated in the bottom row of @fig:global_signal_combined. Using the mean accretion model as a reference, we compare the two remaining model that consider individiual mass histories over $n=10$ snapshots. The first model allows a range of $0 <= alpha <= 5.0$ and the "reduced" model allows $0 <= alpha <= 3.0$.

For the individual models we see that heating is delayed by $Delta z approx 0.5$ and the coupling strength is initially lower but increases more rapidly at later times. This could be due to the apparition of more and more high accretion halos which contribute more to the signal while the mean remains low because of the overall increase in halo number. Halos with high accretion rates also have a significant impact the ionization fraction due to the formation of large bubbles, which explains the closely matched ionization histories.

Finally, a summary of these effects is seen in the differential brightness temperature $d T_"b"$: The absorption trough is shifted to later times because the cosmic dawn is delayed. The delayed heating from late star formation results in a lower temperature. Even though the coupling is strong, the spin temperature remains closer to the CMB temperature, leading to a shallower absorption feature.
The subsequent transition to emission is now less delayed already. In high accretion halos the star formation is increased and heating above the CMB temperature is faster.
Finally the emission is shorter and drops to zero more rapidly, which is expected because the end of reionization occurs simultaneously for all models.

This comparison shows that even though the evolution of the ionization fraction is largely unaffected by our refined treatment, the global signal is nevertheless sensitive to the accretion model in ways that cannot be represented by only shifting the global accretion rate. An individual treatment of halos is the key to capture these effects.


== Map-level investigation
#let notebook = json("../workdir/11_visualization/simulation_maps.ipynb")

Having established that the individual accretion model produces a distinct global signal, we now compare the map-level differences directly. When only considering a single fixed snapshot in time the original model and the model using the mean will create very similar maps since they use the same generalized trend. We therefore directly use a snapshot from the mean model as our reference so that the comparisons are not tainted by the timing differences to the original model.

#figure(
  caption: [
    Map slices of the core profiles applied onto the simulation grid for the different accretion models plotted at a fixed ionization fraction of $x_"HII" = 0.5$. We compare the model that uses a single value of $alpha$ for all halos according to the mean accretion rate (left), individual accretion rates for each halo allowing a range from $alpha = 0$ to $alpha = 5$ (middle), and from $alpha = 0$ to $alpha = 3$ (right).

    From _top_ to _bottom_:
    Map of the $x_alpha$ coupling coefficient and residual map when compared to the reference.
    Map of the kinetic temperature $T_k$ and residual map when compared to the reference.
    Map of the ionization fraction $x_"HII"$ and residual map when compared to the reference.
    In the residual maps blue regions correspond to values lower than the reference model while red regions are higher than the reference model.
  ]
)[
  #set image(height: 87%)
  #image_cell(notebook, cell_id: "grids_and_diffs")
] <fig:grids_and_diffs>

@fig:grids_and_diffs shows slices through the simulation box for the different accretion models. We explicitly fix the ionization fraction of $x_"HII" = 0.5$ which removes the effect of different timing of reionization. Thus we can focus on the spatial differences and compare the morphology of the ionized regions
#footnote[
  Since the models compared here all have a similar ionization history, the redshifts are identical in this case.
].
We omit the original model with $alpha = 0.79$ and directly compare the two alternative accretion models.
The maps resemble each other closely and we focus on the residual maps
// rename?
that highlight specific deviations produced when changing the accretion model. They show that fixing the mean accretion rate is not sufficient to fully represent the complex reionization behavior.

The coupling coefficient map sees a increase in all regions which is explained by the stronger emission of Lyman-$alpha$ photons at these late stages. At the considered redshift, the mean model uses $alpha approx 0.51$. Regions where this reversal has not occured are in theory possible but don't seem to appear with this particular halo population.

As before, the kinetic temperature maps reflect the observation made for the signals. Most regions are colder than in the fiducial case due to the lower heating by fewer stars. The halos lag behind but some high accretion halos seem to catch up already, they practically vanish in the residual map.
These differences are only visible because the mean model fails to capture this diversity of halo histories.

Finally, the ionization maps show the clearest differences due to the sharp bubble cutoff. There are multiple bubbles where the detailed mass accretion models generate a clear contrast, both positive and negative, compared to the mean model. The global picture remains largely unchanged, bubbles have formed and they are in the process of merging into larger contiguous structures. However, the individual bubbles show a nuanced morphology as a direct consequence of the individual halo histories. Capturing this diversity is therefore important to generate maps with the realistic range of existing structures.

So far we have treated the model with a high $alpha$ range and the model with a lower range equally. Focusing on the differences between these two models throughout the previous maps, we see that they are mostly in agreement. This is expected since most halos are expected to have moderate accretion rates. The few very high accretion halos do however lead to small but visible differences that are most easily spotted in the ionization maps.

#figure(
  caption: [
    Map slices of the brightness temperature $d T_"b"$ for the different accretion models plotted at a fixed ionization fraction of $x_"HII" = 0.5$. The layout is the same as in @fig:grids_and_diffs.
  ]
)[
  #set image(width: 80%)
  #image_cell(notebook, cell_id: "dtb_maps")
] <fig:dtb_maps>


The derived brightness temperature maps are of particular interest. As a reminder, these are not a direct output of the simulation but the spatial distribution can be obtained from the local values of the simulated quantities via @eq:dTb. They correspond to the actual observations that can be made by 21-cm surveys.
We present map slices and their comparison to the mean model in @fig:dtb_maps, as previously done for the individual fields.

The obtained differences are a combination of the previously discussed effects. The brightness temperature in unionized regions of the IGM remains lower due to the overall lower heating. The bubbles themselves, which appear as dark regions without signal, display a range of morphologies. Some bubbles have grown larger due to the presence of high accretion halos while others are smaller. Beyond the immediate boundary of the bubbles, the temperature seems to be affected as well, as noticeable from the faint ring-like structures around some bubbles. The detailed maps show the richness of structures that can be obtained when considering individual halo histories. The subtle differences induced by this better modeling are expected to eventually be resolved and should definitely be taken into account when interpreting future observations.

We conclude this section by commenting on the differences between the two individual accretion models. The local fluctuations are hard to quantify from the maps alone. An inspection of the resulting power spectra, which exceeds the scope of this report, reveals a small increase in power at small scales when allowing for a larger range of accretion rates. Fluctuations like these are expected to not be visible in the signal measurements but increasing the dynamic range has no detrimental effect on the performance, which is why we recommend the wider range as a default choice.

// == Comparison of summary statistics
// #let notebook = json("../workdir/11_visualization/simulation_signals.ipynb")

// #figure(
//   caption: [
//     Power spectra of the brightness temperature for the four models:
//     Single value of $alpha$ for all halos according to the mean accretion rate (blue), individual accretion rates for each halo allowing a range from $alpha = 0$ to $alpha = 5$ (green), from $alpha = 0$ to $alpha = 3$ (yellow), and the previously model fixing $alpha = 0.79$ (purple, dashed).
//     _Left_: Power spectra as a function of redshift for fixed scales of $k = 0.12 "Mpc"^(-1)$ and $k = 0.58"Mpc"^(-1)$ (dashed).
//     ]
// )[
//   #set image(width: 70%)
//   #image_cell(notebook, cell_id: "power_spectra_comparison")
// ] <fig:power_spectra_comparison>

// We briefly discuss how the power spectra of the brightness temperature are affected by the different accretion models.

