FeynKit · latest
On this page

UfoLoader

symbolica.community.hepkit Class

UfoLoader(*, restriction_name: Optional[str] = None, simplify_model: bool = True, wrap_indices_in_lorentz_structures: bool = True)

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.

Constructor

#

Construct a UFO loader with normalization options.

Examples

Using the setup in the UfoLoader class example:

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

Parameters

NameTypeDefaultDescription
restriction_nameOptional[str]None

Restriction-card name passed to the UFO loader.

simplify_modelboolTrue

Simplify expressions in the normalized model.

wrap_indices_in_lorentz_structuresboolTrue

Wrap indices in normalized Lorentz structures.

Member details

restriction_name

Property · read-only#
restriction_name: Optional[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

Property · read-only#
simplify_model: 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

Property · read-only#
wrap_indices_in_lorentz_structures: 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

load

Method#
load(path: 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

NameTypeDefaultDescription
pathstr | os.PathLike | pathlib.Path—

Directory containing the UFO Python modules.