reaction

Definition and solving of particle reaction problems.

This is the core component of the expertsystem: it defines the StateTransitionGraph data structure that represents a specific particle reaction. The solving submodule is responsible for finding solutions for particle reaction problems.

class SolvingMode(value)[source]

Bases: enum.Enum

Types of modes for solving.

Fast = 1

find “likeliest” solutions only

Full = 2

find all possible solutions

class StateTransitionManager(initial_state: Sequence[Union[str, Tuple[str, Sequence[float]]]], final_state: Sequence[Union[str, Tuple[str, Sequence[float]]]], particles: Optional[expertsystem.particle.ParticleCollection] = None, allowed_intermediate_particles: Optional[List[str]] = None, interaction_type_settings: Dict[expertsystem.reaction.solving.InteractionTypes, Tuple[expertsystem.reaction.solving.EdgeSettings, expertsystem.reaction.solving.NodeSettings]] = None, formalism_type: str = 'helicity', topology_building: str = 'isobar', number_of_threads: Optional[int] = None, solving_mode: expertsystem.reaction.SolvingMode = <SolvingMode.Fast: 1>, reload_pdg: bool = False)[source]

Bases: object

Main handler for decay topologies.

add_final_state_grouping(fs_group: List[Union[str, List[str]]])None[source]
find_solutions(graph_setting_groups: Dict[float, List[Tuple[expertsystem.reaction.topology.StateTransitionGraph, expertsystem.reaction.solving.GraphSettings]]])expertsystem.reaction.solving.Result[source]

Check for solutions for a specific set of interaction settings.

property formalism_type
prepare_graphs() → Dict[float, List[Tuple[expertsystem.reaction.topology.StateTransitionGraph, expertsystem.reaction.solving.GraphSettings]]][source]
set_allowed_interaction_types(allowed_interaction_types: List[expertsystem.reaction.solving.InteractionTypes])None[source]
set_allowed_intermediate_particles(particle_names: List[str])None[source]
set_topology_builder(topology_builder: expertsystem.reaction.topology.SimpleStateTransitionTopologyBuilder)None[source]
check(initial_state: Union[List[str], str], final_state: Union[List[str], str], allowed_interactions: Optional[str] = None) → Set[str][source]

Check whether a transition from some initial to final state is allowed.

Raises

ValueError – if the reaction is not allowed. The second item of its args contains the violated conservation rules.

Returns

A set of the names of allowed intermediate states.

generate(initial_state: Union[str, Tuple[str, Sequence[float]], Sequence[Union[str, Tuple[str, Sequence[float]]]]], final_state: Sequence[Union[str, Tuple[str, Sequence[float]]]], allowed_intermediate_particles: Optional[List[str]] = None, allowed_interaction_types: Optional[Union[str, List[str]]] = None, formalism_type: str = 'helicity', particles: Optional[expertsystem.particle.ParticleCollection] = None, topology_building: str = 'isobar', number_of_threads: Optional[int] = None)expertsystem.reaction.solving.Result[source]

A convenient facade for the usual workflow.

An example (where, for illustrative purposes only, we specify all arguments) would be:

>>> import expertsystem as es
>>> result = es.reaction.generate(
...     initial_state="D0",
...     final_state=["K~0", "K+", "K-"],
...     allowed_intermediate_particles=["a(0)(980)", "a(2)(1320)-"],
...     allowed_interaction_types="ew",
...     formalism_type="helicity",
...     particles=es.io.load_pdg(),
...     topology_building="isobar",
... )
>>> len(result.solutions)
4
load_default_particles()expertsystem.particle.ParticleCollection[source]

Load the default particle list that comes with the expertsystem.

Submodules and Subpackages