qrules#
import qrules
A rule based system that facilitates particle reaction analysis.
QRules generates allowed particle transitions from a set of conservation rules and boundary conditions as specified by the user. The user boundary conditions for a particle reaction problem are for example the initial state, final state, and allowed interactions.
The core of qrules
computes which transitions (represented by a MutableTransition
)
are allowed between a certain initial and final state. Internally, the system propagates
the quantum numbers defined by the particle
module through the MutableTransition
,
while satisfying the rules define by the conservation_rules
module. See
Generate transitions and Particle database.
Finally, the io
module provides tools that can read and write the objects of this
framework.
- check_reaction_violations(initial_state: str | Tuple[str, Sequence[float]] | Sequence[str | Tuple[str, Sequence[float]]], final_state: Sequence[str | Tuple[str, Sequence[float]]], mass_conservation_factor: float | None = 3.0, particle_db: ParticleCollection | None = None, max_angular_momentum: int = 1, max_spin_magnitude: float = 2.0) Set[FrozenSet[str]] [source]#
Determine violated interaction rules for a given particle reaction.
Warning
This function only guarantees to find P, C and G parity violations, if itβs a two body decay. If all initial and final states have the C/G parity defined, then these violations are also determined correctly.
- Parameters:
initial_state β Shortform description of the initial state w/o spin projections.
final_state β Shortform description of the final state w/o spin projections.
mass_conservation_factor β Factor with which the width is multiplied when checking for
MassConservation
. Set toNone
in order to deactivate mass conservation.particle_db (Optional) β Custom
ParticleCollection
object. Defaults to theParticleCollection
returned byload_pdg
.max_angular_momentum β Maximum angular momentum over which to generate \(LS\)-couplings.
max_spin_magnitude β Maximum spin magnitude over which to generate \(LS\)-couplings.
- Returns:
Set of least violating rules. The set can have multiple entries, as several quantum numbers can be violated. Each entry in the frozenset represents a group of rules that together violate all possible quantum number configurations.
Example
>>> import qrules >>> qrules.check_reaction_violations( ... initial_state="pi0", ... final_state=["gamma", "gamma", "gamma"], ... ) {frozenset({'c_parity_conservation'})}
See also
- generate_transitions(initial_state: str | Tuple[str, Sequence[float]] | Sequence[str | Tuple[str, Sequence[float]]], final_state: Sequence[str | Tuple[str, Sequence[float]]], allowed_intermediate_particles: List[str] | None = None, allowed_interaction_types: str | Iterable[str] | None = None, formalism: str = 'canonical-helicity', particle_db: ParticleCollection | None = None, mass_conservation_factor: float | None = 3.0, max_angular_momentum: int = 2, max_spin_magnitude: float = 2.0, topology_building: str = 'isobar', number_of_threads: int | None = None) ReactionInfo [source]#
Generate allowed transitions between an initial and final state.
Serves as a facade to the
StateTransitionManager
(see Generate transitions).- Parameters:
initial_state (list) β A list of particle names in the initial state. You can specify spin projections for these particles with a
tuple
, e.g.("J/psi(1S)", [-1, 0, +1])
. If spin projections are not specified, all projections are taken, so the example here would be equivalent to"J/psi(1S)"
.final_state (list) β Same as
initial_state
, but for final state particles.allowed_intermediate_particles (
list
, optional) β A list of particle states that you want to allow as intermediate states. This helps (1) filter out resonances and (2) speed up computation time.allowed_interaction_types β Interaction types you want to consider. For instance,
["s", "em"]
results inEM
andSTRONG
and["strong"]
results inSTRONG
.formalism (
str
, optional) β Formalism that you intend to use in the eventual amplitude model.particle_db (
ParticleCollection
, optional) β The particles that you want to be involved in the reaction. Usesload_pdg
by default. Itβs better to use a subset for larger reactions, because of the computation times. This argument is especially useful when you want to use your own particle definitions (see Particle database).mass_conservation_factor β Width factor that is taken into account for for the
MassConservation
rule.max_angular_momentum β Maximum angular momentum over which to generate angular momenta.
max_spin_magnitude β Maximum spin magnitude over which to generate spins.
topology_building (str) β
Technique with which to build the
Topology
instances. Allowed values are:"isobar"
: Isobar model (each state decays into two states)"nbody"
: Use one central node and connect initial and final states to it
number_of_threads β Number of cores with which to compute the allowed transitions. Defaults to the current value returned by
settings.NumberOfThreads.get()
.
An example (where, for illustrative purposes only, we specify all arguments) would be:
>>> import qrules >>> reaction = qrules.generate_transitions( ... initial_state="D0", ... final_state=["K~0", "K+", "K-"], ... allowed_intermediate_particles=["a(0)(980)", "a(2)(1320)-"], ... allowed_interaction_types=["e", "w"], ... formalism="helicity", ... particle_db=qrules.load_pdg(), ... topology_building="isobar", ... ) >>> len(reaction.transitions) 4 >>> len(reaction.group_by_topology()) 3
- load_default_particles() ParticleCollection [source]#
Load the default particle list that comes with
qrules
.Runs
load_pdg
and supplements its output definitions from the fileadditional_definitions.yml
.
Submodules and Subpackages
- argument_handling
- combinatorics
- conservation_rules
GraphElementRule
EdgeQNConservationRule
ConservationRule
additive_quantum_number_rule()
ChargeConservation
BaryonNumberConservation
ElectronLNConservation
MuonLNConservation
TauLNConservation
StrangenessConservation
CharmConservation
BottomnessConservation
parity_conservation()
HelicityParityEdgeInput
parity_conservation_helicity()
CParityEdgeInput
CParityNodeInput
c_parity_conservation()
GParityEdgeInput
GParityNodeInput
g_parity_conservation()
IdenticalParticleSymmetryOutEdgeInput
identical_particle_symmetrization()
SpinNodeInput
SpinMagnitudeNodeInput
ls_spin_validity()
IsoSpinEdgeInput
isospin_validity()
isospin_conservation()
SpinEdgeInput
spin_validity()
spin_conservation()
spin_magnitude_conservation()
clebsch_gordan_helicity_to_canonical()
helicity_conservation()
GellMannNishijimaInput
GellMannNishijimaInput.charge
GellMannNishijimaInput.isospin_projection
GellMannNishijimaInput.strangeness
GellMannNishijimaInput.charmness
GellMannNishijimaInput.bottomness
GellMannNishijimaInput.topness
GellMannNishijimaInput.baryon_number
GellMannNishijimaInput.electron_lepton_number
GellMannNishijimaInput.muon_lepton_number
GellMannNishijimaInput.tau_lepton_number
gellmann_nishijima()
MassEdgeInput
MassConservation
- particle
Spin
Particle
Particle.name
Particle.pid
Particle.latex
Particle.spin
Particle.mass
Particle.width
Particle.charge
Particle.isospin
Particle.strangeness
Particle.charmness
Particle.bottomness
Particle.topness
Particle.baryon_number
Particle.electron_lepton_number
Particle.muon_lepton_number
Particle.tau_lepton_number
Particle.parity
Particle.c_parity
Particle.g_parity
Particle.is_lepton()
ParticleCollection
create_particle()
create_antiparticle()
load_pdg()
- quantum_numbers
Parity
EdgeQuantumNumbers
EdgeQuantumNumbers.pid()
EdgeQuantumNumbers.mass()
EdgeQuantumNumbers.width()
EdgeQuantumNumbers.spin_magnitude()
EdgeQuantumNumbers.spin_projection()
EdgeQuantumNumbers.charge()
EdgeQuantumNumbers.isospin_magnitude()
EdgeQuantumNumbers.isospin_projection()
EdgeQuantumNumbers.strangeness()
EdgeQuantumNumbers.charmness()
EdgeQuantumNumbers.bottomness()
EdgeQuantumNumbers.topness()
EdgeQuantumNumbers.baryon_number()
EdgeQuantumNumbers.electron_lepton_number()
EdgeQuantumNumbers.muon_lepton_number()
EdgeQuantumNumbers.tau_lepton_number()
EdgeQuantumNumbers.parity()
EdgeQuantumNumbers.c_parity()
EdgeQuantumNumbers.g_parity()
NodeQuantumNumbers
InteractionProperties
arange()
- settings
- solving
- system_control
- topology
FrozenDict
Edge
Topology
Topology.nodes
Topology.edges
Topology.incoming_edge_ids
Topology.outgoing_edge_ids
Topology.intermediate_edge_ids
Topology.is_isomorphic()
Topology.get_edge_ids_ingoing_to_node()
Topology.get_edge_ids_outgoing_from_node()
Topology.get_originating_final_state_edge_ids()
Topology.get_originating_initial_state_edge_ids()
Topology.relabel_edges()
Topology.swap_edges()
get_originating_node_list()
MutableTopology
InteractionNode
SimpleStateTransitionTopologyBuilder
create_isobar_topologies()
create_n_body_topology()
Transition
FrozenTransition
MutableTransition
- transition
SolvingMode
ExecutionInfo
ProblemSet
StateTransitionManager
StateTransitionManager.interaction_determinators
StateTransitionManager.topologies
StateTransitionManager.set_allowed_intermediate_particles()
StateTransitionManager.formalism
StateTransitionManager.add_final_state_grouping()
StateTransitionManager.get_allowed_interaction_types()
StateTransitionManager.set_allowed_interaction_types()
StateTransitionManager.create_problem_sets()
StateTransitionManager.find_solutions()
StateTransitionManager.find_quantum_number_transitions()
State
StateTransition
ReactionInfo