CffOrientation
symbolica.community.hepkit Class
CffOrientation()One acyclic energy-flow orientation in a CFF representation.
families contains its cross-free denominator products. to_expression() sums their contributions, including the common energy prefactors and any supplied numerator. Edge directions are relative to the originating diagram's stored orientation.
Examples
from symbolica.community import hepkit as hep
process = hep.Model.phi3().process(["phi"], ["phi", "phi"])
diagrams = process.generate_diagrams(
loops=1, max_vertices=3, maximum_bridges=0, progress=None
)
diagram = diagrams.diagrams[0]
result = diagram.integrate_energy(method="cff")
orientation = result.orientations[0]
expression = orientation.to_expression()Member details
id
Property · read-only#id: intReturn this orientation's stable index within the CFF result.
Examples
Using the setup in the CffOrientation class example:
orientation_ids = [item.id for item in result.orientations]edge_signs
Property · read-only#edge_signs: dict[int, Optional[int]] Edge signs relative to the diagram's stored arrows.
+1 agrees with the stored direction, -1 reverses it, and None denotes an undirected edge. These are orientation signs, not surface coefficients.
Examples
signs = orientation.edge_signs
assert all(sign in (-1, 1, None) for sign in signs.values())edge_orientations
Property · read-only#edge_orientations: list[tuple[int, str]] Return each edge ID and its selected orientation.
Examples
Using the setup in the CffOrientation class example:
directions = dict(orientation.edge_orientations)weight
Property · read-only#weight: TensorExpressionExact weight of this orientation, already included in its families.
Topology-only results weight each closure of a self-loop by one half, so an orientation directing k self-loops has weight 2**-k. Generalized results report one: their family coefficients carry the generated prefactors.
Examples
Using the setup in the CffOrientation class example:
weight = orientation.weightfamilies
Property · read-only#families: list[CrossFreeFamily] Cross-free families contributing to this orientation.
Examples
families = orientation.families__repr__
Method#__repr__() -> strSummarize this orientation without displaying its parent representation.
Examples
text = repr(orientation)to_expression
Method#to_expression(*, expand_surfaces: bool = True) -> TensorExpression Sum this orientation's families, including the common energy prefactor.
Examples
Using the setup in the class example:
expression = orientation.to_expression()Returns
TensorExpression
This orientation's contribution to the CFF energy integral.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
expand_surfaces | bool | True | Replace stored surface placeholders by affine energy definitions. Defaults to True. On-shell energies remain symbolic in either case. |
render
Method#render() -> DiagramViewPrepare this orientation's explorer for display or explicit measurement.
Examples
view = orientation.render()
snapshot = view.measured(browser="chromium")_repr_mimebundle_
Method#_repr_mimebundle_(include: Optional[Sequence[str]] = None, exclude: Optional[Sequence[str]] = None) -> Any Inspect this orientation's family sum and fixed energy-flow graph.
Examples
from IPython.display import display
display(orientation)Parameters
| Name | Type | Default | Description |
|---|---|---|---|
include | Optional[ | None | MIME types requested by the frontend; None allows all available types. |
exclude | Optional[ | None | MIME types omitted from the frontend response. |
_mime_
Method#_mime_() -> AnyReturn Marimo MIME data with static output and an optional live widget.
Examples
view = orientation.render()
view # static output is immediate; an optional widget refines label sizes
snapshot = view.measured(browser="chromium")_display_
Method#_display_() -> AnyDisplay this orientation in Marimo.
Examples
view = orientation._display_()View generated signature source: docs/api/python/feynkit-community.pyi:493