evolven3fit package

Submodules

evolven3fit.cli module

evolven3fit.cli.cli_evolven3fit(configuration_folder, force, load, hessian)[source]

Evolves the fitted PDFs.

evolven3fit.eko_utils module

evolven3fit.eko_utils.build_opcard(op_card_dict, theory, x_grid, mu0, mugrid)[source]

Build the operator card. The user provided options should be given as part of op_card_dict

evolven3fit.eko_utils.construct_eko_cards(nnpdf_theory, q_fin, q_points, x_grid, op_card_dict: Optional[Dict[str, Any]] = None, theory_card_dict: Optional[Dict[str, Any]] = None, legacy40: bool = False)[source]

Return the theory and operator cards used to construct the eko. nnpdf_theory is a NNPDF theory card for which we are computing the operator card and eko q_fin is the final point of the q grid while q_points is the number of points of the grid. x_grid is the x grid to be used. op_card_dict and theory_card_dict are optional updates that can be provided respectively to the operator card and to the theory card.

evolven3fit.eko_utils.construct_eko_photon_cards(nnpdf_theory, q_fin, x_grid, q_gamma, op_card_dict: Optional[Dict[str, Any]] = None, theory_card_dict: Optional[Dict[str, Any]] = None)[source]

Return the theory and operator cards used to construct the eko_photon. nnpdf_theory is a NNPDF theory card for which we are computing the operator card and eko q_fin is the final point of the q grid while q_points is the number of points of the grid. x_grid is the x grid to be used. op_card_dict and theory_card_dict are optional updates that can be provided respectively to the operator card and to the theory card.

evolven3fit.eko_utils.load_theory(nnpdf_theory, theory_card_dict)[source]

loads and returns the theory dictionary and the thresholds

evolven3fit.evolve module

This module collects functions to evolve an arbitrary PDF from an initial scale to the scales define by the loaded EKO.

It also contains functions specialized for NNDPF / n3fit

class evolven3fit.evolve.ExportGrid(q20: float, xgrid: ndarray, pdfgrid: ndarray, labels: list[str] = None, pids: list[int] = None, replica: int = None, hessian: bool = False)[source]

Bases: object

Holds information about the PDF at a fixed scale.

q20: float

Value of Q2 at which the PDF is evaluated

xgrid: np.ndarray

The points in x at which the PDF is evaluated

pdfgrid: np.ndarray

A list of the x*PDF values for all flavours for every point in x shape (len(xgrid), len(labels))

pids: list[int]

A list of the flavours contained in each element of the pdfgrid, by PID.

labels: list[str]

A list of the flavours contained in each element of the pdfgrid, by label. Not necessary if pids is given.

replica: int

Index of the corresponding monte carlo replica or member

hessian: bool = False
labels: list[str] = None
pdfgrid: ndarray
property pdfvalues

Return the PDF, i.e., pdfgrid / xgrid, with a shape (flavours, xgrid)

pids: list[int] = None
q20: float
replica: int = None
xgrid: ndarray
evolven3fit.evolve.dump_evolved_replica(evolved_blocks, dump_folder, replica_num, hessian_fit=False)[source]
Dump the evolved replica given by evolved_block as

dump_folder / f”{dump_folder.stem}_{replica_num:04d}.dat”

Parameters
  • evolved_block (list(numpy.array)) – list of blocks of an evolved PDF

  • usr_path (pathlib.Path) – path of the fit folder

  • replica_num (int) – replica number

  • hessian_fit (bool) – wether the fit is hessian

evolven3fit.evolve.evolve_exportgrid(eko_path: Path, exportgrids: list[evolven3fit.evolve.ExportGrid])[source]

Takes the path to an EKO and a list of exportgrids, returns a tuple with an info file and the evolved exportgrid as a dictionary of the form:

{

(Q_1^2, nf1): (replica, flavours, x), (Q_2^2, nf1): (replica, flavours, x), … (Q_3^2, nf2): (replica, flavours, x),

}

with the output grouped by nf and sorted in ascending order by Q2

Parameters
  • eko_path (pathlib.Path) – Path to the evolution eko

  • exportgrids (list[ExportGrid]) – List of ExportGrid objects to be evolved

Returns

  • info_file (eko_box.info_file) – dict-like object with the info file information

  • evolved_replicas (dict) – a dictionary containing all evolved PDF. The format of the output is

    { (q2, flavour number): np.ndarray(replica, flavours, x) }

evolven3fit.evolve.evolve_exportgrids_into_lhapdf(eko_path: Path, exportgrids: list[evolven3fit.evolve.ExportGrid], output_files: list[pathlib.Path], info_file: Path, finalize: bool = False)[source]

Exportgrid evolution function.

This function takes the path to an eko.tar and a list of ExportGrid objects and generate the corresponding .dat LHAPDF files as given by the output_files list.

Parameters
  • eko_path (pathlib.Path) – Path to the evolution eko

  • exportgrids (list[ExportGrid]) – list of the PDF grids to evolve, the settings must match those of the EKO

  • output_files (list[pathlib.Path]) – list of .dat files where the evolved fit will be written, e.g., [“replica_0.dat”, “replica_1.dat”] the list must be of the same size as exportgrids

  • info_file (pathlib.Path) – path to the info file

  • finalize (bool) – If True, try to finalize the info file, otherwise keep placeholders to be filled at a later step

evolven3fit.evolve.evolve_fit(fit_folder, force, eko_path, hessian_fit=False)[source]

Evolves all the fitted replica in fit_folder/nnfit

Parameters
  • fit_folder (str or pathlib.Path) – path to the folder containing the fit

  • force (bool) – whether to force the evolution to be done again

  • eko_path (str or pathlib.Path) – path where the eko is stored (if None the eko will be recomputed)

  • hessian_fit (bool) – wether the fit is hessian

evolven3fit.q2grids module

Definition of default Q2 grids

This file includes:

  • Q2GRID_DEFAULT: default NNPDF Q2 grid for evolution (55 points, starts at Q=1GeV)

  • Q2GRID_NNPDF40: q2 grid used in the fits for the NNPDF4.0 release (49 points, starts at Q=1.65 GeV)

  • Q2GRID_Nf03: q2 grid used in the perturvative charm fits for the NNPDF4.0 release (48 points, starts at Q=1GeV)

evolven3fit.utils module

evolven3fit.utils.check_filter(config_folder)[source]

Check if config_folder contains a filter.yml file.

evolven3fit.utils.check_is_a_fit(config_folder)[source]

Check if config_folder is a fit folder, i.e. if it contains the filter.yml file and the nnfit folder.

evolven3fit.utils.check_nnfit_folder(config_folder)[source]

Check if config_folder contains a nnfit folder.

evolven3fit.utils.generate_q2grid(Q0, Qfin, Q_points, match_dict, nf0=None, legacy40=False)[source]

Generate the q2grid used in the final evolved pdfs or use the default grid if Qfin or Q_points is not provided.

match_dict contains the couples (mass : factor) where factor is the number to be multiplied to mass in order to obtain the relative matching scale.

evolven3fit.utils.get_theoryID_from_runcard(usr_path)[source]

Return the theoryID from the runcard

evolven3fit.utils.read_runcard(usr_path)[source]

Read the runcard and return the relevant information for evolven3fit

Module contents