You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Add NeoPDF interface to handlle non-perturbative functions #369
As it currently stands, PineAPPL is flexible and generic enough to handle generic processes in QCD as long as they rely on the factorization of the short-distance and non-perturbative functions. These include processes in Single Parton Scatterings [SPS] (collinear processes involving (un)polarized and/or nuclear PDFs, TMD processes involving TMDPDFs, and many more involving GPDs and GTMDs) but also Double Parton Scatterings [DPS] and the generalization of thereof. In this sense, PineAPPL can really be a universal tool to represent generic short-distance functions in QCD.
In order to fully achieve this, however, PineAPPL needs to support convolutions with generic non-perturbative distributions. NeoPDF can already support generic distributions for SPS (that is PDFs, TMDs, GPDs, and GTMDs) and thus would be great to add an interface to it in PineAPPL (and perhaps strip away completely the LHAPDF-dependence). This will make things easier given that NeoPDF is also written in Rust.
@Radonirinaunimi This seems like a very great improvement and would definitely be helpful. However I think it would still be good to not strip away the LHAPDF dependence. LHAPDF is too widely used and it is probably not a good idea to remove already existing and working interfaces.
What we should probably do is to allow the usage of PineAPPL (specifically the CLI which automatically uses LHAPDF) even when LHAPDF is not in the system, by relying completely on NeoPDF.
What we should probably do is to allow the usage of PineAPPL (specifically the CLI which automatically uses LHAPDF) even when LHAPDF is not in the system, by relying completely on NeoPDF.
I guess in some sense this is what I mean. Practically, neopdf will replace the managed-lhapdf dependency, and from the user's point of view everything else will stay the same (ie, being able to load the usual LHAPDF files). The difference is only that instead of the actual LHAPDF calls, NeoPDF would be the one that provides the interpolation (which when used on standard LHAPDF sets provide the exact same results, beyond numerical precision). And for this indeed, then installation of LHAPDF will no longer be required on the system.
This is a great idea, which I fully support. I'm not quite sure to what extend we can completely replace LHAPDF, at least fastNLO (which we use for import) relies on it. I suppose for testing and later for testing the NeoPDF against LHAPDF and vice versa I would be nice to switch the libraries at run-time.
A good start would be to refactor all symbols used from lhapdf:: to the helpers module in pineappl_cli. There aren't too many:
./src/export.rs:use lhapdf::Pdf;
./src/import.rs:use lhapdf::Pdf;
./src/import.rs: assert_eq!(conv_funs.lhapdf_names.len(), 1);
./src/import.rs: let mut file = ffi::make_fastnlo_lhapdf_with_name_file_set(
./src/import.rs: &conv_funs.lhapdf_names[0],
./src/import.rs: let mut reader = ffi::downcast_lhapdf_to_reader_mut(file.as_mut().unwrap());
./src/import.rs: let mut reader = ffi::downcast_lhapdf_to_reader_mut(file.as_mut().unwrap());
./src/evolve.rs:use lhapdf::Pdf;
./src/import/fastnlo.rs: let file_as_reader = ffi::downcast_lhapdf_to_reader(file);
./src/import/fastnlo.rs: let file_as_table = ffi::downcast_lhapdf_to_table(file);
./src/import/applgrid.rs:use lhapdf::Pdf;
./src/lib.rs: pub lhapdf_banner: bool,
./src/export/applgrid.rs:use lhapdf::Pdf;
./src/pull.rs:use lhapdf::{Pdf, PdfSet};
./src/pull.rs: #[arg(default_value_t = lhapdf::CL_1_SIGMA, long)]
./src/main.rs: if !opts.configuration.lhapdf_banner {
./src/main.rs: lhapdf::set_verbosity(0);
./src/uncert.rs: #[arg(default_value_t = lhapdf::CL_1_SIGMA, long)]
./src/uncert.rs: cell!(c->format!("{}\n[{y_unit}] [%] [%]", self.conv_funs.lhapdf_names[index]))
./tests/read.rs: lhapdf = pdlabel ! PDF set
./tests/read.rs: 324900 = lhaid ! If pdlabel=lhapdf, this is the lhapdf number. Only
./tests/import.rs: use lhapdf::Pdf;
./tests/main.rs: --lhapdf-banner Allow LHAPDF to print banners
Then you could write functions that allow selecting the 'convolution function backend' (LHAPDF/NeoPDF) in helper.rs.
Activity
t7phy commentedon Jan 20, 2026
@Radonirinaunimi This seems like a very great improvement and would definitely be helpful. However I think it would still be good to not strip away the LHAPDF dependence. LHAPDF is too widely used and it is probably not a good idea to remove already existing and working interfaces.
What we should probably do is to allow the usage of PineAPPL (specifically the CLI which automatically uses LHAPDF) even when LHAPDF is not in the system, by relying completely on NeoPDF.
Radonirinaunimi commentedon Jan 20, 2026
I guess in some sense this is what I mean. Practically,
neopdfwill replace themanaged-lhapdfdependency, and from the user's point of view everything else will stay the same (ie, being able to load the usual LHAPDF files). The difference is only that instead of the actual LHAPDF calls, NeoPDF would be the one that provides the interpolation (which when used on standard LHAPDF sets provide the exact same results, beyond numerical precision). And for this indeed, then installation of LHAPDF will no longer be required on the system.cschwan commentedon Jan 21, 2026
This is a great idea, which I fully support. I'm not quite sure to what extend we can completely replace LHAPDF, at least fastNLO (which we use for
import) relies on it. I suppose for testing and later for testing the NeoPDF against LHAPDF and vice versa I would be nice to switch the libraries at run-time.A good start would be to refactor all symbols used from
lhapdf::to thehelpersmodule inpineappl_cli. There aren't too many:Then you could write functions that allow selecting the 'convolution function backend' (LHAPDF/NeoPDF) in
helper.rs.cschwan commentedon Jul 25, 2026
Since we've merged #370, I think this can be closed; what do you think, @Radonirinaunimi?
Radonirinaunimi commentedon Jul 28, 2026
Hi @cschwan, yes, this could indeed be merged.