ekobox package

EKO user interface package.

Subpackages

Submodules

ekobox.apply module

Apply operator evolution to PDF set.

ekobox.apply.apply_pdf(eko: EKO, lhapdf_like, targetgrid=None, rotate_to_evolution_basis=False)[source]

Apply all available operators to the input PDFs.

Parameters:
  • output (eko.output.EKO) – eko output object containing all informations

  • lhapdf_like (object) – object that provides an xfxQ2 callable (as lhapdf and ekomark.toyLH.toyPDF do) (and thus is in flavor basis)

  • targetgrid (list) – if given, interpolates to the pdfs given at targetgrid (instead of xgrid)

  • rotate_to_evolution_basis (bool) – if True rotate to evoluton basis

Returns:

out_grid – output PDFs and their associated errors for the computed mu2grid

Return type:

dict

ekobox.apply.apply_pdf_flavor(eko: EKO, lhapdf_like, targetgrid=None, flavor_rotation=None, labels=None)[source]

Apply all available operators to the input PDFs.

Parameters:
  • output (eko.output.EKO) – eko output object containing all informations

  • lhapdf_like (object) –

    object that provides an xfxQ2 callable (as lhapdf and ekomark.toyLH.toyPDF do) (and thus is in flavor basis)

  • targetgrid (list) – if given, interpolates to the pdfs given at targetgrid (instead of xgrid)

  • flavor_rotation (np.ndarray) – Rotation matrix in flavor space

  • labels (list) – list of labels

Returns:

out_grid – output PDFs and their associated errors for the computed mu2grid

Return type:

dict

ekobox.cards module

Tools to generate runcards.

class ekobox.cards.example[source]

Bases: object

Provide runcards examples.

classmethod theory() TheoryCard[source]

Provide example theory card object.

classmethod operator() OperatorCard[source]

Provide example operator card object.

classmethod raw_theory()[source]

Provide example theory card unstructured.

classmethod raw_operator()[source]

Provide example operator card unstructured.

ekobox.cards.dump(card: Dict[str, Any], path: PathLike)[source]

Export the operators card.

Parameters:
  • card (dict) – card to dump

  • path (str) – destination of the dumped card

ekobox.cards.load(path) Dict[str, Any][source]

Import the theory card specified by path.

Parameters:

path (str) – path to theory card in yaml format

Returns:

loaded card

Return type:

dict

ekobox.evol_pdf module

Tools to evolve actual PDFs.

ekobox.evol_pdf.evolve_pdfs(initial_PDF_list, theory_card, operators_card, path=None, store_path=None, targetgrid=None, install=False, name='Evolved_PDF', info_update=None)[source]

Evolves one or several initial_PDFs and dump the evolved PDFs in lhapdf format.

Parameters:
  • initial_PDF_list (list(lhapdf object)) – list of PDF members to be evolved

  • theory_card (dict) – theory card

  • operators_card (dict) – operators card

  • path (str) – path to cached eko output (if “None” it will be recomputed)

  • store_path (str) – path where the eko is stored (if “None” will not be saved)

  • targetgrid (list(float)) – target x-grid (if different from input x-grid)

  • install (bool) – set whether to install evolved PDF to lhapdf directory

  • name (str) – set name of evolved PDF

  • info_update (dict) – dict of info to add or update to default info file

ekobox.evol_pdf.regroup_evolgrid(evolgrid: list)[source]

Split evolution points by nf and sort by scale.

ekobox.evol_pdf.collect_blocks(evolved_PDF: dict, q2block_per_nf: dict, xgrid: list)[source]

Collect all LHAPDF blocks for a given replica.

Parameters:
  • evolved_PDF – PDF evaluated at grid

  • q2block_per_nf – block coordinates

  • xgrid – x grid

ekobox.info_file module

LHAPDF info file utilities.

ekobox.info_file.build(theory_card: TheoryCard, operators_card: OperatorCard, num_members: int, info_update: dict)[source]

Generate a lhapdf info file from theory and operators card.

Parameters:
  • theory_card (dict) – theory card

  • operators_card (dict) – operators_card

  • num_members (int) – number of pdf set members

  • info_update (dict) – info to update

Returns:

info file in lhapdf format

Return type:

dict

ekobox.mock module

Mocking tools.

ekobox.mock.eko_identity(shape)[source]

Generate an identity operator with the given shape.

The operator has to be squared in PIDs and x grid, thus the last two elements of shape are not read, and they are considered to be equal to the second and third element respectively.

Parameters:

shape (5-tuple) – specifies the required output tuple (last two elements are ignored)

Returns:

rank 5 array, representing an identity operator of the requested shape

Return type:

np.array

ekobox.utils module

Generic utilities to work with EKOs.

ekobox.utils.ekos_product(eko_ini: EKO, eko_fin: EKO, rtol: float = 1e-06, atol: float = 1e-10, path: PathLike | None = None)[source]

Compute the product of two ekos.

Parameters:
  • eko_ini – initial eko operator

  • eko_fin – final eko operator

  • rtol – relative tolerance on Q2, used to check compatibility

  • atol – absolute tolerance on Q2, used to check compatibility

  • path – if not provided, the operation is done in-place, otherwie a new operator is written at the given path