feynml.interface.formcalc.fermion.Fermion

class feynml.interface.formcalc.fermion.Fermion(sign: int, type: int, i: int, sequenceform: feynml.interface.formcalc.sequenceform.SequenceForm)[source]

Bases: Particle

__init__(sign: int, type: int, i: int, sequenceform: SequenceForm) None

Methods

__init__(sign, type, i, sequenceform)

from_str(fermion)

Example

get_pdgid()

Example

n()

Example

re()

Attributes

sign

type

i

sequenceform

classmethod from_str(fermion: str)[source]

Example

>>> str(Fermion.from_str('F[1, {1, SequenceForm["Col", 1]}]'))
'F[1, {1, SequenceForm["Col", 1]}]'
>>> str(Fermion.from_str('-F[1, {1, SequenceForm["Col", 1]}]'))
'-F[1, {1, SequenceForm["Col", 1]}]'
get_pdgid() int[source]

Example

>>> Fermion(1, 3, 1, SequenceForm("Col", 1)).get_pdgid()
2
>>> Fermion(-1, 4, 1, SequenceForm("Col", 1)).get_pdgid()
-1
classmethod n()[source]

Example

>>> Fermion.n() == Fermion.re().count('(') - Fermion.re().count('(?')
True