Skip to content

Commit

Permalink
chore: import sympy quantum module inline (faster imports)
Browse files Browse the repository at this point in the history
  • Loading branch information
redeboer committed Dec 6, 2021
1 parent 790726d commit f08f1f0
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/ampform/helicity/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# pylint: disable=import-outside-toplevel
"""Generate an amplitude model with the helicity formalism."""

import collections
Expand Down Expand Up @@ -25,8 +26,6 @@
perform_external_edge_identical_particle_combinatorics,
)
from qrules.transition import ReactionInfo, StateTransition
from sympy.physics.quantum.cg import CG
from sympy.physics.quantum.spin import Rotation as Wigner

from ampform.dynamics.builder import (
ResonanceDynamicsBuilder,
Expand Down Expand Up @@ -419,6 +418,8 @@ def formulate_clebsch_gordan_coefficients(
= C^{1,(-1-0)}_{2,0,1,(-1-0)} C^{1,(-1-0)}_{1,-1,0,0}
= C^{1,-1}_{2,0,1,-1} C^{1,-1}_{1,-1,0,0}
"""
from sympy.physics.quantum.cg import CG

decay = TwoBodyDecay.from_transition(transition, node_id)

angular_momentum = decay.interaction.l_magnitude
Expand Down Expand Up @@ -492,6 +493,8 @@ def formulate_wigner_d(transition: StateTransition, node_id: int) -> sp.Expr:
= D^{1}_{+1,(-1-0)}\left(-\phi_0,\theta_0,0\right)
= D^{1}_{1,-1}\left(-\phi_0,\theta_0,0\right)
"""
from sympy.physics.quantum.spin import Rotation as Wigner

decay = TwoBodyDecay.from_transition(transition, node_id)
_, phi, theta = _generate_kinematic_variables(transition, node_id)
return Wigner.D(
Expand Down

0 comments on commit f08f1f0

Please sign in to comment.