Introduction

Wigxjpf.jl is an unopinionated wrapper of WIGXJPF, which evaluates Wigner 3j, 6j and 9j symbols accurately using prime factorisation and multi-word integer arithmetic.

Usage

Similar to the Python wrapper pywigxjpf, the following 8 functions are exported.

Wigxjpf.wig3jjMethod
wig3jj(two_j1::Integer, two_j2::Integer, two_j3::Integer, two_m1::Integer, two_m2::Integer, two_m3::Integer)

Evaluate Wigner 3-j symbols. Note that all parameter are twice the actual j or m parameters to allow representation of half-integers.

source
Wigxjpf.wig6jjMethod
wig6jj(two_j1::Integer, two_j2::Integer, two_j3::Integer, two_j4::Integer, two_j5::Integer, two_j6::Integer)

Evaluate Wigner 6-j symbols. Note that all parameter are twice the actual j parameters to allow representation of half-integers.

source
Wigxjpf.wig9jjMethod
wig9jj(two_j1::Integer, two_j2::Integer, two_j3::Integer, two_j4::Integer, two_j5::Integer, two_j6::Integer, two_j7::Integer, two_j8::Integer, two_j9::Integer)

Evaluate Wigner 9-j symbols. Note that all parameter are twice the actual j parameters to allow representation of half-integers.

source
Wigxjpf.wig_table_freeMethod
wig_table_free()

Free the calculation table.

When used in a multi-threaded environment, this function should be called globally.

source
Wigxjpf.wig_table_initMethod
wig_table_init(max_two_j::Integer, wigner_type::Integer)

Initialize the calculation table. Must be called before evaluating any Wigner symbols.

max_two_j is twice the highest absolute value of all j values to be evaluated.

wigner_type should be 3, 6, or 9. When multiple types are to be used, you should use the highest value for this parameter.

When used in a multi-threaded environment, this function should be called globally.

source
Wigxjpf.wig_temp_freeMethod
wig_temp_free()

Free the temporary array.

When used in a multi-threaded environment, this function should be called in each thread.

source
Wigxjpf.wig_temp_initMethod
wig_temp_init(max_two_j::Integer)

Initialize the temporary array. Must be called before evaluating any Wigner symbols.

When used in a multi-threaded environment, call wig_thread_temp_init instead.

source
Wigxjpf.wig_thread_temp_initMethod
wig_thread_temp_init(max_two_j::Integer)

Initialize the temporary array. Must be called before evaluating any Wigner symbols.

When used in a multi-threaded environment, this function should be called in each thread.

source

Example

using Wigxjpf

wig_table_init(200, 9)
wig_temp_init(200)

val3j = wig3jj(2 * 10, 2 * 15, 2 * 10, 2 * (-3), 2 * 12, 2 * (-9))

@show val3j # "val3j = 0.040013817682832936"

val6j = wig6jj(2 * 10, 2 * 15, 2 * 10, 2 * 7, 2 * 7, 2 * 9)

@show val6j # "val6j = 0.01033149734335741"

val9j = wig9jj(1, 2, 3, 4, 6, 8, 3, 6, 9)

@show val9j # "val9j = -0.003015611935232274"

wig_temp_free()
wig_table_free()

Reference

The recommended way to refer to WIGXJPF, when used for computations that are published in a research article, is to cite the following paper: H. T. Johansson and C. Forssén, Fast and Accurate Evaluation of Wigner 3j, 6j, and 9j Symbols Using Prime Factorization and Multiword Integer Arithmetic, SIAM J. Sci. Comput., 38(1) (2016), A376-A384.