FeynKit · latest
On this page

MomentumSignature

symbolica.community.hepkit Class

MomentumSignature()

Integer coefficients expressing one edge momentum in a chosen basis.

A signature separates coefficients of independent loop momenta from those of external momenta, for example -l1 + p2.

Examples

from symbolica import S, E
from symbolica.community import hepkit as hep
model = hep.Model.phi4()
process = model.process(["phi", "phi"], ["phi", "phi"])
result = process.generate_diagrams(loops=1)
diagram = result.diagrams[0]
basis = diagram.loop_momentum_basis
edge_id = basis.loop_edges[0]
signature = basis.edge_signatures[edge_id]
routing = signature.format_momentum()

Member details

loops

Property · read-only#
loops: list[int]

Return the integer coefficients of the independent loop momenta.

Examples

Using the setup in the MomentumSignature class example:

assert len(signature.loops) == diagram.loop_count

external

Property · read-only#
external: list[int]

Return the integer coefficients of the external momenta.

Examples

Using the setup in the MomentumSignature class example:

external_coefficients = signature.external

integer_coefficients

Method#
integer_coefficients() -> tuple[list[int], list[int]]

Return loop and external coefficients as a pair of integer lists.

Examples

Using the setup in the MomentumSignature class example:

signature = next(iter(basis.edge_signatures.values()))
loops, external = signature.integer_coefficients()
print("loop coefficients:", loops, "external coefficients:", external)

format_momentum

Method#
format_momentum() -> str

Format the signature as a conventional momentum sum.

Examples

Using the setup in the MomentumSignature class example:

Print the momentum routing assigned to every propagator:

for edge_id, signature in basis.edge_signatures.items():
    print(edge_id, signature.format_momentum())

__str__

Method#
__str__() -> str

Return the conventional momentum sum for str(signature).

Examples

Using the setup in the MomentumSignature class example:

signature = next(iter(basis.edge_signatures.values()))
print(f"propagator momentum: {signature}")

__repr__

Method#
__repr__() -> str

Return an unambiguous momentum-signature summary.

Examples

Using the setup in the MomentumSignature class example:

edge_id, signature = next(iter(basis.edge_signatures.items()))
print(f"edge {edge_id}: {signature!r}")

_repr_pretty_

Method#
_repr_pretty_(pretty: Any, cycle: bool) -> None

Write the momentum signature to an IPython pretty printer.

Examples

Using the setup in the MomentumSignature class example:

from IPython.lib.pretty import pretty
text = pretty(signature)

Parameters

NameTypeDefaultDescription
prettyAny—

The IPython pretty-printer object.

cyclebool—

Whether this object is part of a recursive formatting cycle.