LorentzStructure

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

LorentzStructure

class LorentzStructure

A reusable spin-dependent tensor structure in an interaction rule.

The structure records the spin representation of each leg and the UFO expression used when constructing a diagram numerator.

Examples

from symbolica import S, E
from symbolica.community import hepkit as hep
model = hep.Model.standard_model()
lorentz = model.lorentz_structures[0]
spins = lorentz.spins
formula = lorentz.structure

Attributes

Name Description
name Return the Lorentz-structure name.
spins Return the UFO 2S + 1 spin codes of the structure’s particle slots.
structure Return the symbolic Lorentz expression.

name

LorentzStructure.name: builtins.str

Return the Lorentz-structure name.

Examples

Using the setup in the LorentzStructure class example:

structures = {item.name: item.structure for item in model.lorentz_structures}

spins

LorentzStructure.spins: builtins.list[builtins.int]

Return the UFO 2S + 1 spin codes of the structure’s particle slots.

Examples

Using the setup in the LorentzStructure class example:

vertex = model.vertex_rules[0]
lorentz = model.lorentz_structure(vertex.lorentz_structures[0])
len(lorentz.spins) == len(vertex.particles)
True

structure

LorentzStructure.structure: Expression

Return the symbolic Lorentz expression.

Examples

Using the setup in the LorentzStructure class example:

formula = lorentz.structure

Methods

Name Description
__repr__ Summarize the defining data as well as the structure name.
_repr_html_ Display the model member’s physical data and defining expressions.
_repr_pretty_ Write the complete text summary to an IPython pretty printer.

__repr__

LorentzStructure.__repr__() -> builtins.str

Summarize the defining data as well as the structure name.

Examples

Using the setup in the LorentzStructure class example:

vertex = model.vertex_rules[0]
print(model.lorentz_structure(vertex.lorentz_structures[0]))

_repr_html_

LorentzStructure._repr_html_() -> builtins.str

Display the model member’s physical data and defining expressions.

Examples

Using the setup in the LorentzStructure class example:

from IPython.display import display
display(lorentz)

_repr_pretty_

LorentzStructure._repr_pretty_(pretty: typing.Any, cycle: builtins.bool) -> None

Write the complete text summary to an IPython pretty printer.

Examples

Using the setup in the LorentzStructure class example:

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

Parameters

  • pretty (object) IPython pretty printer receiving the text.
  • cycle (bool) Whether the object occurs recursively in the current display.