WIGXJPF library and program

General Information

WIGXJPF evaluates Wigner 3j, 6j and 9j symbols accurately using prime factorisation and multi-word integer arithmetic.

Scientific software, program package
Program: C. Library interfaces: C, Fortran, Python
WIGXJPF is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
WIGXJPF is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License along with WIGXJPF. If not, see http://www.gnu.org/licenses/.
Main developer
Håkan T. Johansson, Chalmers University of Technology, Sweden
Nuclear theory and few-body physics group, Chalmers University of Technology, Sweden
The research leading to these results has received funding from the European Research Council under the European Community's Seventh Framework Programme (FP7/2007-2013) / ERC grant agreement no. 240603, and the Swedish Foundation for International Cooperation in Research and Higher Education (STINT, IG2012-5158).
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. eprint http://dx.doi.org/10.1137/15M1021908
Pre-print (2015) at arXiv:1504.08329


Håkan T. Johansson (f96hajo@chalmers.se) and Christian Forssén (christian.forssen@chalmers.se)
No formal support
Library for fast lookup: FASTWIGXJ.
(If your program uses very many symbols; trades memory for speed - factor 10+.)
Library for sequence evaluation: WIGSGLL.
(If your program uses sequences of symbols.)


See README (included with download).

A short slide-show presentation.

Some usage statistics.


Symbol evaluation
Symbols can be evaluated directly from the command-line after download and unpacking (half integer arguments are given on decimal form, e.g. ½ as 0.5):
bin/wigxjpf --6j=2,2,1,2,1,1
C interface usage
Compile with -Ipath-to-wigxjpf/inc/ and link with -Lpath-to-wigxjpf/lib/ -lwigxjpf (note that the evaluation functions take 2* the angular momenta arguments as integers).
#include "wigxjpf.h"

int main()
  double val6j;

  wig_table_init(2*100, 9);

  val6j = wig6jj(2*  2 , 2*  2 , 2*  1 ,
                 2*  2 , 2*  1 , 2*  1 );


  return 0;
Python interface usage
Either compile locally:
make pywigxjpf_ffi
or install pywigxjpf directly from PyPI:
pip install pywigxjpf
Example usage:
import pywigxjpf as wig

wig.wig_table_init(10, 9)

wig.wig6jj(2*  2 , 2*  2 , 2*  1 ,
           2*  2,  2*  1 , 2*  1 )
MATLAB usage
Latest version link

To avoid version numbers in directory name, unpack with:

tar --transform 's/wigxjpf-[0-9.]*/wigxjpf/' -zxf wigxjpf-latest.tar.gz

Comments? christian.forssen@chalmers.se

Last modified: Mon 22 Feb 00:17:30 CET 2021