From 126143c58251596fb37000f4b79aa3bae0cd1f43 Mon Sep 17 00:00:00 2001 From: Felix Hekhorn Date: Wed, 5 Apr 2023 14:00:53 +0200 Subject: [PATCH 1/7] Fix pydocstyle in ekomark --- .pre-commit-config.yaml | 2 +- src/ekomark/__init__.py | 6 ++---- src/ekomark/benchmark/__init__.py | 1 + src/ekomark/benchmark/external/__init__.py | 1 + src/ekomark/data/__init__.py | 1 + src/ekomark/navigator/__init__.py | 11 ++++------- src/ekomark/navigator/glob.py | 1 + 7 files changed, 11 insertions(+), 12 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 9bbdd2b1c..2a2c81888 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -34,7 +34,7 @@ repos: hooks: - id: pydocstyle files: ^src/ - args: ["--add-ignore=D107"] + args: ["--add-ignore=D107,D105"] additional_dependencies: - toml - repo: https://github.com/pre-commit/pre-commit diff --git a/src/ekomark/__init__.py b/src/ekomark/__init__.py index 5fffe3d9e..f3c8b2d7c 100644 --- a/src/ekomark/__init__.py +++ b/src/ekomark/__init__.py @@ -1,11 +1,9 @@ -""" -Additional package to benchmark eko. -""" +"""Benchmark package for eko.""" from eko import basis_rotation as br def pdfname(pid_or_name): - """Return pdf name""" + """Return pdf name.""" if isinstance(pid_or_name, int): return br.flavor_basis_names[br.flavor_basis_pids.index(pid_or_name)] return pid_or_name diff --git a/src/ekomark/benchmark/__init__.py b/src/ekomark/benchmark/__init__.py index e69de29bb..c6eca1931 100644 --- a/src/ekomark/benchmark/__init__.py +++ b/src/ekomark/benchmark/__init__.py @@ -0,0 +1 @@ +"""Benchmark implementation for EKO.""" diff --git a/src/ekomark/benchmark/external/__init__.py b/src/ekomark/benchmark/external/__init__.py index e69de29bb..e0581a093 100644 --- a/src/ekomark/benchmark/external/__init__.py +++ b/src/ekomark/benchmark/external/__init__.py @@ -0,0 +1 @@ +"""Tools to run external benchmark programs.""" diff --git a/src/ekomark/data/__init__.py b/src/ekomark/data/__init__.py index e69de29bb..797409204 100644 --- a/src/ekomark/data/__init__.py +++ b/src/ekomark/data/__init__.py @@ -0,0 +1 @@ +"""EKO database configuration.""" diff --git a/src/ekomark/navigator/__init__.py b/src/ekomark/navigator/__init__.py index 17d2d4079..f1c70a907 100644 --- a/src/ekomark/navigator/__init__.py +++ b/src/ekomark/navigator/__init__.py @@ -1,6 +1,4 @@ -""" -ekomark specialization of the navigator -""" +"""ekomark specialization of the navigator.""" import argparse import pathlib @@ -11,9 +9,7 @@ def yelp(*args): - """ - Help function (renamed to avoid clash of names) - short cut: h. - """ + """Help function (renamed to avoid clash of names) - short cut: h.""" if len(args) == 0: print( f"""Welcome to ekomark navigator - the eko benchmark skript! @@ -38,6 +34,7 @@ def yelp(*args): def register_globals(configpath): + """Expose global variables.""" app = navigator.NavigatorApp(configpath, "sandbox") glob.app = app @@ -54,7 +51,7 @@ def register_globals(configpath): def launch_navigator(): - """CLI Entry point""" + """CLI Entry point.""" parser = argparse.ArgumentParser() parser.add_argument( diff --git a/src/ekomark/navigator/glob.py b/src/ekomark/navigator/glob.py index 893dbb324..ecb39b22f 100644 --- a/src/ekomark/navigator/glob.py +++ b/src/ekomark/navigator/glob.py @@ -1,2 +1,3 @@ +"""Global variables register.""" app = None glob = globals() From 62c10a903d986cabc243f9a5f4a794173cc5dfd6 Mon Sep 17 00:00:00 2001 From: Felix Hekhorn Date: Wed, 5 Apr 2023 14:08:19 +0200 Subject: [PATCH 2/7] Fix pydocstyle in ekobox --- src/ekobox/genpdf/cli.py | 14 ++++---- src/ekobox/genpdf/flavors.py | 65 ++++++++++++++++++------------------ src/ekobox/mock.py | 1 + 3 files changed, 42 insertions(+), 38 deletions(-) diff --git a/src/ekobox/genpdf/cli.py b/src/ekobox/genpdf/cli.py index 6c409d91e..f61632829 100644 --- a/src/ekobox/genpdf/cli.py +++ b/src/ekobox/genpdf/cli.py @@ -1,6 +1,4 @@ -""" -This module defines the CLI - see :doc:`here ` -""" +"""Defines the CLI - see :doc:`here `.""" import click @@ -9,7 +7,11 @@ @click.group() def cli(): - pass + """Generate and install fake PDFs. + + See online documentation for a detailed explanation and examples. + + """ @cli.command("generate") @@ -19,7 +21,7 @@ def cli(): @click.option("-m", "--members", is_flag=True, help="generate all the members") @click.option("-i", "--install", is_flag=True, help="install into LHAPDF") def cli_generate_pdf(name, labels, parent_pdf_set, members, install): - """Generate a new PDF from a parent set with given flavors""" + """Generate a new PDF from a parent set with given flavors.""" if len(labels) == 0: raise ValueError("Labels must contain at least one element") return generate_pdf(name, labels, parent_pdf_set, members, None, install) @@ -28,5 +30,5 @@ def cli_generate_pdf(name, labels, parent_pdf_set, members, install): @cli.command("install") @click.argument("name") def cli_install_pdf(name): - """Install the PDF on LHAPDF directory""" + """Install the PDF in LHAPDF directory.""" return install_pdf(name) diff --git a/src/ekobox/genpdf/flavors.py b/src/ekobox/genpdf/flavors.py index e52cac483..2798ccb19 100644 --- a/src/ekobox/genpdf/flavors.py +++ b/src/ekobox/genpdf/flavors.py @@ -1,3 +1,4 @@ +"""Collection of flavor tools.""" import copy import numpy as np @@ -6,18 +7,18 @@ def pid_to_flavor(pids): - """ - Create flavor representations from PIDs. + """Create flavor representations from PIDs. Parameters ---------- - pids : list(int) - active PIDs + pids : list(int) + active PIDs Returns ------- - numpy.ndarray - list of reprentations for each PID + numpy.ndarray + list of reprentations for each PID + """ ps = [] zeros = np.zeros(len(br.flavor_basis_pids)) @@ -30,18 +31,18 @@ def pid_to_flavor(pids): def evol_to_flavor(labels): - """ - Create flavor representations from evolution members. + """Create flavor representations from evolution members. Parameters ---------- - labels : list(str) - active evolution distributions + labels : list(str) + active evolution distributions Returns ------- - numpy.ndarray - list of reprentations for each distribution + numpy.ndarray + list of reprentations for each distribution + """ ps = [] for label in labels: @@ -51,20 +52,20 @@ def evol_to_flavor(labels): def project(blocks, reprs): - """ - Project some combination of flavors defined by reprs from the blocks. + """Project some combination of flavors defined by reprs from the blocks. Parameters ---------- - blocks : list(dict) - PDF blocks - reprs : list(int) - active distributions in flavor representation + blocks : list(dict) + PDF blocks + reprs : list(int) + active distributions in flavor representation Returns ------- - list(dict) : - filtered blocks + list(dict) : + filtered blocks + """ new_blocks = copy.deepcopy(blocks) for block in new_blocks: @@ -88,18 +89,18 @@ def project(blocks, reprs): def is_evolution_labels(labels): - """ - Check whether the labels are provided in evolution basis + """Check whether the labels are provided in evolution basis. Parameters ---------- - labels : list() - list of labels + labels : list() + list of labels Returns ------- - bool : - is evolution basis + bool : + is evolution basis + """ for label in labels: if not isinstance(label, str): @@ -110,18 +111,18 @@ def is_evolution_labels(labels): def is_pid_labels(labels): - """ - Check whether the labels are provided in flavor basis + """Check whether the labels are provided in flavor basis. Parameters ---------- - labels : list() - list of labels + labels : list() + list of labels Returns ------- - bool : - is flavor basis + bool : + is flavor basis + """ try: labels = np.array(labels, dtype=np.int_) diff --git a/src/ekobox/mock.py b/src/ekobox/mock.py index 1e1b8828b..ad56ad0cb 100644 --- a/src/ekobox/mock.py +++ b/src/ekobox/mock.py @@ -1,3 +1,4 @@ +"""Mocking tools.""" import numpy as np From 408724e0c4cbd4f74733bb6ddd816f7522862e6b Mon Sep 17 00:00:00 2001 From: Felix Hekhorn Date: Wed, 5 Apr 2023 14:31:44 +0200 Subject: [PATCH 3/7] Fix pydocstyle in eko --- src/eko/gamma.py | 75 +++++++++-------- src/eko/interpolation.py | 14 +++- src/eko/kernels/__init__.py | 4 +- src/eko/kernels/utils.py | 22 ++--- src/eko/mellin.py | 161 ++++++++++++++++++------------------ src/eko/member.py | 107 ++++++++++++------------ 6 files changed, 197 insertions(+), 186 deletions(-) diff --git a/src/eko/gamma.py b/src/eko/gamma.py index b2c4a857b..de594cfd1 100644 --- a/src/eko/gamma.py +++ b/src/eko/gamma.py @@ -1,5 +1,4 @@ -r""" -This module contains the QCD gamma function coefficients. +r"""The |QCD| gamma function coefficients. See :doc:`pQCD ingredients `. """ @@ -10,75 +9,75 @@ @nb.njit(cache=True) def gamma_qcd_as1(): - """ - Computes the first coefficient of the QCD gamma function. + r"""Compute the first coefficient of the |QCD| gamma function. - Implements Eq. (15) of :cite:`Vermaseren:1997fq`. + Implements :eqref:`15` of :cite:`Vermaseren:1997fq`. Returns ------- - gamma_0 : float - first coefficient of the QCD gamma function :math:`\\gamma_{m,0}^{n_f}` + gamma_0 : float + first coefficient of the |QCD| gamma function :math:`\gamma_{m,0}^{n_f}` + """ return 4.0 @nb.njit(cache=True) def gamma_qcd_as2(nf): - """ - Computes the second coefficient of the QCD gamma function. + r"""Compute the second coefficient of the |QCD| gamma function. - Implements Eq. (15) of :cite:`Vermaseren:1997fq`. + Implements :eqref:`15` of :cite:`Vermaseren:1997fq`. Parameters ---------- - nf : int - number of active flavors + nf : int + number of active flavors Returns ------- - gamma_1 : float - second coefficient of the QCD gamma function :math:`\\gamma_{m,1}^{n_f}` + gamma_1 : float + second coefficient of the |QCD| gamma function :math:`\gamma_{m,1}^{n_f}` + """ return 202.0 / 3.0 - 20.0 / 9.0 * nf @nb.njit(cache=True) def gamma_qcd_as3(nf): - """ - Computes the third coefficient of the QCD gamma function. + r"""Compute the third coefficient of the |QCD| gamma function. - Implements Eq. (15) of :cite:`Vermaseren:1997fq`. + Implements :eqref:`15` of :cite:`Vermaseren:1997fq`. Parameters ---------- - nf : int - number of active flavors + nf : int + number of active flavors Returns ------- - gamma_2 : float - third coefficient of the QCD gamma function :math:`\\gamma_{m,2}^{n_f}` + gamma_2 : float + third coefficient of the |QCD| gamma function :math:`\gamma_{m,2}^{n_f}` + """ return 1249.0 - (2216.0 / 27.0 + 160.0 / 3.0 * zeta3) * nf - 140.0 / 81.0 * nf**2 @nb.njit(cache=True) def gamma_qcd_as4(nf): - """ - Computes the fourth coefficient of the QCD gamma function. + r"""Compute the fourth coefficient of the |QCD| gamma function. - Implements Eq. (15) of :cite:`Vermaseren:1997fq`. + Implements :eqref:`15` of :cite:`Vermaseren:1997fq`. Parameters ---------- - nf : int - number of active flavors + nf : int + number of active flavors Returns ------- - gamma_3 : float - fourth coefficient of the QCD gamma function :math:`\\gamma_{m,3}^{n_f}` + gamma_3 : float + fourth coefficient of the |QCD| gamma function :math:`\gamma_{m,3}^{n_f}` + """ return ( 4603055.0 / 162.0 @@ -98,20 +97,20 @@ def gamma_qcd_as4(nf): @nb.njit(cache=True) def gamma(order, nf): - """ - Compute the value of a gamma coefficient + """Compute the value of a |QCD| gamma coefficient. Parameters ---------- - order: int - perturbative order - nf : int - number of active flavors + order: int + perturbative order + nf : int + number of active flavors - returns + Returns ------- - gamma: float - QCD gamma function coefficient + gamma : float + |QCD| gamma function coefficient + """ _gamma = 0.0 @@ -124,5 +123,5 @@ def gamma(order, nf): elif order == 4: _gamma = gamma_qcd_as4(nf) else: - raise ValueError("QCD Gamma coefficients beyond N3LO are not implemented!") + raise ValueError("QCD gamma coefficients beyond N3LO are not implemented!") return _gamma diff --git a/src/eko/interpolation.py b/src/eko/interpolation.py index 14a63f127..246aa7d73 100644 --- a/src/eko/interpolation.py +++ b/src/eko/interpolation.py @@ -1,5 +1,4 @@ -""" -Library providing all necessary tools for PDF interpolation. +"""Library providing all necessary tools for PDF interpolation. This library also provides a class to generate the interpolator :class:`InterpolatorDispatcher`. Upon construction the dispatcher generates a number of functions @@ -409,6 +408,7 @@ def __iter__(self): yield from self.areas def __call__(self, *args, **kwargs): + """Evaluate function.""" args = list(args) args.append(self.areas_representation) return self.callable(*args, **kwargs) @@ -450,24 +450,34 @@ def __eq__(self, other) -> bool: @property def raw(self) -> np.ndarray: + """Untransformed grid.""" return self.grid if not self.log else self._raw @property def size(self) -> int: + """Number of pointrs.""" return self.grid.size def tolist(self) -> list: + """Raw grid as Python list.""" return self.raw.tolist() def dump(self) -> dict: + """Representation as dictionary.""" return dict(grid=self.tolist(), log=self.log) @classmethod def load(cls, doc: dict): + """Create object from dictinary.""" return cls(doc["grid"], log=doc["log"]) @classmethod def fromcard(cls, value: list, log: bool): + """Create object from theory card config. + + The config can invoke other grid generation methods. + + """ if len(value) == 0: raise ValueError("Empty xgrid!") diff --git a/src/eko/kernels/__init__.py b/src/eko/kernels/__init__.py index 1bb0e5d98..7640727b5 100644 --- a/src/eko/kernels/__init__.py +++ b/src/eko/kernels/__init__.py @@ -1,3 +1 @@ -""" -This module defines all anomalous dimensions in all sectors and at all orders. -""" +"""The solutions to the |DGLAP| equations.""" diff --git a/src/eko/kernels/utils.py b/src/eko/kernels/utils.py index cd504aa3e..8b227199b 100644 --- a/src/eko/kernels/utils.py +++ b/src/eko/kernels/utils.py @@ -1,4 +1,4 @@ -"""Some utility functions""" +"""Utility functions.""" import numba as nb import numpy as np @@ -6,21 +6,21 @@ @nb.njit(cache=True) def geomspace(start, end, num): - """ - Numba port of :func:`numpy.geomspace`. + """Numba port of :func:`numpy.geomspace`. Parameters ---------- - start : float - initial value - end : float - final value - num : int - steps + start : float + initial value + end : float + final value + num : int + steps Returns ------- - geomspace : numpy.ndarray - logarithmic spaced list between `start` and `end` + geomspace : numpy.ndarray + logarithmic spaced list between `start` and `end` + """ return np.exp(np.linspace(np.log(start), np.log(end), num)) diff --git a/src/eko/mellin.py b/src/eko/mellin.py index cdbe7821f..01ec56ad4 100644 --- a/src/eko/mellin.py +++ b/src/eko/mellin.py @@ -1,5 +1,6 @@ -r""" -This module contains the implementation of the +r"""Tools for Mellin inversion. + +We provide all necessary toold to deal with the `inverse Mellin transformation `_. Although this module provides three different path implementations in practice @@ -23,8 +24,7 @@ @nb.njit(cache=True) def Talbot_path(t, r, o): - r""" - Talbot path. + r"""Compute Talbot path. .. math:: p_{\text{Talbot}}(t) = o + r \cdot ( \theta \cot(\theta) + i\theta ), @@ -32,18 +32,19 @@ def Talbot_path(t, r, o): Parameters ---------- - t : float - way parameter - r : float - scaling parameter - effectively corresponds to the intersection of the path with the - real axis - o : float - offset on real axis + t : float + way parameter + r : float + scaling parameter - effectively corresponds to the intersection of the path with the + real axis + o : float + offset on real axis Returns ------- - path : complex - Talbot path + path : complex + Talbot path + """ theta = np.pi * (2.0 * t - 1.0) re = 0.0 @@ -56,27 +57,27 @@ def Talbot_path(t, r, o): @nb.njit(cache=True) -def Talbot_jac(t, r, o): # pylint: disable=unused-argument - r""" - Derivative of Talbot path. +def Talbot_jac(t, r, _o): + r"""Compute Derivative of Talbot path. .. math:: \frac{dp_{\text{Talbot}}(t)}{dt} Parameters ---------- - t : float - way parameter - r : float - scaling parameter - effectively corresponds to the intersection of the path with the - real axis - o : float - offset on real axis + t : float + way parameter + r : float + scaling parameter - effectively corresponds to the intersection of the path with the + real axis + o : float + offset on real axis Returns ------- - jac : complex - derivative of Talbot path + jac : complex + derivative of Talbot path + """ theta = np.pi * (2.0 * t - 1.0) re = 0.0 @@ -91,77 +92,77 @@ def Talbot_jac(t, r, o): # pylint: disable=unused-argument @nb.njit(cache=True) def line_path(t, m, c): - r""" - Textbook path, i.e. a straight line parallel to the imaginary axis. + r"""Compute textbook path, i.e. a straight line parallel to the imaginary axis. .. math:: p_{\text{line}}(t) = c + m \cdot (2t - 1) Parameters ---------- - t : float - way parameter - m : float - scaling parameter - c : float - offset on real axis + t : float + way parameter + m : float + scaling parameter + c : float + offset on real axis Returns ------- - path : complex - Textbook path + path : complex + Textbook path + """ return complex(c, m * (2 * t - 1)) @nb.njit(cache=True) def line_jac(_t, m, _c): - r""" - Derivative of Textbook path. + r"""Compute derivative of Textbook path. .. math:: \frac{dp_{\text{line}}(t)}{dt} Parameters ---------- - t : float - way parameter - m : float - scaling parameter - o : float - offset on real axis + t : float + way parameter + m : float + scaling parameter + o : float + offset on real axis Returns ------- - jac : complex - derivative of Textbook path + jac : complex + derivative of Textbook path + """ return complex(0, m * 2) @nb.njit(cache=True) def edge_path(t, m, c, phi): - r""" - Edged path with a given angle. + r"""Compute edged path with a given angle. .. math:: p_{\text{edge}}(t) = c + m\left|t - \frac 1 2\right|\exp(i\phi) Parameters ---------- - t : float - way parameter - m : float - length of the path - c : float, optional - intersection of path with real axis - phi : complex, optional - bended angle + t : float + way parameter + m : float + length of the path + c : float, optional + intersection of path with real axis + phi : complex, optional + bended angle Returns ------- - path : complex - Edged path + path : complex + Edged path + """ if t < 0.5: # turning point: path is not differentiable in this point return c + (0.5 - t) * m * np.exp(complex(0, -phi)) @@ -170,27 +171,27 @@ def edge_path(t, m, c, phi): @nb.njit(cache=True) def edge_jac(t, m, _c, phi): - r""" - Derivative of edged path + r"""Compute derivative of edged path. .. math:: \frac{dp_{\text{edge}}(t)}{dt} Parameters ---------- - t : float - way parameter - m : float - length of the path - c : float, optional - intersection of path with real axis - phi : complex, optional - bended angle + t : float + way parameter + m : float + length of the path + c : float, optional + intersection of path with real axis + phi : complex, optional + bended angle Returns ------- - path : complex - Derivative of edged path + path : complex + Derivative of edged path + """ if t < 0.5: # turning point: jacobian is not continuous here return -m * np.exp(complex(0, -phi)) @@ -206,17 +207,17 @@ def edge_jac(t, m, _c, phi): @nb.experimental.jitclass(spec) class Path: - """ - Mellin path dispatcher + """Mellin path dispatcher. Parameters ---------- - t : float - way parameter - logx : float - Mellin inversion point - axis_offset: bool - add offset on the real axis + t : float + way parameter + logx : float + Mellin inversion point + axis_offset: bool + add offset on the real axis + """ def __init__(self, t, logx, axis_offset): @@ -231,15 +232,15 @@ def __init__(self, t, logx, axis_offset): # TODO: make also the other 2 paths available ?? @property def n(self): - """Returns the Mellin moment N""" + """Return the Mellin moment N.""" return Talbot_path(self.t, self.r, self.o) @property def jac(self): - """Returns the Jacobian of the Mellin path""" + """Return the Jacobian of the Mellin path.""" return Talbot_jac(self.t, self.r, self.o) @property def prefactor(self): - r"""Returns the mellin inversion prefactor :math:`-\frac{i}{\pi}`""" + r"""Return the mellin inversion prefactor :math:`-\frac{i}{\pi}`.""" return complex(0.0, -1.0 / np.pi) diff --git a/src/eko/member.py b/src/eko/member.py index a764fdb26..ad3fb2e19 100644 --- a/src/eko/member.py +++ b/src/eko/member.py @@ -1,3 +1,4 @@ +"""Atomic operator member.""" import copy import operator from numbers import Number @@ -16,10 +17,11 @@ class OpMember: Parameters ---------- - value : np.array - operator matrix - error : np.array - operator error matrix + value : np.array + operator matrix + error : np.array + operator error matrix + """ def __init__(self, value, error): @@ -27,22 +29,23 @@ def __init__(self, value, error): self.error = np.array(error) def copy(self): + """Copy implementation.""" return self.__class__(self.value.copy(), self.error.copy()) @classmethod def id_like(cls, other): - """ - Creates an identity operator. + """Create an identity operator. Parameters ---------- - other : OpMember - reference member + other : OpMember + reference member Returns ------- - cls : - 1 + cls : + 1 all spaces + """ len_xgrid = other.value.shape[0] return cls(np.eye(len_xgrid), np.zeros((len_xgrid, len_xgrid))) @@ -100,13 +103,13 @@ def __rmul__(self, other): class MemberName: - """ - Operator member name in operator evolution space + """Operator member name in operator evolution space. Parameters ---------- - name : str - operator name + name : str + operator name + """ def __init__(self, name): @@ -122,7 +125,7 @@ def __hash__(self): return hash(str(self)) def _split_name(self): - """Splits the name according to target.input""" + """Split the name according to target.input.""" # we need to do this late, as in raw mode the name to not follow this principle name_spl = self.name.split(".") if len(name_spl) != 2: @@ -135,25 +138,25 @@ def _split_name(self): @property def target(self): - """Returns target flavor name (given by the first part of the name)""" + """Returns target flavor name (given by the first part of the name).""" return self._split_name()[0] @property def input(self): - """Returns input flavor name (given by the second part of the name)""" + """Returns input flavor name (given by the second part of the name).""" return self._split_name()[1] class OperatorBase: - """ - Abstract base class to hold a dictionary of interpolation matrices. + """Abstract base class to hold a dictionary of interpolation matrices. Parameters ---------- - op_members : dict - mapping of :class:`MemberName` onto :class:`OpMember` - q2_final : float - final scale + op_members : dict + mapping of :class:`MemberName` onto :class:`OpMember` + q2_final : float + final scale + """ def __init__(self, op_members, q2_final): @@ -167,15 +170,15 @@ def __getitem__(self, key): @classmethod def promote_names(cls, op_members, q2_final): - """ - Promote string keys to MemberName. + """Promote string keys to MemberName. Parameters ---------- - op_members : dict - mapping of :data:`str` onto :class:`OpMember` - q2_final : float - final scale + op_members : dict + mapping of :data:`str` onto :class:`OpMember` + q2_final : float + final scale + """ # map key to MemberName opms = {} @@ -184,18 +187,18 @@ def promote_names(cls, op_members, q2_final): return cls(opms, q2_final) def __matmul__(self, other): - """ - Multiply ``other`` to self. + """Multiply ``other`` to self. Parameters ---------- - other : OperatorBase - second factor with a lower initial scale + other : OperatorBase + second factor with a lower initial scale Returns ------- - p : PhysicalOperator - self @ other + p : PhysicalOperator + self @ other + """ if not isinstance(other, OperatorBase): raise ValueError("Can only multiply with another OperatorBase") @@ -209,18 +212,18 @@ def __matmul__(self, other): ) def operation(self, other): - """ - Choose mathematical operation by rank + """Choose mathematical operation by rank. Parameters ---------- - other : OperatorBase - operand + other : OperatorBase + operand Returns ------- - callable : - operation to perform (np.matmul or np.multiply) + callable : + operation to perform (np.matmul or np.multiply) + """ if isinstance(self, ScalarOperator) or isinstance(other, ScalarOperator): return operator.mul @@ -228,22 +231,22 @@ def operation(self, other): @staticmethod def operator_multiply(left, right, operation): - """ - Multiply two operators. + """Multiply two operators. Parameters ---------- - left : OperatorBase - left operand - right : OperatorBase - right operand - operation : callable - operation to perform (np.matmul or np.multiply) + left : OperatorBase + left operand + right : OperatorBase + right operand + operation : callable + operation to perform (np.matmul or np.multiply) Returns ------- - dict - new operator members dictionary + dict + new operator members dictionary + """ # prepare paths new_oms = {} @@ -262,4 +265,4 @@ def operator_multiply(left, right, operation): class ScalarOperator(OperatorBase): - pass + """Operator above space of real numbers.""" From fd63675a97f59ce6787c9fb73282d67b73d84a17 Mon Sep 17 00:00:00 2001 From: Felix Hekhorn Date: Wed, 5 Apr 2023 14:52:08 +0200 Subject: [PATCH 4/7] Fix pydocstyle in ekore.harmonics --- src/ekore/harmonics/g_functions.py | 182 ++++++++++++++--------------- src/ekore/harmonics/polygamma.py | 67 +++++------ src/ekore/harmonics/w1.py | 31 ++--- src/ekore/harmonics/w2.py | 32 ++--- src/ekore/harmonics/w3.py | 10 +- src/ekore/harmonics/w4.py | 12 +- 6 files changed, 169 insertions(+), 165 deletions(-) diff --git a/src/ekore/harmonics/g_functions.py b/src/ekore/harmonics/g_functions.py index dc7073175..b1a50aed4 100644 --- a/src/ekore/harmonics/g_functions.py +++ b/src/ekore/harmonics/g_functions.py @@ -1,5 +1,6 @@ -""" -Implementations of some mellin transformations :cite:`MuselliPhD` +"""Auxilary functions for harmonics sums of weight = 3,4. + +Implementations of some Mellin transformations :math:`g_k(N)` :cite:`MuselliPhD` appearing in the analytic continuation of harmonics sums of weight = 3,4. """ import numba as nb @@ -63,8 +64,7 @@ @nb.njit(cache=True) def mellin_g3(N, S1): - r""" - Computes the Mellin transform of :math:`\text{Li}_2(x)/(1+x)`. + r"""Compute the Mellin transform of :math:`\text{Li}_2(x)/(1+x)`. This function appears in the analytic continuation of the harmonic sum :math:`S_{-2,1}(N)` which in turn appears in the |NLO| anomalous dimension @@ -72,20 +72,21 @@ def mellin_g3(N, S1): Parameters ---------- - N : complex - Mellin moment - S1: complex + N : complex + Mellin moment + S1: complex Harmonic sum :math:`S_{1}(N)` Returns ------- - mellin_g3 : complex - approximate Mellin transform :math:`\mathcal{M}[\text{Li}_2(x)/(1+x)](N)` + mellin_g3 : complex + approximate Mellin transform :math:`\mathcal{M}[\text{Li}_2(x)/(1+x)](N)` Note ---- We use the name from :cite:`MuselliPhD`, but not his implementation - rather we use the Pegasus :cite:`Vogt:2004ns` implementation. + """ cs = [1.0000e0, -0.9992e0, 0.9851e0, -0.9005e0, 0.6621e0, -0.3174e0, 0.0699e0] g3 = 0 @@ -97,22 +98,22 @@ def mellin_g3(N, S1): @nb.njit(cache=True) def mellin_g4(N): - r""" - Computes the Mellin transform of :math:`\text{Li}_2(-x)/(1+x)`. + r"""Compute the Mellin transform of :math:`\text{Li}_2(-x)/(1+x)`. - Implementation and definition in B.5.25 of :cite:`MuselliPhD` or - in eq 61 of :cite:`Bl_mlein_2000`, but none of them is fully correct. + Implementation and definition in :eqref:`B.5.25` of :cite:`MuselliPhD` or + in :eqref:`61` of :cite:`Bl_mlein_2000`, but none of them is fully correct. Parameters ---------- - N : complex - Mellin moment + N : complex + Mellin moment Returns ------- - mellin_g4 : complex - Mellin transform :math:`\mathcal{M}[\text{Li}_2(-x)/(1+x)](N)` + mellin_g4 : complex + Mellin transform :math:`\mathcal{M}[\text{Li}_2(-x)/(1+x)](N)` + """ g4 = -1 / 2 * zeta2 * log2 for k, ak in enumerate(a1): @@ -124,11 +125,10 @@ def mellin_g4(N): @nb.njit(cache=True) def mellin_g5(N, S1, S2): - r""" - Computes the Mellin transform of :math:`(\text{Li}_2(x)ln(x))/(1+x)`. + r"""Compute the Mellin transform of :math:`(\text{Li}_2(x)ln(x))/(1+x)`. - Implementation and definition in B.5.26 of :cite:`MuselliPhD` or - in eq 62 of :cite:`Bl_mlein_2000`, but none of them is fully correct. + Implementation and definition in :eqref:`B.5.26` of :cite:`MuselliPhD` or + in :eqref:`62` of :cite:`Bl_mlein_2000`, but none of them is fully correct. Parameters ---------- @@ -154,24 +154,22 @@ def mellin_g5(N, S1, S2): @nb.njit(cache=True) def mellin_g6(N, S1): - r""" - Computes the Mellin transform of :math:`\text{Li}_3(x)/(1+x)`. + r"""Compute the Mellin transform of :math:`\text{Li}_3(x)/(1+x)`. - Implementation and definition in B.5.27 of :cite:`MuselliPhD` or - in eq 63 of :cite:`Bl_mlein_2000`, but none of them is fully correct. + Implementation and definition in :eqref:`B.5.27` of :cite:`MuselliPhD` or + in :eqref:`63` of :cite:`Bl_mlein_2000`, but none of them is fully correct. Parameters ---------- - N : complex - Mellin moment - S1: complex - Harmonic sum :math:`S_{1}(N)` + N : complex + Mellin moment + S1: complex + Harmonic sum :math:`S_{1}(N)` Returns ------- - mellin_g6 : complex - Mellin transform :math:`\mathcal{M}[\text{Li}_3(x)/(1+x)](N)` - + mellin_g6 : complex + Mellin transform :math:`\mathcal{M}[\text{Li}_3(x)/(1+x)](N)` """ g6 = zeta3 * log2 @@ -185,25 +183,25 @@ def mellin_g6(N, S1): @nb.njit(cache=True) def mellin_g8(N, S1, S2): - r""" - Computes the Mellin transform of :math:`S_{1,2}(x)/(1+x)`. + r"""Compute the Mellin transform of :math:`S_{1,2}(x)/(1+x)`. - Implementation and definition in B.5.29 of :cite:`MuselliPhD` or - in eq 65 of :cite:`Bl_mlein_2000`, but none of them is fully correct. + Implementation and definition in :eqref:`B.5.29` of :cite:`MuselliPhD` or + in :eqref:`65` of :cite:`Bl_mlein_2000`, but none of them is fully correct. Parameters ---------- - N : complex - Mellin moment - S1: complex - Harmonic sum :math:`S_{1}(N)` - S2: complex - Harmonic sum :math:`S_{2}(N)` + N : complex + Mellin moment + S1: complex + Harmonic sum :math:`S_{1}(N)` + S2: complex + Harmonic sum :math:`S_{2}(N)` Returns ------- - mellin_g8 : complex - Mellin transform :math:`\mathcal{M}[S_{1,2}(x)/(1+x)](N)` + mellin_g8 : complex + Mellin transform :math:`\mathcal{M}[S_{1,2}(x)/(1+x)](N)` + """ g8 = zeta3 * log2 for k, ak in enumerate(a1): @@ -217,10 +215,9 @@ def mellin_g8(N, S1, S2): @nb.njit(cache=True) def mellin_g18(N, S1, S2): - r""" - Computes the Mellin transform of :math:`-(\text{Li}_2(x) - \zeta_2)/(1-x)`. + r"""Compute the Mellin transform of :math:`-(\text{Li}_2(x) - \zeta_2)/(1-x)`. - Implementation and definition in eq 124 of :cite:`Bl_mlein_2000` + Implementation and definition in :eqref:`124` of :cite:`Bl_mlein_2000` Note: comparing to :cite:`Bl_mlein_2000`, we believe :cite:`MuselliPhD` was not changing the notations of :math:`P^{(1)}_{2}` to :math:`P^{(1)}_{1}`. @@ -229,16 +226,17 @@ def mellin_g18(N, S1, S2): Parameters ---------- - N : complex - Mellin moment - S1 : complex - Harmonic sum :math:`S_{1}(N)` - S2 : complex - Harmonic sum :math:`S_{2}(N)` + N : complex + Mellin moment + S1 : complex + Harmonic sum :math:`S_{1}(N)` + S2 : complex + Harmonic sum :math:`S_{2}(N)` Returns ------- - mellin_g18 : complex - Mellin transform :math:`\mathcal{M}[-(\text{Li}_2(x) - \zeta_2)/(1-x)](N)` + mellin_g18 : complex + Mellin transform :math:`\mathcal{M}[-(\text{Li}_2(x) - \zeta_2)/(1-x)](N)` + """ g18 = (S1**2 + S2) / (N) - zeta2 * S1 for k, ck in enumerate(c1): @@ -252,23 +250,23 @@ def mellin_g18(N, S1, S2): @nb.njit(cache=True) def mellin_g19(N, S1): - r""" - Computes the Mellin transform of :math:`-(\text{Li}_2(-x) + \zeta_2/2)/(1-x)`. + r"""Compute the Mellin transform of :math:`-(\text{Li}_2(-x) + \zeta_2/2)/(1-x)`. - Implementation and definition in B.5.40 of :cite:`MuselliPhD` or in 125 of + Implementation and definition in :eqref:`B.5.40` of :cite:`MuselliPhD` or in :eqref:`125` of :cite:`Bl_mlein_2000`, but none of them is fully correct. Parameters ---------- - N : complex - Mellin moment - S1 : complex - Harmonic sum :math:`S_{1}(N)` + N : complex + Mellin moment + S1 : complex + Harmonic sum :math:`S_{1}(N)` Returns ------- - mellin_g19 : complex - Mellin transform :math:`\mathcal{M}[-(\text{Li}_2(-x) + \zeta_2/2)/(1-x)](N)` + mellin_g19 : complex + Mellin transform :math:`\mathcal{M}[-(\text{Li}_2(-x) + \zeta_2/2)/(1-x)](N)` + """ g19 = 1 / 2 * zeta2 * S1 for k, ak in enumerate(a1): @@ -278,32 +276,32 @@ def mellin_g19(N, S1): @nb.njit(cache=True) def mellin_g21(N, S1, S2, S3): - r""" - Computes the Mellin transform of :math:`-(S_{1,2}(x) - \zeta_3)/(1-x)`. + r"""Compute the Mellin transform of :math:`-(S_{1,2}(x) - \zeta_3)/(1-x)`. - Implementation and definition in B.5.42 of :cite:`MuselliPhD` + Implementation and definition in :eqref:`B.5.42 of` :cite:`MuselliPhD`. Note: comparing to :cite:`Bl_mlein_2000`, we believe :cite:`MuselliPhD` was not changing the notations of :math:`P^{(3)}_{2}` to :math:`P^{(3)}_{1}` and :math:`P^{(3)}_{3}` to :math:`P^{(3)}_{2}`. - So we implement eq 127 of :cite:`Bl_mlein_2000` but using :cite:`MuselliPhD` + So we implement :eqref:`127` of :cite:`Bl_mlein_2000` but using :cite:`MuselliPhD` notation. Parameters ---------- - N : complex - Mellin moment - S1 : complex - Harmonic sum :math:`S_{1}(N)` - S2 : complex - Harmonic sum :math:`S_{2}(N)` - S3 : complex - Harmonic sum :math:`S_{3}(N)` + N : complex + Mellin moment + S1 : complex + Harmonic sum :math:`S_{1}(N)` + S2 : complex + Harmonic sum :math:`S_{2}(N)` + S3 : complex + Harmonic sum :math:`S_{3}(N)` Returns ------- - mellin_g21 : complex - Mellin transform :math:`\mathcal{M}[-(S_{1,2}(x) - \zeta_3)/(1-x)](N)` + mellin_g21 : complex + Mellin transform :math:`\mathcal{M}[-(S_{1,2}(x) - \zeta_3)/(1-x)](N)` + """ g21 = -zeta3 * S1 + (S1**3 + 3 * S1 * S2 + 2 * S3) / (2 * N) for k, ck in enumerate(c3): @@ -327,31 +325,31 @@ def mellin_g21(N, S1, S2, S3): @nb.njit(cache=True) def mellin_g22(N, S1, S2, S3): - r""" - Computes the Mellin transform of :math:`-(\text{Li}_2(x) ln(x))/(1-x)`. + r"""Compute the Mellin transform of :math:`-(\text{Li}_2(x) ln(x))/(1-x)`. - Implementation and definition in B.5.43 of :cite:`MuselliPhD` + Implementation and definition in :eqref:`B.5.43` of :cite:`MuselliPhD`. Note: comparing to :cite:`Bl_mlein_2000`, we believe :cite:`MuselliPhD` was not changing the notations of :math:`P^{(1)}_{2}` to :math:`P^{(1)}_{1}` - So we implement eq 128 of :cite:`Bl_mlein_2000` but using :cite:`MuselliPhD` + So we implement :eqref:`128` of :cite:`Bl_mlein_2000` but using :cite:`MuselliPhD` notation. Parameters ---------- - N : complex - Mellin moment - S1 : complex - Harmonic sum :math:`S_{1}(N)` - S2 : complex - Harmonic sum :math:`S_{2}(N)` - S3 : complex - Harmonic sum :math:`S_{3}(N)` + N : complex + Mellin moment + S1 : complex + Harmonic sum :math:`S_{1}(N)` + S2 : complex + Harmonic sum :math:`S_{2}(N)` + S3 : complex + Harmonic sum :math:`S_{3}(N)` Returns ------- - mellin_g22 : complex - Mellin transform :math:`\mathcal{M}[-(\text{Li}_2(x) ln(x))/(1-x)](N)` + mellin_g22 : complex + Mellin transform :math:`\mathcal{M}[-(\text{Li}_2(x) ln(x))/(1-x)](N)` + """ g22 = 0.0 for k, ck in enumerate(c1): diff --git a/src/ekore/harmonics/polygamma.py b/src/ekore/harmonics/polygamma.py index c360dd8b2..a2c7e442f 100644 --- a/src/ekore/harmonics/polygamma.py +++ b/src/ekore/harmonics/polygamma.py @@ -1,5 +1,4 @@ -""" -Implements higher mathematical functions. +"""Polygamma and harmonic sums implementation. The functions are described in :doc:`Mellin space `. """ @@ -10,8 +9,7 @@ @nb.njit(cache=True) def cern_polygamma(Z, K): # pylint: disable=all - """ - Computes the polygamma functions :math:`\\psi_k(z)`. + r"""Compute the polygamma functions :math:`\psi_k(z)`. Reimplementation of ``WPSIPG`` (C317) in `CERNlib `_ :cite:`KOLBIG1972221`. @@ -21,15 +19,16 @@ def cern_polygamma(Z, K): # pylint: disable=all Parameters ---------- - Z : complex - argument of polygamma function - K : int - order of polygamma function + Z : complex + argument of polygamma function + K : int + order of polygamma function Returns ------- - H : complex - k-th polygamma function :math:`\\psi_k(z)` + H : complex + k-th polygamma function :math:`\psi_k(z)` + """ # fmt: off DELTA = 5e-13 @@ -127,25 +126,27 @@ def cern_polygamma(Z, K): # pylint: disable=all @nb.njit(cache=True) def recursive_harmonic_sum(base_value, n, iterations, weight): - """ + """Recursive computation of harmonic sums. + Compute the harmonic sum :math:`S_{w}(N+k)` stating from the value :math:`S_{w}(N)` via the recurrence relations. Parameters ---------- - base_value: complex - starting value :math:`S_{w}(N)` - n: complex - starting point - iterations: int - number of iterations - weight: int - harmonic sum weight + base_value: complex + starting value :math:`S_{w}(N)` + n: complex + starting point + iterations: int + number of iterations + weight: int + harmonic sum weight Returns ------- - sni : complex - :math:`S_{w}(N+k)` + sni : complex + :math:`S_{w}(N+k)` + """ fact = 0.0 for i in range(1, iterations + 1): @@ -155,24 +156,24 @@ def recursive_harmonic_sum(base_value, n, iterations, weight): @nb.njit(cache=True) def symmetry_factor(N, is_singlet=None): - """ - Compute the analytical continuation of :math:`(-1)^N` + """Compute the analytical continuation of :math:`(-1)^N`. Parameters ---------- - N: complex - Mellin moment - is_singlet: bool, None - True for singlet like quantities - False for non-singlet like quantities - None for generic complex N value + N: complex + Mellin moment + is_singlet: bool, None + True for singlet like quantities + False for non-singlet like quantities + None for generic complex N value Returns ------- - eta: complex - 1 for singlet like quantities, - -1 for non-singlet like quantities, - :math:`(-1)^N` elsewise + eta: complex + 1 for singlet like quantities, + -1 for non-singlet like quantities, + :math:`(-1)^N` elsewise + """ if is_singlet is None: return (-1) ** N diff --git a/src/ekore/harmonics/w1.py b/src/ekore/harmonics/w1.py index 10f7cc3d4..61b0c1f18 100644 --- a/src/ekore/harmonics/w1.py +++ b/src/ekore/harmonics/w1.py @@ -8,7 +8,7 @@ @nb.njit(cache=True) def S1(N): - r"""Computes the harmonic sum :math:`S_1(N)`. + r"""Compute the harmonic sum :math:`S_1(N)`. .. math:: S_1(N) = \sum\limits_{j=1}^N \frac 1 j = \psi_0(N+1)+\gamma_E @@ -18,17 +18,18 @@ def S1(N): Parameters ---------- - N : complex - Mellin moment + N : complex + Mellin moment Returns ------- - S_1 : complex - (simple) Harmonic sum :math:`S_1(N)` + S_1 : complex + (simple) Harmonic sum :math:`S_1(N)` See Also -------- ekore.harmonics.polygamma.cern_polygamma : :math:`\psi_k(N)` + """ return cern_polygamma(N + 1.0, 0) + np.euler_gamma @@ -42,21 +43,23 @@ def Sm1(N, hS1, is_singlet=None): Parameters ---------- - N : complex - Mellin moment - hS1: complex - Harmonic sum :math:`S_{1}(N)` - is_singlet: bool, None - symmetry factor: True for singlet like quantities (:math:`\eta=(-1)^N = 1`), - False for non-singlet like quantities (:math:`\eta=(-1)^N=-1`) + N : complex + Mellin moment + hS1: complex + Harmonic sum :math:`S_{1}(N)` + is_singlet: bool, None + symmetry factor: True for singlet like quantities (:math:`\eta=(-1)^N = 1`), + False for non-singlet like quantities (:math:`\eta=(-1)^N=-1`) + Returns ------- - Sm1 : complex - Harmonic sum :math:`S_{-1}(N)` + Sm1 : complex + Harmonic sum :math:`S_{-1}(N)` See Also -------- eko.anomalous_dimension.w1.S1 : :math:`S_1(N)` + """ if is_singlet is None: return ( diff --git a/src/ekore/harmonics/w2.py b/src/ekore/harmonics/w2.py index 69c0029eb..07b59c77d 100644 --- a/src/ekore/harmonics/w2.py +++ b/src/ekore/harmonics/w2.py @@ -8,7 +8,7 @@ @nb.njit(cache=True) def S2(N): - r"""Computes the harmonic sum :math:`S_2(N)`. + r"""Compute the harmonic sum :math:`S_2(N)`. .. math:: S_2(N) = \sum\limits_{j=1}^N \frac 1 {j^2} = -\psi_1(N+1)+\zeta(2) @@ -18,17 +18,18 @@ def S2(N): Parameters ---------- - N : complex - Mellin moment + N : complex + Mellin moment Returns ------- - S_2 : complex - Harmonic sum :math:`S_2(N)` + S_2 : complex + Harmonic sum :math:`S_2(N)` See Also -------- ekore.harmonics.polygamma.cern_polygamma : :math:`\psi_k(N)` + """ return -cern_polygamma(N + 1.0, 1) + zeta2 @@ -42,23 +43,24 @@ def Sm2(N, hS2, is_singlet=None): Parameters ---------- - N : complex - Mellin moment - hS2: complex - Harmonic sum :math:`S_{2}(N)` - is_singlet: bool, None - symmetry factor: True for singlet like quantities - (:math:`\eta=(-1)^N = 1`), False for non-singlet like quantities - (:math:`\eta=(-1)^N=-1`) + N : complex + Mellin moment + hS2: complex + Harmonic sum :math:`S_{2}(N)` + is_singlet: bool, None + symmetry factor: True for singlet like quantities + (:math:`\eta=(-1)^N = 1`), False for non-singlet like quantities + (:math:`\eta=(-1)^N=-1`) Returns ------- - Sm2 : complex - Harmonic sum :math:`S_{-2}(N)` + Sm2 : complex + Harmonic sum :math:`S_{-2}(N)` See Also -------- eko.anomalous_dimension.w2.S2 : :math:`S_2(N)` + """ if is_singlet is None: return ( diff --git a/src/ekore/harmonics/w3.py b/src/ekore/harmonics/w3.py index dcd52428c..9b6d5c45b 100644 --- a/src/ekore/harmonics/w3.py +++ b/src/ekore/harmonics/w3.py @@ -9,7 +9,7 @@ @nb.njit(cache=True) def S3(N): - r"""Computes the harmonic sum :math:`S_3(N)`. + r"""Compute the harmonic sum :math:`S_3(N)`. .. math:: S_3(N) = \sum\limits_{j=1}^N \frac 1 {j^3} = \frac 1 2 \psi_2(N+1)+\zeta(3) @@ -78,7 +78,7 @@ def Sm3(N, hS3, is_singlet=None): def S21(N, S1, S2): r"""Analytic continuation of harmonic sum :math:`S_{2,1}(N)`. - As implemented in eq B.5.77 of :cite:`MuselliPhD` and eq 37 of + As implemented in :eqref:`B.5.77` of :cite:`MuselliPhD` and :eqref:`37` of :cite:`Bl_mlein_2000`. Parameters @@ -107,7 +107,7 @@ def S21(N, S1, S2): def Sm21(N, S1, Sm1, is_singlet=None): r"""Analytic continuation of harmonic sum :math:`S_{-2,1}(N)`. - As implemented in eq B.5.75 of :cite:`MuselliPhD` and eq 22 of + As implemented in :eqref:`B.5.75` of :cite:`MuselliPhD` and :eq:`22` of :cite:`Bl_mlein_2000`. Parameters @@ -146,7 +146,7 @@ def Sm21(N, S1, Sm1, is_singlet=None): def S2m1(N, S2, Sm1, Sm2, is_singlet=None): r"""Analytic continuation of harmonic sum :math:`S_{2,-1}(N)`. - As implemented in eq B.5.76 of :cite:`MuselliPhD` and eq 23 of + As implemented in :eqref:`B.5.76` of :cite:`MuselliPhD` and :eqref:`23` of :cite:`Bl_mlein_2000`. Parameters @@ -187,7 +187,7 @@ def S2m1(N, S2, Sm1, Sm2, is_singlet=None): def Sm2m1(N, S1, S2, Sm2): r"""Analytic continuation of harmonic sum :math:`S_{-2,-1}(N)`. - As implemented in eq B.5.74 of :cite:`MuselliPhD` and eq 38 of + As implemented in :eqref:`B.5.74` of :cite:`MuselliPhD` and :eqref:`38` of :cite:`Bl_mlein_2000`. Parameters diff --git a/src/ekore/harmonics/w4.py b/src/ekore/harmonics/w4.py index 855602ec7..53a8ad353 100644 --- a/src/ekore/harmonics/w4.py +++ b/src/ekore/harmonics/w4.py @@ -9,7 +9,7 @@ @nb.njit(cache=True) def S4(N): - r"""Computes the harmonic sum :math:`S_4(N)`. + r"""Compute the harmonic sum :math:`S_4(N)`. .. math:: S_4(N) = \sum\limits_{j=1}^N \frac 1 {j^4} = - \frac 1 6 \psi_3(N+1)+\zeta(4) @@ -78,7 +78,7 @@ def Sm4(N, hS4, is_singlet=None): def Sm31(N, S1, Sm1, Sm2, is_singlet=None): r"""Analytic continuation of harmonic sum :math:`S_{-3,1}(N)`. - As implemented in eq B.5.93 of :cite:`MuselliPhD` and eq 25 of + As implemented in :eq:`B.5.93` of :cite:`MuselliPhD` and :eq:`25` of cite:`Bl_mlein_2000`. Parameters @@ -122,7 +122,7 @@ def Sm31(N, S1, Sm1, Sm2, is_singlet=None): def Sm22(N, S1, S2, Sm2, Sm31, is_singlet=None): r"""Analytic continuation of harmonic sum :math:`S_{-2,2}(N)`. - As implemented in eq B.5.94 of :cite:`MuselliPhD` and eq 24 of + As implemented in :eqref:`B.5.94` of :cite:`MuselliPhD` and :eqref:`24` of cite:`Bl_mlein_2000`. Parameters @@ -161,7 +161,7 @@ def Sm22(N, S1, S2, Sm2, Sm31, is_singlet=None): def Sm211(N, S1, S2, Sm1, is_singlet=None): r"""Analytic continuation of harmonic sum :math:`S_{-2,1,1}(N)`. - As implemented in eq B.5.104 of :cite:`MuselliPhD` and eq 27 of + As implemented in :eqref:`B.5.104` of :cite:`MuselliPhD` and :eqref:`27` of cite:`Bl_mlein_2000`. Parameters @@ -204,7 +204,7 @@ def Sm211(N, S1, S2, Sm1, is_singlet=None): def S211(N, S1, S2, S3): r"""Analytic continuation of harmonic sum :math:`S_{2,1,1}(N)`. - As implemented in eq B.5.115 of :cite:`MuselliPhD` and eq 40 of + As implemented in :eqref:`B.5.115` of :cite:`MuselliPhD` and :eqref:`40` of cite:`Bl_mlein_2000`. Parameters @@ -235,7 +235,7 @@ def S211(N, S1, S2, S3): def S31(N, S1, S2, S3, S4): r"""Analytic continuation of harmonic sum :math:`S_{3,1}(N)`. - As implemented in eq B.5.99 of :cite:`MuselliPhD` and eq 41 of + As implemented in :eqref:`B.5.99` of :cite:`MuselliPhD` and :eqref:`41` of cite:`Bl_mlein_2000`. Parameters From 981509621ae1cc9368838b801ec8aebbcb428ab9 Mon Sep 17 00:00:00 2001 From: Felix Hekhorn Date: Wed, 5 Apr 2023 16:37:04 +0200 Subject: [PATCH 5/7] Fix pydocstyle in ekore.ad --- src/ekore/anomalous_dimensions/__init__.py | 59 +++++++++---------- .../polarized/__init__.py | 1 + .../unpolarized/__init__.py | 1 + .../unpolarized/space_like/as4/__init__.py | 12 +--- .../unpolarized/space_like/as4/ggg.py | 23 +++----- .../unpolarized/space_like/as4/ggq.py | 23 +++----- .../unpolarized/space_like/as4/gnsm.py | 39 ++++++------ .../unpolarized/space_like/as4/gnsp.py | 27 +++------ .../unpolarized/space_like/as4/gnsv.py | 28 ++++----- .../unpolarized/space_like/as4/gps.py | 20 +++---- .../unpolarized/space_like/as4/gqg.py | 20 +++---- 11 files changed, 100 insertions(+), 153 deletions(-) diff --git a/src/ekore/anomalous_dimensions/__init__.py b/src/ekore/anomalous_dimensions/__init__.py index 254070755..9ad2d576a 100644 --- a/src/ekore/anomalous_dimensions/__init__.py +++ b/src/ekore/anomalous_dimensions/__init__.py @@ -1,5 +1,4 @@ -r""" -This module contains the Altarelli-Parisi splitting kernels. +r"""The Altarelli-Parisi splitting kernels. Normalization is given by @@ -22,30 +21,30 @@ @nb.njit(cache=True) def exp_matrix_2D(gamma_S): - r""" - Compute the exponential and the eigensystem of the singlet anomalous dimension matrix. + r"""Compute the exponential and the eigensystem of the singlet anomalous dimension matrix. Parameters ---------- - gamma_S : numpy.ndarray - singlet anomalous dimension matrix + gamma_S : numpy.ndarray + singlet anomalous dimension matrix Returns ------- - exp : numpy.ndarray - exponential of the singlet anomalous dimension matrix :math:`\gamma_{S}(N)` - lambda_p : complex - positive eigenvalue of the singlet anomalous dimension matrix - :math:`\gamma_{S}(N)` - lambda_m : complex - negative eigenvalue of the singlet anomalous dimension matrix - :math:`\gamma_{S}(N)` - e_p : numpy.ndarray - projector for the positive eigenvalue of the singlet anomalous - dimension matrix :math:`\gamma_{S}(N)` - e_m : numpy.ndarray - projector for the negative eigenvalue of the singlet anomalous - dimension matrix :math:`\gamma_{S}(N)` + exp : numpy.ndarray + exponential of the singlet anomalous dimension matrix :math:`\gamma_{S}(N)` + lambda_p : complex + positive eigenvalue of the singlet anomalous dimension matrix + :math:`\gamma_{S}(N)` + lambda_m : complex + negative eigenvalue of the singlet anomalous dimension matrix + :math:`\gamma_{S}(N)` + e_p : numpy.ndarray + projector for the positive eigenvalue of the singlet anomalous + dimension matrix :math:`\gamma_{S}(N)` + e_m : numpy.ndarray + projector for the negative eigenvalue of the singlet anomalous + dimension matrix :math:`\gamma_{S}(N)` + """ # compute eigenvalues det = np.sqrt( @@ -64,22 +63,22 @@ def exp_matrix_2D(gamma_S): @nb.njit(cache=True) def exp_matrix(gamma): - r""" - Compute the exponential and the eigensystem of a matrix. + r"""Compute the exponential and the eigensystem of a matrix. Parameters ---------- - gamma : numpy.ndarray - input matrix + gamma : numpy.ndarray + input matrix Returns ------- - exp : numpy.ndarray - exponential of the matrix gamma :math:`\gamma(N)` - w : numpy.ndarray - array of the eigenvalues of the matrix lambda - e : numpy.ndarray - projectors on the eigenspaces of the matrix gamma :math:`\gamma(N)` + exp : numpy.ndarray + exponential of the matrix gamma :math:`\gamma(N)` + w : numpy.ndarray + array of the eigenvalues of the matrix lambda + e : numpy.ndarray + projectors on the eigenspaces of the matrix gamma :math:`\gamma(N)` + """ dim = gamma.shape[0] e = np.zeros((dim, dim, dim), np.complex_) diff --git a/src/ekore/anomalous_dimensions/polarized/__init__.py b/src/ekore/anomalous_dimensions/polarized/__init__.py index e69de29bb..4681a2903 100644 --- a/src/ekore/anomalous_dimensions/polarized/__init__.py +++ b/src/ekore/anomalous_dimensions/polarized/__init__.py @@ -0,0 +1 @@ +"""The polarized anomalous dimensions.""" diff --git a/src/ekore/anomalous_dimensions/unpolarized/__init__.py b/src/ekore/anomalous_dimensions/unpolarized/__init__.py index e69de29bb..282b2663d 100644 --- a/src/ekore/anomalous_dimensions/unpolarized/__init__.py +++ b/src/ekore/anomalous_dimensions/unpolarized/__init__.py @@ -0,0 +1 @@ +"""The unpolarized anomalous dimensions.""" diff --git a/src/ekore/anomalous_dimensions/unpolarized/space_like/as4/__init__.py b/src/ekore/anomalous_dimensions/unpolarized/space_like/as4/__init__.py index e6860191e..e35cbdeb1 100644 --- a/src/ekore/anomalous_dimensions/unpolarized/space_like/as4/__init__.py +++ b/src/ekore/anomalous_dimensions/unpolarized/space_like/as4/__init__.py @@ -1,4 +1,4 @@ -"""This subpackage contains the |N3LO| Altarelli-Parisi splitting kernels. +"""Contains the |N3LO| Altarelli-Parisi splitting kernels. For further documentation see :doc:`N3LO anomalous dimensions <../../../theory/N3LO_ad>` @@ -17,7 +17,7 @@ @nb.njit(cache=True) def gamma_singlet(N, nf, sx): - r"""Computes the |N3LO| singlet anomalous dimension matrix + r"""Compute the |N3LO| singlet anomalous dimension matrix. .. math:: \gamma_S^{(3)} = \left(\begin{array}{cc} @@ -40,14 +40,6 @@ def gamma_singlet(N, nf, sx): |N3LO| singlet anomalous dimension matrix :math:`\gamma_{S}^{(3)}(N)` - See Also - -------- - gamma_nsp : :math:`\gamma_{ns,+}^{(3)}` - gamma_ps : :math:`\gamma_{ps}^{(3)}` - gamma_qg : :math:`\gamma_{qg}^{(3)}` - gamma_gq : :math:`\gamma_{gq}^{(3)}` - gamma_gg : :math:`\gamma_{gg}^{(3)}` - """ gamma_qq = gamma_nsp(N, nf, sx) + gamma_ps(N, nf, sx) gamma_S_0 = np.array( diff --git a/src/ekore/anomalous_dimensions/unpolarized/space_like/as4/ggg.py b/src/ekore/anomalous_dimensions/unpolarized/space_like/as4/ggg.py index c627b474f..e15ee4dcd 100644 --- a/src/ekore/anomalous_dimensions/unpolarized/space_like/as4/ggg.py +++ b/src/ekore/anomalous_dimensions/unpolarized/space_like/as4/ggg.py @@ -1,5 +1,4 @@ -r"""This module contains the anomalous dimension :math:`\gamma_{gg}^{(3)}` -""" +r"""The unpolarized, space-like anomalous dimension :math:`\gamma_{gg}^{(3)}`.""" import numba as nb import numpy as np @@ -8,8 +7,9 @@ @nb.njit(cache=True) def gamma_gg_nf3(n, sx): - r"""Implements the part proportional to :math:`nf^3` of :math:`\gamma_{gg}^{(3)}`, - the expression is copied exact from Eq. 3.14 of :cite:`Davies:2016jie`. + r"""Return the part proportional to :math:`nf^3` of :math:`\gamma_{gg}^{(3)}`. + + The expression is copied exact from :eqref:`3.14` of :cite:`Davies:2016jie`. Parameters ---------- @@ -138,7 +138,7 @@ def gamma_gg_nf3(n, sx): @nb.njit(cache=True) def gamma_gg_nf1(n, sx): - r"""Implements the part proportional to :math:`nf^1` of :math:`\gamma_{gg}^{(3)}`. + r"""Return the part proportional to :math:`nf^1` of :math:`\gamma_{gg}^{(3)}`. Parameters ---------- @@ -169,7 +169,7 @@ def gamma_gg_nf1(n, sx): @nb.njit(cache=True) def gamma_gg_nf2(n, sx): - r"""Implements the part proportional to :math:`nf^2` of :math:`\gamma_{gg}^{(3)}`. + r"""Return the part proportional to :math:`nf^2` of :math:`\gamma_{gg}^{(3)}`. Parameters ---------- @@ -199,7 +199,7 @@ def gamma_gg_nf2(n, sx): @nb.njit(cache=True) def gamma_gg_nf0(n, sx): - r"""Implements the part proportional to :math:`nf^0` of :math:`\gamma_{gg}^{(3)}`. + r"""Return the part proportional to :math:`nf^0` of :math:`\gamma_{gg}^{(3)}`. Parameters ---------- @@ -231,7 +231,7 @@ def gamma_gg_nf0(n, sx): @nb.njit(cache=True) def gamma_gg(n, nf, sx): - r"""Computes the |N3LO| gluon-gluon singlet anomalous dimension. + r"""Compute the |N3LO| gluon-gluon singlet anomalous dimension. Parameters ---------- @@ -248,13 +248,6 @@ def gamma_gg(n, nf, sx): |N3LO| gluon-gluon singlet anomalous dimension :math:`\gamma_{gg}^{(3)}(N)` - See Also - -------- - gamma_gg_nf0: :math:`\gamma_{gg}^{(3)}|_{nf^0}` - gamma_gg_nf1: :math:`\gamma_{gg}^{(3)}|_{nf^1}` - gamma_gg_nf2: :math:`\gamma_{gg}^{(3)}|_{nf^2}` - gamma_gg_nf3: :math:`\gamma_{gg}^{(3)}|_{nf^3}` - """ return ( gamma_gg_nf0(n, sx) diff --git a/src/ekore/anomalous_dimensions/unpolarized/space_like/as4/ggq.py b/src/ekore/anomalous_dimensions/unpolarized/space_like/as4/ggq.py index 4752328dc..549f0c35f 100644 --- a/src/ekore/anomalous_dimensions/unpolarized/space_like/as4/ggq.py +++ b/src/ekore/anomalous_dimensions/unpolarized/space_like/as4/ggq.py @@ -1,5 +1,4 @@ -r"""This module contains the anomalous dimension :math:`\gamma_{gq}^{(3)}` -""" +r"""The unpolarized, space-like anomalous dimension :math:`\gamma_{gq}^{(3)}`.""" import numba as nb import numpy as np @@ -8,8 +7,9 @@ @nb.njit(cache=True) def gamma_gq_nf3(n, sx): - r"""Implements the part proportional to :math:`nf^3` of :math:`\gamma_{gq}^{(3)}`, - the expression is copied exact from Eq. 3.13 of :cite:`Davies:2016jie`. + r"""Return the part proportional to :math:`nf^3` of :math:`\gamma_{gq}^{(3)}`. + + The expression is copied exact from :eqref:`3.13` of :cite:`Davies:2016jie`. Parameters ---------- @@ -53,7 +53,7 @@ def gamma_gq_nf3(n, sx): @nb.njit(cache=True) def gamma_gq_nf0(n, sx): - r"""Implements the part proportional to :math:`nf^0` of :math:`\gamma_{gq}^{(3)}`. + r"""Return the part proportional to :math:`nf^0` of :math:`\gamma_{gq}^{(3)}`. Parameters ---------- @@ -89,7 +89,7 @@ def gamma_gq_nf0(n, sx): @nb.njit(cache=True) def gamma_gq_nf1(n, sx): - r"""Implements the part proportional to :math:`nf^1` of :math:`\gamma_{gq}^{(3)}`. + r"""Return the part proportional to :math:`nf^1` of :math:`\gamma_{gq}^{(3)}`. Parameters ---------- @@ -124,7 +124,7 @@ def gamma_gq_nf1(n, sx): @nb.njit(cache=True) def gamma_gq_nf2(n, sx): - r"""Implements the part proportional to :math:`nf^2` of :math:`\gamma_{gq}^{(3)}`. + r"""Return the part proportional to :math:`nf^2` of :math:`\gamma_{gq}^{(3)}`. Parameters ---------- @@ -155,7 +155,7 @@ def gamma_gq_nf2(n, sx): @nb.njit(cache=True) def gamma_gq(n, nf, sx): - r"""Computes the |N3LO| gluon-quark singlet anomalous dimension. + r"""Compute the |N3LO| gluon-quark singlet anomalous dimension. Parameters ---------- @@ -172,13 +172,6 @@ def gamma_gq(n, nf, sx): |N3LO| gluon-quark singlet anomalous dimension :math:`\gamma_{gq}^{(3)}(N)` - See Also - -------- - gamma_gq_nf0: :math:`\gamma_{gq}^{(3)}|_{nf^0}` - gamma_gq_nf1: :math:`\gamma_{gq}^{(3)}|_{nf^1}` - gamma_gq_nf2: :math:`\gamma_{gq}^{(3)}|_{nf^2}` - gamma_gq_nf3: :math:`\gamma_{gq}^{(3)}|_{nf^3}` - """ return ( gamma_gq_nf0(n, sx) diff --git a/src/ekore/anomalous_dimensions/unpolarized/space_like/as4/gnsm.py b/src/ekore/anomalous_dimensions/unpolarized/space_like/as4/gnsm.py index 1d500d0f6..a6b73936a 100644 --- a/src/ekore/anomalous_dimensions/unpolarized/space_like/as4/gnsm.py +++ b/src/ekore/anomalous_dimensions/unpolarized/space_like/as4/gnsm.py @@ -1,4 +1,4 @@ -r"""This module contains the anomalous dimension :math:`\gamma_{ns,-}^{(3)}`.""" +r"""The unpolarized, space-like anomalous dimension :math:`\gamma_{ns,-}^{(3)}`.""" import numba as nb from eko.constants import CF @@ -9,9 +9,10 @@ @nb.njit(cache=True) def gamma_ns_nf3(n, sx): - """Implements the common part proportional to :math:`nf^3`, - of :math:`\\gamma_{ns,+}^{(3)},\\gamma_{ns,-}^{(3)},\\gamma_{ns,v}^{(3)}`. - The expression is copied exact from Eq. 3.6. of :cite:`Davies:2016jie`. + r"""Return the common part proportional to :math:`nf^3`. + + Holds for :math:`\gamma_{ns,+}^{(3)},\gamma_{ns,-}^{(3)},\gamma_{ns,v}^{(3)}`. + The expression is copied exact from :eqref:`3.6` of :cite:`Davies:2016jie`. Parameters ---------- @@ -23,7 +24,7 @@ def gamma_ns_nf3(n, sx): Returns ------- g_ns_nf3 : complex - |N3LO| non-singlet anomalous dimension :math:`\\gamma_{ns}^{(3)}|_{nf^3}` + |N3LO| non-singlet anomalous dimension :math:`\gamma_{ns}^{(3)}|_{nf^3}` """ S1 = sx[0][0] @@ -52,7 +53,7 @@ def gamma_ns_nf3(n, sx): @nb.njit(cache=True) def gamma_nsm_nf2(n, sx): - """Implements the parametrized valence-like non-singlet part proportional to :math:`nf^2`. + r"""Return the parametrized valence-like non-singlet part proportional to :math:`nf^2`. Parameters ---------- @@ -65,7 +66,7 @@ def gamma_nsm_nf2(n, sx): ------- g_ns_nf2 : complex |N3LO| valence-like non-singlet anomalous dimension - :math:`\\gamma_{ns,-}^{(3)}|_{nf^2}` + :math:`\gamma_{ns,-}^{(3)}|_{nf^2}` """ S1 = sx[0][0] @@ -93,7 +94,7 @@ def gamma_nsm_nf2(n, sx): @nb.njit(cache=True) def gamma_nsm_nf1(n, sx): - """Implements the parametrized valence-like non-singlet part proportional to :math:`nf^1`. + r"""Return the parametrized valence-like non-singlet part proportional to :math:`nf^1`. Parameters ---------- @@ -106,7 +107,7 @@ def gamma_nsm_nf1(n, sx): ------- g_ns_nf1 : complex |N3LO| valence-like non-singlet anomalous dimension - :math:`\\gamma_{ns,-}^{(3)}|_{nf^1}` + :math:`\gamma_{ns,-}^{(3)}|_{nf^1}` """ S1 = sx[0][0] @@ -135,7 +136,7 @@ def gamma_nsm_nf1(n, sx): @nb.njit(cache=True) def gamma_nsm_nf0(n, sx): - """Implements the parametrized valence-like non-singlet part proportional to :math:`nf^0`. + r"""Return the parametrized valence-like non-singlet part proportional to :math:`nf^0`. Parameters ---------- @@ -146,9 +147,10 @@ def gamma_nsm_nf0(n, sx): Returns ------- - g_ns_nf0 : complex - |N3LO| valence-like non-singlet anomalous dimension - :math:`\\gamma_{ns,-}^{(3)}|_{nf^0}` + g_ns_nf0 : complex + |N3LO| valence-like non-singlet anomalous dimension + :math:`\gamma_{ns,-}^{(3)}|_{nf^0}` + """ S1 = sx[0][0] Lm11m1 = lm11m1(n, S1) @@ -177,7 +179,7 @@ def gamma_nsm_nf0(n, sx): @nb.njit(cache=True) def gamma_nsm(n, nf, sx): - """Computes the |N3LO| valence-like non-singlet anomalous dimension. + r"""Compute the |N3LO| valence-like non-singlet anomalous dimension. Parameters ---------- @@ -192,14 +194,7 @@ def gamma_nsm(n, nf, sx): ------- gamma_nsp : complex |N3LO| valence-like non-singlet anomalous dimension - :math:`\\gamma_{ns,-}^{(3)}(N)` - - See Also - -------- - gamma_nsm_nf0: :math:`\\gamma_{ns,-}^{(3)}|_{nf^0}` - gamma_nsm_nf1: :math:`\\gamma_{ns,-}^{(3)}|_{nf^1}` - gamma_nsm_nf2: :math:`\\gamma_{ns,-}^{(3)}|_{nf^2}` - gamma_ns_nf3: :math:`\\gamma_{ns}^{(3)}|_{nf^3}` + :math:`\gamma_{ns,-}^{(3)}(N)` """ return ( diff --git a/src/ekore/anomalous_dimensions/unpolarized/space_like/as4/gnsp.py b/src/ekore/anomalous_dimensions/unpolarized/space_like/as4/gnsp.py index 9f5be5c4d..e08986a09 100644 --- a/src/ekore/anomalous_dimensions/unpolarized/space_like/as4/gnsp.py +++ b/src/ekore/anomalous_dimensions/unpolarized/space_like/as4/gnsp.py @@ -1,6 +1,4 @@ -"""This module contains the anomalous dimension :math:`\\gamma_{ns,+}^{(3)}` - -""" +r"""The unpolarized, space-like anomalous dimension :math:`\gamma_{ns,+}^{(3)}`.""" import numba as nb from .....harmonics.log_functions import lm11m1, lm12m1, lm13m1 @@ -9,7 +7,7 @@ @nb.njit(cache=True) def gamma_nsp_nf2(n, sx): - """Implements the parametrized singlet-like non-singlet part proportional to :math:`nf^2`. + r"""Return the parametrized singlet-like non-singlet part proportional to :math:`nf^2`. Parameters ---------- @@ -21,7 +19,7 @@ def gamma_nsp_nf2(n, sx): Returns ------- g_nsp_nf2 : complex - |N3LO| singlet-like non-singlet anomalous dimension :math:`\\gamma_{ns,+}^{(3)}|_{nf^2}` + |N3LO| singlet-like non-singlet anomalous dimension :math:`\gamma_{ns,+}^{(3)}|_{nf^2}` """ S1 = sx[0][0] @@ -49,7 +47,7 @@ def gamma_nsp_nf2(n, sx): @nb.njit(cache=True) def gamma_nsp_nf1(n, sx): - """Implements the parametrized singlet-like non-singlet part proportional to :math:`nf^1`. + r"""Return the parametrized singlet-like non-singlet part proportional to :math:`nf^1`. Parameters ---------- @@ -61,7 +59,7 @@ def gamma_nsp_nf1(n, sx): Returns ------- g_nsp_nf1 : complex - |N3LO| singlet-like non-singlet anomalous dimension :math:`\\gamma_{ns,+}^{(3)}|_{nf^1}` + |N3LO| singlet-like non-singlet anomalous dimension :math:`\gamma_{ns,+}^{(3)}|_{nf^1}` """ S1 = sx[0][0] @@ -90,7 +88,7 @@ def gamma_nsp_nf1(n, sx): @nb.njit(cache=True) def gamma_nsp_nf0(n, sx): - """Implements the parametrized singlet-like non-singlet part proportional to :math:`nf^0`. + r"""Return the parametrized singlet-like non-singlet part proportional to :math:`nf^0`. Parameters ---------- @@ -102,7 +100,7 @@ def gamma_nsp_nf0(n, sx): Returns ------- g_nsp_nf0 : complex - |N3LO| singlet-like non-singlet anomalous dimension :math:`\\gamma_{ns,+}^{(3)}|_{nf^0}` + |N3LO| singlet-like non-singlet anomalous dimension :math:`\gamma_{ns,+}^{(3)}|_{nf^0}` """ S1 = sx[0][0] @@ -132,7 +130,7 @@ def gamma_nsp_nf0(n, sx): @nb.njit(cache=True) def gamma_nsp(n, nf, sx): - """Computes the |N3LO| singlet-like non-singlet anomalous dimension. + r"""Compute the |N3LO| singlet-like non-singlet anomalous dimension. Parameters ---------- @@ -147,14 +145,7 @@ def gamma_nsp(n, nf, sx): ------- gamma_nsp : complex |N3LO| singlet-like non-singlet anomalous dimension - :math:`\\gamma_{ns,+}^{(3)}(N)` - - See Also - -------- - gamma_nsp_nf0: :math:`\\gamma_{ns,+}^{(3)}|_{nf^0}` - gamma_nsp_nf1: :math:`\\gamma_{ns,+}^{(3)}|_{nf^1}` - gamma_nsp_nf2: :math:`\\gamma_{ns,+}^{(3)}|_{nf^2}` - gamma_ns_nf3: :math:`\\gamma_{ns}^{(3)}|_{nf^3}` + :math:`\gamma_{ns,+}^{(3)}(N)` """ return ( diff --git a/src/ekore/anomalous_dimensions/unpolarized/space_like/as4/gnsv.py b/src/ekore/anomalous_dimensions/unpolarized/space_like/as4/gnsv.py index 5d831590f..8ee1aabd7 100644 --- a/src/ekore/anomalous_dimensions/unpolarized/space_like/as4/gnsv.py +++ b/src/ekore/anomalous_dimensions/unpolarized/space_like/as4/gnsv.py @@ -1,6 +1,4 @@ -"""This module contains the anomalous dimension :math:`\\gamma_{ns,v}^{(3)}` - -""" +r"""The unpolarized, space-like anomalous dimension :math:`\gamma_{ns,v}^{(3)}`.""" import numba as nb from .gnsm import gamma_nsm @@ -8,8 +6,9 @@ @nb.njit(cache=True) def gamma_nss_nf2(n, sx): - """Implements the sea non-singlet part proportional to :math:`nf^2` - as in Eq. 3.5 of :cite:`Davies:2016jie`. + r"""Return the sea non-singlet part proportional to :math:`nf^2`. + + Implements :eqref:`3.5` of :cite:`Davies:2016jie`. Parameters ---------- @@ -21,7 +20,7 @@ def gamma_nss_nf2(n, sx): Returns ------- g_nss_nf2 : complex - |N3LO| sea non-singlet anomalous dimension :math:`\\gamma_{ns,s}^{(3)}|_{nf^2}` + |N3LO| sea non-singlet anomalous dimension :math:`\gamma_{ns,s}^{(3)}|_{nf^2}` """ S1, _ = sx[0] @@ -164,9 +163,10 @@ def gamma_nss_nf2(n, sx): @nb.njit(cache=True) def gamma_nss_nf1(n, sx): - """Implements the sea non-singlet part proportional to :math:`nf^1`. + r"""Return the sea non-singlet part proportional to :math:`nf^1`. + The expression is the average of the Mellin transform - of Eq. 4.19, 4.20 of :cite:`Moch:2017uml` + of :eqref:`4.19` and :eqref:`4.20` of :cite:`Moch:2017uml`. Parameters ---------- @@ -178,7 +178,7 @@ def gamma_nss_nf1(n, sx): Returns ------- g_nss_nf1 : complex - |N3LO| sea non-singlet anomalous dimension :math:`\\gamma_{ns,s}^{(3)}|_{nf^1}` + |N3LO| sea non-singlet anomalous dimension :math:`\gamma_{ns,s}^{(3)}|_{nf^1}` """ S1 = sx[0][0] @@ -219,7 +219,7 @@ def gamma_nss_nf1(n, sx): @nb.njit(cache=True) def gamma_nsv(n, nf, sx): - """Computes the |N3LO| valence non-singlet anomalous dimension. + r"""Compute the |N3LO| valence non-singlet anomalous dimension. Parameters ---------- @@ -234,13 +234,7 @@ def gamma_nsv(n, nf, sx): ------- gamma_nsv : complex |N3LO| valence non-singlet anomalous dimension - :math:`\\gamma_{ns,v}^{(3)}(N)` - - See Also - -------- - gamma_nsm: :math:`\\gamma_{ns,-}^{(3)}` - gamma_nss_nf1: :math:`\\gamma_{ns,s}^{(3)}|_{nf^1}` - gamma_nss_nf2: :math:`\\gamma_{ns,s}^{(3)}|_{nf^2}` + :math:`\gamma_{ns,v}^{(3)}(N)` """ return ( diff --git a/src/ekore/anomalous_dimensions/unpolarized/space_like/as4/gps.py b/src/ekore/anomalous_dimensions/unpolarized/space_like/as4/gps.py index a563a693c..6b2c1c809 100644 --- a/src/ekore/anomalous_dimensions/unpolarized/space_like/as4/gps.py +++ b/src/ekore/anomalous_dimensions/unpolarized/space_like/as4/gps.py @@ -1,13 +1,13 @@ -r"""This module contains the anomalous dimension :math:`\gamma_{ps}^{(3)}` -""" +r"""The unpolarized, space-like anomalous dimension :math:`\gamma_{ps}^{(3)}`.""" import numba as nb import numpy as np @nb.njit(cache=True) def gamma_ps_nf3(n, sx): - r"""Implements the part proportional to :math:`nf^3` of :math:`\gamma_{ps}^{(3)}`, - the expression is copied exact from Eq. 3.10 of :cite:`Davies:2016jie`. + r"""Return the part proportional to :math:`nf^3` of :math:`\gamma_{ps}^{(3)}`. + + The expression is copied exact from :eqref:`3.10` of :cite:`Davies:2016jie`. Parameters ---------- @@ -78,7 +78,7 @@ def gamma_ps_nf3(n, sx): @nb.njit(cache=True) def gamma_ps_nf1(n, sx): - r"""Implements the part proportional to :math:`nf^1` of :math:`\gamma_{ps}^{(3)}`. + r"""Return the part proportional to :math:`nf^1` of :math:`\gamma_{ps}^{(3)}`. Parameters ---------- @@ -108,7 +108,7 @@ def gamma_ps_nf1(n, sx): @nb.njit(cache=True) def gamma_ps_nf2(n, sx): - r"""Implements the part proportional to :math:`nf^2` of :math:`\gamma_{ps}^{(3)}`. + r"""Return the part proportional to :math:`nf^2` of :math:`\gamma_{ps}^{(3)}`. Parameters ---------- @@ -137,7 +137,7 @@ def gamma_ps_nf2(n, sx): @nb.njit(cache=True) def gamma_ps(n, nf, sx): - r"""Computes the |N3LO| pure singlet quark-quark anomalous dimension. + r"""Compute the |N3LO| pure singlet quark-quark anomalous dimension. Parameters ---------- @@ -154,12 +154,6 @@ def gamma_ps(n, nf, sx): |N3LO| pure singlet quark-quark anomalous dimension :math:`\gamma_{ps}^{(3)}(N)` - See Also - -------- - gamma_ps_nf1: :math:`\gamma_{ps}^{(3)}|_{nf^1}` - gamma_ps_nf2: :math:`\gamma_{ps}^{(3)}|_{nf^2}` - gamma_ps_nf3: :math:`\gamma_{ps}^{(3)}|_{nf^3}` - """ return ( +nf * gamma_ps_nf1(n, sx) diff --git a/src/ekore/anomalous_dimensions/unpolarized/space_like/as4/gqg.py b/src/ekore/anomalous_dimensions/unpolarized/space_like/as4/gqg.py index 7f146eebc..3df5bd0f2 100644 --- a/src/ekore/anomalous_dimensions/unpolarized/space_like/as4/gqg.py +++ b/src/ekore/anomalous_dimensions/unpolarized/space_like/as4/gqg.py @@ -1,5 +1,4 @@ -r"""This module contains the anomalous dimension :math:`\gamma_{qg}^{(3)}` -""" +r"""The unpolarized, space-like anomalous dimension :math:`\gamma_{qg}^{(3)}`.""" import numba as nb import numpy as np @@ -8,8 +7,9 @@ @nb.njit(cache=True) def gamma_qg_nf3(n, sx): - r"""Implements the part proportional to :math:`nf^3` of :math:`\gamma_{qg}^{(3)}`, - the expression is copied exact from Eq. 3.12 of :cite:`Davies:2016jie`. + r"""Return the part proportional to :math:`nf^3` of :math:`\gamma_{qg}^{(3)}`. + + The expression is copied exact from :eqref:`3.12` of :cite:`Davies:2016jie`. Parameters ---------- @@ -330,7 +330,7 @@ def gamma_qg_nf3(n, sx): @nb.njit(cache=True) def gamma_qg_nf1(n, sx): - r"""Implements the part proportional to :math:`nf^1` of :math:`\gamma_{qg}^{(3)}`. + r"""Return the part proportional to :math:`nf^1` of :math:`\gamma_{qg}^{(3)}`. Parameters ---------- @@ -366,7 +366,7 @@ def gamma_qg_nf1(n, sx): @nb.njit(cache=True) def gamma_qg_nf2(n, sx): - r"""Implements the part proportional to :math:`nf^2` of :math:`\gamma_{qg}^{(3)}`. + r"""Return the part proportional to :math:`nf^2` of :math:`\gamma_{qg}^{(3)}`. Parameters ---------- @@ -401,7 +401,7 @@ def gamma_qg_nf2(n, sx): @nb.njit(cache=True) def gamma_qg(n, nf, sx): - r"""Computes the |N3LO| quark-gluon singlet anomalous dimension. + r"""Compute the |N3LO| quark-gluon singlet anomalous dimension. Parameters ---------- @@ -418,12 +418,6 @@ def gamma_qg(n, nf, sx): |N3LO| quark-gluon singlet anomalous dimension :math:`\gamma_{qg}^{(3)}(N)` - See Also - -------- - gamma_qg_nf1: :math:`\gamma_{qg}^{(3)}|_{nf^1}` - gamma_qg_nf2: :math:`\gamma_{qg}^{(3)}|_{nf^2}` - gamma_qg_nf3: :math:`\gamma_{qg}^{(3)}|_{nf^3}` - """ return ( +nf * gamma_qg_nf1(n, sx) From 19c06a9ca010bdc71dae15ae6e1114605b50a410 Mon Sep 17 00:00:00 2001 From: Felix Hekhorn Date: Wed, 5 Apr 2023 17:00:22 +0200 Subject: [PATCH 6/7] Fix pydocstyle in ekore.ome --- src/ekore/__init__.py | 1 + .../operator_matrix_elements/__init__.py | 1 + .../polarized/__init__.py | 1 + .../polarized/space_like/__init__.py | 2 + .../unpolarized/__init__.py | 1 + .../unpolarized/space_like/__init__.py | 77 +++--- .../unpolarized/space_like/as1.py | 183 +++++++------- .../unpolarized/space_like/as2.py | 235 +++++++++--------- .../unpolarized/space_like/as3/__init__.py | 10 +- .../unpolarized/space_like/as3/aHg.py | 9 +- .../unpolarized/space_like/as3/aHgstfac.py | 8 +- .../unpolarized/space_like/as3/aHq.py | 8 +- .../unpolarized/space_like/as3/agg.py | 9 +- .../unpolarized/space_like/as3/aggTF2.py | 7 +- .../unpolarized/space_like/as3/agq.py | 6 +- .../unpolarized/space_like/as3/aqg.py | 4 +- .../unpolarized/space_like/as3/aqqNS.py | 4 +- .../unpolarized/space_like/as3/aqqPS.py | 4 +- .../unpolarized/time_like/__init__.py | 2 + 19 files changed, 277 insertions(+), 295 deletions(-) diff --git a/src/ekore/__init__.py b/src/ekore/__init__.py index e69de29bb..9874df66c 100644 --- a/src/ekore/__init__.py +++ b/src/ekore/__init__.py @@ -0,0 +1 @@ +"""Core elements and their math.""" diff --git a/src/ekore/operator_matrix_elements/__init__.py b/src/ekore/operator_matrix_elements/__init__.py index e69de29bb..ab2fab9fc 100644 --- a/src/ekore/operator_matrix_elements/__init__.py +++ b/src/ekore/operator_matrix_elements/__init__.py @@ -0,0 +1 @@ +"""The |OME|.""" diff --git a/src/ekore/operator_matrix_elements/polarized/__init__.py b/src/ekore/operator_matrix_elements/polarized/__init__.py index e69de29bb..2e6cd00a9 100644 --- a/src/ekore/operator_matrix_elements/polarized/__init__.py +++ b/src/ekore/operator_matrix_elements/polarized/__init__.py @@ -0,0 +1 @@ +"""The polarized |OME|.""" diff --git a/src/ekore/operator_matrix_elements/polarized/space_like/__init__.py b/src/ekore/operator_matrix_elements/polarized/space_like/__init__.py index 5d5f771f7..61dae3b77 100644 --- a/src/ekore/operator_matrix_elements/polarized/space_like/__init__.py +++ b/src/ekore/operator_matrix_elements/polarized/space_like/__init__.py @@ -5,9 +5,11 @@ @nb.njit(cache=True) def A_non_singlet(_matching_order, _n, _sx, _nf, _L): + """Compute the non-singlet |OME|.""" raise NotImplementedError("Polarised, space-like is not yet implemented") @nb.njit(cache=True) def A_singlet(_matching_order, _n, _sx, _nf, _L, _is_msbar, _sx_ns=None): + """Compute the singlet |OME|.""" raise NotImplementedError("Polarised, space-like is not yet implemented") diff --git a/src/ekore/operator_matrix_elements/unpolarized/__init__.py b/src/ekore/operator_matrix_elements/unpolarized/__init__.py index e69de29bb..0510aeef0 100644 --- a/src/ekore/operator_matrix_elements/unpolarized/__init__.py +++ b/src/ekore/operator_matrix_elements/unpolarized/__init__.py @@ -0,0 +1 @@ +"""The unpolarized |OME|.""" diff --git a/src/ekore/operator_matrix_elements/unpolarized/space_like/__init__.py b/src/ekore/operator_matrix_elements/unpolarized/space_like/__init__.py index a1d2f8ec6..95e8a6f4e 100644 --- a/src/ekore/operator_matrix_elements/unpolarized/space_like/__init__.py +++ b/src/ekore/operator_matrix_elements/unpolarized/space_like/__init__.py @@ -1,7 +1,4 @@ -""" -This module defines the |OME| for the non-trivial matching conditions in the -|VFNS| evolution. -""" +"""The unpolarized, space-like |OME|.""" import numba as nb import numpy as np @@ -11,37 +8,30 @@ @nb.njit(cache=True) def A_singlet(matching_order, n, sx, nf, L, is_msbar, sx_ns=None): - r""" - Computes the tower of the singlet |OME|. + r"""Compute the tower of the singlet |OME|. Parameters ---------- - matching_order : tuple(int,int) - perturbative matching_order - n : complex - Mellin variable - sx : list - singlet like harmonic sums cache - nf: int - number of active flavor below threshold - L : float - :math:``\ln(\mu_F^2 / m_h^2)`` - is_msbar: bool - add the |MSbar| contribution - sx_ns : list - non-singlet like harmonic sums cache + matching_order : tuple(int,int) + perturbative matching_order + n : complex + Mellin variable + sx : list + singlet like harmonic sums cache + nf: int + number of active flavor below threshold + L : float + :math:``\ln(\mu_F^2 / m_h^2)`` + is_msbar: bool + add the |MSbar| contribution + sx_ns : list + non-singlet like harmonic sums cache Returns ------- - A_singlet : numpy.ndarray - singlet |OME| + A_singlet : numpy.ndarray + singlet |OME| - See Also - -------- - ekore.matching_conditions.nlo.A_singlet_1 : :math:`A^{S,(1)}(N)` - ekore.matching_conditions.nlo.A_hh_1 : :math:`A_{HH}^{(1)}(N)` - ekore.matching_conditions.nlo.A_gh_1 : :math:`A_{gH}^{(1)}(N)` - ekore.matching_conditions.nnlo.A_singlet_2 : :math:`A_{S,(2)}(N)` """ A_s = np.zeros((matching_order[0], 3, 3), np.complex_) if matching_order[0] >= 1: @@ -55,31 +45,26 @@ def A_singlet(matching_order, n, sx, nf, L, is_msbar, sx_ns=None): @nb.njit(cache=True) def A_non_singlet(matching_order, n, sx, nf, L): - r""" - Computes the tower of the non-singlet |OME| + r"""Compute the tower of the non-singlet |OME|. Parameters ---------- - matching_order : tuple(int,int) - perturbative matching_order - n : complex - Mellin variable - sx : list - harmonic sums cache - nf: int - number of active flavor below threshold - L : float - :math:``\ln(\mu_F^2 / m_h^2)`` + matching_order : tuple(int,int) + perturbative matching_order + n : complex + Mellin variable + sx : list + harmonic sums cache + nf: int + number of active flavor below threshold + L : float + :math:``\ln(\mu_F^2 / m_h^2)`` Returns ------- - A_non_singlet : numpy.ndarray - non-singlet |OME| + A_non_singlet : numpy.ndarray + non-singlet |OME| - See Also - -------- - ekore.matching_conditions.nlo.A_hh_1 : :math:`A_{HH}^{(1)}(N)` - ekore.matching_conditions.nnlo.A_ns_2 : :math:`A_{qq,H}^{NS,(2)}` """ A_ns = np.zeros((matching_order[0], 2, 2), np.complex_) if matching_order[0] >= 1: diff --git a/src/ekore/operator_matrix_elements/unpolarized/space_like/as1.py b/src/ekore/operator_matrix_elements/unpolarized/space_like/as1.py index c373f8091..553952481 100644 --- a/src/ekore/operator_matrix_elements/unpolarized/space_like/as1.py +++ b/src/ekore/operator_matrix_elements/unpolarized/space_like/as1.py @@ -1,6 +1,5 @@ -r""" -This module contains the |NLO| |OME| (OMEs) -for the matching conditions in the |VFNS|. +r"""The unpolarized, spacelike |NLO| |OME|. + Heavy quark contribution for intrinsic evolution are taken from :cite:`Ball_2016` and Mellin transformed with Mathematica. The other matching conditions for the |VFNS| at :math:`\mu_F^2 \neq m_H^2` @@ -14,23 +13,25 @@ @nb.njit(cache=True) def A_hh(n, sx, L): - r""" - |NLO| heavy-heavy |OME| :math:`A_{HH}^{(1)}` defined as the - mellin transform of :math:`K_{hh}` given in Eq. (20a) of :cite:`Ball_2016`. + r"""|NLO| heavy-heavy |OME| :math:`A_{HH}^{(1)}`. + + They are defined as the Mellin transform of :math:`K_{hh}` + given in :eqref:`20a` of :cite:`Ball_2016`. Parameters ---------- - n : complex - Mellin moment - sx : list - harmonic sums cache - L : float - :math:`\ln(\mu_F^2 / m_h^2)` + n : complex + Mellin moment + sx : list + harmonic sums cache + L : float + :math:`\ln(\mu_F^2 / m_h^2)` Returns ------- - A_hh : complex - |NLO| heavy-heavy |OME| :math:`A_{HH}^{(1)}` + A_hh : complex + |NLO| heavy-heavy |OME| :math:`A_{HH}^{(1)}` + """ S1m = sx[0][0] - 1 / n # harmonics.S1(n - 1) S2m = sx[1][0] - 1 / n**2 # harmonics.S2(n - 1) @@ -48,23 +49,24 @@ def A_hh(n, sx, L): @nb.njit(cache=True) def A_gh(n, L): - r""" - |NLO| gluon-heavy |OME| :math:`A_{gH}^{(1)}` defined as the - mellin transform of :math:`K_{gh}` given in Eq. (20b) of :cite:`Ball_2016`. + r"""|NLO| gluon-heavy |OME| :math:`A_{gH}^{(1)}`. + + They are defined as the Mellin transform of :math:`K_{gh}` + given in :eqref:`20b` of :cite:`Ball_2016`. Parameters ---------- - n : complex - Mellin moment - L : float - :math:`\ln(\mu_F^2 / m_h^2)` + n : complex + Mellin moment + L : float + :math:`\ln(\mu_F^2 / m_h^2)` Returns ------- - A_hg : complex - |NLO| gluon-heavy |OME| :math:`A_{gH}^{(1)}` - """ + A_hg : complex + |NLO| gluon-heavy |OME| :math:`A_{gH}^{(1)}` + """ agh_l1 = (2 + n + n**2) / (n * (n**2 - 1)) agh_l0 = (-4 + 2 * n + n**2 * (15 + n * (3 + n - n**2))) / ( n * (n**2 - 1) @@ -74,21 +76,22 @@ def A_gh(n, L): @nb.njit(cache=True) def A_hg(n, L): - r""" - |NLO| heavy-gluon |OME| :math:`A_{Hg}^{S,(1)}` defined as the - mellin transform of Eq. (B.2) from :cite:`Buza_1998`. + r"""|NLO| heavy-gluon |OME| :math:`A_{Hg}^{S,(1)}`. + + They are defined as the Mellin transform of:eqref:`B.2` from :cite:`Buza_1998`. Parameters ---------- - n : complex - Mellin moment - L : float - :math:`\ln(\mu_F^2 / m_h^2)` + n : complex + Mellin moment + L : float + :math:`\ln(\mu_F^2 / m_h^2)` Returns ------- - A_hg : complex - |NLO| heavy-gluon |OME| :math:`A_{Hg}^{S,(1)}` + A_hg : complex + |NLO| heavy-gluon |OME| :math:`A_{Hg}^{S,(1)}` + """ den = 1.0 / (n * (n + 1) * (2 + n)) num = 2 * (2 + n + n**2) @@ -97,55 +100,49 @@ def A_hg(n, L): @nb.njit(cache=True) def A_gg(L): - r""" - |NLO| gluon-gluon |OME| :math:`A_{gg,H}^{S,(1)}` defined as the - mellin transform of Eq. (B.6) from :cite:`Buza_1998`. + r"""|NLO| gluon-gluon |OME| :math:`A_{gg,H}^{S,(1)}`. + + They are defined as the Mellin transform of :eqref:`B.6` from :cite:`Buza_1998`. Parameters ---------- - L : float - :math:`\ln(\mu_F^2 / m_h^2)` + L : float + :math:`\ln(\mu_F^2 / m_h^2)` Returns ------- - A_gg : complex - |NLO| gluon-gluon |OME| :math:`A_{gg,H}^{S,(1)}` + A_gg : complex + |NLO| gluon-gluon |OME| :math:`A_{gg,H}^{S,(1)}` + """ return -2.0 / 3.0 * L @nb.njit(cache=True) def A_singlet(n, sx, L): - r""" - Computes the |NLO| singlet |OME|. - - .. math:: - A^{S,(1)} = \left(\begin{array}{cc} - A_{gg,H}^{S,(1)} & 0 & A_{gH}^{(1)} \\ - 0 & 0 & 0 \\ - A_{hg}^{S,(1)} & 0 & A_{HH}^{(1)} - \end{array}\right) - - Parameters - ---------- - n : complex - Mellin moment - sx : list - harmonic sums cache containing: [[:math:`S_1`][:math:`S_2`]] - L : float - :math:`\ln(\mu_F^2 / m_h^2)` - - Returns - ------- - A_S : numpy.ndarray - |NLO| singlet |OME| :math:`A^{S,(1)}` - - See Also - -------- - A_hg : :math:`A_{hg}^{S,(1)}` - A_hh : :math:`A_{HH}^{(1)}` - A_gg : :math:`A_{gg,H}^{S,(1)}` - A_gh : :math:`A_{gH}^{(1)}` + r"""Compute the |NLO| singlet |OME|. + + .. math:: + A^{S,(1)} = \left(\begin{array}{cc} + A_{gg,H}^{S,(1)} & 0 & A_{gH}^{(1)} \\ + 0 & 0 & 0 \\ + A_{hg}^{S,(1)} & 0 & A_{HH}^{(1)} + \end{array}\right) + + Parameters + ---------- + n : complex + Mellin moment + sx : list + harmonic sums cache containing: [[:math:`S_1`][:math:`S_2`]] + L : float + :math:`\ln(\mu_F^2 / m_h^2)` + + Returns + ------- + A_S : numpy.ndarray + |NLO| singlet |OME| :math:`A^{S,(1)}` + """ A_S = np.array( [ @@ -160,30 +157,26 @@ def A_singlet(n, sx, L): @nb.njit(cache=True) def A_ns(n, sx, L): - r""" - Computes the |NLO| non-singlet |OME| with intrinsic contributions. - - .. math:: - A^{NS,(1)} = \left(\begin{array}{cc} - 0 & 0 \\ - 0 & A_{HH}^{(1)} - \end{array}\right) - - Parameters - ---------- - n : complex - Mellin moment - sx : list - harmonic sums cache containing: [[:math:`S_1`][:math:`S_2`]] - L : float - :math:`\ln(\mu_F^2 / m_h^2)` - Returns - ------- - A_NS : numpy.ndarray - |NLO| non-singlet |OME| :math:`A^{S,(1)}` - - See Also - -------- - A_hh : :math:`A_{HH}^{(1)}` + r"""Compute the |NLO| non-singlet |OME| with intrinsic contributions. + + .. math:: + A^{NS,(1)} = \left(\begin{array}{cc} + 0 & 0 \\ + 0 & A_{HH}^{(1)} + \end{array}\right) + + Parameters + ---------- + n : complex + Mellin moment + sx : list + harmonic sums cache containing: [[:math:`S_1`][:math:`S_2`]] + L : float + :math:`\ln(\mu_F^2 / m_h^2)` + Returns + ------- + A_NS : numpy.ndarray + |NLO| non-singlet |OME| :math:`A^{S,(1)}` + """ return np.array([[0 + 0j, 0 + 0j], [0 + 0j, A_hh(n, sx, L)]], np.complex_) diff --git a/src/ekore/operator_matrix_elements/unpolarized/space_like/as2.py b/src/ekore/operator_matrix_elements/unpolarized/space_like/as2.py index 2197fbfd9..f8a7cfebd 100644 --- a/src/ekore/operator_matrix_elements/unpolarized/space_like/as2.py +++ b/src/ekore/operator_matrix_elements/unpolarized/space_like/as2.py @@ -1,12 +1,12 @@ -r""" -This module contains the |NNLO| |OME| for the matching conditions in the |VFNS| -(see, :cite:`Buza_1998` appendix B). +r"""The unpolarized, spacelike |NNLO| |OME|. + +See, :cite:`Buza_1998` appendix B. The expession for :math:`\mu_F^2 = m_H^2` are taken from :cite:`Vogt:2004ns` directly in N space. While the parts proportional to :math:`\ln(\mu_F^2 / m_h^2)` comes |QCDNUM| (https://github.com/N3PDF/external/blob/master/qcdnum/qcdnum/pij/ome.f) and Mellin transformed with Mathematica. -The expession for A_Hg_l0 comes form :cite:`Bierenbaum:2009zt` +The expession for ``A_Hg_l0`` comes form :cite:`Bierenbaum:2009zt`. """ import numba as nb import numpy as np @@ -20,23 +20,24 @@ @nb.njit(cache=True) def A_qq_ns(n, sx, L): - r""" - |NNLO| light-light non-singlet |OME| :math:`A_{qq,H}^{NS,(2)}` given in - Eq. (B.4) of :cite:`Buza_1998`. + r"""|NNLO| light-light non-singlet |OME| :math:`A_{qq,H}^{NS,(2)}`. + + It is given in :eqref:`B.4` of :cite:`Buza_1998`. Parameters ---------- - n : complex - Mellin moment - sx : list - harmonic sums cache - L : float - :math:`\ln(\mu_F^2 / m_h^2)` + n : complex + Mellin moment + sx : list + harmonic sums cache + L : float + :math:`\ln(\mu_F^2 / m_h^2)` Returns ------- - A_qq_ns : complex - |NNLO| light-light non-singlet |OME| :math:`A_{qq,H}^{NS,(2)}` + A_qq_ns : complex + |NNLO| light-light non-singlet |OME| :math:`A_{qq,H}^{NS,(2)}` + """ S1 = sx[0][0] S2 = sx[1][0] @@ -75,23 +76,24 @@ def A_qq_ns(n, sx, L): @nb.njit(cache=True) def A_hq_ps(n, sx, L): - r""" - |NNLO| heavy-light pure-singlet |OME| :math:`A_{Hq}^{PS,(2)}` given in - Eq. (B.1) of :cite:`Buza_1998`. + r"""|NNLO| heavy-light pure-singlet |OME| :math:`A_{Hq}^{PS,(2)}`. + + It is given in :eqref:`B.1` of :cite:`Buza_1998`. Parameters ---------- - n : complex - Mellin moment - sx : list - harmonic sums cache - L : float - :math:`\ln(\mu_F^2 / m_h^2)` + n : complex + Mellin moment + sx : list + harmonic sums cache + L : float + :math:`\ln(\mu_F^2 / m_h^2)` Returns ------- - A_hq_ps : complex - |NNLO| heavy-light pure-singlet |OME| :math:`A_{Hq}^{PS,(2)}` + A_hq_ps : complex + |NNLO| heavy-light pure-singlet |OME| :math:`A_{Hq}^{PS,(2)}` + """ S2 = sx[1][0] @@ -138,24 +140,25 @@ def A_hq_ps(n, sx, L): @nb.njit(cache=True) def A_hg(n, sx, L): - r""" - |NNLO| heavy-gluon |OME| :math:`A_{Hg}^{S,(2)}` given in - Eq. (B.3) of :cite:`Buza_1998`. - The expession for A_Hg_l0 comes form :cite:`Bierenbaum:2009zt`. + r"""|NNLO| heavy-gluon |OME| :math:`A_{Hg}^{S,(2)}`. + + It is given in :eqref:`B.3` of :cite:`Buza_1998`. + The expession for ``A_Hg_l0`` comes form :cite:`Bierenbaum:2009zt`. Parameters ---------- - n : complex - Mellin moment - sx : list - harmonic sums cache - L : float - :math:`\ln(\mu_F^2 / m_h^2)` + n : complex + Mellin moment + sx : list + harmonic sums cache + L : float + :math:`\ln(\mu_F^2 / m_h^2)` Returns ------- - A_hg : complex - |NNLO| heavy-gluon |OME| :math:`A_{Hg}^{S,(2)}` + A_hg : complex + |NNLO| heavy-gluon |OME| :math:`A_{Hg}^{S,(2)}` + """ S1 = sx[0][0] S2, Sm2 = sx[1] @@ -278,23 +281,24 @@ def A_hg(n, sx, L): @nb.njit(cache=True) def A_gq(n, sx, L): - r""" - |NNLO| gluon-quark |OME| :math:`A_{gq,H}^{S,(2)}` given in - Eq. (B.5) of :cite:`Buza_1998`. + r"""|NNLO| gluon-quark |OME| :math:`A_{gq,H}^{S,(2)}`. + + It is given in :eqref:`B.5` of :cite:`Buza_1998`. Parameters ---------- - n : complex - Mellin moment - sx : list - harmonic sums cache - L : float - :math:`\ln(\mu_F^2 / m_h^2)` + n : complex + Mellin moment + sx : list + harmonic sums cache + L : float + :math:`\ln(\mu_F^2 / m_h^2)` Returns ------- - A_gq : complex - |NNLO| gluon-quark |OME| :math:`A_{gq,H}^{S,(2)}` + A_gq : complex + |NNLO| gluon-quark |OME| :math:`A_{gq,H}^{S,(2)}` + """ S1 = sx[0][0] S2 = sx[1][0] @@ -328,23 +332,24 @@ def A_gq(n, sx, L): @nb.njit(cache=True) def A_gg(n, sx, L): - r""" - |NNLO| gluon-gluon |OME| :math:`A_{gg,H}^{S,(2)} ` given in - Eq. (B.7) of :cite:`Buza_1998`. + r"""|NNLO| gluon-gluon |OME| :math:`A_{gg,H}^{S,(2)}`. + + It is given in :eqref:`B.7` of :cite:`Buza_1998`. Parameters ---------- - n : complex - Mellin moment - sx : list - harmonic sums cache - L : float - :math:`\ln(\mu_F^2 / m_h^2)` + n : complex + Mellin moment + sx : list + harmonic sums cache + L : float + :math:`\ln(\mu_F^2 / m_h^2)` Returns ------- - A_gg : complex - |NNLO| gluon-gluon |OME| :math:`A_{gg,H}^{S,(2)}` + A_gg : complex + |NNLO| gluon-gluon |OME| :math:`A_{gg,H}^{S,(2)}` + """ S1 = sx[0][0] S1m = S1 - 1 / n # harmonic_S1(n - 1) @@ -415,40 +420,32 @@ def A_gg(n, sx, L): @nb.njit(cache=True) def A_singlet(n, sx, L, is_msbar=False): - r""" - Computes the |NNLO| singlet |OME|. - - .. math:: - A^{S,(2)} = \left(\begin{array}{cc} - A_{gg, H}^{S,(2)} & A_{gq, H}^{S,(2)} & 0 \\ - 0 & A_{qq,H}^{NS,(2)} & 0\\ - A_{hg}^{S,(2)} & A_{hq}^{PS,(2)} & 0\\ - \end{array}\right) - - Parameters - ---------- - n : complex - Mellin moment - sx : list - harmonic sums cache containing: - [[:math:`S_1,S_{-1}`],[:math:`S_2,S_{-2}`],[:math:`S_3,S_{-2,1},S_{-3}`]] - L : float - :math:`\ln(\mu_F^2 / m_h^2)` - is_msbar: bool - add the |MSbar| contribution - - Returns - ------- - A_S : numpy.ndarray - |NNLO| singlet |OME| :math:`A^{S,(2)}(N)` - - See Also - -------- - A_ns : :math:`A_{qq,H}^{NS,(2)}` - A_hq : :math:`A_{hq}^{PS,(2)}` - A_hg : :math:`A_{hg}^{S,(2)}` - A_gq : :math:`A_{gq, H}^{S,(2)}` - A_gg : :math:`A_{gg, H}^{S,(2)}` + r"""Compute the |NNLO| singlet |OME|. + + .. math:: + A^{S,(2)} = \left(\begin{array}{cc} + A_{gg, H}^{S,(2)} & A_{gq, H}^{S,(2)} & 0 \\ + 0 & A_{qq,H}^{NS,(2)} & 0\\ + A_{hg}^{S,(2)} & A_{hq}^{PS,(2)} & 0\\ + \end{array}\right) + + Parameters + ---------- + n : complex + Mellin moment + sx : list + harmonic sums cache containing: + [[:math:`S_1,S_{-1}`],[:math:`S_2,S_{-2}`],[:math:`S_3,S_{-2,1},S_{-3}`]] + L : float + :math:`\ln(\mu_F^2 / m_h^2)` + is_msbar: bool + add the |MSbar| contribution + + Returns + ------- + A_S : numpy.ndarray + |NNLO| singlet |OME| :math:`A^{S,(2)}(N)` + """ A_hq_2 = A_hq_ps(n, sx, L) A_qq_2 = A_qq_ns(n, sx, L) @@ -466,32 +463,28 @@ def A_singlet(n, sx, L, is_msbar=False): @nb.njit(cache=True) def A_ns(n, sx, L): - r""" - Computes the |NNLO| non-singlet |OME|. - - .. math:: - A^{NS,(2)} = \left(\begin{array}{cc} - A_{qq,H}^{NS,(2)} & 0 \\ - 0 & 0 \\ - \end{array}\right) - - Parameters - ---------- - n : complex - Mellin moment - sx : list - harmonic sums cache containing: - [[:math:`S_1,S_{-1}`],[:math:`S_2,S_{-2}`],[:math:`S_3,S_{-2,1},S_{-3}`]] - L : float - :math:`\ln(\mu_F^2 / m_h^2)` - - Returns - ------- - A_NS : numpy.ndarray - |NNLO| non-singlet |OME| :math:`A^{NS,(2)}` - - See Also - -------- - A_qq_ns : :math:`A_{qq,H}^{NS,(2)}` + r"""Compute the |NNLO| non-singlet |OME|. + + .. math:: + A^{NS,(2)} = \left(\begin{array}{cc} + A_{qq,H}^{NS,(2)} & 0 \\ + 0 & 0 \\ + \end{array}\right) + + Parameters + ---------- + n : complex + Mellin moment + sx : list + harmonic sums cache containing: + [[:math:`S_1,S_{-1}`],[:math:`S_2,S_{-2}`],[:math:`S_3,S_{-2,1},S_{-3}`]] + L : float + :math:`\ln(\mu_F^2 / m_h^2)` + + Returns + ------- + A_NS : numpy.ndarray + |NNLO| non-singlet |OME| :math:`A^{NS,(2)}` + """ return np.array([[A_qq_ns(n, sx, L), 0.0], [0 + 0j, 0 + 0j]], np.complex_) diff --git a/src/ekore/operator_matrix_elements/unpolarized/space_like/as3/__init__.py b/src/ekore/operator_matrix_elements/unpolarized/space_like/as3/__init__.py index 06feccd38..10935a9f3 100644 --- a/src/ekore/operator_matrix_elements/unpolarized/space_like/as3/__init__.py +++ b/src/ekore/operator_matrix_elements/unpolarized/space_like/as3/__init__.py @@ -1,4 +1,4 @@ -r"""This module defines the matching conditions for the N3LO |VFNS| evolution. +r"""The unpolarized, space-like |N3LO| |OME|. The expressions are based on: @@ -70,7 +70,7 @@ @nb.njit(cache=True) def A_singlet(n, sx_singlet, sx_non_singlet, nf, L): - r"""Computes the |N3LO| singlet |OME|. + r"""Compute the |N3LO| singlet |OME|. .. math:: A^{S,(3)} = \left(\begin{array}{cc} @@ -131,7 +131,7 @@ def A_singlet(n, sx_singlet, sx_non_singlet, nf, L): @nb.njit(cache=True) def A_ns(n, sx_all, nf, L): - r"""Computes the |N3LO| non-singlet |OME|. + r"""Compute the |N3LO| non-singlet |OME|. .. math:: A^{NS,(3)} = \left(\begin{array}{cc} @@ -166,9 +166,5 @@ def A_ns(n, sx_all, nf, L): A_NS : numpy.ndarray |N3LO| non-singlet |OME| :math:`A^{NS,(3)}` - See Also - -------- - A_qqNS_3 : :math:`A_{qq,H}^{NS,(3))}` - """ return np.array([[A_qqNS(n, sx_all, nf, L), 0.0], [0 + 0j, 0 + 0j]], np.complex_) diff --git a/src/ekore/operator_matrix_elements/unpolarized/space_like/as3/aHg.py b/src/ekore/operator_matrix_elements/unpolarized/space_like/as3/aHg.py index c676ce558..13e571701 100644 --- a/src/ekore/operator_matrix_elements/unpolarized/space_like/as3/aHg.py +++ b/src/ekore/operator_matrix_elements/unpolarized/space_like/as3/aHg.py @@ -1,3 +1,4 @@ +"""The unpolarized, space-like |N3LO| heavy-gluon |OME|.""" # pylint: skip-file import numba as nb import numpy as np @@ -7,7 +8,8 @@ @nb.njit(cache=True) def A_Hg(n, sx, nf, L): # pylint: disable=too-many-locals - r"""Computes the |N3LO| singlet |OME| :math:`A_{Hg}^{S,(3)}(N)`. + r"""Compute the |N3LO| singlet |OME| :math:`A_{Hg}^{S,(3)}(N)`. + The expression is presented in :cite:`Bierenbaum:2009mv`. When using the code, please cite the complete list of references @@ -29,11 +31,6 @@ def A_Hg(n, sx, nf, L): # pylint: disable=too-many-locals complex :math:`A_{Hg}^{S,(3)}(N)` - See Also - -------- - A_Hgstfac: ekore.matching_conditions.as3.aHgstfac.A_Hgstfac - Incomplete part of the |OME|. - """ S1, _ = sx[0] S2, Sm2 = sx[1] diff --git a/src/ekore/operator_matrix_elements/unpolarized/space_like/as3/aHgstfac.py b/src/ekore/operator_matrix_elements/unpolarized/space_like/as3/aHgstfac.py index 4eed1890a..b0aed818c 100644 --- a/src/ekore/operator_matrix_elements/unpolarized/space_like/as3/aHgstfac.py +++ b/src/ekore/operator_matrix_elements/unpolarized/space_like/as3/aHgstfac.py @@ -1,3 +1,4 @@ +"""The approximate incomplete part of the unpolarized, space-like |N3LO| heavy-gluon |OME|.""" # pylint: skip-file import numba as nb import numpy as np @@ -5,9 +6,9 @@ @nb.njit(cache=True) def A_Hgstfac(n, sx, nf): - r"""Computes the approximate incomplete part of :math:`A_{Hg}^{S,(3)}(N)` - proportional to :math:`T_{F}`. - The expression is presented in :cite:`Blumlein:2017wxd` (eq 3.1). + r"""Compute the approximate incomplete part of :math:`A_{Hg}^{S,(3)}(N)` proportional to :math:`T_{F}`. + + The expression is presented in :cite:`Blumlein:2017wxd` :eqref:`3.1`. When using the code, please cite the complete list of references available in :mod:`ekore.matching_conditions.as3`. @@ -29,6 +30,7 @@ def A_Hgstfac(n, sx, nf): Returns ------- complex + :math:`A_{Hg}^{S,(3)}(N)` """ S1, _ = sx[0] diff --git a/src/ekore/operator_matrix_elements/unpolarized/space_like/as3/aHq.py b/src/ekore/operator_matrix_elements/unpolarized/space_like/as3/aHq.py index 6ea2968ec..59cd6f406 100644 --- a/src/ekore/operator_matrix_elements/unpolarized/space_like/as3/aHq.py +++ b/src/ekore/operator_matrix_elements/unpolarized/space_like/as3/aHq.py @@ -1,3 +1,4 @@ +"""The unpolarized, space-like |N3LO| heavy-quark |OME|.""" # pylint: disable=too-many-lines import numba as nb import numpy as np @@ -5,9 +6,10 @@ @nb.njit(cache=True) def A_Hq(n, sx, nf, L): # pylint: disable=too-many-locals - r"""Computes the |N3LO| singlet |OME| :math:`A_{Hq}^{S,(3)}(N)`. - The expression is presented in :cite:`Ablinger_2015` (eq 5.1) - and :cite:`Blumlein:2017wxd` (eq 3.1). + r"""Compute the |N3LO| singlet |OME| :math:`A_{Hq}^{S,(3)}(N)`. + + The expression is presented in :cite:`Ablinger_2015` :eqref:`5.1` + and :cite:`Blumlein:2017wxd` :eqref:`3.1`. When using the code, please cite the complete list of references available in :mod:`ekore.matching_conditions.as3`. diff --git a/src/ekore/operator_matrix_elements/unpolarized/space_like/as3/agg.py b/src/ekore/operator_matrix_elements/unpolarized/space_like/as3/agg.py index b4783d83e..7bd86ba8a 100644 --- a/src/ekore/operator_matrix_elements/unpolarized/space_like/as3/agg.py +++ b/src/ekore/operator_matrix_elements/unpolarized/space_like/as3/agg.py @@ -1,3 +1,4 @@ +"""The unpolarized, space-like |N3LO| gluon-gluon |OME|.""" # pylint: skip-file import numba as nb import numpy as np @@ -7,7 +8,8 @@ @nb.njit(cache=True) def A_gg(n, sx, nf, L): # pylint: disable=too-many-locals - r"""Computes the |N3LO| singlet |OME| :math:`A_{gg}^{S,(3)}(N)`. + r"""Compute the |N3LO| singlet |OME| :math:`A_{gg}^{S,(3)}(N)`. + The expression is presented in :cite:`Bierenbaum:2009mv`. When using the code, please cite the complete list of references @@ -29,11 +31,6 @@ def A_gg(n, sx, nf, L): # pylint: disable=too-many-locals complex :math:`A_{gg}^{S,(3)}(N)` - See Also - -------- - A_ggTF2: ekore.matching_conditions.as3.aggTF2.A_ggTF2 - Incomplete part proportional to :math:`T_{F}^2`. - """ S1, _ = sx[0] S2, Sm2 = sx[1] diff --git a/src/ekore/operator_matrix_elements/unpolarized/space_like/as3/aggTF2.py b/src/ekore/operator_matrix_elements/unpolarized/space_like/as3/aggTF2.py index 299006dc6..a67186c80 100644 --- a/src/ekore/operator_matrix_elements/unpolarized/space_like/as3/aggTF2.py +++ b/src/ekore/operator_matrix_elements/unpolarized/space_like/as3/aggTF2.py @@ -1,12 +1,13 @@ +"""The approximate incomplete part of unpolarized, space-like |N3LO| gluon-gluon |OME|.""" import numba as nb import numpy as np @nb.njit(cache=True) def A_ggTF2(n, sx): - r"""Computes the approximate incomplete part of :math:`A_{gg}^{S,(3)}(N)` - proportional to :math:`T_{F}^2`. - The expression is presented in :cite:`Ablinger:2014uka` (eq 4.2). + r"""Compute the approximate incomplete part of :math:`A_{gg}^{S,(3)}(N)` proportional to :math:`T_{F}^2`. + + The expression is presented in :cite:`Ablinger:2014uka` :eqref:`4.2`. It contains a binomial factor which is given approximated. When using the code, please cite the complete list of references diff --git a/src/ekore/operator_matrix_elements/unpolarized/space_like/as3/agq.py b/src/ekore/operator_matrix_elements/unpolarized/space_like/as3/agq.py index 906e08e52..a9ac48219 100644 --- a/src/ekore/operator_matrix_elements/unpolarized/space_like/as3/agq.py +++ b/src/ekore/operator_matrix_elements/unpolarized/space_like/as3/agq.py @@ -1,11 +1,13 @@ +"""The unpolarized, space-like |N3LO| gluon-quark |OME|.""" import numba as nb import numpy as np @nb.njit(cache=True) def A_gq(n, sx, nf, L): # pylint: disable=too-many-locals - r"""Computes the |N3LO| singlet |OME| :math:`A_{gq}^{S,(3)}(N)`. - The expression is presented in :cite:`Ablinger_2014` (eq 6.3). + r"""Compute the |N3LO| singlet |OME| :math:`A_{gq}^{S,(3)}(N)`. + + The expression is presented in :cite:`Ablinger_2014` :eqref:`6.3`. When using the code, please cite the complete list of references available in :mod:`ekore.matching_conditions.as3`. diff --git a/src/ekore/operator_matrix_elements/unpolarized/space_like/as3/aqg.py b/src/ekore/operator_matrix_elements/unpolarized/space_like/as3/aqg.py index 3c2cc36e4..45509d96c 100644 --- a/src/ekore/operator_matrix_elements/unpolarized/space_like/as3/aqg.py +++ b/src/ekore/operator_matrix_elements/unpolarized/space_like/as3/aqg.py @@ -1,10 +1,12 @@ +"""The unpolarized, space-like |N3LO| quark-gluon |OME|.""" import numba as nb import numpy as np @nb.njit(cache=True) def A_qg(n, sx, nf, L): - r"""Computes the |N3LO| singlet |OME| :math:`A_{qg}^{S,(3)}(N)`. + r"""Compute the |N3LO| singlet |OME| :math:`A_{qg}^{S,(3)}(N)`. + The expression is presented in :cite:`Bierenbaum:2009mv`. When using the code, please cite the complete list of references diff --git a/src/ekore/operator_matrix_elements/unpolarized/space_like/as3/aqqNS.py b/src/ekore/operator_matrix_elements/unpolarized/space_like/as3/aqqNS.py index 40be9ed69..e03459d51 100644 --- a/src/ekore/operator_matrix_elements/unpolarized/space_like/as3/aqqNS.py +++ b/src/ekore/operator_matrix_elements/unpolarized/space_like/as3/aqqNS.py @@ -1,10 +1,12 @@ +"""The unpolarized, space-like |N3LO| quark-quark non-singlet |OME|.""" import numba as nb import numpy as np @nb.njit(cache=True) def A_qqNS(n, sx, nf, L): - r"""Computes the |N3LO| singlet |OME| :math:`A_{qq}^{NS,(3)}(N)`. + r"""Compute the |N3LO| singlet |OME| :math:`A_{qq}^{NS,(3)}(N)`. + The expression is presented in :cite:`Bierenbaum:2009mv` and :cite:`Ablinger:2014vwa`. It contains some weight 5 harmonics sums. diff --git a/src/ekore/operator_matrix_elements/unpolarized/space_like/as3/aqqPS.py b/src/ekore/operator_matrix_elements/unpolarized/space_like/as3/aqqPS.py index ee8f136cd..38b6674d3 100644 --- a/src/ekore/operator_matrix_elements/unpolarized/space_like/as3/aqqPS.py +++ b/src/ekore/operator_matrix_elements/unpolarized/space_like/as3/aqqPS.py @@ -1,10 +1,12 @@ +"""The unpolarized, space-like |N3LO| quark-quark pure-singlet |OME|.""" import numba as nb import numpy as np @nb.njit(cache=True) def A_qqPS(n, sx, nf, L): - r"""Computes the |N3LO| singlet |OME| :math:`A_{qq}^{PS,(3)}(N)`. + r"""Compute the |N3LO| singlet |OME| :math:`A_{qq}^{PS,(3)}(N)`. + The expression is presented in :cite:`Bierenbaum:2009mv`. When using the code, please cite the complete list of references diff --git a/src/ekore/operator_matrix_elements/unpolarized/time_like/__init__.py b/src/ekore/operator_matrix_elements/unpolarized/time_like/__init__.py index 53c68e8d6..bb20ff58b 100644 --- a/src/ekore/operator_matrix_elements/unpolarized/time_like/__init__.py +++ b/src/ekore/operator_matrix_elements/unpolarized/time_like/__init__.py @@ -5,9 +5,11 @@ @nb.njit(cache=True) def A_non_singlet(_matching_order, _n, _sx, _nf, _L): + """Compute the non-singlet |OME|.""" raise NotImplementedError("Time-like is not yet implemented") @nb.njit(cache=True) def A_singlet(_matching_order, _n, _sx, _nf, _L, _is_msbar, _sx_ns=None): + """Compute the singlet |OME|.""" raise NotImplementedError("Time-like is not yet implemented") From 5eb8f057071a3f596d8c9e29846a7592ed200bae Mon Sep 17 00:00:00 2001 From: Felix Hekhorn Date: Wed, 5 Apr 2023 17:04:27 +0200 Subject: [PATCH 7/7] Fix eq translation --- src/ekore/harmonics/w3.py | 18 +----------------- src/ekore/harmonics/w4.py | 2 +- 2 files changed, 2 insertions(+), 18 deletions(-) diff --git a/src/ekore/harmonics/w3.py b/src/ekore/harmonics/w3.py index 9b6d5c45b..d13b95c50 100644 --- a/src/ekore/harmonics/w3.py +++ b/src/ekore/harmonics/w3.py @@ -95,10 +95,6 @@ def S21(N, S1, S2): S21 : complex Harmonic sum :math:`S_{2,1}(N)` - See Also - -------- - ekore.harmonics.g_functions.mellin_g18 : :math:`g_18(N)` - """ return -gf.mellin_g18(N, S1, S2) + 2 * zeta3 @@ -107,7 +103,7 @@ def S21(N, S1, S2): def Sm21(N, S1, Sm1, is_singlet=None): r"""Analytic continuation of harmonic sum :math:`S_{-2,1}(N)`. - As implemented in :eqref:`B.5.75` of :cite:`MuselliPhD` and :eq:`22` of + As implemented in :eqref:`B.5.75` of :cite:`MuselliPhD` and :eqref:`22` of :cite:`Bl_mlein_2000`. Parameters @@ -127,10 +123,6 @@ def Sm21(N, S1, Sm1, is_singlet=None): Sm21 : complex Harmonic sum :math:`S_{-2,1}(N)` - See Also - -------- - ekore.harmonics.g_functions : :math:`g_3(N)` - """ # Note mellin g3 was integrated following x^(N-1) convention. eta = symmetry_factor(N, is_singlet) @@ -168,10 +160,6 @@ def S2m1(N, S2, Sm1, Sm2, is_singlet=None): S2m1 : complex Harmonic sum :math:`S_{2,-1}(N)` - See Also - -------- - ekore.harmonics.g_functions.mellin_g4 : :math:`g_4(N)` - """ eta = symmetry_factor(N, is_singlet) return ( @@ -206,9 +194,5 @@ def Sm2m1(N, S1, S2, Sm2): Sm2m1 : complex Harmonic sum :math:`S_{-2,-1}(N)` - See Also - -------- - ekore.harmonics.g_functions.mellin_g19 : :math:`g_19(N)` - """ return -gf.mellin_g19(N, S1) + log2 * (S2 - Sm2) - 5 / 8 * zeta3 diff --git a/src/ekore/harmonics/w4.py b/src/ekore/harmonics/w4.py index 53a8ad353..190067dc6 100644 --- a/src/ekore/harmonics/w4.py +++ b/src/ekore/harmonics/w4.py @@ -78,7 +78,7 @@ def Sm4(N, hS4, is_singlet=None): def Sm31(N, S1, Sm1, Sm2, is_singlet=None): r"""Analytic continuation of harmonic sum :math:`S_{-3,1}(N)`. - As implemented in :eq:`B.5.93` of :cite:`MuselliPhD` and :eq:`25` of + As implemented in :eqref:`B.5.93` of :cite:`MuselliPhD` and :eqref:`25` of cite:`Bl_mlein_2000`. Parameters