Skip to content

Commit

Permalink
rust: Fix documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
felixhekhorn committed May 23, 2024
1 parent 06bb027 commit 0be8857
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 15 deletions.
1 change: 1 addition & 0 deletions crates/eko/src/bib.rs
3 changes: 2 additions & 1 deletion crates/eko/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ use ekore;
use ekore::harmonics::cache::Cache;
use std::ffi::c_void;

mod mellin;
pub mod bib;
pub mod mellin;

/// QCD intergration kernel inside quad.
#[no_mangle]
Expand Down
11 changes: 7 additions & 4 deletions crates/eko/src/mellin.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,13 @@ use std::f64::consts::PI;
/// Talbot inversion path.
///
/// Implements the algorithm presented in [\[Abate\]](crate::bib::Abate).
/// $p_{\text{Talbot}}(t) = o + r \cdot ( \theta \cot(\theta) + i\theta)$ with $\theta = \pi(2t-1)$
/// The default values for the parameters $r,o$ are given by $r = 1/2, o = 0$ for
/// the non-singlet integrals and by $r = \frac{2}{5} \frac{16}{0.1 - \ln(x)}, o = 1$
/// for the singlet sector. Note that the non-singlet kernels evolve poles only up to
///
/// $$p_{\text{Talbot}}(t) = o + r \cdot ( \theta \cot(\theta) + i\theta) ~ \text{with}~ \theta = \pi(2t-1)$$
///
/// The default values for the parameters $r,o$ are given by
/// $r = \frac{2}{5} \frac{16}{0.1 - \ln(x)}$ and $o = 0$ for
/// the non-singlet integrals and $o = 1$ for the singlet sector.
/// Note that the non-singlet kernels evolve poles only up to
/// $N=0$ whereas the singlet kernels have poles up to $N=1$.
pub struct TalbotPath {
/// integration variable
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ pub fn gamma_nsp(c: &mut Cache, nf: u8) -> Complex<f64> {

/// Compute the pure-singlet quark-quark anomalous dimension.
///
/// Implements Eq. (3.6) of [\[Vogt:2004mw\]][crate::bib::Vogt:2004mw].
/// Implements Eq. (3.6) of [\[Vogt:2004mw\]][crate::bib::Vogt2004mw].
pub fn gamma_ps(c: &mut Cache, nf: u8) -> Complex<f64> {
let N = c.n;
let gqqps1_nfcf = (-4. * (2. + N * (5. + N)) * (4. + N * (4. + N * (7. + 5. * N))))
Expand All @@ -98,7 +98,7 @@ pub fn gamma_ps(c: &mut Cache, nf: u8) -> Complex<f64> {

/// Compute the quark-gluon singlet anomalous dimension.
///
/// Implements Eq. (3.7) of [\[Vogt:2004mw\]][crate::bib::Vogt:2004mw].
/// Implements Eq. (3.7) of [\[Vogt:2004mw\]][crate::bib::Vogt2004mw].
pub fn gamma_qg(c: &mut Cache, nf: u8) -> Complex<f64> {
let N = c.n;
let S1 = c.get(K::S1);
Expand Down Expand Up @@ -126,7 +126,7 @@ pub fn gamma_qg(c: &mut Cache, nf: u8) -> Complex<f64> {

/// Compute the gluon-quark singlet anomalous dimension.
///
/// Implements Eq. (3.8) of [\[Vogt:2004mw\]][crate::bib::Vogt:2004mw].
/// Implements Eq. (3.8) of [\[Vogt:2004mw\]][crate::bib::Vogt2004mw].
pub fn gamma_gq(c: &mut Cache, nf: u8) -> Complex<f64> {
let N = c.n;
let S1 = c.get(K::S1);
Expand Down Expand Up @@ -162,7 +162,7 @@ pub fn gamma_gq(c: &mut Cache, nf: u8) -> Complex<f64> {

/// Compute the gluon-gluon singlet anomalous dimension.
///
/// Implements Eq. (3.9) of [\[Vogt:2004mw\]][crate::bib::Vogt:2004mw].
/// Implements Eq. (3.9) of [\[Vogt:2004mw\]][crate::bib::Vogt2004mw].
pub fn gamma_gg(c: &mut Cache, nf: u8) -> Complex<f64> {
let N = c.n;
let S1 = c.get(K::S1);
Expand Down
4 changes: 2 additions & 2 deletions crates/ekore/src/harmonics/g_functions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ use num::{complex::Complex, Zero};
/// This function appears in the analytic continuation of the harmonic sum
/// $S_{-2,1}(N)$ which in turn appears in the NLO anomalous dimension.
///
/// We use the name from [[MuselliPhD]][crate::bib::MuselliPhD], but not his implementation - rather we use the
/// Pegasus [[Vogt:2004ns]][crate::bib::Vogt2004ns] implementation.
/// We use the name from [\[MuselliPhD\]](crate::bib::MuselliPhD), but not his implementation - rather we use the
/// Pegasus [\[Vogt:2004ns\]](crate::bib::Vogt2004ns) implementation.
pub fn g3(N: Complex<f64>, S1: Complex<f64>) -> Complex<f64> {
const CS: [f64; 7] = [
1.0000e0, -0.9992e0, 0.9851e0, -0.9005e0, 0.6621e0, -0.3174e0, 0.0699e0,
Expand Down
7 changes: 3 additions & 4 deletions crates/ekore/src/harmonics/polygamma.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ use std::f64::consts::PI;

/// Compute the polygamma functions $\psi_k(z)$.
///
/// Reimplementation of ``WPSIPG`` (C317) in [CERNlib](http://cernlib.web.cern.ch/cernlib/) given by [[KOLBIG1972221]][crate::bib::KOLBIG1972221].
/// Reimplementation of ``WPSIPG`` (C317) in [CERNlib](http://cernlib.web.cern.ch/cernlib/)
/// given by [\[KOLBIG1972221\]](crate::bib::KOLBIG1972221).
///
/// TODO: introduce back errors
pub fn cern_polygamma(Z: Complex<f64>, K: usize) -> Complex<f64> {
Expand Down Expand Up @@ -82,9 +83,7 @@ pub fn cern_polygamma(Z: Complex<f64>, K: usize) -> Complex<f64> {
}
let mut R = 1. / V.powu(2);
let mut P = R * C[K][6 - 1];
for i in (1..=5).rev()
// (int i = 5; i>1-1; i--)
{
for i in (1..=5).rev() {
P = R * (C[K][i - 1] + P);
}
H = (SGN[K] as f64)
Expand Down

0 comments on commit 0be8857

Please sign in to comment.