conservation_rules#
import qrules.conservation_rules
Collection of quantum number conservation rules for particle reactions.
This module is the place where the ‘expert’ defines the rules that verify quantum numbers of the reaction.
A rule is a function that takes quantum numbers as input and outputs a boolean. There are three different types of rules:
GraphElementRule
that work on individual graph edges or nodes.EdgeQNConservationRule
that work on the interaction level, which use ingoing edges, outgoing edges as arguments. E.g.:ChargeConservation
.ConservationRule
that work on the interaction level, which use ingoing edges, outgoing edges and a interaction node as arguments. E.g:parity_conservation
.
The arguments can be any type of quantum number. However a rule argument resembling
edges only accepts EdgeQuantumNumbers
. Similarly arguments that
resemble a node only accept NodeQuantumNumbers
. The argument types
do not have to be limited to a single quantum number, but can be a composite (see
CParityEdgeInput
).
Warning
Besides the rule logic itself, a rule also has the responsibility of
stating its run conditions. These run conditions must be stated by
the type annotations of its __call__
method. The type annotations
therefore are not just there for static type checking: they also
carry more information about the rule that is extracted dynamically
by the solving
module.
Generally, the conditions can be separated into two categories:
variable conditions
toplogical conditions
Currently, only variable conditions are being used. Topological conditions could be
created in the form of Tuple
instead of List
.
For additive quantum numbers, the decorator additive_quantum_number_rule
can be used
to automatically generate the appropriate behavior.
The module is therefore strongly typed (both for the reader of the code and for type
checking with mypy). An example is HelicityParityEdgeInput
, which
has been defined to provide type checks on parity_conservation_helicity
.
See also
- additive_quantum_number_rule(quantum_number: type) Callable[[Any], EdgeQNConservationRule] [source]#
Class decorator for creating an additive conservation rule.
Use this decorator to create a
EdgeQNConservationRule
for a quantum number to which an additive conservation rule applies:\[\sum q_{in} = \sum q_{out}\]- Parameters:
quantum_number – Quantum number to which you want to apply the additive conservation check. An example would be
EdgeQuantumNumbers.charge
.
- class ChargeConservation(*args, **kwargs)[source]#
Bases:
EdgeQNConservationRule
Decorated via
additive_quantum_number_rule
.Check for
charge
conservation.
- class BaryonNumberConservation(*args, **kwargs)[source]#
Bases:
EdgeQNConservationRule
Decorated via
additive_quantum_number_rule
.Check for
baryon_number
conservation.- __call__(ingoing_edge_qns: List[baryon_number], outgoing_edge_qns: List[baryon_number]) bool [source]#
Call self as a function.
- class ElectronLNConservation(*args, **kwargs)[source]#
Bases:
EdgeQNConservationRule
Decorated via
additive_quantum_number_rule
.Check for
electron_lepton_number
conservation.- __call__(ingoing_edge_qns: List[electron_lepton_number], outgoing_edge_qns: List[electron_lepton_number]) bool [source]#
Call self as a function.
- class MuonLNConservation(*args, **kwargs)[source]#
Bases:
EdgeQNConservationRule
Decorated via
additive_quantum_number_rule
.Check for
muon_lepton_number
conservation.- __call__(ingoing_edge_qns: List[muon_lepton_number], outgoing_edge_qns: List[muon_lepton_number]) bool [source]#
Call self as a function.
- class TauLNConservation(*args, **kwargs)[source]#
Bases:
EdgeQNConservationRule
Decorated via
additive_quantum_number_rule
.Check for
tau_lepton_number
conservation.- __call__(ingoing_edge_qns: List[tau_lepton_number], outgoing_edge_qns: List[tau_lepton_number]) bool [source]#
Call self as a function.
- class StrangenessConservation(*args, **kwargs)[source]#
Bases:
EdgeQNConservationRule
Decorated via
additive_quantum_number_rule
.Check for
strangeness
conservation.- __call__(ingoing_edge_qns: List[strangeness], outgoing_edge_qns: List[strangeness]) bool [source]#
Call self as a function.
- class CharmConservation(*args, **kwargs)[source]#
Bases:
EdgeQNConservationRule
Decorated via
additive_quantum_number_rule
.Check for
charmness
conservation.
- class BottomnessConservation(*args, **kwargs)[source]#
Bases:
EdgeQNConservationRule
Decorated via
additive_quantum_number_rule
.Check for
bottomness
conservation.- __call__(ingoing_edge_qns: List[bottomness], outgoing_edge_qns: List[bottomness]) bool [source]#
Call self as a function.
- parity_conservation(ingoing_edge_qns: List[parity], outgoing_edge_qns: List[parity], l_magnitude: l_magnitude) bool [source]#
Implement \(P_{in} = P_{out} \cdot (-1)^L\).
- class HelicityParityEdgeInput(parity, spin_magnitude, spin_projection)[source]#
Bases:
object
- spin_magnitude: spin_magnitude[source]#
- spin_projection: spin_projection[source]#
- parity_conservation_helicity(ingoing_edge_qns: List[HelicityParityEdgeInput], outgoing_edge_qns: List[HelicityParityEdgeInput], parity_prefactor: parity_prefactor) bool [source]#
Implements parity conservation for helicity formalism.
Check the following:
\[A_{-\lambda_1-\lambda_2} = P_1 P_2 P_3 (-1)^{S_2+S_3-S_1} A_{\lambda_1\lambda_2}\]\[\mathrm{parity\,prefactor} = P_1 P_2 P_3 (-1)^{S_2+S_3-S_1}\]Note
Only the special case \(\lambda_1=\lambda_2=0\) may return
False
independent on the parity prefactor.
- class CParityEdgeInput(spin_magnitude, pid, c_parity=None)[source]#
Bases:
object
- spin_magnitude: spin_magnitude[source]#
- class CParityNodeInput(l_magnitude, s_magnitude)[source]#
Bases:
object
- l_magnitude: l_magnitude[source]#
- s_magnitude: s_magnitude[source]#
- c_parity_conservation(ingoing_edge_qns: List[CParityEdgeInput], outgoing_edge_qns: List[CParityEdgeInput], interaction_node_qns: CParityNodeInput) bool [source]#
Check for \(C\)-parity conservation.
Implements \(C_{in} = C_{out}\).
- class GParityEdgeInput(isospin_magnitude, spin_magnitude, pid, g_parity=None)[source]#
Bases:
object
- isospin_magnitude: isospin_magnitude[source]#
- spin_magnitude: spin_magnitude[source]#
- class GParityNodeInput(l_magnitude, s_magnitude)[source]#
Bases:
object
- l_magnitude: l_magnitude[source]#
- s_magnitude: s_magnitude[source]#
- g_parity_conservation(ingoing_edge_qns: List[GParityEdgeInput], outgoing_edge_qns: List[GParityEdgeInput], interaction_qns: GParityNodeInput) bool [source]#
Check for \(G\)-parity conservation.
Implements for \(G_{in} = G_{out}\).
- class IdenticalParticleSymmetryOutEdgeInput(spin_magnitude, spin_projection, pid)[source]#
Bases:
object
- spin_magnitude: spin_magnitude[source]#
- spin_projection: spin_projection[source]#
- identical_particle_symmetrization(ingoing_parities: List[parity], outgoing_edge_qns: List[IdenticalParticleSymmetryOutEdgeInput]) bool [source]#
Verifies multi particle state symmetrization for identical particles.
In case of a multi particle state with identical particles, their exchange symmetry has to follow the spin statistic theorem.
For bosonic systems the total exchange symmetry (parity) has to be even (+1). For fermionic systems the total exchange symmetry (parity) has to be odd (-1).
In case of a particle decaying into N identical particles (N>1), the decaying particle has to have the same parity as required by the spin statistic theorem of the multi body state.
- class SpinNodeInput(l_magnitude, l_projection, s_magnitude, s_projection)[source]#
Bases:
object
- l_magnitude: l_magnitude[source]#
- l_projection: l_projection[source]#
- s_magnitude: s_magnitude[source]#
- s_projection: s_projection[source]#
- class SpinMagnitudeNodeInput(l_magnitude, s_magnitude)[source]#
Bases:
object
- l_magnitude: l_magnitude[source]#
- s_magnitude: s_magnitude[source]#
- ls_spin_validity(spin_input: SpinNodeInput) bool [source]#
Check for valid isospin magnitude and projection.
- class IsoSpinEdgeInput(isospin_magnitude, isospin_projection)[source]#
Bases:
object
- isospin_magnitude: isospin_magnitude[source]#
- isospin_projection: isospin_projection[source]#
- isospin_validity(isospin: IsoSpinEdgeInput) bool [source]#
Check for valid isospin magnitude and projection.
- isospin_conservation(ingoing_isospins: List[IsoSpinEdgeInput], outgoing_isospins: List[IsoSpinEdgeInput]) bool [source]#
Check for isospin conservation.
Implements
\[|I_1 - I_2| \leq I \leq |I_1 + I_2|\]Also checks \(I_{1,z} + I_{2,z} = I_z\) and if Clebsch-Gordan coefficients are all 0.
- class SpinEdgeInput(spin_magnitude, spin_projection)[source]#
Bases:
object
- spin_magnitude: spin_magnitude[source]#
- spin_projection: spin_projection[source]#
- spin_validity(spin: SpinEdgeInput) bool [source]#
Check for valid spin magnitude and projection.
- spin_conservation(ingoing_spins: List[SpinEdgeInput], outgoing_spins: List[SpinEdgeInput], interaction_qns: SpinNodeInput) bool [source]#
Check for spin conservation.
Implements
\[|S_1 - S_2| \leq S \leq |S_1 + S_2|\]and
\[|L - S| \leq J \leq |L + S|\]Also checks \(M_1 + M_2 = M\) and if Clebsch-Gordan coefficients are all 0.
See also
/docs/usage/ls-coupling
- spin_magnitude_conservation(ingoing_spins: List[SpinEdgeInput], outgoing_spins: List[SpinEdgeInput], interaction_qns: SpinMagnitudeNodeInput) bool [source]#
Check for spin conservation.
Implements
\[|S_1 - S_2| \leq S \leq |S_1 + S_2|\]and
\[|L - S| \leq J \leq |L + S|\]
- clebsch_gordan_helicity_to_canonical(ingoing_spins: List[SpinEdgeInput], outgoing_spins: List[SpinEdgeInput], interaction_qns: SpinNodeInput) bool [source]#
Implement Clebsch-Gordan checks.
For \(S_1, S_2\) to \(S\) and the \(L,S\) to \(J\) coupling based on the conversion of helicity to canonical amplitude sums.
Note
This rule does not check that the spin magnitudes couple correctly to \(L\) and \(S\), as this is already performed by
spin_magnitude_conservation
.
- helicity_conservation(ingoing_spin_mags: List[spin_magnitude], outgoing_helicities: List[spin_projection]) bool [source]#
Implementation of helicity conservation.
Check for \(|\lambda_2-\lambda_3| \leq S_1\).
- class GellMannNishijimaInput(charge, isospin_projection=None, strangeness=None, charmness=None, bottomness=None, topness=None, baryon_number=None, electron_lepton_number=None, muon_lepton_number=None, tau_lepton_number=None)[source]#
Bases:
object
- isospin_projection: isospin_projection | None[source]#
- strangeness: strangeness | None[source]#
- bottomness: bottomness | None[source]#
- baryon_number: baryon_number | None[source]#
- electron_lepton_number: electron_lepton_number | None[source]#
- muon_lepton_number: muon_lepton_number | None[source]#
- tau_lepton_number: tau_lepton_number | None[source]#
- gellmann_nishijima(edge_qns: GellMannNishijimaInput) bool [source]#
Check the Gell-Mann-Nishijima formula.
\[Q = I_3 + \frac{1}{2}(B+S+C+B'+T)\]where \(Q\) is charge (computed), \(I_3\) is
Spin.projection
ofisospin
, \(B\) isbaryon_number
, \(S\) isstrangeness
, \(C\) ischarmness
, \(B'\) isbottomness
, and \(T\) istopness
.
- class MassConservation(width_factor: float)[source]#
Bases:
object
Mass conservation rule.
- __call__(ingoing_edge_qns: List[MassEdgeInput], outgoing_edge_qns: List[MassEdgeInput]) bool [source]#
Implements mass conservation.
\(M_{out} - N \cdot W_{out} < M_{in} + N \cdot W_{in}\)
It makes sure that the net mass outgoing state \(M_{out}\) is smaller than the net mass of the ingoing state \(M_{in}\). Also the width \(W\) of the states is taken into account.