5#if !defined USE_WIG_SU2_COEFFS && !defined USE_WIG_SU2_COEFFS && !defined USE_FAST_WIG_SU2_COEFFS
6#define USE_GSL_SU2_COEFFS 1
10#ifdef USE_GSL_SU2_COEFFS
11#include <gsl/gsl_sf_coupling.h>
12#pragma message("Using GSL library for 3nj-symbols.")
15#ifdef USE_WIG_SU2_COEFFS
17#pragma message("Using WIGXJPF library for 3nj-symbols.")
20#ifdef USE_FAST_WIG_SU2_COEFFS
23#pragma message("Using FASTWIGXJ library for 3nj-symbols.")
71#ifdef USE_GSL_SU2_COEFFS
73 const int q4,
const int q5,
const int q6,
74 const int q7,
const int q8,
const int q9)
76 return gsl_sf_coupling_9j(q1-1, q2-1, q3-1,
82 const int q4,
const int q5,
const int q6)
84 return gsl_sf_coupling_6j(q1-1, q2-1, q3-1,
89 const int q1_z,
const int q2_z,
const int q3_z)
91 return gsl_sf_coupling_3j(q1-1, q2-1, q3-1,
96#ifdef USE_WIG_SU2_COEFFS
97inline double coupl_9j_base(
const int q1,
const int q2,
const int q3,
98 const int q4,
const int q5,
const int q6,
99 const int q7,
const int q8,
const int q9)
101 return wig9jj(q1-1, q2-1, q3-1,
106inline double coupl_6j_base (
const int q1,
const int q2,
const int q3,
107 const int q4,
const int q5,
const int q6)
109 return wig6jj(q1-1, q2-1, q3-1,
113inline double coupl_3j_base (
const int q1 ,
const int q2 ,
const int q3,
114 const int q1_z,
const int q2_z,
const int q3_z)
116 return wig3jj(q1-1, q2-1, q3-1,
123#ifdef USE_FAST_WIG_SU2_COEFFS
124inline double coupl_9j_base(
const int q1,
const int q2,
const int q3,
125 const int q4,
const int q5,
const int q6,
126 const int q7,
const int q8,
const int q9)
128 return fw9jja(q1-1, q2-1, q3-1,
133inline double coupl_6j_base (
const int q1,
const int q2,
const int q3,
134 const int q4,
const int q5,
const int q6)
136 return fw6jja(q1-1, q2-1, q3-1,
140inline double coupl_3j_base (
const int q1 ,
const int q2 ,
const int q3,
141 const int q1_z,
const int q2_z,
const int q3_z)
143 return fw3jja(q1-1, q2-1, q3-1,
150assert(omp_get_max_threads() == 1 and
"Hashing the cgcs is not treadsafe!");
153std::unordered_map<std::array<int,9>,
double > Table9j;
154std::unordered_map<std::array<int,6>,
double > Table6j;
156double coupling_9j (
const int q1,
const int q2,
const int q3,
157 const int q4,
const int q5,
const int q6,
158 const int q7,
const int q8,
const int q9)
160 auto it = Table9j.find(std::array<int,9>{q1,q2,q3,q4,q5,q6,q7,q8,q9});
162 if (it != Table9j.end())
164 return Table9j[std::array<int,9>{q1,q2,q3,q4,q5,q6,q7,q8,q9}];
171 Table9j[std::array<int,9>{q1,q2,q3,q4,q5,q6,q7,q8,q9}] = out;
176double coupling_6j (
const int q1,
const int q2,
const int q3,
177 const int q4,
const int q5,
const int q6)
179 auto it = Table6j.find(std::array<int,6>{q1,q2,q3,q4,q5,q6});
180 if (it != Table6j.end())
182 return Table6j[std::array<int,6>{q1,q2,q3,q4,q5,q6}];
188 Table6j[std::array<int,6>{q1,q2,q3,q4,q5,q6}] = out;
193inline double coupling_3j (
const int q1 ,
const int q2 ,
const int q3,
194 const int q1_z,
const int q2_z,
const int q3_z)
201inline double coupling_9j (
const int q1,
const int q2,
const int q3,
202 const int q4,
const int q5,
const int q6,
203 const int q7,
const int q8,
const int q9)
210inline double coupling_6j (
const int q1,
const int q2,
const int q3,
211 const int q4,
const int q5,
const int q6)
217inline double coupling_3j (
const int q1 ,
const int q2 ,
const int q3,
218 const int q1_z,
const int q2_z,
const int q3_z)
double coupl_6j_base(const int q1, const int q2, const int q3, const int q4, const int q5, const int q6)
double coupl_3j_base(const int q1, const int q2, const int q3, const int q1_z, const int q2_z, const int q3_z)
double coupling_9j(const int q1, const int q2, const int q3, const int q4, const int q5, const int q6, const int q7, const int q8, const int q9)
double coupling_3j(const int q1, const int q2, const int q3, const int q1_z, const int q2_z, const int q3_z)
double coupling_6j(const int q1, const int q2, const int q3, const int q4, const int q5, const int q6)
double coupl_9j_base(const int q1, const int q2, const int q3, const int q4, const int q5, const int q6, const int q7, const int q8, const int q9)