UfoLoader

Symbolica documentation for getting started, symbolic expressions, numerical evaluation, pattern matching, and APIs in Python and Rust.

UfoLoader

class UfoLoader

Load and normalize a Universal FeynRules Output model.

The loader delegates UFO parsing to ufo_model_loader and returns typed HEP model entities suitable for process and diagram generation.

Examples

Replace path/to/MyUFO with the directory containing your UFO model (particles.py, vertices.py, and related files).

from symbolica.community import hepkit as hep
loader = hep.UfoLoader()
loaded = loader.load("path/to/MyUFO")

Parameters

  • restriction_name (str, optional) Restriction-card name to apply while loading.
  • simplify_model (bool, optional) Simplify normalized symbolic model expressions.
  • wrap_indices_in_lorentz_structures (bool, optional) Wrap normalized indices in Lorentz structures.

Attributes

Name Description
restriction_name Return the configured restriction-card name.
simplify_model Return whether model simplification is enabled.
wrap_indices_in_lorentz_structures Return whether normalized Lorentz indices are wrapped.

restriction_name

UfoLoader.restriction_name: typing.Optional[builtins.str]

Return the configured restriction-card name.

Examples

Using the setup in the UfoLoader class example:

loader = hep.UfoLoader(restriction_name="massless")
assert loader.restriction_name == "massless"

simplify_model

UfoLoader.simplify_model: builtins.bool

Return whether model simplification is enabled.

Examples

Using the setup in the UfoLoader class example:

loader = hep.UfoLoader(simplify_model=False)
assert not loader.simplify_model

wrap_indices_in_lorentz_structures

UfoLoader.wrap_indices_in_lorentz_structures: builtins.bool

Return whether normalized Lorentz indices are wrapped.

Examples

Using the setup in the UfoLoader class example:

loader = hep.UfoLoader(wrap_indices_in_lorentz_structures=True)
assert loader.wrap_indices_in_lorentz_structures

Methods

Name Description
__new__ Construct a UFO loader with normalization options.
load Load through the caller’s attached interpreter without changing Python globals.

__new__

UfoLoader.__new__(
    *,
    restriction_name: typing.Optional[builtins.str] = None,
    simplify_model: builtins.bool = True,
    wrap_indices_in_lorentz_structures: builtins.bool = True,
) -> UfoLoader

Construct a UFO loader with normalization options.

Examples

Using the setup in the UfoLoader class example:

loader = hep.UfoLoader(restriction_name="massless")

Parameters

  • restriction_name (str, optional) Restriction-card name passed to the UFO loader.
  • simplify_model (bool, optional) Simplify expressions in the normalized model.
  • wrap_indices_in_lorentz_structures (bool, optional) Wrap indices in normalized Lorentz structures.

load

UfoLoader.load(path: builtins.str | os.PathLike | pathlib.Path) -> LoadedModel

Load through the caller’s attached interpreter without changing Python globals.

Examples

Using the setup in the UfoLoader class example:

loaded = hep.UfoLoader().load("path/to/ufo_model")
model = loaded.model

Parameters

  • path (str or os.PathLike) Directory containing the UFO Python modules.