Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reorganize amplitude building functions and make public #61

Open
redeboer opened this issue May 19, 2021 · 2 comments
Open

Reorganize amplitude building functions and make public #61

redeboer opened this issue May 19, 2021 · 2 comments
Labels
📝 Docs Improvements or additions to documentation 🔨 Maintenance Maintenance and upkeep improvements

Comments

@redeboer
Copy link
Member

redeboer commented May 19, 2021

For the documentation (but arguably also for the design), it would be more transparent to build the amplitude model through functions. In particular, the _generate_partial_decay methods can be reformulated so that they just produce a product of terms that are relevant to the helicity kinematics only (no dynamics).

This issue was motivated by ComPWA/qrules#57, where it would have been nice to explain how the InteractionProperties are used to create Clebsch-Gordan coefficients in the canonical basis by pointing to the functions responsible for this in AmpForm:

def _generate_partial_decay( # pylint: disable=too-many-locals
self, graph: StateTransitionGraph[ParticleWithSpin], node_id: int
) -> sp.Expr:
wigner_d = self._generate_wigner_d(graph, node_id)
dynamics_symbol = self.__create_dynamics(graph, node_id)
return wigner_d * dynamics_symbol

def _generate_partial_decay( # pylint: disable=too-many-locals
self, graph: StateTransitionGraph[ParticleWithSpin], node_id: int
) -> sp.Symbol:

@redeboer redeboer added 📝 Docs Improvements or additions to documentation 🔨 Maintenance Maintenance and upkeep improvements labels May 19, 2021
@redeboer redeboer added this to the 0.9.0 milestone May 19, 2021
@redeboer redeboer self-assigned this May 19, 2021
@redeboer
Copy link
Member Author

redeboer commented May 19, 2021

This may also make it easier to write some unit tests for the Clebsch-Gordan coefficients. These arguments j1 through to m3 are rather error-prone:

cg_ls = CG(
j1=sp.nsimplify(ang_mom.magnitude),
m1=sp.nsimplify(ang_mom.projection),
j2=sp.nsimplify(spin.magnitude),
m2=sp.nsimplify(decay_particle_lambda),
j3=sp.nsimplify(parent_spin.magnitude),
m3=sp.nsimplify(decay_particle_lambda),
)
cg_ss = CG(
j1=sp.nsimplify(daughter_spins[0].magnitude),
m1=sp.nsimplify(daughter_spins[0].projection),
j2=sp.nsimplify(daughter_spins[1].magnitude),
m2=sp.nsimplify(-daughter_spins[1].projection),
j3=sp.nsimplify(spin.magnitude),
m3=sp.nsimplify(decay_particle_lambda),
)
return cg_ls * cg_ss * amplitude

@redeboer redeboer modified the milestones: 0.9.0, 0.10.0 May 27, 2021
@redeboer redeboer modified the milestones: 0.10.0, 0.10.1, 0.10.2 Jun 23, 2021
@redeboer redeboer removed this from the 0.11.1 milestone Sep 20, 2021
@redeboer redeboer added this to the 0.13.2 milestone Mar 7, 2022
@redeboer
Copy link
Member Author

Largely addressed through #87, which introduced formulate_clebsch_gordan_coefficients() and formulate_wigner_d(). With #245, however, the HelicityAmplitudeBuilder has again acquired a lot of implementation methods that are note well documented.

@redeboer redeboer removed this from the 0.13.2 milestone Mar 10, 2022
@redeboer redeboer moved this to 📋 Backlog in Student projects Jul 27, 2022
@redeboer redeboer removed their assignment Sep 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
📝 Docs Improvements or additions to documentation 🔨 Maintenance Maintenance and upkeep improvements
Projects
None yet
Development

No branches or pull requests

1 participant