system_control#
import qrules.system_control
Functions that steer operations of qrules.
- create_edge_properties(particle: Particle, spin_projection: float | Fraction | None = None) GraphEdgePropertyMap[source]#
- create_node_properties(interactions: InteractionProperties) dict[type[l_magnitude | l_projection | s_magnitude | s_projection | parity_prefactor], int | float | Fraction][source]#
- find_particle(state: GraphEdgePropertyMap, particle_db: ParticleCollection) ParticleWithSpin[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:
states β The quantum number dictionary. particle_db: A
ParticleCollectionwhich is used to retrieve a referencestateto 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[l_magnitude | l_projection | s_magnitude | s_projection | parity_prefactor], int | float | Fraction]) InteractionProperties[source]#
- filter_interaction_types(valid_determined_interaction_types: list[InteractionType], allowed_interaction_types: list[InteractionType]) list[InteractionType][source]#
- class InteractionDeterminator[source]#
Bases:
ABCInterface for interaction determination.
- abstractmethod check(in_states: list[ParticleWithSpin], out_states: list[ParticleWithSpin], interactions: InteractionProperties) list[InteractionType][source]#
- class GammaCheck[source]#
Bases:
InteractionDeterminatorConservation check for photons.
- check(in_states: list[ParticleWithSpin], out_states: list[ParticleWithSpin], interactions: InteractionProperties) list[InteractionType][source]#
- class LeptonCheck[source]#
Bases:
InteractionDeterminatorConservation check lepton numbers.
- check(in_states: list[ParticleWithSpin], out_states: list[ParticleWithSpin], interactions: InteractionProperties) list[InteractionType][source]#
- remove_duplicate_solutions(solutions: list[MutableTransition[ParticleWithSpin, InteractionProperties]], remove_qns_list: set[type[NodeQuantumNumber]] | None = None, ignore_qns_list: set[type[NodeQuantumNumber]] | None = None) list[MutableTransition[ParticleWithSpin, InteractionProperties]][source]#
- class NodePropertyComparator(ignored_qn_list: set[type[l_magnitude | l_projection | s_magnitude | s_projection | parity_prefactor]] | None = None)[source]#
Bases:
objectFunctor for comparing node properties in two graphs.
- __call__(interactions1: InteractionProperties, interactions2: InteractionProperties) bool[source]#
Call self as a function.
- filter_graphs(graphs: list[MutableTransition], filters: Iterable[Callable[[MutableTransition], bool]]) list[MutableTransition][source]#
Implement filtering of a list of
MutableTransitionβs.This function can be used to select a subset of
MutableTransitionβ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[NodeQuantumNumber], allowed_values: list) Callable[[MutableTransition[ParticleWithSpin, InteractionProperties]], 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]