naming
naming¶
import ampform.helicity.naming
Generate descriptions used in the helicity
formalism.
- class NameGenerator[source]¶
Bases:
ABC
Name generator for amplitudes and coefficients in a
HelicityModel
.See also
- abstract generate_amplitude_name(transition: StateTransition, node_id: int | None = None) str [source]¶
Generates a unique name for the amplitude corresponding.
That is, corresponging to the given
StateTransition
. Ifnode_id
is given, it generates a unique name for the partial amplitude corresponding to the interaction node of the givenStateTransition
.
- abstract generate_sequential_amplitude_suffix(transition: StateTransition) str [source]¶
Generate unique suffix for a sequential amplitude transition.
- abstract generate_coefficient_suffix(transition: StateTransition, node_id: int) str [source]¶
Generate partial amplitude coefficient name suffix.
- class HelicityAmplitudeNameGenerator(transitions: ReactionInfo | Iterable[StateTransition], insert_parent_helicities: bool = False, insert_child_helicities: bool = True)[source]¶
Bases:
NameGenerator
- property insert_parent_helicities: bool¶
Insert helicities of each parent state in the coefficient names.
- property insert_child_helicities: bool¶
Embed the helicity of each decay product in the coefficients.
- generate_amplitude_name(transition: StateTransition, node_id: int | None = None) str [source]¶
Generates a unique name for the amplitude corresponding.
That is, corresponging to the given
StateTransition
. Ifnode_id
is given, it generates a unique name for the partial amplitude corresponding to the interaction node of the givenStateTransition
.
- generate_coefficient_suffix(transition: StateTransition, node_id: int) str [source]¶
Generate partial amplitude coefficient name suffix.
- generate_sequential_amplitude_suffix(transition: StateTransition) str [source]¶
Generate unique suffix for a sequential amplitude transition.
- class CanonicalAmplitudeNameGenerator(transitions: ReactionInfo | Iterable[StateTransition], insert_parent_helicities: bool = False, insert_child_helicities: bool = False, insert_ls_combinations: bool = True)[source]¶
Bases:
HelicityAmplitudeNameGenerator
- generate_amplitude_name(transition: StateTransition, node_id: int | None = None) str [source]¶
Generates a unique name for the amplitude corresponding.
That is, corresponging to the given
StateTransition
. Ifnode_id
is given, it generates a unique name for the partial amplitude corresponding to the interaction node of the givenStateTransition
.
- generate_transition_label(transition: StateTransition) str [source]¶
Generate a label for a coherent intensity, including spin projection.
>>> import qrules >>> reaction = qrules.generate_transitions( ... initial_state="J/psi(1S)", ... final_state=["gamma", "pi0", "pi0"], ... allowed_intermediate_particles=["f(0)(980)"], ... ) >>> print(generate_transition_label(reaction.transitions[0])) J/\psi(1S)_{-1} \to \gamma_{-1} \pi^{0}_{0} \pi^{0}_{0} >>> print(generate_transition_label(reaction.transitions[-1])) J/\psi(1S)_{+1} \to \gamma_{+1} \pi^{0}_{0} \pi^{0}_{0}
- get_helicity_angle_label(topology: Topology, state_id: int) tuple[str, str] [source]¶
Generate a nested helicity angle label for \(\phi,\theta\).
See
get_boost_chain_suffix()
for the meaning of the suffix.
- get_boost_chain_suffix(topology: Topology, state_id: int) str [source]¶
Generate a subscript-superscript to identify a chain of Lorentz boosts.
The generated subscripts describe the decay sequence from the right to the left, separated by commas. Resonance edge IDs are expressed as a sum of the final state IDs that lie below them (see
determine_attached_final_state()
). The generated label does not state the top-most edge (the initial state).Example
The following two allowed isobar topologies for a 1-to-5-body decay illustrates how the naming scheme results in a unique label for each of the eight edges in the decay topology. Note that label only uses final state IDs, but still reflects the internal decay topology.
>>> from qrules.topology import create_isobar_topologies >>> topologies = create_isobar_topologies(5) >>> topology = topologies[0] >>> for i in topology.intermediate_edge_ids | topology.outgoing_edge_ids: ... suffix = get_boost_chain_suffix(topology, i) ... print(f"{i}: 'phi{suffix}'") 0: 'phi_0^034' 1: 'phi_1^12' 2: 'phi_2^12' 3: 'phi_3^34,034' 4: 'phi_4^34,034' 5: 'phi_034' 6: 'phi_12' 7: 'phi_34^034' >>> topology = topologies[1] >>> for i in topology.intermediate_edge_ids | topology.outgoing_edge_ids: ... suffix = get_boost_chain_suffix(topology, i) ... print(f"{i}: 'phi{suffix}'") 0: 'phi_0^01' 1: 'phi_1^01' 2: 'phi_2^234' 3: 'phi_3^34,234' 4: 'phi_4^34,234' 5: 'phi_01' 6: 'phi_234' 7: 'phi_34^234'
Some labels explained:
phi_12
: edge 6 on the left topology, because for this topology, we have \(p_6=p_1+p_2\).phi_234
: edge 6 right, because for this topology, \(p_6=p_2+p_3+p_4\).phi_1^12
: edge 1 left, because 1 decays from \(p_6=p_1+p_2\).phi_1^01
: edge 1 right, because it decays from \(p_5=p_0+p_1\).phi_4^34,234
: edge 4 right, because it decays from edge 7 (\(p_7=p_3+p_4\)), which comes from edge 6 (\(p_7=p_2+p_3+p_4\)).
As noted, the top-most parent (initial state) is not listed in the label.
- get_helicity_suffix(topology: Topology, state_id: int) str [source]¶
Create an identifier suffix for a topology.
Used in Spin alignment. Comparable to
get_boost_chain_suffix()
.