Skip to content

Commit

Permalink
rust: Fix ad.p.s.as1
Browse files Browse the repository at this point in the history
  • Loading branch information
felixhekhorn committed Sep 21, 2024
1 parent e054c2a commit ae0f200
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 13 deletions.
1 change: 1 addition & 0 deletions crates/ekore/src/anomalous_dimensions.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
//! The anomalous dimensions for |DGLAP| evolution.

pub mod polarized;
pub mod unpolarized;
33 changes: 20 additions & 13 deletions crates/ekore/src/anomalous_dimensions/polarized/spacelike/as1.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,25 +2,32 @@

use num::complex::Complex;

use super::super::unpolarized::spacelike::as1::gamma_ns;
use super::super::super::unpolarized::spacelike::as1::gamma_ns as unpol;
use crate::constants::{CA, CF, TR};
use crate::harmonics::cache::{Cache, K};

/// Compute the non-singlet anomalous dimension.
///
/// Identical to the unpolarized counterpart.
pub fn gamma_ns(c: &mut Cache, nf: u8) -> Complex<f64> {
unpol(c, nf)
}

/// Compute the quark-gluon anomalous dimension.
///
/// Implements Eq. (A.1) of [\[Gluck:1995yr\]][crate::bib::Gluck1995yr].
pub fn gamma_qg(c: &mut Cache, _nf: u8) -> Complex<f64> {
pub fn gamma_qg(c: &mut Cache, nf: u8) -> Complex<f64> {
let N = c.n();
let gamma = -(N - 1) / N / (N + 1);
2.0 * TR * 2.0 * nf * gamma
let gamma = -(N - 1.) / N / (N + 1.);
2.0 * TR * 2.0 * (nf as f64) * gamma
}

/// Compute the gluon-quark anomalous dimension.
///
/// Implements Eq. (A.1) of [\[Gluck:1995yr\]][crate::bib::Gluck1995yr].
pub fn gamma_gq(c: &mut Cache, _nf: u8) -> Complex<f64> {
let N = c.n();
let gamma = -(N + 2) / N / (N + 1);
let gamma = -(N + 2.) / N / (N + 1.);
2.0 * CF * gamma
}

Expand All @@ -30,8 +37,8 @@ pub fn gamma_gq(c: &mut Cache, _nf: u8) -> Complex<f64> {
pub fn gamma_gg(c: &mut Cache, nf: u8) -> Complex<f64> {
let N = c.n();
let S1 = c.get(K::S1);
let gamma = -S1 + 2 / N / (N + 1);
CA * (-4.0 * gamma - 11.0 / 3.0) + 4.0 / 3.0 * TR * nf;
let gamma = -S1 + 2. / N / (N + 1.);
CA * (-4.0 * gamma - 11.0 / 3.0) + 4.0 / 3.0 * TR * (nf as f64)
}

/// Compute the singlet anomalous dimension matrix.
Expand All @@ -54,25 +61,25 @@ mod tests {

#[test]
fn quark_momentum_conservation() {
const N: Complex<f64> = cmplx![2., 0.];
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_cmplx!(f64, me, Complex::zero(), epsilon = 1e-12);
assert_approx_eq_cmplx!(f64, me, cmplx!((4. * CF) / 3., 0.), epsilon = 1e-12);
}

#[test]
fn gluon_momentum_conservation() {
const N: Complex<f64> = cmplx![2., 0.];
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_cmplx!(f64, me, Complex::zero(), epsilon = 1e-12);
assert_approx_eq_cmplx!(f64, me, cmplx!(3. + (NF as f64) / 3., 0.), epsilon = 1e-12);
}

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

0 comments on commit ae0f200

Please sign in to comment.