system_control#
import qrules.system_control
Functions that steer operations of qrules
.
- create_edge_properties(particle: Particle, spin_projection: Optional[float] = None) Dict[Type[Union[pid, mass, width, spin_magnitude, spin_projection, charge, isospin_magnitude, isospin_projection, strangeness, charmness, bottomness, topness, baryon_number, electron_lepton_number, muon_lepton_number, tau_lepton_number, parity, c_parity, g_parity]], Union[int, float]] [source]#
- create_node_properties(node_props: InteractionProperties) Dict[Type[Union[l_magnitude, l_projection, s_magnitude, s_projection, parity_prefactor]], Union[int, float]] [source]#
- find_particle(state: Dict[Type[Union[pid, mass, width, spin_magnitude, spin_projection, charge, isospin_magnitude, isospin_projection, strangeness, charmness, bottomness, topness, baryon_number, electron_lepton_number, muon_lepton_number, tau_lepton_number, parity, c_parity, g_parity]], Union[int, float]], particle_db: ParticleCollection) Tuple[Particle, float] [source]#
Create a Particle with spin projection from a qn dictionary.
The implementation assumes the edge properties match the attributes of a particle inside the
ParticleCollection
.- Parameters:
edge_props β The quantum number dictionary.
particle_db β A
ParticleCollection
which is used to retrieve a referencestate
to lower the memory footprint.
- Raises:
KeyError β If the edge properties do not contain the pid information or no particle with the same pid is found in the
ParticleCollection
.ValueError β If the edge properties do not contain spin projection info.
- create_interaction_properties(qn_solution: Dict[Type[Union[l_magnitude, l_projection, s_magnitude, s_projection, parity_prefactor]], Union[int, float]]) InteractionProperties [source]#
- filter_interaction_types(valid_determined_interaction_types: List[InteractionType], allowed_interaction_types: List[InteractionType]) List[InteractionType] [source]#
- class GammaCheck[source]#
Bases:
InteractionDeterminator
Conservation check for photons.
- class LeptonCheck[source]#
Bases:
InteractionDeterminator
Conservation check lepton numbers.
- remove_duplicate_solutions(solutions: List[StateTransitionGraph[Tuple[Particle, float]]], remove_qns_list: Optional[Set[Type[Union[l_magnitude, l_projection, s_magnitude, s_projection, parity_prefactor]]]] = None, ignore_qns_list: Optional[Set[Type[Union[l_magnitude, l_projection, s_magnitude, s_projection, parity_prefactor]]]] = None) List[StateTransitionGraph[Tuple[Particle, float]]] [source]#
- class NodePropertyComparator(ignored_qn_list: Optional[Set[Type[Union[l_magnitude, l_projection, s_magnitude, s_projection, parity_prefactor]]]] = None)[source]#
Bases:
object
Functor for comparing node properties in two graphs.
- __call__(node_props1: InteractionProperties, node_props2: InteractionProperties) bool [source]#
Call self as a function.
- filter_graphs(graphs: List[StateTransitionGraph], filters: Iterable[Callable[[StateTransitionGraph], bool]]) List[StateTransitionGraph] [source]#
Implement filtering of a list of
StateTransitionGraph
βs.This function can be used to select a subset of
StateTransitionGraph
βs from a list. Only the graphs passing all supplied filters will be returned.Note
For the more advanced user, lambda functions can be used as filters.
Example
Selecting only the solutions, in which the \(\rho\) decays via p-wave:
my_filter = require_interaction_property( "rho", InteractionQuantumNumberNames.L, create_spin_domain([1], True), ) filtered_solutions = filter_graphs(solutions, [my_filter])
- require_interaction_property(ingoing_particle_name: str, interaction_qn: Type[Union[l_magnitude, l_projection, s_magnitude, s_projection, parity_prefactor]], allowed_values: List) Callable[[StateTransitionGraph[Tuple[Particle, float]]], bool] [source]#
Filter function.
Closure, which can be used as a filter function in
filter_graphs()
.It selects graphs based on a requirement on the property of specific interaction nodes.
- Parameters:
ingoing_particle_name β name of particle, used to find nodes which have a particle with this name as βingoingβ
interaction_qn β interaction quantum number
allowed_values β list of allowed values, that the interaction quantum number may take
- Returns:
True if the graph has nodes with an ingoing particle of the given name, and the graph fullfills the quantum number requirement
False otherwise
- Return type:
Callable[Any, bool]