Skip to content

MomentumSignature

Symbolica documentation for getting started, symbolic expressions, numerical evaluation, pattern matching, and APIs in Python and Rust.

MomentumSignature

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()

Attributes

Name Description
external Return the integer coefficients of the external momenta.
loops Return the integer coefficients of the independent loop momenta.

external

MomentumSignature.external: builtins.list[builtins.int]

Return the integer coefficients of the external momenta.

Examples

Using the setup in the MomentumSignature class example:

external_coefficients = signature.external

loops

MomentumSignature.loops: builtins.list[builtins.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

Methods

Name Description
__repr__ Return an unambiguous momentum-signature summary.
__str__ Return the conventional momentum sum for str(signature).
_repr_pretty_ Write the momentum signature to an IPython pretty printer.
format_momentum Format the signature as a conventional momentum sum.
integer_coefficients Return loop and external coefficients as a pair of integer lists.

__repr__

MomentumSignature.__repr__() -> builtins.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}")

__str__

MomentumSignature.__str__() -> builtins.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_pretty_

MomentumSignature._repr_pretty_(pretty: typing.Any, cycle: builtins.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

  • pretty (Any) The IPython pretty-printer object.
  • cycle (bool) Whether this object is part of a recursive formatting cycle.

format_momentum

MomentumSignature.format_momentum() -> builtins.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())

integer_coefficients

MomentumSignature.integer_coefficients() -> tuple[builtins.list[builtins.int], builtins.list[builtins.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)