DiagramHalfEdge

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

DiagramHalfEdge

class DiagramHalfEdge

A particle-line endpoint using the diagram’s native half-edge numbering.

Examples

from symbolica import S, E
from symbolica.community import hepkit as hep
model = hep.Model.phi4()
diagram = model.process(["phi", "phi"], ["phi", "phi"]).generate_diagrams(loops=1, progress=None).diagrams[0]
endpoints = [(half.id, half.vertex, half.edge.particle_name) for half in diagram.half_edges]

Attributes

Name Description
edge Physics edge containing this half-edge.
flow Underlying endpoint flow: source or sink.
id Native half-edge ID, also used in symbolic hedge annotations.
vertex Incident interaction vertex ID.

edge

DiagramHalfEdge.edge: DiagramEdge

Physics edge containing this half-edge.

Examples

particles = [half.edge.particle_name for half in diagram.half_edges]

flow

DiagramHalfEdge.flow: builtins.str

Underlying endpoint flow: source or sink.

Examples

incoming = [half.id for half in diagram.half_edges if half.flow == "sink"]

id

DiagramHalfEdge.id: builtins.int

Native half-edge ID, also used in symbolic hedge annotations.

Examples

ids = [half.id for half in diagram.half_edges]

vertex

DiagramHalfEdge.vertex: builtins.int

Incident interaction vertex ID.

Examples

incident = [half.vertex for half in diagram.half_edges]