Skip to content

Commit

Permalink
Add rusty 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 a124e22 commit e054c2a
Show file tree
Hide file tree
Showing 3 changed files with 138 additions and 0 deletions.
3 changes: 3 additions & 0 deletions crates/ekore/src/anomalous_dimensions/polarized.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
//! The polarized anomalous dimensions for space-like kinematics.

pub mod spacelike;
57 changes: 57 additions & 0 deletions crates/ekore/src/anomalous_dimensions/polarized/spacelike.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
//! The polarized, space-like anomalous dimensions at various couplings power.

use crate::constants::{PID_NSM, PID_NSP, PID_NSV};
use crate::harmonics::cache::Cache;
use num::complex::Complex;
use num::Zero;
pub mod as1;
// pub mod as2;
// pub mod as3;

/// Compute the tower of the non-singlet anomalous dimensions.
pub fn gamma_ns_qcd(order_qcd: usize, mode: u16, c: &mut Cache, nf: u8) -> Vec<Complex<f64>> {
let mut gamma_ns = vec![Complex::<f64>::zero(); order_qcd];
gamma_ns[0] = as1::gamma_ns(c, nf);
// // NLO and beyond
// if order_qcd >= 2 {
// let gamma_ns_1 = match mode {
// PID_NSP => as2::gamma_nsp(c, nf),
// // To fill the full valence vector in NNLO we need to add gamma_ns^1 explicitly here
// PID_NSM | PID_NSV => as2::gamma_nsm(c, nf),
// _ => panic!("Unkown non-singlet sector element"),
// };
// gamma_ns[1] = gamma_ns_1
// }
// // NNLO and beyond
// if order_qcd >= 3 {
// let gamma_ns_2 = match mode {
// PID_NSP => as3::gamma_nsp(c, nf),
// PID_NSM => as3::gamma_nsm(c, nf),
// PID_NSV => as3::gamma_nsv(c, nf),
// _ => panic!("Unkown non-singlet sector element"),
// };
// gamma_ns[2] = gamma_ns_2
// }
gamma_ns
}

/// Compute the tower of the singlet anomalous dimension matrices.
pub fn gamma_singlet_qcd(order_qcd: usize, c: &mut Cache, nf: u8) -> Vec<[[Complex<f64>; 2]; 2]> {
let mut gamma_S = vec![
[
[Complex::<f64>::zero(), Complex::<f64>::zero()],
[Complex::<f64>::zero(), Complex::<f64>::zero()]
];
order_qcd
];
gamma_S[0] = as1::gamma_singlet(c, nf);
// // NLO and beyond
// if order_qcd >= 2 {
// gamma_S[1] = as2::gamma_singlet(c, nf);
// }
// // NNLO and beyond
// if order_qcd >= 3 {
// gamma_S[2] = as3::gamma_singlet(c, nf);
// }
gamma_S
}
78 changes: 78 additions & 0 deletions crates/ekore/src/anomalous_dimensions/polarized/spacelike/as1.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
//! |LO| |QCD|.

use num::complex::Complex;

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

/// 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> {
let N = c.n();
let gamma = -(N - 1) / N / (N + 1);
2.0 * TR * 2.0 * nf * 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);
2.0 * CF * gamma
}

/// Compute the gluon-gluon anomalous dimension.
///
/// Implements Eq. (A.1) of [\[Gluck:1995yr\]][crate::bib::Gluck1995yr].
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;
}

/// Compute the singlet anomalous dimension matrix.
pub fn gamma_singlet(c: &mut Cache, nf: u8) -> [[Complex<f64>; 2]; 2] {
let gamma_qq = gamma_ns(c, nf);
[
[gamma_qq, gamma_qg(c, nf)],
[gamma_gq(c, nf), gamma_gg(c, nf)],
]
}

#[cfg(test)]
mod tests {
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 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_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_cmplx!(f64, me, Complex::zero(), epsilon = 1e-12);
}

#[test]
fn qg_helicity_conservation() {
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);
}
}

0 comments on commit e054c2a

Please sign in to comment.