system_control#

import qrules.system_control

Functions that steer operations of qrules.

create_edge_properties(particle: Particle, spin_projection: float | None = None) Dict[Type[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], int | float][source]#
create_node_properties(interactions: InteractionProperties) Dict[Type[l_magnitude | l_projection | s_magnitude | s_projection | parity_prefactor], int | float][source]#
find_particle(state: Dict[Type[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], 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:

states – The quantum number dictionary. particle_db: A ParticleCollection which is used to retrieve a reference state 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[l_magnitude | l_projection | s_magnitude | s_projection | parity_prefactor], int | float]) InteractionProperties[source]#
filter_interaction_types(valid_determined_interaction_types: List[InteractionType], allowed_interaction_types: List[InteractionType]) List[InteractionType][source]#
class InteractionDeterminator[source]#

Bases: ABC

Interface for interaction determination.

abstract check(in_states: List[Tuple[Particle, float]], out_states: List[Tuple[Particle, float]], interactions: InteractionProperties) List[InteractionType][source]#
class GammaCheck[source]#

Bases: InteractionDeterminator

Conservation check for photons.

check(in_states: List[Tuple[Particle, float]], out_states: List[Tuple[Particle, float]], interactions: InteractionProperties) List[InteractionType][source]#
class LeptonCheck[source]#

Bases: InteractionDeterminator

Conservation check lepton numbers.

check(in_states: List[Tuple[Particle, float]], out_states: List[Tuple[Particle, float]], interactions: InteractionProperties) List[InteractionType][source]#
remove_duplicate_solutions(solutions: List[MutableTransition[Tuple[Particle, float], InteractionProperties]], remove_qns_list: Set[Type[l_magnitude | l_projection | s_magnitude | s_projection | parity_prefactor]] | None = None, ignore_qns_list: Set[Type[l_magnitude | l_projection | s_magnitude | s_projection | parity_prefactor]] | None = None) List[MutableTransition[Tuple[Particle, float], InteractionProperties]][source]#
class NodePropertyComparator(ignored_qn_list: Set[Type[l_magnitude | l_projection | s_magnitude | s_projection | parity_prefactor]] | None = None)[source]#

Bases: object

Functor 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[l_magnitude | l_projection | s_magnitude | s_projection | parity_prefactor], allowed_values: List) Callable[[MutableTransition[Tuple[Particle, float], 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]