Lepton numbers should be flavoured and this should be conserved across each vertex (or at least over the total interaction). Consider something like giving the Lepton base class electron, muon, tau properties, setting them all to zero and assigning values to the relevant particles. Then in Interaction._vertex_invariants we check if a particle is a Lepton and count lepton numbers appropriately.
Lepton numbers should be flavoured and this should be conserved across each vertex (or at least over the total interaction). Consider something like giving the
Lepton
base classelectron
,muon
,tau
properties, setting them all to zero and assigning values to the relevant particles. Then inInteraction._vertex_invariants
we check if a particle is aLepton
and count lepton numbers appropriately.