PartonDensity

class madspace.PartonDensity(*args, **kwargs)

Bases: FunctionGenerator

Parton-density interpolation as a compute-graph function.

Interpolates a PdfGrid at the sampled \((x, q)\), returning \(x f(x, q)\) for the requested flavours; the numerical output agrees with LHAPDF to double precision [1] (Sec. 3.2.3 of [2]). With a CustomPdf, the user-supplied library is called once per requested flavour instead.

batch is the leading batch dimension.

Arguments

  • x – float, shape (batch,) – momentum fraction.

  • q – float, shape (batch,) – factorization scale.

  • flavor_index – int, shape (batch,) – which flavour to return. Present only when dynamic_pid is true.

Returns

  • pdf – float, shape (batch,) when dynamic_pid is true, otherwise (batch, len(pids)) – the interpolated x f(x, q).

References

Overloaded function.

  1. __init__(self: madspace._madspace_py.PartonDensity, grid: madspace._madspace_py.PdfGrid, pids: collections.abc.Sequence[typing.SupportsInt], dynamic_pid: bool = False, prefix: str = ‘’) -> None

Parameters:
  • grid – The parton-density grid to interpolate.

  • pids – PDG ids of the flavours to return.

  • dynamic_pid – If true, a single flavour selected per event by the flavor_index argument is returned.

  • prefix – Prefix for the grid global names.

  1. __init__(self: madspace._madspace_py.PartonDensity, custom_pdf: madspace._madspace_py.CustomPdf, pids: collections.abc.Sequence[typing.SupportsInt], beam_index: typing.SupportsInt, dynamic_pid: bool = False) -> None

Parameters:
  • custom_pdf – The user-supplied parton density.

  • pids – PDG ids of the flavours to return.

  • beam_index – Index of the beam (0 or 1), passed to the library.

  • dynamic_pid – If true, a single flavour selected per event by the flavor_index argument is returned.