Skip to content

Remove QRules from interface #281

Description

@redeboer

It would be better if AmpForm modules can be built from an internal data structure, just like is happening in ComPWA/compwa.github.io#129 and ComPWA/compwa.github.io#133 (see in particular ComPWA/compwa.github.io#133 (comment)). That would make it easier to build up an amplitude model without having to generate all transitions with QRules. A problem with QRules is that its Transition class is too general for isobar decays, which makes the amplitude building code clunky.

So we need a data structure that:

  1. contains all information about an isobar decay that's required to formulate a complete amplitude model, including:
    • polarizations (helicities) of initial state and final states
    • resonances and their decay products (particularly the final state products to which they decay)
    • (?) spectator particles of those resonances
    • optional: LS-couplings
    • ...?
  2. is easy to navigate over while building up the amplitude expression
  3. is easy to construct for users

Activity

  1. self-assigned this
    on Apr 27, 2022
  2. redeboer commented on Apr 27, 2022

    @redeboer
    MemberAuthor

    Some idea:

    from typing import Generic
    
    from attrs import frozen
    
    State = TypeVar("State")
    Interaction = TypeVar("Interaction")
    
    
    @frozen
    class IsobarNode(Generic[State, Interaction]):
        parent: State
        child1: State | IsobarNode
        child2: State | IsobarNode
        interaction: Interaction | None = field(default=None)
    
        @property
        def children(self) -> tuple[State, ...]:
            def flatten(
                obj: State | IsobarNode[State, Interaction]
            ) -> Sequence[State]:
                if isinstance(obj, IsobarNode):
                    return obj.children
                return [obj]
    
            return (*flatten(self.child1), *flatten(self.child2))

    where State and Interaction could be further specified with e.g.:

    import sympy as sp
    
    @frozen
    class Particle:  # State
        name: str
        spin: sp.Rational
        # polarization: sp.Rational  # (?)
        parity: int
    
    
    @frozen
    class LSCoupling:  # Interaction
        L: int
        S: sp.Rational
  3. added this to the 0.15.0 milestone on May 20, 2022
  4. modified the milestones: 0.15.0, 0.16.0 on Mar 4, 2024
  5. removed their assignment
    on Sep 30, 2024
  6. self-assigned this
    on Jul 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions