1 Introduction

Deep-inelastic scattering (DIS) experiments provide strong constraints on the structure of hadrons, and around half of the experimental data points, used in the most recent PDF determinations [1,2,3], corresponds to charged current (CC) or neutral current (NC) DIS processes. These include both relatively recent data, such as the ones collected at HERA [4, 5], and earlier data such as from the BCDMS [6, 7] experiment. While in recent years the focus of particle physics phenomenology has shifted away from DIS in favor of the description of LHC data, the upcoming Electron-Ion Collider (EIC) projects in the US [8] and China [9] have renewed interest in DIS. Thus, an accurate description of these processes is required to optimally utilize their future data. Reliable predictions for DIS are furthermore relevant for the interpretation of neutrino scattering data [10] from neutrino telescopes such as IceCube [11] and experiments such as the FPF [12, 13], the LHeC [14,15,16] or FASER\(\nu \) [17] and SND@LHC [18, 19] at the LHC.

In this paper we present yadism, a new software library developed for the calculation of DIS observables with the requirements of the particle physics community of the current age in mind. Yadism differs from other QCD codes such as APFEL [20], APFEL++ [21], HOPPET [22], and QCDNUM [23] in various ways, which we briefly highlight in the following.

Yadism includes most of the currently available results in literature, specifically it allows for the computation of polarized [24] and unpolarized structure functions up to next-to-next-to-next-to-leading order (N\(^{3}\)LO) [25] in QCD. Thanks to its modular design, the library can be easily extended as the results of new computations become available. The coefficients, whenever possible, have been benchmarked against APFEL++ and QCDNUM.

Yadism provides both renormalization and factorization scale variations consistently [26] and both can be implemented at any order. The currently implemented coefficients allow to perform renormalization scale variations up to N\(^{3}\)LO and factorization scale variations up to NNLO. Instead, N\(^{3}\)LO factorization scale variations can be included through the EKO evolution code [27].

Yadism can, together with EKO, be used to construct general-mass variable flavor number schemes (GM-VFNS) using coexisting PDFs with different numbers of active flavors. This can avoid [28] the perturbative expansion of the evolution kernel as is currently done in the construction of the FONLL scheme [29].

Yadism has a uniform treatment of all heavy quarks, i.e., all features that are available for charm are also available for bottom and top. This strategy opens up the possibility for computations with an intrinsic bottom quark [30, 31]. We provide both the fixed-flavor number scheme (FFNS) and zero-mass variable-flavor number scheme (ZM-VFNS) calculation, as well as the asymptotic limit, \(Q^2 \gg m^2\), of the FFNS (FFN0), which is required in the construction of the FONLL scheme [29].

Yadism is interfaced to PineAPPL [32, 33], a library providing fast interpolation grids in a unique format and exposing an Application Programming Interface (API) for the programming languages C, C++, Fortran, Rust, and Python making it portable and easy to use. Fast interpolation grids provide a representation of predictions independent of PDFs and the strong coupling, and therefore do not require rerunning the entire toolchain of theory codes if one whishes to assess the impact of the PDF on a theory prediction. This feature can be useful both for PDF fitting and also for the determination of standard model parameters [34]. Fast interpolation grids were pioneered by FastNLO [35] and are a vital part in the toolchain for phenomenology of perturbative QCD, as such the grid technique has been adopted in various programs including APPLgrid [36] and APPLfast [37]. The PineAPPL grid output format allows yadism to be integrated into the xFitter framework [38,39,40] and the pineline framework [41]. Specifically, the latter consists of various codes with the aim to automate and efficiently compute theory predictions for collider physics processes. Through this toolchain, one can define a collection of consistent theory parameters and observables of interest for which both the partonic coefficients along with the DGLAP evolution kernels (through the EKO package [27]) can conveniently be calculated to produce fast interpolation grids.

Yadism is written in the Python programming language, which is known for its ease of use, and thus reduces the threshold for potential new contributors. For these reasons, development of new functionality can be quick to, e.g., rapidly adopt new computations. Proposed changes to the yadism code are reviewed thoroughly and are subjected to automated checks as part of a Continuous Integration (CI) policy.

So far yadism has already been used in various papers. Specifically, it has been used for the evaluation of neutrino structure functions in Refs. [10, 42], and for the computation of polarized structure functions in Ref. [24]. Furthermore, yadism has been adopted by the NNPDF collaboration, who has used it in their most recent papers [25, 26, 43].

The yadism code is open source and free to use under a GPL\(-\)3.0 license and can be found in its Github repository:

https://github.com/NNPDF/yadism

along with a user-friendly and up-to-date documentation:

https://yadism.readthedocs.io/en/latest/.

In this paper, we aim to provide an overview of some of the functionalities provided by yadism while we refer the reader to the documentation for an extensive overview of all the available features.

The rest of the paper proceeds as follows: in Sect. 2, we briefly summarize the theory underlying deep-inelastic scattering and provide details on the yadism implementation. In Sect. 3, we discuss representative benchmarks in comparison to other available libraries. Finally, we conclude in Sect. 4 and provide a brief description on possible extensions. In addition, we include two appendices where we briefly comment on the calculation of a new set of formerly unknown coefficient functions in Appendix A and we give an explicit example on how to run yadism in Appendix B.

2 The yadism library

In this section we introduce yadism and provide an overview of its most important features. In the following we assume the standard notation on DIS calculations as can be found, e.g., in any textbook [44] or in the PDG review [45].

DIS structure functions can be evaluated within the framework of perturbative Quantum Chromodynamics (pQCD) using collinear factorization [46] by convoluting the PDFs with the relevant coefficient functions

$$\begin{aligned} F\left( x, Q^2\right) = \sum _{j} \int _x^1 \frac{d z}{z} C_{j}\left( z, \alpha _s\left( Q^2\right) \right) f_j\left( \frac{x}{z}, Q^2\right) , \nonumber \\ \end{aligned}$$
(2.1)

where j runs over all possible partons in the initial state, \(f_j\) denotes the PDF of flavor j and \(C_{j}\) are the coefficient function that can be calculated perturbatively as an expansion in the strong coupling \(\alpha _s\)

$$\begin{aligned} C_{j}\left( z, \alpha _s\left( Q^2\right) \right) = \sum _{k=0}^{\infty } \left( \frac{\alpha _s}{4 \pi } \right) ^{k} C_{j}^{(k)}(z). \end{aligned}$$
(2.2)

Here and in the following we will assume that the LO coefficient function are of \(\mathcal {O}(\alpha _s^{0})\) irrespective of the first non-zero order.

All structure functions depend on two kinematic variables: the Bjorken-x and the virtuality \(Q^2\). Equation (2.1) highlights how the DIS structure functions, describing the lepton-hadron interaction, depend on a linear combination of PDFs. Thus, it is clear why DIS processes provide important constraints on flavor separation and are therefore fundamental for the PDFs determination from experimental data.

However, while the factorization formula, Eq. (2.1), is conceptually simple, if one wishes to actually compute a structure function one needs to define a number of theory parameters and parameters of the experimental setup. Such input settings are passed to yadism through runcards in YAML format,Footnote 1 and they are divided into two parts: an observable runcard describing the experimental setup (such as scattering particles, kinematic bins, or helicity settings) and a theory runcard describing the parameters of the theory framework (such as coupling strength, perturbative orders, or quark masses). While observable runcards are usually tailored to a given experiment, theory parameters are usually shared by multiple runs. An example of such runcards is reported in Sect. B, where we show explicitly how to run yadism.

For completeness, the current settings of DIS datasets used in the NNPDF framework are collected in the repository pinecards:

https://github.com/NNPDF/pinecards.

where we specify the setup for a number of measurements at NMC [47, 48], SLAC [49, 50], BCDMS [6, 7], CHORUS [51], NuTeV [52], EMC [53], and HERA [4, 5]. There, we also provide settings for several pseudo-measurements, which are used as theoretical constraints in NNPDF [3].

Below, we describe the most important options for the configuration of the observables (Sect. 2.1) and theories (Sect. 2.2) that can be defined in the respective runcard. Section 2.3 overviews the partonic coefficient functions implementation and technical details on the computation thereof.

2.1 Observable configuration options

Projectile. Yadism supports computations of DIS coefficients with massless charged leptons and their associated neutrinos as projectiles in the scattering process. Specifically, to describe, e.g., the HERA data one needs both electrons and positrons and, e.g., for the CHORUS data both neutrinos and anti-neutrinos are needed. Charged leptons can interact both electromagnetically and weakly with the scattered nuclei, whereas neutrinos only carry weak charges. Recently, together with a machine-learning parametrization of experimental data, CC neutrino DIS predictions computed with yadism have been used to extend predictions for neutrino structure functions [10].

Target. Yadism supports computations with nuclei with mass number A and Z protons as targets in the scattering process. By acting on the coefficients associated to up and down partons yadism implements the isospin symmetry of the form:

$$\begin{aligned} \begin{pmatrix} c'_u \\ c'_d \end{pmatrix} = \frac{1}{A} \begin{pmatrix} Z &{} A - Z \\ A - Z &{} Z \end{pmatrix} \begin{pmatrix} c_u \\ c_d \end{pmatrix} \end{aligned}$$
(2.3)

where \(c'_i\) and \(c_i\) are the effective and the proton coefficient associated with the parton i. This rotation is particularly useful in the context of proton PDF fitting where it can be used to relate neutron, deuteron, and heavier nuclear structure functions to the proton ones. In this way, isospin is used as a first approximation of nuclear correction by just swapping up and down contribution for the amount specified by the target nuclei. In particular for:

proton targets:

(\(A=1, Z=1\)): up and down are kept as they are.

neutron targets:

(\(A=1, Z=0\)): up and down components are fully swapped, such that the up coefficient function is matched to the down PDF and conversely.

isoscalar targets, i.e. deuteron:

(\(A=2, Z=1\)): the effective coefficient functions will be mixed such that \(c'_{u}\) will be half the original \(c_{u}\) and half the original \(c_{d}\).

Yadism is completely general with respect to the nuclear target allowing a user to provide values for A and Z as input to the computation. Alternatively, for a number of targets, the name itself can also be provided as input. The readily available targets are: iron (\(A=49.618,Z=23.403\)), used to describe NuTeV data; lead (\(A=208,Z=82\)), used to describe CHORUS data; neon and marble (\(CaCO_{3}\)) with both \(A=20, Z=10\), used to describe respectively the BEBCWA59 [54] and CHARM [55] data.

Exchanged electroweak gauge boson(s). DIS can be categorized into three different processes defined by the gauge boson mediating the interaction:

Electromagnetic current (EM):

corresponds to a process where the exchanged boson is a photon.

Neutral current (NC):

corresponds to cases where the exchanged boson does not carry any electric charge. Thus, it is a superset of the EM process where also the exchange of the Z boson is allowed. Since for NC two bosons are allowed, interference terms must be included. Because the Z boson has an axial coupling to the incoming lepton it introduces further complications related to \(\gamma _5\) [56]. Note that at small virtualities the Z contributions are suppressed by a factor \(Q^2/M_Z^2\).

Charged current (CC):

corresponds to processes where a \(W^\pm \) boson is exchanged. The CC process is a flavor-changing current where the CKM-matrix encodes the probabilities to transition between different quark flavors [57, 58].

Cross sections Yadism supports the computation of both structure functions and (reduced) cross sections. In particular, for the unpolarized scattering, we implement the structure functions:

$$\begin{aligned} F_2, \ F_L, \ x F_3, \end{aligned}$$
(2.4)

and their polarized counter parts:

$$\begin{aligned} g_4, \ g_L, \ 2 x g_1, \end{aligned}$$
(2.5)

where the normalization is chosen such that at LO, all the structure functions are proportional to different PDF combinations of the form xf(x).

While structure functions may only depend on two variables, cross sections may also depend on the inelasticity y. Generally, we can write the (reduced) cross sections for a DIS process in terms of the structure functions as

$$\begin{aligned} \sigma (x,Q^2,y){} & {} =N\left( F_2(x,Q^2)-d_L F_L(x,Q^2)\right. \nonumber \\{} & {} \quad \left. +d_3 x F_3(x,Q^2)\right) , \end{aligned}$$
(2.6)

where N, \(d_L\), and \(d_3\) may depend on the experimental setup or the scattered lepton. The different reduced cross sections implemented in yadism, and their definitions in terms of N, \(d_L\), and \(d_3\) can be found in the online documentation.Footnote 2 The implemented definitions can be used to describe data from HERA, CHORUS, NuTeV, CDHSW [59], and FPF [42].

Finally, we provide the linearly dependent structure functions:

$$\begin{aligned} 2x F_1 = F_2 - F_L, \quad \quad 2x g_5 = g_4 - g_L. \end{aligned}$$
(2.7)

Flavor tagging. In general, any total DIS structure function F can be decomposed in three different components, according to the type of quark coupling to the exchanged EW boson:

$$\begin{aligned} F = F^{(l)} + F^{(h)} + F^{(hl)}, \end{aligned}$$
(2.8)

where \(F^{(l)}\) denotes the contribution coming from diagrams where all the fermion lines are massless, \(F^{(h)}\) is the contribution due to heavy quarks coupling to the EW boson and \(F^{(hl)}\) originates from higher order diagrams where a light quark is coupling to the boson, but heavy quarks lines are present.

Given Eq. (2.8), we support the calculation of fully inclusive (total) observables, where only the lepton is observed in the final state, and flavor tagged final state, where we require a specific heavy quark (charm, bottom, or top) to couple with the mediating boson. This definition coincides with \(F^{(h)}\) and it is an infrared-safe definition [29]. For example, the charm structure function \(F^{(c)}\) can be obtained by assuming the coupling of any quark other than charm and anti-charm to be zero. Instead, a naive definition of \(F^{(c)}\) by the heavy final state tag would not be infrared safe. For completeness, also light structure functions \(F^{(l)}\) are available, in isolation, although they do not corresponds to any physical observable.

2.2 Theory configuration options

Flavor number schemes. Flavor number schemes provide a prescription to resolve the ambiguous treatment of heavy quark masses. Generally, to achieve a faithful description of experimental data at scales roughly around the heavy quarks mass \(Q\sim m\), quarks should be treated fully massive. However, in the region where \(Q \gg m\), quarks should be considered massless. In yadism we allow for 3 different schemes. Only one single heavy quark is allowed at each time.

  1. Fixed flavor number scheme (FFNS).

    The FFNS, is defined as a configuration with a fixed number of flavors at all scales, i.e. all quark masses are fixed to be either light, heavy or decoupled. The FFNS retains all power-like heavy quark corrections \(m^2/Q^2\) and a finite number of logarithmic corrections \(\ln (Q^2/m^2)\). This finite number of logarithms, as opposed to a full resummation, limits the perturbative stable region.

  2. Zero mass-variable flavor number scheme (ZM-VFNS).

    In the ZM-VFNS all quark masses in the calculations are either light or decoupled. The number of light quarks \(n_f\) is not fixed, but instead varies with the number of active flavors depending on the scale of the process, i.e. \(n_f(Q^2)\). Specifically, \(n_f=3\) below \(m_c\) and this increases as the heavy quark thresholds are crossed, i.e. \(Q>m_h\), after which the corresponding heavy quark is treated to be light. The ZM-VFNS resums all logarithmic corrections as they are provided by DGLAP evolution. However, the ZM-VFNS does not contain any power-like heavy quark corrections \(m^2/Q^2\) which may be phenomenological important in certain regions of the kinematic phase space.

  3. Asymtotic fixed flavor number scheme (FFN0).

    The FFN0 is similar to the FFNS, but retains only the logarithmic corrections, i.e. it does not contain any power-like heavy quark corrections \(m^2/Q^2\). The FFN0 is constructed as the overlap between FFNS and ZM-VFNS and can be used to construct a GM-VFNS flavor number schemes. A GM-VFNS can be constructed to overcome the limitation due to potentially large missing corrections of FFNS and ZM-VFNS. One possible scheme is the FONLL scheme [29], which is defined through a linear combination of the FFNS and ZM-VFNS while taking care of possible double counting through the FFN0. A detailed discussion on how to construct the FONLL scheme is given in Ref. [28]. Yadism does not provide it explicitly, but all the necessary ingredients FFNS, FFN0, and ZM-VFNS are available.

Renormalization and factorization scale variations. In perturbative QCD the coefficients \(C_j\) of Eq. (2.1), are expanded in powers of \(\alpha _s\). The estimate of the error introduced by the truncation of such series is quite relevant in multiple precision applications. Some information about the missing higher orders, and the related uncertainty (MHOU), can be extracted from the Callan-Symanzyk equations violation. In this sense, a practical approach to obtain a numerical estimate consists in varying the relevant unphysical scales.

In DIS, the two involved unphysical scales are the renormalization scale, arising from the subtraction of ultraviolet divergences, and the factorization scale, from the subtraction of collinear logarithms in the PDF definition.

The explicit expressions of the \(C_i\) expansion upon scale variations can be found, e.g., in Sect. 2 of Ref. [60]. Generally, these depend, order by order in perturbation theory, on the derivatives of \(\alpha _s\) and the PDF s with respect to the mentioned scales. The former are the \(\beta \)-function coefficients and the latter the splitting functions. In yadism, necessary \(\beta \)-function coefficients are taken from the EKO package, while the x-space splitting functions are directly implemented.

At the level of structure function, scale variations can be cast into an additional convolution with a kernel K:

$$\begin{aligned} F(x,\mu \ne Q) = \left( K \otimes C \otimes f\right) (x) \end{aligned}$$
(2.9)

It can be shown that the transformation can be applied a-posteriori to an already computed interpolation grid.

Target mass corrections. While Eq. (2.1) is usually derived for the scattering of two massless particles, it is possible to account for the finite mass of the scattering target through target mass corrections [24, 61, 62]. These corrections become relevant for either small virtualities or large Bjorken-x. They can be implemented as an additional convolution and we provide several approximations (corresponding to higher twist expansions) following Ref. [61].

2.3 Implemented partonic coefficients and computation details

Quark mass corrections. We can differentiate quarks into three different types: light (\(m=0\)), heavy (m finite) and decoupled (\(m=\infty \)). Thus, each coefficient function of Eq. (2.1) can be categorized by the appearance of heavy quark lines in various parts of the diagrams:

Light:

does not contain massive corrections in any part, i.e. all quarks are either light or decoupled.

Heavy:

contains heavy quarks in the output. Note that while some calculation of coefficients with two mass scales are available [63], in yadism we currently only provide support for coefficients depending on a single heavy quark mass scale since the impact of the missing corrections are small.

Intrinsic:

contains contributions where the incoming parton is a heavy quark and which thus allows for intrinsic heavy quarks as opposed to radiatively produced heavy quarks.

Asymptotic:

is the \(Q\gg m\) limit of either the heavy or intrinsic coefficient. The asymptotic contributions are used in the construction of general mass variable flavor number schemes.

This classification is not exclusive and it is useful to only distinguish coefficient functions but it does not correspond to a unique trivial mapping at the level of structure functions (see Eq. (2.8)). In fact, depending on the chosen variable flavor number scheme, the same coefficients can be reshuffled differently inside each of the components \(F^{(l)}\), \(F^{(h)}\), and \(F^{(hl)}\), or might even not be present at all. For example in the FONLL scheme [29] \(F^{(c)}\) is computed with massive quarks (using heavy), with massless quarks (using light), and in the asymptotic mass limit (using asymptotic).

Partonic coefficient functions.

Table 1 Overview of the unpolarized DIS coefficients currently implemented in the yadism library at the corresponding order in perturbative QCD. In the columns we distinguish between light, heavy, intrinsic, and asymptotic. We mark in green coefficient function that are implemented in yadism, in red the ones which are not yet known and in yellow the ones which are not yet implemented in yadism, but available in literature

Yadism implements both unpolarized and polarized coefficient functions up to N\(^{3}\)LO in fixed-order QCD. In Tables 1 and 2 we collect a summary of the coefficient functions as currently implemented. For each perturbative orderFootnote 3 and process, we distinguish contributions from light, heavy, asymptotic and intrinsic coefficients. In the unpolarized case, Table 1, the light, heavy, and asymptotic contributions are available up to N\(^{3}\)LO, except for the CC. The intrinsic components are also available only up to NLO, with the CC part computed very recently, see also Sect. A. The NNLO corrections to CC are known only through K-factors [73] and their implementation into yadism is currently work in progress. Instead, for the heavy NC N\(^{3}\)LO coefficients, a full analytical result is not known, although approximations can be constructed using information already available through resummations and high virtuality limits [74, 75]. These coefficient are then implemented together with an uncertainty which can be propagated to the final result.

Table 2 Same as Table 1 for NC polarized coefficients

Similarly, Table 2 provides an overview of the polarized NC coefficient functions currently implemented. As opposed to the unpolarized counterpart, intrinsic polarized coefficient functions are not yet known. At N\(^{3}\)LO, only the light coefficient functions for the structure function \(g_1\) have been computed [88] together with the heavy asymptotic limit \(Q^2 \gg m_h^2\) [89,90,91,92,93,94]. Their implementation in yadism is left for future updates.

Analytic structure of coefficient functions. The coefficient functions are not restricted to being regular functions, but they might also correspond to a Dirac delta function or singular distributions. In particular, the latter occur in the light coefficient functions because of massless quarks: whenever the mass of the quark does not prevent IR divergences, it generates plus distributions upon subtractions.

The presence of such distributions does not cause any issue at the analytical level, since the coefficients have to be convoluted with a PDF (or an interpolation polynomial as in Eq. (2.11)), and thus they always act within the scope of an integral. Instead, it does require a dedicated treatment at numerical level, since a distribution cannot be just evaluated (sampled) at given points, and integrated with some approximation, as it is done for regular functions. As common in literature, our x-space coefficient function implementation follows the so called regular, singular, local formalism, first described in [95].

Grid formalism. It is common for DIS calculations to provide coefficient functions that are directly convoluted with a given PDF, thus returning the predicted value for the requested DIS cross section. This is, however, not necessarily the most practical approach. Instead one may wish to store the computation of the DIS coefficient in an interpolation grid format, thus factorizing the PDF dependence. This is useful in situations where predictions for the same observable have to be computed for different PDFs. The case where this is clearly most relevant is in the context of PDF fits, where at each step of the fitting procedure new comparisons to data are required. In order to unify the treatment inside a PDF fit we follow the pineline framework [41] and provide interpolation grids, which are more beneficial in a PDF fitting environment.

We introduce an interpolation for the PDF f(x) using the nodes \(x_k\) and its associated basis of interpolation polynomials \(p_k(x)\) and write

$$\begin{aligned} f(x) = \sum _k f(x_k) p_k(x) = f^k p_k(x) \end{aligned}$$
(2.10)

where we defined \(f^k \equiv f(x_k)\) and, as usual, sum over repeated indices. While the choice of the nodes is left up to the user, the interpolation basis is fixed to piece-wise Lagrange polynomials, and provided by EKO. The PDF values can then be evaluated directly on the nodes from the original parametrization, or (re-)interpolated from distributed PDF grids (such as provided by LHAPDF [96]).

To compute an observable \(\sigma (x)\) for a given Bjorken-x, we can then write

$$\begin{aligned} \sigma (x) = (C \otimes f)(x) = f^k (C \otimes p_k)(x) = f^k C_k(x) \end{aligned}$$
(2.11)

and identify \(C_k(x) = (C\otimes p_k)(x)\) as the sought-after interpolation grid. Note that in Eq. (2.11) we suppressed for the sake of readability the flavor dependency, the scale dependency, and the dependency on the strong coupling. In practice, however, we need to keep track of all of them and the PineAPPL format [32, 33] supports such a full breakdown.

3 Benchmarking and validation

Having described the yadism library and its available features, we will now provide various benchmark analyses. First, we benchmark yadism with some of the most widely used libraries for the computation of DIS observables, namely APFEL++ and QCDNUM. Then we provide representative comparisons on the different prescriptions used to treat heavy quark masses in order to underline their relevance in the different kinematic regions. In all the subsequent comparisons, we adopt a fixed boundary condition defined as a PDF set at a given scale \(Q=Q_0\). Evolution of the boundary condition, including changing of the number of active flavors, is performed using EKO.

Fig. 1
figure 1

Relative difference between yadism and QCDNUM for the structure function \(F_{2}\) using ZM-VFNS as function of x and \(Q^2\) at NLO (left) and NNLO (right) accuracy

Fig. 2
figure 2

Same as Fig. 1, but now comparing the structure function \(F_L\)

Fig. 3
figure 3

Same as Fig. 1, but now comparing the structure function \(2 x g_1\) computed with yadism and APFEL++

Fig. 4
figure 4

Same as Fig. 1, but now comparing the structure function \(F_2\) computed with yadism and APFEL++ at NLO (upper left), NNLO (upper right) and N\(^{3}\)LO (bottom) accuracy

Fig. 5
figure 5

Same as Fig. 4, but now comparing the structure function \(F_L\)

3.1 Benchmarking

Let us start discussing the benchmarks of yadism in comparison to other available libraries for a set of representative structure functions using various flavor number schemes and different perturbative orders. In particular, we show benchmarks for both the unpolarised structure function \(F_{2}\) and its polarised counterpart \(2xg_1\) using ZM-VFNSFootnote 4 to highlight the accuracy of the massless calculation. Then we compare \(F_{2}^{\text {(c)}}\) with FFNS with \(n_f=3\) light flavors to highlight heavy quark mass effects. As benchmark tools, we rely on two main programs:

APFEL++ [21]:

which provides DIS observables up to N\(^{3}\)LO for massless, unpolarized structure functions and up to NNLO for massless, polarized structure functions. It extends the functionalities of the previous Fortran code APFEL [20] and has an explicit dependence on the PDF, which can be interfaced via LHAPDF [96].

QCDNUM [23]:

which computes DIS structure functions up to NNLO for unpolarized parton densities and up to NLO for polarized parton densities. The program implements both FFNS and ZM-VFNS and uses polynomial spline interpolation to compute the structure function from a given PDF.

The results reported below show the agreement between yadism and other tools.

Massless coefficient functions.

In the ZM-VFNS only massless coefficient functions are involved, thus we expect to reach good agreement with different tools for a broad range of kinematics. Here we select \(x \in [10^{-4}, 1]\) and \(Q^2 \in [4.0, 10^4]\,{\textrm{GeV}^2}\), covering the relevant ranges for DIS phenomenology studies. For simplicity, we focus on NC structure functions, but analogous results hold also for CC DIS. First, in Fig. 1 (Fig. 2) we show the relative difference on \(F_{2}\) (\(F_L\)) between yadism and QCDNUM computed at NLO (left) and NNLO (right) accuracy for different kinematics ranges. The overall agreement is within \({0.05}{\%}\) with the largest discrepancies visible in the small-x corner.

The analogous comparison with APFEL++ is displayed in Fig. 3 for the polarized structure function \(2 x g_1\) and in Fig. 4 (Fig. 5) again for \(F_{2}\) (\(F_L\)) but now at NLO (upper left), NNLO (upper right) and N\(^{3}\)LO (bottom) accuracy. Also here the agreement between the different codes is always within \({0.05}{\%}\). An exception is found for \(2 x g_1\) at NNLO, where the differences are around \({0.5}{\%}\). This larger difference is a result of the different implementation of the nonsinglet (NS) coefficient function – while yadism exploits the exact symmetry of \(\Delta C_{1,\textrm{NS}}^{(2)} = C_{3,\textrm{NS}}^{(2)}\) [87], APFEL++ implements the analytical calculation from [83].

From the examples discussed, it is clear that the accuracy of the results does not depend on the perturbative order, i.e. the pattern is not affected by the complexity of the calculation.

Heavy quark mass effects. Benchmarks of massive calculations are more involved because massive effects are subdominant in most of the kinematic regions, and can be affected by different approximation of the massive coefficient functions [67, 97].

In order to verify the accuracy of our implementation, we report the comparison for the EM charm-tagged structure function \(F^{\text {(c)}}\), computed in FFNS with three light flavors. We adopt the same kinematic range in \(Q^2\) as in the previous part, but we select \(x \in [10^{-4}, 10^{-1}]\) excluding the large-x region where massive structure functions become small and relative uncertainties large. Moreover, a sufficiently large-x corresponds to an energy that is below the threshold to produce a heavy quark pair (\(s < 4m^2\)).

Figure 6 (Fig. 7) displays the relative difference between APFEL++ and yadism for a NLO and NNLO computations of \(F_2^{\text {(c)}}\) (\(F_L^{\text {(c)}}\)). In this case, the agreement is around \({0.02}{\%}\) at NLO for most of the kinematics and around \({0.05}{\%}\) at NNLO.

The analogue comparison to QCDNUM is shown in Fig. 8 at NLO accuracy only demonstrating again a good level of agreement. Here, we cannot perform the comparison at NNLO as QCDNUM does not follow the infrared safe definition of \(F^{\text {(c)}}\) (as discussed in Sect. 2), but instead includes diagrams with a light quark coupling to the boson into their respective \(F^{(h)}\) result which start contributing at NNLO.

Fig. 6
figure 6

Relative difference between yadism and APFEL++ for the structure function \(F_{2}^{\text {(c)}}\) using FFNS, \(n_f=3\), as function of x and \(Q^2\) at NLO (left) and NNLO (right) accuracy

Fig. 7
figure 7

Same as Fig. 6, but now comparing the structure function \(F_L^{(c)}\)

Fig. 8
figure 8

Similar as Figs. 6 and 7, but now comparing structure function \(F_2^{(c)}\) (left) and \(F_L^{(c)}\) (right) computed with yadism and QCDNUM. Note that we can only compare at NLO due to the different conventions adopted by the programs - see text for an explanation

3.2 Flavour number schemes

As discussed in Sect. 2.2, yadism implements various FNS s with the aim of reducing the impact of missing logarithmic or power-like corrections that become large in certain regions of phase space. In this section we investigate their relevance.

Fig. 9
figure 9

Comparison of the structure functions \(F_2\) (top) and \(F^{(c)}_2\) (bottom) using FFNS and ZM-VFNS at NNLO accuracy. The top panels show the absolute comparisons while the bottom ones show the ratio w.r.t. ZM-VFNS

First, in Fig. 9, we compare the ZM-VFNS and FFNS coefficient functions as a function of \(Q^2\). Recall that the ZM-VFNS is defined by assuming all (active) quarks to be massless and the FFNS by considering a single heavy quark with a finite mass and the remaining quarks massless. We expect both calculations to differ more in the low-\(Q^2\) region and progressively reach better agreement towards the large-\(Q^2\) region. However, while ZM-VFNS fully resums all (collinear) logarithms \(\log (m^2/Q^2)\), FFNS is a fixed order calculation which only collects a finite number of (collinear) logarithms and hence a finite difference between the two calculations remains. We indeed observe for both structure functions \(F_2\) and \(F_2^{(c)}\) this expected pattern, thus confirming a consistent implementation.

Fig. 10
figure 10

Same as Fig. 9 but now comparing FFNS and FFN0

Next, in Fig. 10, we compare FFNS and FFN0 coefficient functions as a function of \(Q^2\). Recall that FFN0 is derived from FFNS by only keeping the finite number of collinear logs and, hence, we expect both calculations to converge in the large-\(Q^2\) region where any power-like mass corrections vanish. While we can indeed observe this convergence at large-\(Q^2\), we also find a relevant region at mid to low \(Q^2\) where mass effects can grow up to \({25}{\%}\). This latter region can reach up to O(100) times the heavy quark mass and clearly demonstrates the need for GM-VFNS s to improve the accuracy of the prediction.

4 Conclusions and outlook

In this paper we presented yadism, a new software package to compute cross section and structure functions in deep-inelastic scattering. In Sect. 2 we reviewed some core features that are relevant in specifying the exact theoretical and experimental setup for which yadism is able to provides calculations. Yadism has been developed with much care to ensure the results are in agreement with the widely used packages QCDNUM and APFEL++ when they should be, and to understand any differences where they do appear. The success of this effort has been shown in the benchmarking exercise presented in Sect. 3.

While yadism is able to reproduce results also available in QCDNUM and APFEL++, it provides value in following a modular design, allowing it to be easily extended with new coefficient functions, new observables or new DIS-like theories [98, 99]. At the time of writing, yadism has been used for calculations of the photon PDF [43], where the photon PDF is computed from DIS cross sections in the LuxQED procedure [100,101,102,103,104], the study of heavy quark mass effects in polarised DIS scatterings [24], the study of neutrino-ion interactions at the Forward Physics Facility (FPF) [42] and the determination of low-energy neutrino structure functions [10]. Yadism is adopted by the NNPDF collaboration to perform PDF fits where it provides the computations for all fully inclusive DIS measurements by merit of its interface to PineAPPL, and so far this has resulted in the work presented in Refs. [26, 43].

In future it will be possible to adjust the package structure to exploit synergies with a new software package dedicated to the computation of cross sections in semi-inclusive annihilation (SIA). Indeed, DIS and SIA are related by a crossing relation of Feynman diagrams, which makes the mathematical structure of convoluting a collinear distribution, in this case a fragmentation function (FF), with a coefficient function very similar.