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.wig3jj
Wigxjpf.wig6jj
Wigxjpf.wig9jj
Wigxjpf.wig_table_free
Wigxjpf.wig_table_init
Wigxjpf.wig_temp_free
Wigxjpf.wig_temp_init
Wigxjpf.wig_thread_temp_init
Wigxjpf.wig3jj
— Methodwig3jj(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.
Wigxjpf.wig6jj
— Methodwig6jj(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.
Wigxjpf.wig9jj
— Methodwig9jj(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.
Wigxjpf.wig_table_free
— Methodwig_table_free()
Free the calculation table.
When used in a multi-threaded environment, this function should be called globally.
Wigxjpf.wig_table_init
— Methodwig_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.
Wigxjpf.wig_temp_free
— Methodwig_temp_free()
Free the temporary array.
When used in a multi-threaded environment, this function should be called in each thread.
Wigxjpf.wig_temp_init
— Methodwig_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.
Wigxjpf.wig_thread_temp_init
— Methodwig_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.
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.