Skip to content

Commit

Permalink
various tiny fixes on documentations
Browse files Browse the repository at this point in the history
  • Loading branch information
Radonirinaunimi committed Apr 1, 2024
1 parent 3d20c17 commit 3392c4c
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 25 deletions.
48 changes: 24 additions & 24 deletions doc/sphinx/source/tutorials/polarized_fits.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@ How to run a Polarized fit
==========================

The user should first refer to the :ref:`detailed guide <n3fit-usage>` on how to run
a standard unpolarized PDF fit. Most of the steps in that guide are still apply
and in the following section we only highlight the differences.
a standard unpolarized PDF fit. Most of the steps in that guide still apply and in
the following section we only highlight the differences.


Preparing a runcard and running a fit
-------------------------------------

The writing of a polarized fit runcard follows exactly the guideline described
in :ref:`Preparing a fit runcard <prepare-fits>`. The user only need to modify
in :ref:`Preparing a fit runcard <prepare-fits>`. The user only need to modify
and adjust various entries.

In polarized fits, the positivity of the polarized PDFs are enforced using as
Expand All @@ -30,7 +30,7 @@ constraint is enforced is defined under the key ``positivity_bound`` as follows:
where ``unpolarized_bc `` specifies the name of the unpolarized PDF set to be used as a
boundary condition while ``n_std `` specifies the shift in terms of the standard
deviation to be applied to the PDF central values. If ``stderr=0.0`` then the
deviation to be applied to the PDF central values. If ``n_std=0.0`` then the
PDF central values will be used to constrain their polarized counterparts.

Given that polarized fits require different fitting bases and different theory
Expand All @@ -52,46 +52,46 @@ Specifically:
where ``TSR`` specifies that only sum rules on the :math:`T_3` and :math:`T_8`
distributions are applied. If any of these values are specified differently the program will
raise an error.
raise an error. Note that for polarized fits, the basis has to start with ``POLARIZED_```.

.. note::

While the treatment of integrability follows exactly the same concept as in the
default unpolarized fits, the treatment of positivity in the polarized case
requires specific treatment. Similar to the unpolarised fits, the cost function
While the treatment of integrability follows exactly the same concept as in the
default unpolarized fits, the treatment of positivity in the polarized case
requires specific treatment. Similar to the unpolarized fits, the cost function
used to enforce the positivity is defined by the following observable:

.. math::
\chi_{\mathrm{tot}}^2 \rightarrow \chi_{\mathrm{tot}}^2+ \Lambda_{\rm POS} \sum_{k=1}^8 \sum_{i=1}^{n_x} \operatorname{ReLU}\left(-\mathcal{C}_k\left(x_i, Q^2\right)\right)
where:

.. math::
\mathrm{ReLU}(t)= \begin{cases}t & \text { if } t>0 \\ 0 & \text { if } t \leq 0\end{cases}
with :math:`n_i=20` and :math:`Q^2=5~\mathrm{GeV}^2` chosen to be the same as in the unpolarised
case. In the polarized case, omitting the :math:`Q^2`-dependence, the expression of :math:`\mathcal{C}_k`
with :math:`n_i=20` and :math:`Q^2=5~\mathrm{GeV}^2` chosen to be the same as in the unpolarized
case. In the polarized case, omitting the :math:`Q^2`-dependence, the expression of :math:`\mathcal{C}_k`
is rather given by:

.. math::
\mathcal{C}_k(x_i) = \mathcal{F}_k(x_i) + \Sigma_k(x_i) - | \Delta \mathcal{F}_k(x_i) |
where :math:`\Sigma_k(x_i)` represents the one standard deviation error computed at
:math:`x_i` for the flavour :math:`k`. :math:`\mathcal{F}_k` can be a (p)PDF of
where :math:`\Sigma_k(x_i)` represents the one standard deviation error computed at
:math:`x_i` for the flavour :math:`k`. :math:`\mathcal{F}_k` can be a (p)PDF of
flavour :math:`k` or the longitudinally (polarized) structure functions :math:`(k=1)`.
The way in which the unpolarized prediction uncertainties are accounted for during
the fit is by sampling according to a normal distribution and ought to enforce the
The way in which the unpolarized prediction uncertainties are accounted for during
the fit is by sampling according to a normal distribution and ought to enforce the
following inequality:

.. math::
\mathcal{N}_r \left( \mathcal{F}_k, \Sigma_k^2 \right) - | \Delta \mathcal{F}_k | \geq 0
where the subscript :math:`r` indicates that the random seed per replica is always
different. In practice, when imposing the positivity at the level of PDFs, we enforce
the constraints on the flavor combination :math:`\left( \Delta f_i + \Delta \bar{f}_i \right)`,
where the subscript :math:`r` indicates that the random seed per replica is always
different. In practice, when imposing the positivity at the level of PDFs, we enforce
the constraints on the flavor combination :math:`\left( \Delta f_i + \Delta \bar{f}_i \right)`,
that is :math:`(\Delta) \mathcal{F}_k \equiv (\Delta) f_k + (\Delta) \bar{f}_k`.

Once the runcard is ready, the user can follow the guidelines :ref:`here <run-n3fit-fits>`
Once the runcard is ready, the user can follow the guidelines :ref:`here <run-n3fit-fits>`
to set up and run fits.


Expand All @@ -112,11 +112,11 @@ Comparing polarized fits
------------------------

Additionally, a specific report template should be used when comparing two polarized
fits. This can be done by simply using the ``--use_polarized`` when using ``vp-comparefits``:
fits. This can be done by simply using the ``--use_polarized`` when using ``vp-comparefits``:

.. code-block:: bash
vp-comparefits -i --use_polarized
To read in details how to compare two fits, head to the :ref:`following <compare-fits>`
To read in details how to compare two fits, head to the :ref:`following <compare-fits>`
documentation.
2 changes: 1 addition & 1 deletion n3fit/runcards/examples/nnpdfpol20_dis_nnlo.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ datacuts:
# Define the unpolarized PDF set to be used as BC for POS
positivity_bound:
unpolarized_bc: NNPDF40_nnlo_pch_as_01180
n_stdv: 1.00 # Standard Deviation to be added as Error
n_std: 1.00 # Standard Deviation to be added as Error

############################################################
theory:
Expand Down

0 comments on commit 3392c4c

Please sign in to comment.