libwignernj: a reusable C/C++/Fortran/Python library for exact Wigner symbols and related coefficients
Susi Lehtola

TL;DR
libwignernj is a versatile, open-source library providing exact evaluations of Wigner symbols and related coefficients in multiple programming languages, ensuring high precision and easy integration for scientific applications.
Contribution
It introduces a new, exact rational-based computational approach for Wigner symbols, with multi-language bindings and no runtime dependencies, enhancing precision and usability.
Findings
Provides exact rational evaluations with correct last-bit precision.
Supports multiple precisions including IEEE 754 binary128 and arbitrary precision.
Includes bindings for C++, Python, and Fortran with easy integration.
Abstract
We describe libwignernj, a freely available, BSD-licensed library that evaluates Wigner 3j, 6j, and 9j symbols, Clebsch--Gordan, Racah , and Fano coefficients, and Gaunt coefficients over both complex and real spherical harmonics in standards-compliant C99. libwignernj represents factorials by the vector of their signed prime-exponent decomposition - a prime-factorization technique introduced for the angular-momentum coefficients by Dodds and Wiechers (Comput. Phys. Commun. 4, 268 (1972)) and refined in a long line of subsequent work - and combines that representation with the multiword-integer Racah sum of Johansson and Forss\'en (SIAM J. Sci. Comput. 38, A376 (2016)), under which every intermediate quantity is an exact rational and all rounding is confined to the final floating-point conversion. Single-, double-, and long-double-precision results are correct to the last…
Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
