From a40908b8a11b91a6a938868b81f159ff41a8844a Mon Sep 17 00:00:00 2001 From: tgiani Date: Mon, 21 Oct 2024 11:35:08 +0200 Subject: [PATCH] unit tests --- .../unpolarized/spacelike/aem1.rs | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/crates/ekore/src/anomalous_dimensions/unpolarized/spacelike/aem1.rs b/crates/ekore/src/anomalous_dimensions/unpolarized/spacelike/aem1.rs index 91427622c..68e30694c 100644 --- a/crates/ekore/src/anomalous_dimensions/unpolarized/spacelike/aem1.rs +++ b/crates/ekore/src/anomalous_dimensions/unpolarized/spacelike/aem1.rs @@ -118,4 +118,21 @@ mod tests { let me = gamma_ns(&mut c, NF) + gamma_phq(&mut c, NF); assert_approx_eq_cmplx!(f64, me, Complex::zero(), epsilon = 1e-12); } + + #[test] + fn photon_momentum_conservation() { + const N: Complex = cmplx!(2., 0.); + let mut c = Cache::new(N); + + for nf in 2..7 { + let nu = uplike_flavors(nf); + let nd = nf - nu; + assert_approx_eq_cmplx!( + f64, + eu2 * gamma_qph(&mut c, nu) + ed2 * gamma_qph(&mut c, nd) + gamma_phph(&mut c, nf), + cmplx!(0., 0.), + epsilon = 2e-6 + ); + } + } }