Skip to content

Commit

Permalink
Merge branch 'ome_rust' of github.com:N3PDF/eko into ome_rust
Browse files Browse the repository at this point in the history
  • Loading branch information
tgiani committed Sep 11, 2024
2 parents 2d9b7ca + 8f09ea0 commit fc01791
Show file tree
Hide file tree
Showing 9 changed files with 226 additions and 132 deletions.
13 changes: 13 additions & 0 deletions crates/ekore/refs.bib
Original file line number Diff line number Diff line change
Expand Up @@ -94,3 +94,16 @@ @article{Buza1996wv
pages = "301--320",
year = "1998"
}
@article{Bierenbaum2009zt,
author = "Bierenbaum, Isabella and Blumlein, Johannes and Klein, Sebastian",
title = "{The Gluonic Operator Matrix Elements at O(alpha(s)**2) for DIS Heavy Flavor Production}",
eprint = "0901.0669",
archivePrefix = "arXiv",
primaryClass = "hep-ph",
reportNumber = "DESY-08-187, SFB-CPP-08-107, IFIC-08-68",
doi = "10.1016/j.physletb.2009.01.057",
journal = "Phys. Lett. B",
volume = "672",
pages = "401--406",
year = "2009"
}
31 changes: 16 additions & 15 deletions crates/ekore/src/anomalous_dimensions/unpolarized/spacelike/as1.rs
Original file line number Diff line number Diff line change
Expand Up @@ -54,63 +54,64 @@ pub fn gamma_singlet(c: &mut Cache, nf: u8) -> [[Complex<f64>; 2]; 2] {

#[cfg(test)]
mod tests {
use crate::cmplx;
use crate::{anomalous_dimensions::unpolarized::spacelike::as1::*, harmonics::cache::Cache};
use float_cmp::assert_approx_eq;
use super::*;
use crate::harmonics::cache::Cache;
use crate::{assert_approx_eq_cmplx, cmplx};
use num::complex::Complex;
use num::Zero;
const NF: u8 = 5;

#[test]
fn number_conservation() {
const N: Complex<f64> = cmplx![1., 0.];
let mut c = Cache::new(N);
let me = gamma_ns(&mut c, NF);
assert_approx_eq!(f64, me.re, 0., epsilon = 1e-12);
assert_approx_eq!(f64, me.im, 0., epsilon = 1e-12);
assert_approx_eq_cmplx!(f64, me, Complex::zero(), epsilon = 1e-12);
}

#[test]
fn quark_momentum_conservation() {
const N: Complex<f64> = cmplx![2., 0.];
let mut c = Cache::new(N);
let me = gamma_ns(&mut c, NF) + gamma_gq(&mut c, NF);
assert_approx_eq!(f64, me.re, 0., epsilon = 1e-12);
assert_approx_eq!(f64, me.im, 0., epsilon = 1e-12);
assert_approx_eq_cmplx!(f64, me, Complex::zero(), epsilon = 1e-12);
}

#[test]
fn gluon_momentum_conservation() {
const N: Complex<f64> = cmplx![2., 0.];
let mut c = Cache::new(N);
let me = gamma_qg(&mut c, NF) + gamma_gg(&mut c, NF);
assert_approx_eq!(f64, me.re, 0., epsilon = 1e-12);
assert_approx_eq!(f64, me.im, 0., epsilon = 1e-12);
assert_approx_eq_cmplx!(f64, me, Complex::zero(), epsilon = 1e-12);
}

#[test]
fn gamma_qg_() {
const N: Complex<f64> = cmplx![1., 0.];
let mut c = Cache::new(N);
let me = gamma_qg(&mut c, NF);
assert_approx_eq!(f64, me.re, -20. / 3.0, ulps = 32);
assert_approx_eq!(f64, me.im, 0., epsilon = 1e-12);
assert_approx_eq_cmplx!(f64, me, cmplx!(-20. / 3., 0.), ulps = 32, epsilon = 1e-12);
}

#[test]
fn gamma_gq_() {
const N: Complex<f64> = cmplx![0., 1.];
let mut c = Cache::new(N);
let me = gamma_gq(&mut c, NF);
assert_approx_eq!(f64, me.re, 4. / 3.0, ulps = 32);
assert_approx_eq!(f64, me.im, -4. / 3.0, ulps = 32);
assert_approx_eq_cmplx!(f64, me, cmplx!(4. / 3.0, -4. / 3.0), ulps = 32);
}

#[test]
fn gamma_gg_() {
const N: Complex<f64> = cmplx![0., 1.];
let mut c = Cache::new(N);
let me = gamma_gg(&mut c, NF);
assert_approx_eq!(f64, me.re, 5.195725159621, ulps = 32, epsilon = 1e-11);
assert_approx_eq!(f64, me.im, 10.52008856962, ulps = 32, epsilon = 1e-11);
assert_approx_eq_cmplx!(
f64,
me,
cmplx!(5.195725159621, 10.52008856962),
ulps = 32,
epsilon = 1e-11
);
}
}
124 changes: 80 additions & 44 deletions crates/ekore/src/anomalous_dimensions/unpolarized/spacelike/as2.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//! |NLO| |QCD|.

use ::num::complex::Complex;
use num::complex::Complex;
use std::f64::consts::LN_2;

use crate::constants::{CA, CF, TR, ZETA2, ZETA3};
Expand Down Expand Up @@ -216,41 +216,55 @@ pub fn gamma_singlet(c: &mut Cache, nf: u8) -> [[Complex<f64>; 2]; 2] {

#[cfg(test)]
mod tests {
use crate::cmplx;
use crate::{anomalous_dimensions::unpolarized::spacelike::as2::*, harmonics::cache::Cache};
use float_cmp::assert_approx_eq;
use super::*;
use crate::harmonics::cache::Cache;
use crate::{assert_approx_eq_cmplx, cmplx};
use num::complex::Complex;
use num::traits::Pow;
use num::Zero;
use std::f64::consts::PI;

const NF: u8 = 5;

#[test]
fn physical_constraints() {
// number conservation
let mut c = Cache::new(cmplx![1., 0.]);
assert_approx_eq!(f64, gamma_nsm(&mut c, NF).re, 0.0, epsilon = 2e-6);
let mut c = Cache::new(cmplx!(1., 0.));
assert_approx_eq_cmplx!(f64, gamma_nsm(&mut c, NF), Complex::zero(), epsilon = 2e-6);

// momentum conservation
let mut c = Cache::new(cmplx![2., 0.]);
let mut c = Cache::new(cmplx!(2., 0.));
let gS1 = gamma_singlet(&mut c, NF);

// gluon momentum conservation
assert_approx_eq!(f64, (gS1[0][1] + gS1[1][1]).re, 0.0, epsilon = 4e-5);
assert_approx_eq_cmplx!(
f64,
(gS1[0][1] + gS1[1][1]),
Complex::zero(),
epsilon = 4e-5
);
// quark momentum conservation
assert_approx_eq!(f64, (gS1[0][0] + gS1[1][0]).re, 0.0, epsilon = 2e-6);
assert_approx_eq_cmplx!(
f64,
(gS1[0][0] + gS1[1][0]),
Complex::zero(),
epsilon = 2e-6
);
}

#[test]
fn N2() {
// reference values are obtained from MMa
let mut c = Cache::new(cmplx![2., 0.]);
let mut c = Cache::new(cmplx!(2., 0.));

// ns+
assert_approx_eq!(
assert_approx_eq_cmplx!(
f64,
gamma_nsp(&mut c, NF).re,
(-112.0 * CF + 376.0 * CA - 64.0 * (NF as f64)) * CF / 27.0,
gamma_nsp(&mut c, NF),
cmplx!(
(-112.0 * CF + 376.0 * CA - 64.0 * (NF as f64)) * CF / 27.0,
0.
),
epsilon = 2e-6
);

Expand All @@ -259,80 +273,102 @@ mod tests {
+ (373.0 / 9.0 - 34.0 * PI.pow(2) / 9.0 + 8.0 * ZETA3) * CA
- 64.0 * (NF as f64) / 27.0)
* CF;
assert_approx_eq!(f64, gamma_nsm(&mut c, NF).re, check, epsilon = 2e-6);
assert_approx_eq_cmplx!(
f64,
gamma_nsm(&mut c, NF),
cmplx!(check, 0.),
epsilon = 2e-6
);

// singlet sector
let gS1 = gamma_singlet(&mut c, NF);
// ps
assert_approx_eq!(
assert_approx_eq_cmplx!(
f64,
gamma_ps(&mut c, NF).re,
-40.0 * CF * (NF as f64) / 27.0
gamma_ps(&mut c, NF),
cmplx!(-40.0 * CF * (NF as f64) / 27.0, 0.)
);
// qg
assert_approx_eq!(
assert_approx_eq_cmplx!(
f64,
gS1[0][1].re,
(-74.0 * CF - 35.0 * CA) * (NF as f64) / 27.0
gS1[0][1],
cmplx!((-74.0 * CF - 35.0 * CA) * (NF as f64) / 27.0, 0.)
);
// gq
assert_approx_eq!(
assert_approx_eq_cmplx!(
f64,
gS1[1][0].re,
(112.0 * CF - 376.0 * CA + 104.0 * (NF as f64)) * CF / 27.0,
gS1[1][0],
cmplx!(
(112.0 * CF - 376.0 * CA + 104.0 * (NF as f64)) * CF / 27.0,
0.
),
epsilon = 1e-13
);
}

#[test]
fn N3() {
let mut c = Cache::new(cmplx![3., 0.]);
let mut c = Cache::new(cmplx!(3., 0.));
// ns+
let check = ((-34487.0 / 432.0 + 86.0 * PI.pow(2) / 9.0 - 16.0 * ZETA3) * CF
+ (459.0 / 8.0 - 43.0 * PI.pow(2) / 9.0 + 8.0 * ZETA3) * CA
- 415.0 * (NF as f64) / 108.0)
* CF;
assert_approx_eq!(f64, gamma_nsp(&mut c, NF).re, check, epsilon = 2e-6);
assert_approx_eq_cmplx!(
f64,
gamma_nsp(&mut c, NF),
cmplx!(check, 0.),
epsilon = 2e-6
);

// singlet sector
let gS1 = gamma_singlet(&mut c, NF);
// ps
assert_approx_eq!(
assert_approx_eq_cmplx!(
f64,
gamma_ps(&mut c, NF).re,
-1391.0 * CF * (NF as f64) / 5400.0
gamma_ps(&mut c, NF),
cmplx!(-1391.0 * CF * (NF as f64) / 5400.0, 0.)
);
// gq
assert_approx_eq!(
assert_approx_eq_cmplx!(
f64,
gS1[1][0].re,
(973.0 / 432.0 * CF
+ (2801.0 / 5400.0 - 7.0 * PI.pow(2) / 9.0) * CA
+ 61.0 / 54.0 * (NF as f64))
* CF
gS1[1][0],
cmplx!(
(973.0 / 432.0 * CF
+ (2801.0 / 5400.0 - 7.0 * PI.pow(2) / 9.0) * CA
+ 61.0 / 54.0 * (NF as f64))
* CF,
0.
)
);
// gg
assert_approx_eq!(
assert_approx_eq_cmplx!(
f64,
gS1[1][1].re,
(-79909.0 / 3375.0 + 194.0 * PI.pow(2) / 45.0 - 8.0 * ZETA3) * CA.pow(2)
- 967.0 / 270.0 * CA * (NF as f64)
+ 541.0 / 216.0 * CF * (NF as f64),
gS1[1][1],
cmplx!(
(-79909.0 / 3375.0 + 194.0 * PI.pow(2) / 45.0 - 8.0 * ZETA3) * CA.pow(2)
- 967.0 / 270.0 * CA * (NF as f64)
+ 541.0 / 216.0 * CF * (NF as f64),
0.
),
epsilon = 3e-5
);
}

#[test]
fn N4() {
let mut c = Cache::new(cmplx![4., 0.]);
let mut c = Cache::new(cmplx!(4., 0.));
// singlet sector
let gS1 = gamma_singlet(&mut c, NF);
// qg
assert_approx_eq!(
assert_approx_eq_cmplx!(
f64,
gS1[0][1].re,
(-56317.0 / 18000.0 * CF + 16387.0 / 9000.0 * CA) * (NF as f64),
gS1[0][1],
cmplx!(
(-56317.0 / 18000.0 * CF + 16387.0 / 9000.0 * CA) * (NF as f64),
0.
),
epsilon = 1e-14
)
);
}
}
41 changes: 33 additions & 8 deletions crates/ekore/src/anomalous_dimensions/unpolarized/spacelike/as3.rs
Original file line number Diff line number Diff line change
Expand Up @@ -425,9 +425,9 @@ pub fn gamma_singlet(c: &mut Cache, nf: u8) -> [[Complex<f64>; 2]; 2] {

#[cfg(test)]
mod tests {
use crate::cmplx;
use crate::{anomalous_dimensions::unpolarized::spacelike::as3::*, harmonics::cache::Cache};
use float_cmp::assert_approx_eq;
use super::*;
use crate::harmonics::cache::Cache;
use crate::{assert_approx_eq_cmplx, cmplx};
use num::complex::Complex;

const NF: u8 = 5;
Expand All @@ -436,20 +436,45 @@ mod tests {
fn physical_constraints() {
// number conservation
let mut c = Cache::new(cmplx![1., 0.]);
assert_approx_eq!(f64, gamma_nsv(&mut c, NF).re, -0.000960586, epsilon = 3e-7);
assert_approx_eq!(f64, gamma_nsm(&mut c, NF).re, 0.000594225, epsilon = 6e-7);
assert_approx_eq_cmplx!(
f64,
gamma_nsv(&mut c, NF),
cmplx!(-0.000960586, 0.),
epsilon = 3e-7
);
assert_approx_eq_cmplx!(
f64,
gamma_nsm(&mut c, NF),
cmplx!(0.000594225, 0.),
epsilon = 6e-7
);

let mut c = Cache::new(cmplx![2., 0.]);
let gS2 = gamma_singlet(&mut c, NF);
// gluon momentum conservation
assert_approx_eq!(f64, (gS2[0][1] + gS2[1][1]).re, -0.00388726, epsilon = 2e-6);
assert_approx_eq_cmplx!(
f64,
(gS2[0][1] + gS2[1][1]),
cmplx!(-0.00388726, 0.),
epsilon = 2e-6
);
// quark momentum conservation
assert_approx_eq!(f64, (gS2[0][0] + gS2[1][0]).re, 0.00169375, epsilon = 2e-6);
assert_approx_eq_cmplx!(
f64,
(gS2[0][0] + gS2[1][0]),
cmplx!(0.00169375, 0.),
epsilon = 2e-6
);
}

#[test]
fn N2() {
let mut c = Cache::new(cmplx![2., 0.]);
assert_approx_eq!(f64, gamma_nsv(&mut c, NF).re, 188.325593, epsilon = 3e-7);
assert_approx_eq_cmplx!(
f64,
gamma_nsv(&mut c, NF),
cmplx!(188.325593, 0.),
epsilon = 3e-7
);
}
}
14 changes: 13 additions & 1 deletion crates/ekore/src/bib.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//! List of References (autogenerated on 2024-07-18T17:42:47.650964).
//! List of References (autogenerated on 2024-09-10T11:22:16.645053).

#[allow(non_snake_case)]
/// The Three loop splitting functions in QCD: The Nonsinglet case
Expand Down Expand Up @@ -95,3 +95,15 @@ pub fn Ball2015tna() {}
///
/// DOI: [10.1007/BF01245820](https:dx.doi.org/10.1007/BF01245820)
pub fn Buza1996wv() {}

#[allow(non_snake_case)]
/// The Gluonic Operator Matrix Elements at O(alpha(s)**2) for DIS Heavy Flavor Production
///
/// Bierenbaum, Isabella and Blumlein, Johannes and Klein, Sebastian
///
/// Published in: Phys. Lett. B 672 (2009), 401--406
///
/// e-Print: [0901.0669](https://arxiv.org/abs/0901.0669)
///
/// DOI: [10.1016/j.physletb.2009.01.057](https:dx.doi.org/10.1016/j.physletb.2009.01.057)
pub fn Bierenbaum2009zt() {}
Loading

0 comments on commit fc01791

Please sign in to comment.