FeynKit · latest
On this page

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: Expression

Numerator supplied to energy integration; one for scalar generation.

Examples

numerator = result.numerator

energy_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_bounds

report

Property · read-only#
report: CffReport

Return 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: FeynmanDiagram

Originating diagram or selected subgraph, retaining its routing and owner.

Examples

routing = result.diagram.loop_momentum_basis

on_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

NameTypeDefaultDescription
expand_surfacesboolTrue

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

NameTypeDefaultDescription
edge_representativesOptional[Mapping[int, int]]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

NameTypeDefaultDescription
groupCffSurfaceGroup—

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

NameTypeDefaultDescription
groupCffSurfaceGroup—

A raised-surface group belonging to this result.

variableExpression | 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]—

Independent integration variable.

rootExpression | 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]—

Simple zero of the surface, independent of variable.

surfaceExpression | 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]—

Energy surface expressed in the integration variable.

coefficientExpression | 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]—

Complete remaining coefficient to differentiate.

replacementsOptional[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

Route all energy dependence to the integration variable before differentiating.

__len__

Method#
__len__() -> int

Return the number of unfolded denominator terms.

Examples

Using the setup in the CffRepresentation class example:

denominator_term_count = len(result)

__repr__

Method#
__repr__() -> str

Return a concise summary of the CFF expression and its surfaces.

Examples

Using the setup in the CffRepresentation class example:

print(result)

render

Method#
render() -> DiagramView

Prepare 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

NameTypeDefaultDescription
includeOptional[Sequence[str]]None

MIME types requested by the frontend; None allows all available types.

excludeOptional[Sequence[str]]None

MIME types omitted from the frontend response.

_mime_

Method#
_mime_() -> Any

Return 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_() -> Any

Return 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

NameTypeDefaultDescription
prettyAny—

The IPython pretty-printer object.

cyclebool—

Whether this object is part of a recursive formatting cycle.