LoopMomentumBasis
symbolica.community.hepkit Class
LoopMomentumBasis()A consistent routing of independent loop and external momenta.
Chords of the spanning tree define the loop momenta; every diagram edge is then assigned an integer MomentumSignature by momentum conservation.
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
assert len(basis.loop_edges) == diagram.loop_count
assignments = basis.edge_signaturesMember details
tree_edges
Property · read-only#tree_edges: list[int] Return the edge identifiers belonging to the spanning tree.
Examples
Using the setup in the LoopMomentumBasis class example:
rerouted = diagram.with_loop_momentum_tree_edges(basis.tree_edges)loop_edges
Property · read-only#loop_edges: list[int] Return the edge identifiers chosen as independent loop momenta.
Examples
Using the setup in the LoopMomentumBasis class example:
basis = diagram.loop_momentum_bases(limit=1)[0]
len(basis.loop_edges) == diagram.loop_countexternal_edges
Property · read-only#external_edges: list[int] Return the identifiers of edges attached to external states.
Examples
Using the setup in the LoopMomentumBasis class example:
external_ids = basis.external_edges
external_routings = [basis.edge_signatures[i] for i in external_ids]dependent_externals
Property · read-only#dependent_externals: list[int] Return external-edge identifiers fixed by momentum conservation.
Examples
Using the setup in the LoopMomentumBasis class example:
basis = diagram.loop_momentum_bases(limit=1)[0]
set(basis.dependent_externals) <= set(basis.external_edges)edge_signatures
Property · read-only#edge_signatures: dict[int, MomentumSignature] Return momentum signatures keyed by stable diagram edge ID.
Examples
Using the setup in the LoopMomentumBasis class example:
basis = diagram.loop_momentum_bases(limit=1)[0]
momentum_by_edge = {
edge_id: signature.format_momentum()
for edge_id, signature in basis.edge_signatures.items()
}
for edge in diagram.edges:
print(edge.particle_name, momentum_by_edge[edge.id])momentum_replacements
Method#momentum_replacements() -> list[Any] Return Symbolica Replacement objects using the same routing as numerical momenta. Tensor index arguments are retained on every routed vector.
Examples
Using the setup in the LoopMomentumBasis class example:
rules = diagram.loop_momentum_basis.momentum_replacements()
routed = diagram.numerator_expression().to_expression().replace_multiple(rules)__repr__
Method#__repr__() -> strReturn a concise description of the selected momentum basis.
Examples
Using the setup in the LoopMomentumBasis class example:
basis = diagram.loop_momentum_bases(limit=1)[0]
print(basis)_repr_html_
Method#_repr_html_() -> strReturn an HTML table of edge momentum assignments for notebooks.
Examples
Using the setup in the LoopMomentumBasis class example:
from IPython.display import display
display(basis)_repr_pretty_
Method#_repr_pretty_(pretty: Any, cycle: bool) -> None Write the basis summary to an IPython pretty printer.
Examples
Using the setup in the LoopMomentumBasis class example:
from IPython.lib.pretty import pretty
text = pretty(basis)Parameters
| Name | Type | Default | Description |
|---|---|---|---|
pretty | Any | — | The IPython pretty-printer object. |
cycle | bool | — | Whether this object is part of a recursive formatting cycle. |
route_expression
Method#Overloads
Overload 1 #
route_expression(expression: TensorExpression, *, loop_momenta: Optional[Sequence[TensorName]] = None, external_momenta: Optional[Sequence[TensorName]] = None) -> TensorExpression Express edge momenta in this basis while retaining tensor index arguments.
Examples
Using the setup in the LoopMomentumBasis class example:
routed = basis.route_expression(diagram.numerator_expression().to_expression())Parameters
| Name | Type | Default | Description |
|---|---|---|---|
expression | TensorExpression | — | Expression with canonical edge momenta to route, or a scalar constant. |
loop_momenta | Optional[ | None | Vector names in |
external_momenta | Optional[ | None | Vector names in |
Overload 2 #
route_expression(expression: 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], *, loop_momenta: Optional[Sequence[TensorName]] = None, external_momenta: Optional[Sequence[TensorName]] = None) -> Expression Express edge momenta in this basis while retaining tensor index arguments.
Examples
Using the setup in the LoopMomentumBasis class example:
routed = basis.route_expression(diagram.numerator_expression().to_expression())Parameters
| Name | Type | Default | Description |
|---|---|---|---|
expression | Expression | int | Float | int | float | str | decimal. | — | Expression with canonical edge momenta to route, or a scalar constant. |
loop_momenta | Optional[ | None | Vector names in |
external_momenta | Optional[ | None | Vector names in |
route
Method#Overloads
Overload 1 #
route(loop_momenta: Sequence[ThreeMomentum], external_momenta: Sequence[ThreeMomentum]) -> dict[int, ThreeMomentum] Route four-momenta through every diagram edge.
Examples
Using basis from the class example; zero external momenta keep this routing illustration momentum-conserving:
loop_momentum = hep.FourMomentum(2.0, 1.0, 0.0, 0.0)
external_four_momenta = [hep.FourMomentum(0.0, 0.0, 0.0, 0.0)
for edge in basis.external_edges]
routed = basis.route([loop_momentum], external_four_momenta)
internal_momentum = routed[basis.loop_edges[0]]Parameters
| Name | Type | Default | Description |
|---|---|---|---|
loop_momenta | Sequence[ | — | Independent loop momenta in |
external_momenta | Sequence[ | — | External momenta in |
Overload 2 #
route(loop_momenta: Sequence[FourMomentum], external_momenta: Sequence[FourMomentum]) -> dict[int, FourMomentum] Route four-momenta through every diagram edge.
Examples
Using basis from the class example; zero external momenta keep this routing illustration momentum-conserving:
loop_momentum = hep.FourMomentum(2.0, 1.0, 0.0, 0.0)
external_four_momenta = [hep.FourMomentum(0.0, 0.0, 0.0, 0.0)
for edge in basis.external_edges]
routed = basis.route([loop_momentum], external_four_momenta)
internal_momentum = routed[basis.loop_edges[0]]Parameters
| Name | Type | Default | Description |
|---|---|---|---|
loop_momenta | Sequence[ | — | Independent loop momenta in |
external_momenta | Sequence[ | — | External momenta in |
View generated signature source: docs/api/python/feynkit-community.pyi:6644