FeynKit · latest
On this page

DiagramVertex

symbolica.community.hepkit Class

DiagramVertex()

An interaction point in a Feynman diagram.

External states belong to edges; every public vertex references an interaction.

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]
vertex = diagram.vertices[0]
interaction = model.vertex_rule(vertex.interaction)
factor = vertex.numerator_expression()

Member details

id

Property · read-only#
id: int

Return this vertex's integer ID within the diagram.

Examples

Using the setup in the DiagramVertex class example:

vertices_by_id = {item.id: item for item in diagram.vertices}

name

Property · read-only#
name: str

Return the stable vertex label stored in the diagram.

Examples

Using the setup in the DiagramVertex class example:

vertex_names = [item.name for item in diagram.vertices]

interaction

Property · read-only#
interaction: str

Return the interaction name.

Raises DiagramError for an incomplete imported diagram.

Examples

Using the setup in the DiagramVertex class example:

vertex = diagram.vertices[0]
rule = model.vertex_rule(vertex.interaction)

numerator

Property · read-only#
numerator: str

Return the symbolic numerator annotation as source text.

Raises DiagramError when the diagram does not carry an instantiated Feynman-rule numerator for this vertex.

Examples

Using the setup in the DiagramVertex class example:

source_text = vertex.numerator
factor = vertex.numerator_expression()

numerator_expression

Method#
numerator_expression() -> TensorExpression

Return the numerator annotation as a Spenso TensorExpression.

Examples

Using the setup in the DiagramVertex class example:

vertex = diagram.vertices[0]
vertex_factor = vertex.numerator_expression()
weighted_vertex_factor = diagram.overall_factor_expression() * vertex_factor

__repr__

Method#
__repr__() -> str

Return a concise, unambiguous description of the vertex.

Examples

Using the setup in the DiagramVertex class example:

vertex = diagram.vertices[0]
print(vertex)  # includes its external state or interaction rule

_repr_pretty_

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

Write the vertex summary to an IPython pretty printer.

Examples

Using the setup in the DiagramVertex class example:

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

Parameters

NameTypeDefaultDescription
prettyAny—

The IPython pretty-printer object.

cyclebool—

Whether this object is part of a recursive formatting cycle.