feynml.interface.formcalc.rule.Rule
- class feynml.interface.formcalc.rule.Rule(lhs: feynml.interface.formcalc.field.Field, rhs: feynml.interface.formcalc.particle.Particle | str)[source]
Bases:
object
Methods
__init__
(lhs, rhs)from_str
(rule)Example
n
()Example
re
()Attributes
lhs
rhs
- classmethod from_str(rule: str)[source]
Example
>>> str(Rule.from_str("Field[1] -> V[1]")) 'Field[1] -> V[1]'
>>> str(Rule.from_str('Field[1] -> F[1, {1, SequenceForm["Col", 1]}]')) 'Field[1] -> F[1, {1, SequenceForm["Col", 1]}]'
>>> str(Rule.from_str('Field[4] -> V[5, {SequenceForm["Glu", 4]}]')) 'Field[4] -> V[5, {SequenceForm["Glu", 4]}]'