-
Notifications
You must be signed in to change notification settings - Fork 4
Rustify QED #416
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Rustify QED #416
Changes from 11 commits
Commits
Show all changes
72 commits
Select commit
Hold shift + click to select a range
1762846
start implementation of aem1
tgiani 61220f8
complete aem1.py
tgiani a40908b
unit tests
tgiani f0edfae
add struct for charge combinations
tgiani a8d72c0
some work on gamma_ns_qed
tgiani e8a3a8b
start as1aem1.rs
tgiani 136dbe8
gamma_qph as1aem1
tgiani ce11227
some work on as1aem1
tgiani 659fe31
addingv recursive harmonics to cache
tgiani 4007f0d
S1p2 and G3p2. Check that this is correct
tgiani 7c160f1
gamma_nsp
tgiani 37a65e8
rewrite ChargeCombination struct
tgiani fc5de81
missing entries in as1aem1
tgiani 2a911b1
adding tests
tgiani bad124a
some work on spacelike.rs and recasting from list to vec
tgiani d50e9c7
valence qed
tgiani b0f6722
some unit tests
tgiani e4c621b
use Vec<> only when dimension is not known, else use normal list
tgiani 81ece22
fix notation row/columns
tgiani 0def938
add unravel functions for qed case. To be checked
tgiani 9b58455
modifying rust_quad_ker_qcd, PyQuadKerQCDT and QuadQCDargs to include…
tgiani 588496a
add qed valence option in rust_quad_ker_qcd
tgiani 3452243
remove useless flag is_qed
tgiani 9335b97
extend QuadQCDargs to include arguments for c_quad_ker_qed
tgiani 3390aca
setting up input vectors for cb_quad_ker_qed
tgiani 6a3af19
cb_quad_ker_qed
tgiani f0a727d
fix modes for singlet QED and use == in if statements
tgiani 398c89a
small fix
tgiani ea44cee
cargo fmt
tgiani 5721326
forgot pre-commit
tgiani 83af836
updating patch file
tgiani 1af5cbf
Update crates/ekore/src/constants.rs
tgiani 80fe896
Merge branch 'master' into aem1
felixhekhorn 5ce8eb3
rust: Iterate ekore/constants
felixhekhorn 88d7ed9
rust: Fix clippy warning
felixhekhorn 9797190
rust: Add missing ref for polarized ad
felixhekhorn 5013a8f
rust: Iterate aem1
felixhekhorn 064c31c
rust: Iterate as1aem1
felixhekhorn 1dc1ffd
rust: Init ad/u/s/aem2
felixhekhorn b7b314f
rust: Expand ad/u/s/aem2
felixhekhorn 180cc7e
rust: Complete ad/u/s/aem2
felixhekhorn 7bed428
rust: Start generalizing ad/u/spacelike
felixhekhorn 680dae8
rust: Use QCD ads also in QED
felixhekhorn 5046f50
rust: Iterate eko/lib.rs
felixhekhorn d56b122
Fix LO FFNS apfel bench
felixhekhorn f3f027a
rust: Fix range error
felixhekhorn 6fea38a
Fix QED FFNS apfel bench
felixhekhorn fa88d4f
rust: Swap dimensions for ad
felixhekhorn d53ca75
Use Lsv for SV in QED
felixhekhorn 8dc3452
Don't pass L back from Rust to Python
felixhekhorn 714efa9
rust: Fix typo in aem1/v
felixhekhorn b598f4d
Fix size of transferred arrays
felixhekhorn 4633ca9
rust: Add minor fixes to ad/u/s/{as1}aem1
felixhekhorn ec743ca
py: Make repetition in ad/u/s/aem2 more explicit
felixhekhorn 1a77d68
Add void external
felixhekhorn efe3c93
Fix bug in benchmark runner
felixhekhorn ab59da8
fix bug in qed anomalous dimensions
tgiani ffc6f70
same bug in ns sector
tgiani 3a1bf31
rust: Remove G3p2 from cache
felixhekhorn 044432b
rust: Drop recursive definitions from cache
felixhekhorn 4507b75
Avoid setting more couplings in OME
felixhekhorn 0a4717e
unit tests for rust qed anomalous dimensions
tgiani 938378a
rust: Add more test macros for complex
felixhekhorn 79d5437
ekomark: Fix void+QED
felixhekhorn bf5cb42
rust: Simplify test_gamma_singlet_qed
felixhekhorn e8126f4
Explicitly hide asX in cb_quad_ker_qed
felixhekhorn 01985ec
rust: Improve ad/u/s unit tests
felixhekhorn da13119
Initialize pointers with max size
felixhekhorn 2ef7a29
Add max_areas_shape to interpolation
felixhekhorn e956e0a
Use max_areas_shape for pointer init
felixhekhorn 74fd522
Call max_areas_shape for pointer init
felixhekhorn 2bdad40
Spell nf in apfel VFNS bench
felixhekhorn File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
130 changes: 130 additions & 0 deletions
130
crates/ekore/src/anomalous_dimensions/unpolarized/spacelike/aem1.rs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,130 @@ | ||
| //! |LO| |QED|. | ||
| use num::complex::Complex; | ||
| use num::Zero; | ||
|
|
||
| use crate::constants::{charge_combinations, ed2, eu2, uplike_flavors, CF, NC, TR}; | ||
| use crate::harmonics::cache::Cache; | ||
|
|
||
| use crate::anomalous_dimensions::unpolarized::spacelike::as1; | ||
|
|
||
| /// Compute the leading-order photon-quark anomalous dimension. | ||
| /// | ||
| /// Implements Eq. (2.5) of | ||
| pub fn gamma_phq(c: &mut Cache, nf: u8) -> Complex<f64> { | ||
| as1::gamma_gq(c, nf) / CF | ||
| } | ||
|
|
||
| /// Compute the leading-order quark-photon anomalous dimension. | ||
| /// | ||
| /// Implements Eq. (2.5) of | ||
| pub fn gamma_qph(c: &mut Cache, nf: u8) -> Complex<f64> { | ||
| as1::gamma_qg(c, nf) / TR * (NC as f64) | ||
| } | ||
|
|
||
| /// Compute the leading-order photon-photon anomalous dimension. | ||
| /// | ||
| /// Implements Eq. (2.5) of | ||
| pub fn gamma_phph(_c: &mut Cache, nf: u8) -> Complex<f64> { | ||
| let nu = uplike_flavors(nf); | ||
| let nd = nf - nu; | ||
| (4.0 / 3.0 * (NC as f64) * ((nu as f64) * eu2 + (nd as f64) * ed2)).into() | ||
| } | ||
|
|
||
| /// Compute the leading-order non-singlet QED anomalous dimension | ||
| /// | ||
| /// Implements Eq. (2.5) of | ||
| pub fn gamma_ns(c: &mut Cache, nf: u8) -> Complex<f64> { | ||
| as1::gamma_ns(c, nf) / CF | ||
| } | ||
|
|
||
| /// 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] { | ||
| let cc = charge_combinations(nf); | ||
|
|
||
| let gamma_ph_q = gamma_phq(c, nf); | ||
| let gamma_q_ph = gamma_qph(c, nf); | ||
| let gamma_nonsinglet = gamma_ns(c, nf); | ||
|
|
||
| [ | ||
| [ | ||
| Complex::<f64>::zero(), | ||
| Complex::<f64>::zero(), | ||
| Complex::<f64>::zero(), | ||
| Complex::<f64>::zero(), | ||
| ], | ||
| [ | ||
| Complex::<f64>::zero(), | ||
| gamma_phph(c, nf), | ||
| cc.e2avg * gamma_ph_q, | ||
| cc.vue2m * gamma_ph_q, | ||
| ], | ||
| [ | ||
| Complex::<f64>::zero(), | ||
| cc.e2avg * gamma_q_ph, | ||
| cc.e2avg * gamma_nonsinglet, | ||
| cc.vue2m * gamma_nonsinglet, | ||
| ], | ||
| [ | ||
| Complex::<f64>::zero(), | ||
| cc.vde2m * gamma_q_ph, | ||
| cc.vde2m * gamma_nonsinglet, | ||
| cc.e2delta * gamma_nonsinglet, | ||
| ], | ||
| ] | ||
| } | ||
|
|
||
| /// Compute the leading-order valence QED anomalous dimension matrix | ||
| /// | ||
| /// Implements Eq. (2.5) of | ||
| pub fn gamma_valence(c: &mut Cache, nf: u8) -> [[Complex<f64>; 2]; 2] { | ||
| let cc = charge_combinations(nf); | ||
|
|
||
| [ | ||
| [cc.e2avg * gamma_ns(c, nf), cc.vue2m * gamma_ns(c, nf)], | ||
| [cc.vde2m * gamma_ns(c, nf), cc.e2delta * gamma_ns(c, nf)], | ||
| ] | ||
| } | ||
|
|
||
| #[cfg(test)] | ||
| mod tests { | ||
| use super::*; | ||
| 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_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_phq(&mut c, NF); | ||
| assert_approx_eq_cmplx!(f64, me, Complex::zero(), epsilon = 1e-12); | ||
| } | ||
|
|
||
| #[test] | ||
| fn photon_momentum_conservation() { | ||
| const N: Complex<f64> = 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 | ||
| ); | ||
| } | ||
| } | ||
| } |
142 changes: 142 additions & 0 deletions
142
crates/ekore/src/anomalous_dimensions/unpolarized/spacelike/as1aem1.rs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,142 @@ | ||
| //! The $O(a_s^1a_{em}^1)$ Altarelli-Parisi splitting kernels. | ||
| use crate::cmplx; | ||
| use num::complex::Complex; | ||
|
|
||
| use crate::constants::{ed2, eu2, uplike_flavors, CA, CF, NC, TR, ZETA2, ZETA3}; | ||
| use crate::harmonics::cache::{Cache, K}; | ||
|
|
||
| /// Compute the $O(a_s^1a_{em}^1)$ photon-quark anomalous dimension. | ||
| /// | ||
| /// Implements Eq. (36) of | ||
| pub fn gamma_phq(c: &mut Cache, _nf: u8) -> Complex<f64> { | ||
| let N = c.n(); | ||
| let S1 = c.get(K::S1); | ||
| let S2 = c.get(K::S2); | ||
|
|
||
| #[rustfmt::skip] | ||
| let tmp_const = | ||
| 2.0 | ||
| * ( | ||
| -4.0 | ||
| - 12.0 * N | ||
| - N.powu(2) | ||
| + 28.0 * N.powu(3) | ||
| + 43.0 * N.powu(4) | ||
| + 30.0 * N.powu(5) | ||
| + 12.0 * N.powu(6) | ||
| ) / ((-1.0 + N) * N.powu(3) * (1.0 + N).powu(3)); | ||
|
|
||
| #[rustfmt::skip] | ||
| let tmp_S1 = -4.0 | ||
| * (10.0 + 27.0 * N + 25.0 * N.powu(2) + 13.0 * N.powu(3) + 5.0 * N.powu(4)) | ||
| / ((-1.0 + N) * N * (1.0 + N).powu(3)); | ||
|
|
||
| let tmp_S12 = 4.0 * (2.0 + N + N.powu(2)) / ((-1.0 + N) * N * (1.0 + N)); | ||
| let tmp_S2 = 4.0 * (2.0 + N + N.powu(2)) / ((-1.0 + N) * N * (1.0 + N)); | ||
|
|
||
| CF * (tmp_const + tmp_S1 * S1 + tmp_S12 * S1.powu(2) + tmp_S2 * S2) | ||
| } | ||
|
|
||
| /// Compute the $O(a_s^1a_{em}^1)$ quark-photon anomalous dimension. | ||
| /// | ||
| /// Implements Eq. (26) of | ||
| pub fn gamma_qph(c: &mut Cache, nf: u8) -> Complex<f64> { | ||
| let N = c.n(); | ||
| let S1 = c.get(K::S1); | ||
| let S2 = c.get(K::S2); | ||
|
|
||
| #[rustfmt::skip] | ||
| let tmp_const = -2.0 | ||
| * (4.0 | ||
| + 8.0 * N | ||
| + 25.0 * N.powu(2) | ||
| + 51.0 * N.powu(3) | ||
| + 36.0 * N.powu(4) | ||
| + 15.0 * N.powu(5) | ||
| + 5.0 * N.powu(6)) | ||
| / (N.powu(3) * (1.0 + N).powu(3) * (2.0 + N)); | ||
|
|
||
| let tmp_S1 = 8.0 / N.powu(2); | ||
| let tmp_S12 = -4.0 * (2.0 + N + N.powu(2)) / (N * (1.0 + N) * (2.0 + N)); | ||
| let tmp_S2 = 4.0 * (2.0 + N + N.powu(2)) / (N * (1.0 + N) * (2.0 + N)); | ||
|
|
||
| 2.0 * (nf as f64) * CA * CF * (tmp_const + tmp_S1 * S1 + tmp_S12 * S1.powu(2) + tmp_S2 * S2) | ||
| } | ||
|
|
||
| /// Compute the $O(a_s^1a_{em}^1)$ gluon-photon anomalous dimension. | ||
| /// | ||
| /// Implements Eq. (27) of | ||
| pub fn gamma_gph(c: &mut Cache, _nf: u8) -> Complex<f64> { | ||
| let N = c.n(); | ||
| CF * CA | ||
| * (8.0 * (-4.0 + N * (-4.0 + N * (-5.0 + N * (-10.0 + N + 2.0 * N.powu(2) * (2.0 + N)))))) | ||
| / (N.powu(3) * (1.0 + N).powu(3) * (-2.0 + N + N.powu(2))) | ||
| } | ||
|
|
||
| /// Compute the $O(a_s^1a_{em}^1)$ photon-gluon anomalous dimension. | ||
| /// | ||
| /// Implements Eq. (30) of | ||
| pub fn gamma_phg(c: &mut Cache, nf: u8) -> Complex<f64> { | ||
| TR / CF / CA * (NC as f64) * gamma_gph(c, nf) | ||
| } | ||
|
|
||
| /// Compute the $O(a_s^1a_{em}^1)$ quark-gluon singlet anomalous dimension. | ||
| /// | ||
| /// Implements Eq. (29) of | ||
| pub fn gamma_qg(c: &mut Cache, nf: u8) -> Complex<f64> { | ||
| TR / CF / CA * (NC as f64) * gamma_qph(c, nf) | ||
| } | ||
|
|
||
| /// Compute the $O(a_s^1a_{em}^1)$ gluon-quark singlet anomalous dimension. | ||
| /// | ||
| /// Implements Eq. (35) of | ||
| pub fn gamma_gq(c: &mut Cache, nf: u8) -> Complex<f64> { | ||
| gamma_phq(c, nf) | ||
| } | ||
|
|
||
| /// Compute the $O(a_s^1a_{em}^1)$ photon-photon singlet anomalous dimension. | ||
| /// | ||
| /// Implements Eq. (28) of | ||
| pub fn gamma_phph(_c: &mut Cache, nf: u8) -> Complex<f64> { | ||
| let nu = uplike_flavors(nf); | ||
| let nd = nf - nu; | ||
| cmplx!(4.0 * CF * CA * ((nu as f64) * eu2 + (nd as f64) * ed2), 0.) | ||
| } | ||
|
|
||
| /// Compute the $O(a_s^1a_{em}^1)$ gluon-gluon singlet anomalous dimension. | ||
| /// | ||
| /// Implements Eq. (31) of | ||
| pub fn gamma_gg(_c: &mut Cache, _nf: u8) -> Complex<f64> { | ||
| cmplx!(4.0 * TR * (NC as f64), 0.) | ||
| } | ||
|
|
||
| /// Compute the $O(a_s^1a_{em}^1)$ singlet-like non singlet anomalous dimension. | ||
| /// | ||
| /// Implements Eqs. (33-34) of | ||
| pub fn gamma_nsp(c: &mut Cache, _nf: u8) -> Complex<f64> { | ||
| let N = c.n(); | ||
| let S1 = c.get(K::S1); | ||
| let S2 = c.get(K::S2); | ||
| let S3 = c.get(K::S3); | ||
| let S1h = c.get(K::S1h); | ||
| let S2h = c.get(K::S2h); | ||
| let S3h = c.get(K::S3h); | ||
| let S1p1h = c.get(K::S1ph); | ||
| let S2p1h = c.get(K::S2ph); | ||
| let S3p1h = c.get(K::S3ph); | ||
| let g3N = c.get(K::G3); | ||
| let g3Np2 = c.get(K::G3p2); | ||
|
|
||
| #[rustfmt::skip] | ||
| let result = 32.0 * ZETA2 * S1h - 32.0 * ZETA2 * S1p1h | ||
| + 8.0 / (N + N.powu(2)) * S2h | ||
| - 4.0 * S3h + (24.0 + 16.0 / (N + N.powu(2))) * S2 | ||
| - 32.0 * S3 - 8.0 / (N + N.powu(2)) * S2p1h | ||
| + S1 * (16.0 * (3.0 / N.powu(2) - 3.0 / (1.0 + N).powu(2) + 2.0 * ZETA2) - 16.0 * S2h | ||
| - 32.0 * S2 + 16.0 * S2p1h ) | ||
| + (-8.0 + N * (-32.0 + N * ( -8.0 - 3.0 * N * (3.0 + N) * (3.0 + N.powu(2)) - 48.0 * (1.0 + N).powu(2) * ZETA2))) | ||
| / (N.powu(3) * (1.0 + N).powu(3)) | ||
| + 32.0 * (g3N + g3Np2) + 4.0 * S3p1h - 16.0 * ZETA3; | ||
|
|
||
| CF * result | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.