## WignerSymbols.jl

A Julia package for computing Wigner symbols and related quantities
Popularity
29 Stars
Updated Last
1 Year Ago
Started In
August 2017

# WignerSymbols

Compute Wigner's 3j and 6j symbols, and related quantities such as Clebsch-Gordan coefficients and Racah's symbols.

## Installation

Install with the new package manager via `]add WignerSymbols` or

```using Pkg

## Available functions

While the following function signatures are probably self-explanatory, you can query help for them in the Julia REPL to get further details.

• `wigner3j(T::Type{<:Real} = RationalRoot{BigInt}, j₁, j₂, j₃, m₁, m₂, m₃ = -m₂-m₁) -> ::T`
• `wigner6j(T::Type{<:Real} = RationalRoot{BigInt}, j₁, j₂, j₃, j₄, j₅, j₆) -> ::T`
• `clebschgordan(T::Type{<:Real} = RationalRoot{BigInt}, j₁, m₁, j₂, m₂, j₃, m₃ = m₁+m₂) -> ::T`
• `racahV(T::Type{<:Real} = RationalRoot{BigInt}, j₁, j₂, j₃, m₁, m₂, m₃ = -m₁-m₂) -> ::T`
• `racahW(T::Type{<:Real} = RationalRoot{BigInt}, j₁, j₂, J, j₃, J₁₂, J₂₃) -> ::T`
• `δ(j₁, j₂, j₃) -> ::Bool`
• `Δ(T::Type{<:Real} = RationalRoot{BigInt}, j₁, j₂, j₃) -> ::T`

The package relies on HalfIntegers.jl to support and use arithmetic with half integer numbers, and, since v1.1, on RationalRoots.jl to return the result exactly as the square root of a `Rational{BigInt}`, which will then be automatically converted to a suitable floating point value upon further arithmetic, using the `AbstractIrrational` interface from Julia Base.

## Implementation

Largely based on reading the paper (but not the code):

with some additional modifications to further improve efficiency for large `j` (angular momenta quantum numbers).

In particular, 3j and 6j symbols are computed exactly, in the format `√(r) * s` where `r` and `s` are exactly computed as `Rational{BigInt}`, using an intermediate representation based on prime number factorization. As a consequence thereof, all of the above functions can be called requesting `BigFloat` precision for the result. There is currently no convenient syntax for obtaining `r` and `s` directly (see TODO).

Most intermediate calculations (prime factorizations of numbers and their factorials, conversion between prime powers and `BigInt`s) are cached to improve the efficiency, but this can result in large use of memory when querying Wigner symbols for large values of `j`.

Also uses ideas from

for caching the computed 3j and 6j symbols.

## Todo

• Wigner 9-j symbols, as explained in  and based on

• Convenient syntax to get the exact results in the `√(r) * s` format, but in such a way that it can be used by the Julia type system and can be converted afterwards. Solved in v1.1 by the package RationalRoots.jl, the implementation of which was initiated by @w-vdh in PR #9.