.. _models:

Model Description
=================

In this section we provide a description of the theoretical framework necessary
to model the anisotropic galaxy power spectrum
:math:`P_\mathrm{gg}^s(k,z,\mu)`, and most importantly its Legendre multipoles
:math:`P^{(\ell)}(k,z)`, which are the main observables provided by the COMET
emulator.

Real-space matter power spectrum
--------------------------------

**Standard Perturbation Theory**

Following the classical approach of perturbative methods, we consider
how small post-inflationary fluctuations in the matter density field
:math:`\rho_\mathrm{m}({\bf{x}},t)` evolve into the current large-scale
distribution probed by galaxy redshift surveys. The regime of validity of
Cosmological Perturbation Theory is limited only down to mildly non-linear
scales, where the matter density contrast

.. math::
  \delta_\mathrm{m}({\bf{x}},t)= \
  \frac{\rho_\mathrm{m}({\bf{x}},t)}{\bar{\rho}_\mathrm{m}(t)}-1

is still small enough that can be described by means of analytical approaches.
Unless explicitly noted, for sake of easiness we omit all the time-dependencies
in the rest of this section.

It is more convenient to work with wavemodes :math:`{\bf{k}}` rather than with
comoving separations :math:`{\bf{x}}`, and therefore it is better to define the
Fourier transform of :math:`\delta_\mathrm{m}({\bf{x}})` as

.. math::
  \delta_\mathrm{m}({\bf{k}}) = \int_{\bf{x}} e^{-i{\bf{k}}\cdot{\bf{x}}} \, \
  \delta_\mathrm{m}({\bf{x}}) \equiv \int \frac{\mathrm{d}{\bf{x}}}{(2\pi)^3} \
  \, e^{-i{\bf{k}}\cdot{\bf{x}}} \, \delta_\mathrm{m}({\bf{x}}).

The matter power spectrum :math:`P_\mathrm{mm}(k)` is defined as the
auto-covariance function of :math:`\delta_\mathrm{m}({\bf{x}})`, namely

.. math::
  <\delta_\mathrm{m}({\bf{k}}) \, \delta_\mathrm{m}({\bf{k'}})> \, = (2\pi)^3 \
  \delta_\mathrm{D}({\bf{k}}+{\bf{k'}}) \, P_\mathrm{m}(k),

where :math:`\delta_\mathrm{D}` denotes the Dirac delta, and we made use of both
homogeneity and isotropy of the matter density field to express the argument of
the power spectrum as the modulus of the wavemode :math:`{\bf{k}}`.

In the context of Standard Perturbation Theory (SPT), for which the dark matter
can be treated as a perfectly pressureless fluid, with vanishing energy-stress
tensor :math:`\sigma_{ij}`, matter particles do not experience shell-crossing
within the deeply non-linear regime. At intermediate scales, it is possible
to express the matter density field using a perturbative expansion,

.. math::
  \delta = \delta^{(1)} + \delta^{(2)} + \delta^{(3)} + \ldots

and, by cross-correlating the individual terms of the expansion, we can write
the matter power spectrum as

.. math::
  P_\mathrm{mm}(k)=P_\mathrm{L}(k)+P^\mathrm{1-loop}(k)+\ldots,

where :math:`P_\mathrm{L}(k)` is the linear matter power spectrum, and

.. math::
  \begin{flalign*}
    P^\mathrm{1-loop}(k) = \; & P_{22}(k) + P_{13}(k) = \\
    & 2\int_{\bf{q}} F_2^2({\bf{k}}-{\bf{q}}, \, {\bf{q}}) \
    P_\mathrm{L}(|{\bf{k}}-{\bf{q}}|) \, P_\mathrm{L}(q) \, + \\
    & + 6 \, P_\mathrm{L}(k) \int_{\bf{q}} F_3({\bf{q}},-{\bf{q}},{\bf{k}}) \
    P_\mathrm{L}(q)
  \end{flalign*}

is the one-loop contribution generated by non-linear evolution of the matter
density field. Here :math:`F_2({\bf{k}}_1,{\bf{k}}_2)` and
:math:`F_3({\bf{k}}_1,{\bf{k}}_2,{\bf{k}}_3)` are the second and third order
matter kernels describing the non-linear interaction between different
wavemodes. A similar expression holds true for the velocity divergence power
spectrum :math:`P_{\theta\theta}(k)` and the cross density-velocity power
spectrum :math:`P_{\mathrm{m}\theta}(k)`, where in this case the matter kernels
:math:`F_n` are substituted by their counterparts :math:`G_n`.

In the previous equations, loops refer to the number of internal wavemodes
:math:`{\bf{q}}_n` which are integrated over to obtain higher order
corrections. The two individual one-loop contributions, :math:`P_{22}(k)` and
:math:`P_{13}(k)` are obtained by respectively self-correlating the second
order term of the :math:`\delta` expansion with itself,
:math:`<\delta^{(2)}\delta^{(2)}>`, and
cross-correlating the leading order term with the third-order one,
:math:`<\delta^{(1)}\delta^{(3)}>`. The first term is defined as a mixture of
the linear power spectrum evaluated at different wavemodes (mode-coupling
term), while the second one is a simple rescaling of the amplitude of the
linear power spectrum (propagator-like term).

Full expressions for the second- and third-order kernels, together with
recursion relations to generate them at higher order, can be found in
`Bernardeau et al 2002 <https://www.sciencedirect.com/science/article/abs/pii/\
S0370157302001357?via%3Dihub>`_.

**Large-scale displacements and IR-resummation**

Despite one-loop SPT predictions are partially able to recover the amplitude
of the non-linear matter power spectrum at mildly non-linear scales, a direct
comparison with the output of N-body simulations shows how its accuracy is soon
degraded, in particular when trying to model the power spectrum on BAO scales.
The amplitude of BAO wiggles are indeed sensitive to large-scale bulk flows,
whose main effect is a smearing of the BAO ring. This effect can be taken into
account by effectively resumming all infrared modes :math:`q<k`.

In practical terms, the linear power spectrum is expressed as the sum of a
smooth :math:`P_\mathrm{nw}` and wiggly :math:`P_\mathrm{w}` component, such
that

.. math::
  P_\mathrm{L}(k)=P_\mathrm{nw}(k)+P_\mathrm{w}(k).

At leading order, the IR-resummed power spectrum can then be written as

.. math::
  P_\mathrm{mm}^\mathrm{IR-LO}(k) = P_\mathrm{nw}(k) + \
  e^{-k^2\Sigma^2} P_\mathrm{w}(k),

where the two-point function :math:`\Sigma` of the relative displacement field
is defined as

.. math::
  \Sigma^2 = \frac{1}{6\pi^2} \int_0^{k_\mathrm{s}} P_\mathrm{nw}(q) \
  \bigg[1 - j_0\Big(\frac{q}{k_\mathrm{osc}}\Big) + \
  2 \, j_2\Big(\frac{q}{k_\mathrm{osc}}\Big)\bigg] \mathrm{d}q.

Here :math:`j_n` is the :math:`n`-th order spherical Bessel function,
:math:`k_\mathrm{osc}=1/\ell_\mathrm{osc}` is the wavemode corresponding to the
BAO scale :math:`\ell_\mathrm{osc}=110 \, h^{-1} \, \mathrm{Mpc}`, and
:math:`k_\mathrm{s}=0.2 \, h \, \mathrm{Mpc}^{-1}` is the UV integration limit.
Despite the latter is theoretically meant to be a function of :math:`k`, it is
common to adopt a fixed value, regardless of the considered range of wavemodes.

At next-to-leading order, the IR-resummed power spectrum can be written
considering matter one-loop corrections, as well as the next order in the
smearing of the BAO features, such that

.. math::
  \begin{flalign*}
    P_\mathrm{mm}^\mathrm{IR-NLO}(k) = \; & P_\mathrm{nw}(k) + \
    \left(1+k^2\Sigma^2\right) e^{-k^2\Sigma^2} P_\mathrm{w}(k) + \\
    & + P^\mathrm{1-loop}\left[P_\mathrm{mm}^\mathrm{IR-LO}\right](k),
  \end{flalign*}

where the square brackets of the last term are to be intended as an evaluation
of the one-loop corrections using the leading order IR-resummed power spectrum
rather than the linear one in the loop integrals.

**Non-trivial energy-stress tensor and matter counterterm**

In addition to a poor accuracy for the amplitude of the BAO wiggles, SPT also
produces a failure in the broadband amplitude already at mildly non-linear
separations. This is the result of assuming a zero energy-stress tensor, which,
on the contrary, is introducing non-negligible corrections e.g. when analysing
measurements from N-body simulations.

At leading order, the only additional contribution to the matter power spectrum
is given by

.. math::
  P_\mathrm{ctr}(k) = -2 \, c_\mathrm{s}^2 \, k^2 \
  P_\mathrm{mm}^\mathrm{IR-LO}(k),

where :math:`c_\mathrm{s}` can be treated as an effective sound speed.
Ultimately, we can write the complete non-linear matter power spectrum as

.. math::
  P_\mathrm{mm}(k)=P_\mathrm{mm}^\mathrm{IR-NLO}(k)+P_\mathrm{ctr}(k).


Real-space galaxy power spectrum
--------------------------------

**Standard Perturbation Theory**

The general perturbative expansion of the galaxy density field
:math:`\delta_\mathrm{g}({\bf{x}})` is based on the sum of all the individual
operators that are a function of properties of the galaxy environment, such as
the underlying matter density field :math:`\delta({\bf{x}})`, or the
large-scale tidal field :math:`K_{ij}({\bf{x}})`. More precisely, this sum
includes all those operators which are sourced by the gravitational potential
:math:`\Phi` and the velocity potential :math:`\Phi_\mathrm{v}`.

At one-loop in the galaxy power spectrum, the only terms of the :math:`\delta`
expansion that are required are summarised as follows,

.. math::
  \begin{flalign*}
    \delta_\mathrm{g}({\bf{x}}) = \; & b_1\delta({\bf{x}}) + \
    \beta_1\nabla^2\delta({\bf{x}}) + \
    \varepsilon_\mathrm{g}({\bf{x}}) \, + \\
    &+ \frac{b_2}{2}\,\delta^2({\bf{x}}) + \
    \gamma_2\,\mathcal{G}_2(\Phi_\mathrm{v}|{\bf{x}}) + \
    \gamma_{21}\,\mathcal{G}_{2}(\varphi_1,\varphi_2|{\bf{x}}) + \ldots
  \end{flalign*}

Here it is possible to identify a dependence on different operators, each one
of them carrying free nuisance parameters that can be marginalized over in
likelihood analyses:

[-] At linear level, :math:`\delta_\mathrm{g}` can be obtained as a constant
rescaling of the amplitude of :math:`\delta`. The multiplicative factor which
reflects this rescaling, :math:`b_1`, is typically labelled `linear bias`.

[-] Moving to mildly non-linear scales, different powers of the matter density
field start to appear, as expected from a spherically symmetric gravitational
collapse. The only term which is relevant for the one-loop galaxy power
spectrum is the next-to-leading order correction :math:`\delta^2`, with the
corresponding quadratic bias :math:`b_2`.

[-] Other than producing higher order local corrections, non-linear evolution
is also responsible for the generation of a large-scale tidal field, which at
leading order in the power spectrum is characterised by a non-local bias
parameter :math:`\gamma_2` and by a single operator called second-order
Galileon, :math:`\mathcal{G}_2`, defined as

.. math::
  \mathcal{G}_2(\Phi_\mathrm{v}|{\bf{x}}) = \
  \left(\nabla_{ij}\Phi_\mathrm{v}\right)^2 ({\bf{x}}) \
  -\nabla^2\Phi_\mathrm{v} ({\bf{x}}).

In Fourier space, this becomes

.. math::
  \mathcal{G}_2({\bf{k}}) = \int_{\bf{q}} \
  \bigg[S^2({\bf{q}},{\bf{k}}-{\bf{q}})-1\bigg] \
  \theta({\bf{q}}) \, \theta({\bf{k}}-{\bf{q}}),

where :math:`\theta` is the divergence of the velocity field, and

.. math::
  S({\bf{k}}_1,{\bf{k}}_2) = \frac{{\bf{k}}_1\cdot{\bf{k}}_2}{k_1k_2}.

[-] Still contributing to the one-loop galaxy power spectrum, we can expand the
velocity potential :math:`\Phi_\mathrm{v}` up to second order,
:math:`\Phi_\mathrm{v}=\Phi_\mathrm{v}^{(1)}+\Phi_\mathrm{v}^{(2)}+\ldots=\
\varphi_1+\varphi_2+\ldots`, and compute the effect of the tidal field induced
by non-linear evolution at the next-to-leading order. In this case the model
requires an extra non-local cubic bias, :math:`\gamma_{21}`.

[-] The previously defined operators are all defined as second derivatives of
the gravitational and velocity potentials. However, the presence of short-range
non-localities, which are mostly tied to the processes of galaxy formation,
is taken into account introducing a new operator which is made up of higher
derivatives of the gravitational potential. At one-loop the only contribution
to the galaxy power spectrum is given by the laplacian of the density
field, :math:`\nabla^2\delta`, whose amplitude is controlled by an extra
bias parameter, :math:`\beta_1`.

[-] The process of galaxy formation also has a dependence on short wavelengths
fluctuations. Differently from the previous operators, that are purely
deterministic, this extra term enters the formula for the galaxy power spectrum
as a stochastic contribution, via the field
:math:`\varepsilon_\mathrm{g}({\bf{x}})`.

The galaxy power spectrum can then be obtained simply taking the
auto-correlation of the galaxy density field, :math:`\delta_\mathrm{g}`,
similarly to what is done to obtain the matter power spectrum from the matter
density field :math:`\delta_\mathrm{m}` in the previous section. The full
one-loop expression then becomes

.. math::
  P_\mathrm{gg}(k)=P_\mathrm{gg}^\mathrm{tree}(k) + \
  P_\mathrm{gg}^\mathrm{1-loop}(k) + P_\mathrm{gg}^\mathrm{ctr}(k) + \
  P_\mathrm{gg}^\mathrm{noise}(k),

where the individual contribution are given by

.. math::
  \begin{flalign*}
    P_\mathrm{gg}^\mathrm{tree}(k) = \; & b_1^2 \, P_\mathrm{L}(k), \\
    P_\mathrm{gg}^\mathrm{1-loop}(k) = \; & P_\mathrm{gg,22}(k) + \
    P_\mathrm{gg,13}(k) = \\
    & 2\int_{\bf{q}} K_2^2({\bf{q}},{\bf{k}}-{\bf{q}}) \
    P_\mathrm{L}(|{\bf{k}}-{\bf{q}}|) \, P_\mathrm{L}(q) \, + \\
    & +6 \, b_1 \, P_\mathrm{L}(k) \int_{\bf{q}} \
    K_3({\bf{q}},-{\bf{q}},{\bf{k}}) P_\mathrm{L}(q), \\
    P_\mathrm{gg}^\mathrm{ctr}(k) = \; & -2 \, b_1 \big(b_1 c_\mathrm{s}^2 + \
    \beta_1\big) k^2 \, P_\mathrm{L}(k) = \\
    & -2 \, c_0 \, k^2 P_\mathrm{L}(k), \\
    P_\mathrm{gg}^\mathrm{noise}(k) = \; & \frac{1}{\bar{n}} \
    \left(1 + N_0 + N_2 \, k^2 \right).
  \end{flalign*}

Here, :math:`K_2` and :math:`K_3` are the second and third order galaxy
PT kernels, which can be written as

.. math::
  \begin{flalign*}
    K_2({\bf{k}}_1,{\bf{k}}_2) = \; & b_1 F_2({\bf{k}}_1,{\bf{k}}_2) + \
    \frac{1}{2}b_2 + \gamma_2 \, S({\bf{k}}_1,{\bf{k}}_2) \\
    K_3({\bf{k}}_1,{\bf{k}}_2,{\bf{k}}_3) = \; & \
    b_1 F_3({\bf{k}}_1,{\bf{k}}_2,{\bf{k}}_3) + \
    b_2 \, F_2({\bf{k}}_1,{\bf{k}}_2) + \\
    & + 2 \, \gamma_2 \, S({\bf{k}}_1,{\bf{k}}_2+{\bf{k}}_3) \
    F_2({\bf{k}}_2,{\bf{k}}_3) + \\
    & + 2 \, \gamma_{21} \, S({\bf{k}}_1,{\bf{k}}_2+{\bf{k}}_3) \
    [F_2({\bf{k}}_2,{\bf{k}}_3)-G_2({\bf{k}}_2,{\bf{k}}_3)],
  \end{flalign*}

where the expression for :math:`K_3` has to be symmetrised with respect to its
arguments.

Since at leading order, the effect on the galaxy power spectrum of higher
derivatives is completely degenerate with the one of the dark matter
counterterm defined in the previous section, we combine the two parameters
:math:`c_\mathrm{s}` and :math:`\beta_1` into a single parameter :math:`c_0` to
avoid unnecessary degrees of freedom in the model.

The noise component can be parametrised in units of the sample number density
:math:`\bar{n}`. In the Poissonian limit, the total noise tends to the value
defined by the inverse number density :math:`1/\bar{n}`. However, galaxy
distribution within the one-halo term is not completely random, as two
individual objects cannot be defined in the limit where their separation tends
to zero (similarly to the exclusion effect for dark matter halos). Therefore,
new terms must be included, starting from the leading order scale independent
parameter :math:`N_0`, which accounts for constant deviations from Poissonian
shot noise, to the :math:`k^2`-dependent parameter :math:`N_2`.

**Large-scale displacements and IR-resummation**

In order to account for the effect of large-scale bulk flows on intermediate
scales, infrared modes have to be resummed in a similar way to what is done for
the matter power spectrum. At leading order, it follows

.. math::
  P_\mathrm{gg}^\mathrm{IR-LO}(k)=b_1^2 \
  \left[P_\mathrm{nw}(k)+e^{-k^2\Sigma^2}P_\mathrm{w}(k)\right] + \
  \frac{1}{\bar{n}}(1+N_0),

and similarly at next-to-leading order,

.. math::
  \begin{flalign*}
  P_\mathrm{gg}^\mathrm{IR-NLO}(k)=\; & b_1^2 \
  \Big[P_\mathrm{nw}(k)+(1+k^2\Sigma^2) \, e^{-k^2\Sigma^2} \
  P_\mathrm{w}(k)\Big] \, + \\
  & + P_\mathrm{gg}^\mathrm{1-loop}\left[P_\mathrm{mm}^\mathrm{IR-LO}\right] \
  (k) + P_\mathrm{gg}^\mathrm{ctr}\left[P_\mathrm{mm}^\mathrm{IR-LO}\right] \
  (k) \,+ \\
  &+P_\mathrm{gg}^\mathrm{noise}(k),
  \end{flalign*}

where, following the notation already adopted in the matter power spectrum
section, the square brackets of the second and third term of the previous
equation are to be intended as an evaluation of
:math:`P_\mathrm{gg}^\mathrm{1-loop}` and :math:`P_\mathrm{gg}^\mathrm{ctr}`
using the leading order IR-resummed matter power spectrum in place of the
linear matter power spectrum.


Redshift-space galaxy power spectrum
------------------------------------

The use of the observed redshift of a luminous source as a proxy for its
comoving distance from the observer is responsible for the generation of
anisotropic distortions in the distribution pattern of galaxies. This
originates from the effect of galaxy peculiar velocities summing up to the
velocity induced by the cosmic flow, in a way that

.. math::
  z_\mathrm{obs} = z_\mathrm{cos}+z_\mathrm{pec}.

This means that the observed comoving position {\bf{s}} of an object is
displaced with respect to its true position {\bf{r}} as

.. math::
  {\bf{s}} = {\bf{r}}+\frac{v_\parallel}{aH(a)}\hat{\bf{z}}.

The only component of the peculiar velocity which matters is the one along the
line of sight :math:`v_\parallel={\bf{v}}\cdot\hat{\bf{z}}`, and this leads to
anisotropies in the shape of the galaxy (and matter) power spectrum.

A common ansatz is to assume the plane-parallel approximation, for which all
the considered separations are much smaller than the distance to the observer.
In this case, the whole angular dependence is characterised by the angle
between the galaxy pair separation and the line of sight
:math:`\mu=({\bf{k}}\cdot\hat{\bf{z}})/k`.

Still making use of one-loop perturbation theory, it is then possible to write
the redshift-space galaxy power spectrum as

.. math::
  P_\mathrm{gg}^{s}(k,\mu) = P_\mathrm{gg}^{s,\mathrm{tree}}(k,\mu) + \
  P_\mathrm{gg}^{s,\mathrm{1-loop}}(k,\mu) + \
  P_\mathrm{gg}^{s,\mathrm{ctr}}(k,\mu) + \
  P_\mathrm{gg}^{s,\mathrm{noise}}(k,\mu),

where the individual contribution are given by

.. math::
  \begin{flalign*}
  P_\mathrm{gg}^{s,\mathrm{tree}}(k,\mu) = \; & Z_1^2({\bf{k}}) \
  P_\mathrm{L}(k), \\
  P_\mathrm{gg}^{s,\mathrm{1-loop}}(k,\mu) = \; & \
  P_\mathrm{gg,22}^{s}(k,\mu) + P_\mathrm{gg,13}^{s}(k,\mu) = \\
  & 2\int_{\bf{q}} Z_2^2({\bf{q}},{\bf{k}}-{\bf{q}}) \
  P_\mathrm{L}(|{\bf{k}}-{\bf{q}}|)\,  P_\mathrm{L}(q) + \\
  & + 6 \, Z_1(\mu) P_\mathrm{L}(k) \
  \int_{\bf{q}} Z_3({\bf{q}},-{\bf{q}},{\bf{k}}) P_\mathrm{L}(q), \\
  P_\mathrm{gg}^{s,\mathrm{ctr}}(k,\mu) = \; & \
  P_\mathrm{gg}^{s,\mathrm{ctr,\nabla^2\delta}}(k,\mu) + \
  P_\mathrm{gg}^{s,\mathrm{ctr,\nabla^4\delta}}(k,\mu), \\
  P_\mathrm{gg}^{s,\mathrm{noise}}(k,\mu) = \; & \
  \frac{1}{\bar{n}} \
  \left[1 + N_0 + N_{20}k^2 + N_{22}k^2\,{\cal L}_2(\mu)\right].
  \end{flalign*}

Here, the individual galaxy redshift-space PT kernels :math:`Z_n` are defined
as

.. math::
  \begin{flalign*}
  Z_1({\bf{k}}) = \; &b_1 + f\mu^2, \\
  Z_2({\bf{k}}_1,{\bf{k}}_2) = \; & K_2({\bf{k}}_1,{\bf{k}}_2) + \
  f\mu^2 G_2({\bf{k}}_1,{\bf{k}}_2) \, + \\
  & +\frac{1}{2}fk\mu \
  \bigg[\frac{\mu_1}{k_1}\left(b_1+f\mu_2^2\right) + \
  \frac{\mu_2}{k_2}\left(b_1+f\mu_1^2\right)\bigg], \\
  Z_3({\bf{k}}_1,{\bf{k}}_2,{\bf{k}}_3) = \; & \
  K_3({\bf{k}}_1,{\bf{k}}_2,{\bf{k}}_3) + \
  f\mu^2G_3({\bf{k}}_1,{\bf{k}}_2,{\bf{k}}_3) \, + \\
  & + \frac{1}{2}f^2k^2\mu^2\left(b_1+f\mu_1^2\right) \
  \frac{\mu_2\mu_3}{k_2k_3} \, + \\
  & + fk\mu\frac{\mu_3}{k_3} \
  \Big[b_1F_2({\bf{k}}_1,{\bf{k}}_2)+ \
  f\mu_{12}^2G_2({\bf{k}}_1,{\bf{k}}_2)\Big] + \\
  & + fk\mu (b_1+f\mu_1^2)\frac{\mu_{23}}{k_{23}} \
  G_2({\bf{k}}_2,{\bf{k}}_3) \, + \\
  & + \frac{b_2}{2}fk\mu\frac{\mu_1}{k_1} + \
  \gamma_2 fk\mu\frac{\mu_1}{k_1} S({\bf{k}}_2,{\bf{k}}_3),
  \end{flalign*}

where the linear growth rate

.. math::
  f=\frac{\mathrm{d}\log D}{\mathrm{d}\log a}

is the logarithmic derivative of the linear growth factor :math:`D(a)` with
respect to the scale factor :math:`a`, and the third order kernel :math:`Z_3`
must be symmetrized with respect to its arguments.

The contribution of higher derivatives and matter counterterm is encapsulated
by the term :math:`P_\mathrm{gg}^{s,\mathrm{ctr}}(k,\mu)`. The latter is split
into the leading order term, which now scales with different powers of
:math:`\mu`,

.. math::
  P_\mathrm{gg}^{s,\mathrm{ctr,\nabla^2\delta}}(k,\mu) = \
  -2\left[c_0+c_2\,{\cal L}_2(\mu)+c_4\,{\cal L}_4(\mu)\right] k^2 P_\mathrm{L}(k),

and the next-to-leading order correction that scales with :math:`k^4`,

.. math::
  P_\mathrm{gg}^{s,\mathrm{ctr,\nabla^4\delta}}(k,\mu) = \
  -c_\mathrm{nlo}f^4\mu^4 Z_1({\bf{k}}) k^4 P_\mathrm{L}(k).

Similarly, the shot-noise term now consists of the same expansion for the
real-space case, but with an additional scale-dependent correction to the
quadrupole, characterised by the parameter :math:`N_{22}`.

**Large-scale displacements and IR-resummation**

Also in this case, the resummation of infrared modes is carried out with a
splitting of the power spectrum into a smooth and wiggly component. The most
direct difference with the real-space case is that the BAO damping factor now
also depends on the orientation of the pair separation vector, via :math:`\mu`,
and on the growth rate :math:`f`. At leading order, the IR-resummed
redshift-space galaxy power spectrum reads

.. math::
  P_\mathrm{gg}^\mathrm{IR-LO}(k,\mu) = Z_1^2({\bf{k}}) \
  \left(P_\mathrm{nw}(k)+e^{-k^2\Sigma_\mathrm{tot}^2(\mu)}P_\mathrm{w}\right),

where the angular dependence of :math:`\Sigma_\mathrm{tot}` is given by

.. math::
  \Sigma_\mathrm{tot}(\mu) = \
  \left[1+f\mu^2(2+f)\right]\Sigma^2 + f^2\mu^2(\mu^2-1)\delta\Sigma^2,

with

.. math::
  \delta\Sigma^2 = \frac{1}{2\pi^2} \
  \int_0^{k_\mathrm{s}} \mathrm{d}q \, P_\mathrm{nw}(q) \
  j_2\left(\frac{q}{k_\mathrm{osc}}\right).

The next-to-leading order IR-resummed redshift-space galaxy power spectrum can
finally be written as

.. math::
  \begin{flalign*}
    P_\mathrm{gg}^\mathrm{IR-NLO}(k,\mu) = \; & Z_1^2({\bf{k}}) \
    \bigg[P_\mathrm{nw}(k)+\left(1+k^2\Sigma_\mathrm{tot}^2(\mu)\right) \
    e^{-k^2\Sigma_\mathrm{tot}^2(\mu)} P_\mathrm{w}(k)\bigg] \, + \\
    & + P_\mathrm{gg}^{s,\mathrm{1-loop}}\
    \left[P_\mathrm{mm}^\mathrm{IR-LO}\right](k,\mu) \, + \\
    & + P_\mathrm{gg}^{s,\mathrm{ctr}} \
    \left[P_\mathrm{mm}^\mathrm{IR-LO}\right](k,\mu) + \
    P_\mathrm{gg}^{s,\mathrm{noise}}(k,\mu),
  \end{flalign*}

where, once again, following the notation introduced in the previous sections,
the square brackets of the second and third terms of the previous equation mean
that the one-loop corrections and the counterterms are evaluated using the
leading order IR-resummed matter power spectrum in place of the linear power
spectrum.

.. note::

  From COMET v1.4 a new RSD framework is available, i.e. the :math:`{\rm VDG}_\infty`
  model. To understand the details of the model, check out the corresponding
  paper `Eggemeier et al. 2025 <https://arxiv.org/abs/2501.18597>`_ .
  (This page will be updated soon).

Legendre multipoles and geometrical distortions
-----------------------------------------------

For practical reasons, like the size of the covariance matrix rapidly
increasing as a function of :math:`(n_k\cdot n_\mu)` (where :math:`n_k` and
:math:`n_\mu` are the number of :math:`k` and :math:`\mu` bins, respectively),
it has become standard practice to project the information content of the full
anisotropic galaxy power spectrum into a basis formed by the Legendre
multipoles :math:`\{\mathcal{L}_\ell\}`, such that

.. math::
  P_\ell(k) = \frac{2\ell+1}{2}\int_{-1}^{+1} \
  P_\mathrm{gg}^{s}\left(k,\mu\right) \
  \mathcal{L}_\ell\left(\mu\right)\,\mathrm{d}\mu.

By construction, all the odd terms of this projection vanish, because of the
symmetric behaviour in terms of :math:`\mu`, which only enters in the
expression of :math:`P_\mathrm{gg}^s(k,\mu)` with even powers
:math:`(0,2,4,\ldots)`. In linear theory, the only non-vanishing even
multipoles are the monopole :math:`P_0(k)`, the quadrupole :math:`P_2(k)` and
the hexadecapole :math:`P_4(k)`. Even though non-linear evolution generates
higher order multipoles, their constraining power is basically irrelevant if
compared to the other three multipoles, and therefore, it is natural to
only consider the latter as a good representation of the full anisotropic
galaxy power spectrum.

A direct comparison between the one-loop model for the galaxy power spectrum
multipoles and real-data observations still allows for an extra degree of
freedom, represented by the choice of the fiducial cosmology used to convert
the observed redshifts into comoving distances :math:`{\bf{s}}` (and wavemodes
:math:`{\bf{k}}`). A wrong fiducial cosmology, deviating from the correct one,
inevitably leads to a wrong rescaling of the components, along and orthogonal to
the line of sight, of the two-point statistics that has been the central
argument of this documentation.

The anisotropic distortions introduced by the choice of a wrong fiducial
cosmology are partially degenerate with the anisotropies induced by the
peculiar velocity field, and therefore, must be taken into account
if one wishes to correctly interpret the information content contained in the
galaxy power spectrum.

The standard approach to account for the choice of the fiducial cosmology is
to rescale the considered model power spectrum along the two directions,
parallel and perpendicular to the line of sight, such that

.. math::
  \begin{flalign*}
    k'_\perp = \, & q_\perp k_\perp, \\
    k'_\parallel = \, & q_\parallel k_\parallel,
  \end{flalign*}

where primed quantities are evaluated in the fiducial cosmology, and the
Alcock-Paczinsky parameters, :math:`q_\perp` and :math:`q_\parallel` are
defined as ratios of the angular diameter distance :math:`D_\mathrm{M}(z)` and
the Hubble distance :math:`D_H(z)`,

.. math::
  \begin{flalign*}
    & q_\perp(z) = \frac{D_\mathrm{M}(z)}{D'_\mathrm{M}(z)}, \\
    & q_\parallel(z) = \frac{D_H(z)}{D'_H(z)} = \
    \frac{H'(z)}{H(z)}.
  \end{flalign*}

In this way it is possible to rewrite the AP-corrected quantities
:math:`k(k',\mu')` and :math:`\mu(\mu')` as

.. math::
  \begin{flalign*}
    k(k',\mu') = \; & k' \bigg[\frac{(\mu')^2}{q_\parallel^2} + \
    \frac{1-(\mu')^2}{q_\perp^2}\bigg]^\frac{1}{2}, \\
    \mu(\mu') = \; & \frac{\mu'}{q_\parallel} \
    \bigg[\frac{(\mu')^2}{q_\parallel^2} + \frac{1-(\mu')^2}{q_\perp^2} \
    \bigg]^{-\frac{1}{2}},
  \end{flalign*}

and finally evaluate the AP-corrected galaxy power spectrum multipoles as

.. math::
  P_\ell(k') = \frac{2\ell+1}{2q_\perp^2q_\parallel}\int_{-1}^{+1} \
  P_\mathrm{gg}^{s}\left(k(k',\mu'),\mu(\mu')\right) \
  \mathcal{L}_\ell\left(\mu(\mu')\right)d\mu'.
