AmplitudeLeg

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

AmplitudeLeg

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

Attributes

Name Description
index Stable external-leg label shared by every diagram.
momentum Unindexed physical momentum P(index).
particle Model particle, including particle/antiparticle identity.
slots Typed open spin/color slots attached to this physical state.
state Whether the state is incoming or outgoing.
tensor_index Bare label shared by this leg’s spin and color slots.

index

AmplitudeLeg.index: builtins.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]

momentum

AmplitudeLeg.momentum: Expression

Unindexed physical momentum P(index).

Examples

Using the setup in the AmplitudeLeg class example:

external_momentum = leg.momentum

particle

AmplitudeLeg.particle: Particle

Model particle, including particle/antiparticle identity.

Examples

Using the setup in the AmplitudeLeg class example:

particle_name = leg.particle.name

slots

AmplitudeLeg.slots: builtins.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

state

AmplitudeLeg.state: builtins.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"]

tensor_index

AmplitudeLeg.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"))

Methods

Name Description
__repr__ Describe the state and its physical leg identity.

__repr__

AmplitudeLeg.__repr__() -> builtins.str

Describe the state and its physical leg identity.

Examples

Using the setup in the AmplitudeLeg class example:

print(amplitude.legs[0])