FeynKit · latest
On this page

AmplitudeLeg

symbolica.community.hepkit Class

AmplitudeLeg()

One physical external state of a symbolic amplitude.

Examples

from symbolica import S, E
from symbolica.community import hepkit as hep
model = hep.Model.phi4()
process = model.process(["phi", "phi"], ["phi", "phi"])
generated = process.generate_diagrams()
diagram = generated.diagrams[0]
amplitude = hep.Amplitude(generated.diagrams)
leg = amplitude.legs[0]
state = (leg.index, leg.particle.name, leg.state)
spin_sum = leg.particle.spin_sum(leg.momentum, leg.tensor_index, S("conjugate_index"))

Member details

index

Property · read-only#
index: int

Stable external-leg label shared by every diagram.

Examples

Using the setup in the AmplitudeLeg class example:

label = leg.index
assert label in [state.index for state in amplitude.legs]

particle

Property · read-only#
particle: Particle

Model particle, including particle/antiparticle identity.

Examples

Using the setup in the AmplitudeLeg class example:

particle_name = leg.particle.name

state

Property · read-only#
state: str

Whether the state is incoming or outgoing.

Examples

Using the setup in the AmplitudeLeg class example:

incoming = [state for state in amplitude.legs if state.state == "incoming"]

momentum

Property · read-only#
momentum: Expression

Unindexed physical momentum P(index).

Examples

Using the setup in the AmplitudeLeg class example:

external_momentum = leg.momentum

tensor_index

Property · read-only#
tensor_index: Expression

Bare label shared by this leg's spin and color slots.

Examples

Using the setup in the AmplitudeLeg class example:

spin_sum = leg.particle.spin_sum(leg.momentum, leg.tensor_index, S("bra"))

slots

Property · read-only#
slots: list[Slot]

Typed open spin/color slots attached to this physical state.

Examples

Using the setup in the AmplitudeLeg class example:

open_slots = leg.slots

__repr__

Method#
__repr__() -> str

Describe the state and its physical leg identity.

Examples

Using the setup in the AmplitudeLeg class example:

print(amplitude.legs[0])