CffRepresentation
symbolica.community.hepkit Class
CffRepresentation()A loop-energy integral in the cross-free family (CFF) representation.
Create with diagram.integrate_energy(method="cff"). The result groups acyclic energy-flow orientations into cross-free families of denominators. With :math:E_e=\sqrt{\boldsymbol{q}_e^2+m_e^2}, its scalar expression is
$$ I_{\mathrm{CFF}}=\left(\prod_e\frac{-1}{2E_e}\right) \sum_o\sum_{F\in\mathcal{F}_o}\prod_{s\in F}\frac{1}{s}. $$
Repeated surfaces appear with their multiplicity. Family and orientation expressions include their energy prefactors, so they sum to the result. The measure is :math:d\ell^0/(2\pi i) per loop, with contours closed below, as in LtdRepresentation. The scalar formula above applies without a numerator. Supply numerator=... to integrate_energy to generate bounded polynomial energy numerators, including quadratic and higher powers. Each generalized family retains its own coefficient, numerator evaluation map and denominator powers. Couplings, graph weights and the spatial measure remain separate.
Both representations use gammalooprs::OSE(e) for :math:E_e and gammalooprs::Q(e, spenso::cind(0)) for external energies; e is a physical diagram edge ID. on_shell_energies supplies the routed square roots. Impose external momentum conservation when comparing CFF and LTD.
Displaying the object opens the orientation, family and surface explorer in Marimo or an HTML notebook. len(result) counts denominator products.
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")
expression = result.to_expression()
assert result.report.acyclic_orientations == len(result.orientations)Member details
numerator
Property · read-only#numerator: ExpressionNumerator supplied to energy integration; one for scalar generation.
Examples
numerator = result.numeratorenergy_degree_bounds
Property · read-only#energy_degree_bounds: dict[int, int] Inferred polynomial energy-degree bounds keyed by physical internal edge ID.
Omitted edges have degree zero. Bounds are computed before applying routing.
Examples
bounds = result.energy_degree_boundsreport
Property · read-only#report: CffReportReturn generation statistics for this CFF result.
Examples
Using the setup in the CffRepresentation class example:
assert result.report.acyclic_orientations == len(result.orientations)orientations
Property · read-only#orientations: list[CffOrientation] Return the acyclic energy-flow orientations in this result.
Examples
Using the setup in the CffRepresentation class example:
products = [item.to_expression() for item in result.orientations]surfaces
Property · read-only#surfaces: list[EnergySurface] Return all unique energy and H surfaces in this result.
Examples
Using the setup in the CffRepresentation class example:
energies = [surface.to_expression() for surface in result.surfaces]diagram
Property · read-only#diagram: FeynmanDiagramOriginating diagram or selected subgraph, retaining its routing and owner.
Examples
routing = result.diagram.loop_momentum_basison_shell_energies
Property · read-only#on_shell_energies: dict[int, OnShellEnergy] Shared symbolic energies and routed square roots, keyed by physical edge ID.
Examples
definitions = [(e.symbol, e.to_expression()) for e in result.on_shell_energies.values()]to_expression
Method#to_expression(*, expand_surfaces: bool = True) -> TensorExpression Return the scalar loop-energy integral as a Symbolica expression.
Includes contour signs and on-shell energy factors for :math:d\ell^0/(2\pi i) per loop, with contours closed below. A supplied numerator is included; couplings, graph weights and the spatial measure are separate. expand_surfaces expands affine denominators while leaving gammalooprs::OSE(e) symbolic. Use on_shell_energies for their routed definitions or custom evaluation.
Examples
Using the setup in the class example:
expression = result.to_expression()
compact = result.to_expression(expand_surfaces=False)Returns
TensorExpression
Rank-zero tensor summing all orientation contributions and prefactors.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
expand_surfaces | bool | True | Replace surface placeholders by their affine energy definitions. Defaults to True. False keeps placeholders local to this representation. |
raised_surface_groups
Method#raised_surface_groups(edge_representatives: Optional[Mapping[int, int]] = None) -> list[CffSurfaceGroup] Group equivalent energy surfaces after identifying raised propagator edges. edge_representatives maps repeated edges to their canonical edge.
Examples
Using the setup in the CffRepresentation class example:
groups = result.raised_surface_groups({3: 2})
[group.max_order for group in groups]Parameters
| Name | Type | Default | Description |
|---|---|---|---|
edge_representatives | Optional[ | None | Repeated propagator edge IDs mapped to their canonical representative. |
pole_coefficients
Method#pole_coefficients(group: CffSurfaceGroup) -> list[CffRepresentation] Return coefficients of each inverse surface power, indexed from order one. These are pole coefficients, before analytic residue derivatives.
Examples
Using the setup in the CffRepresentation class example:
coefficients = result.pole_coefficients(result.raised_surface_groups()[0])
[coefficient.to_expression() for coefficient in coefficients]Parameters
| Name | Type | Default | Description |
|---|---|---|---|
group | CffSurfaceGroup | — | A raised-surface group belonging to this result. |
residue
Method#residue(group: CffSurfaceGroup, *, variable: Expression | int | Float | int | float | str | decimal.Decimal | ComplexFloat | Float | int | float | str | decimal.Decimal | complex | tuple[Float | int | float | str | decimal.Decimal, Float | int | float | str | decimal.Decimal], root: Expression | int | Float | int | float | str | decimal.Decimal | ComplexFloat | Float | int | float | str | decimal.Decimal | complex | tuple[Float | int | float | str | decimal.Decimal, Float | int | float | str | decimal.Decimal], surface: Expression | int | Float | int | float | str | decimal.Decimal | ComplexFloat | Float | int | float | str | decimal.Decimal | complex | tuple[Float | int | float | str | decimal.Decimal, Float | int | float | str | decimal.Decimal], coefficient: Expression | int | Float | int | float | str | decimal.Decimal | ComplexFloat | Float | int | float | str | decimal.Decimal | complex | tuple[Float | int | float | str | decimal.Decimal, Float | int | float | str | decimal.Decimal], replacements: Optional[Sequence[tuple[Expression | int | Float | int | float | str | decimal.Decimal | ComplexFloat | Float | int | float | str | decimal.Decimal | complex | tuple[Float | int | float | str | decimal.Decimal, Float | int | float | str | decimal.Decimal], Expression | int | Float | int | float | str | decimal.Decimal | ComplexFloat | Float | int | float | str | decimal.Decimal | complex | tuple[Float | int | float | str | decimal.Decimal, Float | int | float | str | decimal.Decimal]]]] = None) -> TensorExpression Evaluate all pole-order contributions to a residue in an explicit variable. surface must be the group's energy surface expressed in that variable; coefficient is the complete remaining coefficient, including any factors whose derivatives must act. The supplied root is assumed to be a simple zero.
Examples
Using the setup in CffRepresentation, illustrate a simple pole locally parameterized by surface=t with constant remaining coefficient:
from symbolica import E, S
t = S("t")
group = result.raised_surface_groups()[0]
residue = result.residue(group, variable=t, root=E("0"), surface=t, coefficient=E("1"))Parameters
| Name | Type | Default | Description |
|---|---|---|---|
group | CffSurfaceGroup | — | A raised-surface group belonging to this result. |
variable | Expression | int | Float | int | float | str | decimal. | — | Independent integration variable. |
root | Expression | int | Float | int | float | str | decimal. | — | Simple zero of the surface, independent of variable. |
surface | Expression | int | Float | int | float | str | decimal. | — | Energy surface expressed in the integration variable. |
coefficient | Expression | int | Float | int | float | str | decimal. | — | Complete remaining coefficient to differentiate. |
replacements | Optional[ | None | Route all energy dependence to the integration variable before differentiating. |
__len__
Method#__len__() -> intReturn the number of unfolded denominator terms.
Examples
Using the setup in the CffRepresentation class example:
denominator_term_count = len(result)__repr__
Method#__repr__() -> strReturn a concise summary of the CFF expression and its surfaces.
Examples
Using the setup in the CffRepresentation class example:
print(result)render
Method#render() -> DiagramViewPrepare a browser-measured orientation, family and surface explorer.
Examples
view = result.render()
view
snapshot = view.measured(browser="chromium")_repr_mimebundle_
Method#_repr_mimebundle_(include: Optional[Sequence[str]] = None, exclude: Optional[Sequence[str]] = None) -> Any Explore orientations, factored families and surface regions on the native graph.
Arrowhead clicks select another retained orientation; they never change the result. Shift-click surface factors to inspect several circlings together. The displayed expression includes any supplied numerator and excludes the spatial measure.
Examples
Using the setup in the CffRepresentation class example:
from IPython.display import display
display(result)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
Using the setup in the CffRepresentation class example:
view = result.render()
view # static output is immediate; an optional widget refines label sizes
snapshot = view.measured(browser="chromium")_display_
Method#_display_() -> AnyReturn a Marimo widget when available, otherwise static HTML.
Notebook MIME hooks use the same DiagramView display contract.
Examples
Using the setup in the CffRepresentation class example:
presentation = result._display_()_repr_pretty_
Method#_repr_pretty_(pretty: Any, cycle: bool) -> None Write a summary with Symbolica's native expression formatting.
Examples
Using the setup in the CffRepresentation class example:
from IPython.lib.pretty import pretty
text = pretty(result)Parameters
| Name | Type | Default | Description |
|---|---|---|---|
pretty | Any | — | The IPython pretty-printer object. |
cycle | bool | — | Whether this object is part of a recursive formatting cycle. |
View generated signature source: docs/api/python/feynkit-community.pyi:752