10 #define GRID_STRINGIFY(SYMBOL) #SYMBOL
13 #if defined(__GNUC__) && !defined(__INTEL_COMPILER) && __GNUC__ < 6
14 #define GRID_PRAGMA_SIMD(OBJS, N)
16 #elif defined(__INTEL_COMPILER) && __INTEL_COMPILER < 1900
17 #define GRID_PRAGMA_SIMD(OBJS, N)
20 #define GRID_PRAGMA_SIMD(OBJS, N) \
21 _Pragma(GRID_STRINGIFY(omp simd linear OBJS simdlen(N)))
25 #if defined(__GNUC__) && !defined(__INTEL_COMPILER) && __GNUC__ < 8
26 #define GRID_PRAGMA_UNROLL(N)
27 #define GRID_PRAGMA_UNROLL_UP_TO(N)
29 #elif defined(__GNUC__) && !defined(__INTEL_COMPILER) && __GNUC__ >= 8
30 #define GRID_PRAGMA_UNROLL(N) _Pragma(GRID_STRINGIFY(GCC unroll N))
31 #define GRID_PRAGMA_UNROLL_UP_TO(N) _Pragma(GRID_STRINGIFY(GCC unroll N))
34 #define GRID_PRAGMA_UNROLL(N) _Pragma(GRID_STRINGIFY(unroll(N)))
35 #define GRID_PRAGMA_UNROLL_UP_TO(N) _Pragma("unroll")
38 #if defined(__CUDACC__) || defined(__HIPCC__)
39 #define GRID_HOST_DEVICE __host__ __device__
41 #define GRID_HOST_DEVICE
49 static const double table[] = {
50 0.10000000000000000000E+01, 0.10000000000000000000E+01,
51 0.20000000000000000000E+01, 0.60000000000000000000E+01,
52 0.24000000000000000000E+02, 0.12000000000000000000E+03,
53 0.72000000000000000000E+03, 0.50400000000000000000E+04,
54 0.40320000000000000000E+05, 0.36288000000000000000E+06,
55 0.36288000000000000000E+07, 0.39916800000000000000E+08,
56 0.47900160000000000000E+09, 0.62270208000000000000E+10,
57 0.87178291200000000000E+11, 0.13076743680000000000E+13,
58 0.20922789888000000000E+14, 0.35568742809600000000E+15,
59 0.64023737057280000000E+16, 0.12164510040883200000E+18,
60 0.24329020081766400000E+19, 0.51090942171709440000E+20,
61 0.11240007277776076800E+22, 0.25852016738884976640E+23,
62 0.62044840173323943936E+24, 0.15511210043330985984E+26,
63 0.40329146112660563558E+27, 0.10888869450418352161E+29,
64 0.30488834461171386050E+30, 0.88417619937397019545E+31,
65 0.26525285981219105864E+33};
74 static const int table[] = {0,
78 20, 35, 56, 84, 120, 165, 220, 286,
79 364, 455, 560, 680, 816, 969, 1140, 1330};
88 const int l = lx + ly + lz;
92 return ncoset(l - 1) + ((l - lx) * (l - lx + 1)) / 2 + lz;
101 return (x < y ? x : y);
109 return (x > y ? x : y);
118 return ((
a % m + m) % m);
154 return coset(
a.l[0],
a.l[1],
a.l[2]);
static GRID_HOST_DEVICE int coset(int lx, int ly, int lz)
Maps three angular momentum components to a single zero based index.
static GRID_HOST_DEVICE int ncoset(const int l)
Number of Cartesian orbitals up to given angular momentum quantum.
static GRID_HOST_DEVICE int imin(int x, int y)
Returns the smaller of two given integer (missing from the C standard)
static GRID_HOST_DEVICE int imax(int x, int y)
Returns the larger of two given integer (missing from the C standard)
static GRID_HOST_DEVICE int modulo(int a, int m)
Equivalent of Fortran's MODULO, which always return a positive number. https://gcc....
static GRID_HOST_DEVICE double fac(const int i)
Factorial function, e.g. fac(5) = 5! = 120.
static GRID_HOST_DEVICE orbital up(const int i, const orbital a)
Increase i'th component of given orbital angular momentum.
static GRID_HOST_DEVICE int idx(const orbital a)
Return coset index of given orbital angular momentum.
static GRID_HOST_DEVICE orbital down(const int i, const orbital a)
Decrease i'th component of given orbital angular momentum.
static void const int const int i
Orbital angular momentum.