Skip to content

Commit

Permalink
some work on spacelike.rs and recasting from list to vec
Browse files Browse the repository at this point in the history
  • Loading branch information
tgiani committed Nov 20, 2024
1 parent 2a911b1 commit bad124a
Show file tree
Hide file tree
Showing 4 changed files with 75 additions and 4 deletions.
39 changes: 39 additions & 0 deletions crates/ekore/src/anomalous_dimensions/unpolarized/spacelike.rs
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ pub fn gamma_ns_qed(
let mut gamma_ns = vec![row; order_qed + 1];
gamma_ns[1][0] = as1::gamma_ns(c, nf);
gamma_ns[0][1] = choose_ns_as_aem1(mode, c, nf);
gamma_ns[1][1] = choose_ns_as_as1aem1(mode, c, nf);
gamma_ns
}

Expand All @@ -82,3 +83,41 @@ pub fn choose_ns_as_aem1(mode: u16, c: &mut Cache, nf: u8) -> Complex<f64> {
_ => panic!("Unkown non-singlet sector element"),
}
}

pub fn choose_ns_as_as1aem1(mode: u16, c: &mut Cache, nf: u8) -> Complex<f64> {
match mode {
PID_NSP_EU2 => eu2 * as1aem1::gamma_nsp(c, nf),
PID_NSP_ED2 => ed2 * as1aem1::gamma_nsp(c, nf),
PID_NSM_EU2 => eu2 * as1aem1::gamma_nsm(c, nf),
PID_NSM_ED2 => ed2 * as1aem1::gamma_nsm(c, nf),
_ => panic!("Unkown non-singlet sector element"),
}
}

pub fn gamma_singlet_qed(
order_qcd: usize,
order_qed: usize,
mode: u16,
c: &mut Cache,
nf: u8,
) -> Vec<Vec<Vec<[Complex<f64>; 4]>>> {
let mut row = vec![
vec![
[
Complex::<f64>::zero(),
Complex::<f64>::zero(),
Complex::<f64>::zero(),
Complex::<f64>::zero()
];
4
];
order_qcd + 1
];

let mut gamma_s = vec![row; order_qed + 1];

gamma_s[1][0] = as1::gamma_singlet_qed(c, nf);
gamma_s[0][1] = aem1::gamma_singlet(c, nf);
gamma_s[1][1] = as1aem1::gamma_singlet(c, nf);
gamma_s
}
Original file line number Diff line number Diff line change
Expand Up @@ -40,14 +40,14 @@ pub fn gamma_ns(c: &mut Cache, nf: u8) -> Complex<f64> {
/// Compute the leading-order singlet QED anomalous dimension matrix
///
/// Implements Eq. (2.5) of
pub fn gamma_singlet(c: &mut Cache, nf: u8) -> [[Complex<f64>; 4]; 4] {
pub fn gamma_singlet(c: &mut Cache, nf: u8) -> Vec<[Complex<f64>; 4]> {
let cc = ChargeCombinations { nf };

let gamma_ph_q = gamma_phq(c, nf);
let gamma_q_ph = gamma_qph(c, nf);
let gamma_nonsinglet = gamma_ns(c, nf);

[
vec![
[
Complex::<f64>::zero(),
Complex::<f64>::zero(),
Expand Down
32 changes: 32 additions & 0 deletions crates/ekore/src/anomalous_dimensions/unpolarized/spacelike/as1.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
//! |LO| |QCD|.
use num::complex::Complex;
use num::Zero;

use crate::constants::{CA, CF, TR};
use crate::harmonics::cache::{Cache, K};
Expand Down Expand Up @@ -52,6 +53,37 @@ pub fn gamma_singlet(c: &mut Cache, nf: u8) -> [[Complex<f64>; 2]; 2] {
]
}

/// Compute the leading-order singlet anomalous dimension matrix
/// for the unified evolution basis.
pub fn gamma_singlet_qed(c: &mut Cache, nf: u8) -> Vec<[Complex<f64>; 4]> {
vec![
[
gamma_gg(c, nf),
Complex::<f64>::zero(),
gamma_gq(c, nf),
Complex::<f64>::zero(),
],
[
Complex::<f64>::zero(),
Complex::<f64>::zero(),
Complex::<f64>::zero(),
Complex::<f64>::zero(),
],
[
gamma_qg(c, nf),
Complex::<f64>::zero(),
gamma_ns(c, nf),
Complex::<f64>::zero(),
],
[
Complex::<f64>::zero(),
Complex::<f64>::zero(),
Complex::<f64>::zero(),
gamma_ns(c, nf),
],
]
}

#[cfg(test)]
mod tests {
use super::*;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -195,15 +195,15 @@ pub fn gamma_nsm(c: &mut Cache, _nf: u8) -> Complex<f64> {
}

/// Compute the $O(a_s^1a_{em}^1)$ singlet sector.
pub fn gamma_singlet(c: &mut Cache, nf: u8) -> [[Complex<f64>; 4]; 4] {
pub fn gamma_singlet(c: &mut Cache, nf: u8) -> Vec<[Complex<f64>; 4]> {
let cc = ChargeCombinations { nf };
// let e2avg = cc.e2avg();
// let vue2m = cc.vue2m();
// let vde2m = cc.vde2m();
// let e2delta = cc.e2delta();
let e2_tot = nf as f64 * cc.e2avg();

[
vec![
[
e2_tot * gamma_gg(c, nf),
e2_tot * gamma_gph(c, nf),
Expand Down

0 comments on commit bad124a

Please sign in to comment.