diff --git a/crates/eko/src/lib.rs b/crates/eko/src/lib.rs index a6c5fa9ae..f8c7cb1d8 100644 --- a/crates/eko/src/lib.rs +++ b/crates/eko/src/lib.rs @@ -14,6 +14,7 @@ struct RawCmplx { } /// Map tensors to c-ordered list +/// (res is a vector with dim order_qcd filled with DIMxDIM matrices) fn unravel(res: Vec<[[Complex; DIM]; DIM]>, order_qcd: usize) -> RawCmplx { let mut target = RawCmplx { re: Vec::::new(), @@ -30,6 +31,50 @@ fn unravel(res: Vec<[[Complex; DIM]; DIM]>, order_qcd: us target } +/// Map tensors to c-ordered list in the QED singlet and valence case +/// (res is a matrix with dim order_qcd x order_qed filled with DIMxDIM matrices) +fn unravel_qed_singlet( + res: Vec; DIM]; DIM]>>, + order_qcd: usize, + order_qed: usize, +) -> RawCmplx { + let mut target = RawCmplx { + re: Vec::::new(), + im: Vec::::new(), + }; + for obj_ in res.iter().take(order_qcd) { + for obj in obj_.iter().take(order_qed) { + for col in obj.iter().take(DIM) { + for el in col.iter().take(DIM) { + target.re.push(el.re); + target.im.push(el.im); + } + } + } + } + target +} + +/// Map tensors to c-ordered list in the QED singlet and valence case +/// (res is a matrix with dim order_qcd x order_qed filled with complex numbers) +fn unravel_qed_ns( + res: Vec>>, + order_qcd: usize, + order_qed: usize, +) -> RawCmplx { + let mut target = RawCmplx { + re: Vec::::new(), + im: Vec::::new(), + }; + for col in res.iter().take(order_qcd) { + for el in col.iter().take(order_qed) { + target.re.push(el.re); + target.im.push(el.im); + } + } + target +} + /// QCD intergration kernel inside quad. /// /// # Safety