NNPDF / pineappl

PineAPPL is not an extension of APPLgrid
https://nnpdf.github.io/pineappl/
GNU General Public License v3.0
12 stars 3 forks source link

Introduce more general convolution types #287

Closed t7phy closed 1 month ago

t7phy commented 1 month ago

This PR aims to make it possible to optimize grids that perform a double convolution between unpolarized and polarized PDFs or PDFs and FFs by not only checking the PID of the convolution particle but also the convolution type. The grids will require the following new keys:

convolution_particle_1: <PID>
convolution_type_1: PDF/FF/polPDF/polFF
convolution_particle_2: <PID>
convolution_type_2: PDF/FF/polPDF/polFF
cschwan commented 1 month ago

Great @t7phy, thank you very much for this. I will review it as soon as possible!

cschwan commented 1 month ago

I thought about this over the weekend and I think we should refactor this:

  1. Introduce a new enum:
    #[derive(Eq, PartialEq)]
    enum Convolution {
       UnpolPdf(i32),
       PolPdf(i32),
       UnpolFf(i32),
       // we can add more types as they are needed
    }
  2. Write the method:
    impl Grid {
       pub fn convolutions(&self) -> Vec<Convolution> {
            todo!()
       }
    }
  3. Use the method from 2) in symmetrize_channels.
t7phy commented 1 month ago

what is the 'convolutions' function supposed to do actually?

cschwan commented 1 month ago

what is the 'convolutions' function supposed to do actually?

It should return a Vec with the convolution types for the grid, so for a proton-proton grid we'll return vec![UnpolPdf(2212), UnpolPdf(2212)].

cschwan commented 1 month ago

@t7phy I simplified the implementation a bit in commit cc7fd091b01e355b606cf0d16233ac9a45a3333f. What's missing is the following: