particle

Collection of data structures and functions for particle information.

This module defines a particle as a collection of quantum numbers and things related to this.

class AbstractQNConverter[source]

Bases: abc.ABC

Abstract interface for a quantum number converter.

abstract convert_to_dict(qn_type, qn_value)[source]
abstract parse_from_dict(data_dict)[source]
class CompareGraphElementPropertiesFunctor(ignored_qn_list=None)[source]

Bases: object

Functor for comparing graph elements.

__call__(props1, props2)[source]

Call self as a function.

compare_qn_numbers(qns1, qns2)[source]
class InteractionQuantumNumberNames[source]

Bases: enum.Enum

Definition of quantum number names for interaction nodes.

L = 1
ParityPrefactor = 3
S = 2
class Labels[source]

Bases: enum.Enum

Labels that are useful in the particle module.

Class = 1
Component = 2
DecayInfo = 3
Name = 4
Parameter = 5
Pid = 6
PreFactor = 7
Projection = 8
QuantumNumber = 9
Type = 10
Value = 11
class ParticleDecayPropertyNames[source]

Bases: enum.Enum

Definition of decay properties names of particles.

Width = 1
class ParticlePropertyNames[source]

Bases: enum.Enum

Definition of properties names of particles.

Mass = 2
Pid = 1
class QuantumNumberClasses[source]

Bases: enum.Enum

Types of quantum number classes in the form of an enumerate.

Float = 2
Int = 1
Spin = 3
class Spin(mag, proj)[source]

Bases: object

Simple struct-like class defining spin as magnitude plus projection.

__eq__(other)[source]

Return self==value.

magnitude()[source]
projection()[source]
class StateQuantumNumberNames[source]

Bases: enum.Enum

Definition of quantum number names for states.

BaryonNumber = 1
Bottomness = 2
CParity = 5
Charge = 3
Charm = 4
ElectronLN = 6
GParity = 7
IsoSpin = 8
MuonLN = 9
Parity = 10
Spin = 11
Strangeness = 12
TauLN = 13
Topness = 14
add_to_particle_database(particle)[source]

Add a particle dictionary object to the particle database dict.

The key will be extracted from the particle name (XML tag Name). If the key already exists, the entry in particle database will be overwritten by this one.

calculate_combinatorics(edges, state_particles, attached_external_edges_per_node, allowed_particle_groupings=None)[source]
check_if_spin_projections_set(state)[source]
check_qns_equal(qns_state, qns_particle)[source]
compare_qns(qn_dict, qn_dict2)[source]
create_spin_domain(list_of_magnitudes, set_projection_zero=False)[source]
find_particle(search_term)[source]

Search for a particle in the database, by PID or name.

Return type

Union[dict, Dict[str, dict]]

Returns

When searching by name (str), all matches will be returned in the form of a dict, with the particle names as keys. For instance, searching "f" returns all particles that contain an "f" in their name. If there’s only one search result, only the definition of particle is returned.

get_interaction_property(interaction_properties, qn_name, converter=None)[source]
get_particle_candidates_for_state(state, allowed_particle_list)[source]
get_particle_copy(search_term)[source]

Get a deepcopy of a particle or particles from the database.

This is useful when you want to manipulate that copy and add it as a new entry to the particle database.

Parameters

search_term (Union[str, int]) – see find_particle.

Return type

Union[dict, Dict[str, dict]]

get_particle_property(particle_properties, qn_name, converter=None)[source]
initialize_allowed_particle_list(allowed_particle_list)[source]
initialize_edges(graph, edge_particle_dict)[source]
initialize_external_edge_lists(attached_external_edges_per_node, edge_particle_mapping)[source]
initialize_graph(graph, initial_state, final_state, final_state_groupings)[source]
initialize_graphs_with_particles(graphs, allowed_particle_list=None)[source]
is_boson(qn_dict)[source]
load_particles(filename)[source]

Add entries to the particle database from a custom config file.

By default, the expert system loads the particle database from the XML file particle_list.xml that comes with the expertsystem. Use this function to append or overwrite definitions in the particle database.

Note

If a particle name in the loaded XML file already exists in the particle database, the one in the particle database will be overwritten.

Return type

None

merge_qn_props(qns_state, qns_particle)[source]
populate_edge_with_spin_projections(graph, edge_id, spin_projections)[source]
write_particle_database(filename)[source]

Write particle database instance to human readable format.

Return type

None