FASTWIGXJ library and support programs

General Information

FASTWIGXJ evaluates Wigner 3j, 6j and 9j symbols quickly by lookup in precalculated tables, and dynamic hash tables.

Scientific software, program package
Program: C. Library interfaces: C, Fortran
FASTWIGXJ 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.
FASTWIGXJ 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 FASTWIGXJ. If not, see
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.
A paper describing FASTWIGXJ is in preparation. Meanwhile:
As the library WIGXJPF is used to evaluate symbols, when FASTWIGXJ is used for computations that are published in a research article, it is recommended to 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
Pre-print (2015) at arXiv:1504.08329
When FASTWIGXJ is used for fast lookup of 3j or 6j symbols, it is also suggested to cite the paper describing the mathematical background of the implemented methods:
J. Rasch and A. C. H. Yu, Efficient storage scheme for precalculated Wigner 3 j, 6 j and Gaunt coefficients, SIAM J. Sci. Comput., 25 (2003), pp. 1416-1428


Håkan T. Johansson (
No formal support
Library for accurate evaluation: WIGXJPF.
(Easier use if your program does not use many symbols.)


See README (included with download).

Some usage statistics.


Generation of precalculated tables
First download and build the prerequisite library WIGXJPF in a sibling directory, then build:
To create a table of Wigner 3j symbols, valid for all j ≤ 25:
bin/hash_js --max-E-3j=50 /dev/null ./table_50.3j
A hash table of all Wigner 9j symbols, with j ≤ 8:
bin/gen_9j --flat-lim=16 | bin/combine_js | bin/unique_js ./comb_16.9j
bin/hash_js ./comb_16.9j ./hashed_16.9j
C interface usage
Compile with -Ipath-to-fastwigxj/inc/ -Ipath-to-wigxjpf/inc/ and link with -Lpath-to-fastwigxj/lib/ -Lpath-to-wigxjpf/lib/ -lfastwigxj -lwigxjpf -lm (note that the evaluation functions take 2* the angular momenta arguments as integers).
#include "fastwigxj.h"

int main()
  double val3j;

  fastwigxj_load("table_50.3j", 3, NULL);

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


  return 0;


Last modified: Mon Jul 16:53:37 CEST 2019 by htj