# Common routines

AngularMomentumAlgebra.triangle_rangeFunction
triangle_range(a,b)

Find all k such that |a-b| ≤ k ≤ a + b. This is useful when expanding matrix elements of tensors between angular momenta a and b in multipoles k; triangle_range can then be used to decided which multipole terms are required.

source
AngularMomentumAlgebra.@linearly_combinableMacro
@linearly_combinable TT

Turns the type TT into a linearly combinable type, i.e. defines arithmetic operators.

Examples

julia> @linearly_combinable Symbol

julia> 4*(:x) - 5*(:y)
4 :x - 5 :y
source
AngularMomentumAlgebra.@δMacro
@δ (a,b)[, (c,d) ...]

Kronecker $\delta_{ab}\delta_{cd}...$ that tests each pair of values for equality and quick-returns 0 at the first inequality. Thus intended usage is within a function body, and not as part of an expression.

Example

julia> import AngularMomentumAlgebra: @δ

julia> function my_function(a,b)
@δ a,b # Quick-returns unless a and b are equal
sin(a)
end
my_function (generic function with 1 method)

julia> my_function(1,1)
0.8414709848078965

julia> my_function(1,0)
0
source
AngularMomentumAlgebra.couplingsMethod
couplings(j₁, m₁, j₂, m₂)

Return all j, m for which the Clebsch–Gordan coefficient ⟨j₁m₁ j₂m₂|jm⟩ is non-zero.

source