PdfGrid

class madspace.PdfGrid(self: madspace._madspace_py.PdfGrid, file: str)

Bases: pybind11_object

A parton-density grid in the LHAPDF format, loaded from a file.

madspace carries a built-in PDF interpolator compatible with the LHAPDF grid format so it needs no external PDF library [1, 2]. This struct holds the loaded grid; PartonDensity does the interpolation. initialize_globals uploads the grid to a Context.

Load an LHAPDF-format grid.

Parameters:

file – Path to the grid file.

coefficients_shape(self: madspace._madspace_py.PdfGrid, batch_dim: bool = False) → list[int]

Shape of the coefficient tensor, optionally with a leading batch axis.

property grid_point_count

Total number of (x, q) grid points.

initialize_globals(self: madspace._madspace_py.PdfGrid, context: madspace._madspace_py.Context, prefix: str = '') → None

Upload the grid to context as compute-graph globals under prefix.

property logq2

log(q^2) grid knots.

logq2_shape(self: madspace._madspace_py.PdfGrid, batch_dim: bool = False) → list[int]

Shape of the log(q^2) tensor.

property logx

log(x) grid knots.

logx_shape(self: madspace._madspace_py.PdfGrid, batch_dim: bool = False) → list[int]

Shape of the log(x) tensor.

property pids

PDG ids of the flavours in the grid.

property q

Scale grid knots.

property q_count

Number of scale knots.

property region_sizes

Knot counts of the sub-grid regions.

property values

Grid values, indexed by flavour then by (x, q) knot.

property x

Momentum-fraction grid knots.