LIBINT  2.6.0
shgshell_ordering.h
1 /*
2  * Copyright (C) 2004-2019 Edward F. Valeev
3  *
4  * This file is part of Libint.
5  *
6  * Libint is free software: you can redistribute it and/or modify
7  * it under the terms of the GNU Lesser General Public License as published by
8  * the Free Software Foundation, either version 3 of the License, or
9  * (at your option) any later version.
10  *
11  * Libint is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  * GNU Lesser General Public License for more details.
15  *
16  * You should have received a copy of the GNU Lesser General Public License
17  * along with Libint. If not, see <http://www.gnu.org/licenses/>.
18  *
19  */
20 
21 #ifndef _libint2_src_bin_libint_shgshellordering_h_
22 #define _libint2_src_bin_libint_shgshellordering_h_
23 
24 #include <cmath>
25 
26 #include <libint2/config.h>
27 
28 namespace libint2 {
29 
30 enum SHGShellOrdering {
31  SHGShellOrdering_Standard = LIBINT_SHGSHELL_ORDERING_STANDARD,
32  SHGShellOrdering_Gaussian = LIBINT_SHGSHELL_ORDERING_GAUSSIAN,
33  SHGShellOrdering_MOLDEN // same as Gaussian
34 };
35 
36 }
37 
38 //
39 // Macros that define orderings
40 //
41 
42 #if LIBINT_SHGSHELL_ORDERING == LIBINT_SHGSHELL_ORDERING_STANDARD
43 
44 /* Computes an index to a Cartesian function within a shell given
45  * l = total angular momentum
46  * m = real solid harmonic index (|m| = the absolute value of the projection of
47  * the angular momentum on the z axis) m runs from -l to l
48  */
49 #define INT_SOLIDHARMINDEX(l, m) ((m) + (l))
50 
51 /* This sets up the above loop over cartesian exponents as follows
52  * int m;
53  * FOR_SOLIDHARM(l,m)
54  * END_FOR_SOLIDHARM
55  */
56 #define FOR_SOLIDHARM(l, m) for ((m) = -(l); (m) <= (l); ++(m)) {
57 #define END_FOR_SOLIDHARM }
58 
59 #endif // Standard ordering
60 
61 #if LIBINT_SHGSHELL_ORDERING == LIBINT_SHGSHELL_ORDERING_GAUSSIAN
62 
63 /* Computes an index to a Cartesian function within a shell given
64  * l = total angular momentum
65  * m = real solid harmonic index (|m| = the absolute value of the projection of
66  * the angular momentum on the z axis) m runs as 0, +1, -1, +2, -2 ... +l, -l
67  */
68 #define INT_SOLIDHARMINDEX(l, m) (2 * std::abs(m) + ((m) > 0 ? -1 : 0))
69 
70 /* This sets up the above loop over cartesian exponents as follows
71  * int m;
72  * FOR_SOLIDHARM(l,m)
73  * END_FOR_SOLIDHARM
74  */
75 #define FOR_SOLIDHARM(l, m) \
76  for ((m) = 0; (m) != (l) + 1; (m) = ((m) > 0 ? -(m) : 1 - (m))) {
77 #define END_FOR_SOLIDHARM }
78 
79 #endif // Gaussian ordering
80 
82 
83 #define INT_SOLIDHARMINDEX_MOLDEN(l, m) (2 * std::abs(m) + ((m) > 0 ? -1 : 0))
84 #define FOR_SOLIDHARM_MOLDEN(l, m) \
85  for ((m) = 0; (m) != (l) + 1; (m) = ((m) > 0 ? -(m) : 1 - (m))) {
86 #define END_FOR_SOLIDHARM_MOLDEN }
87 
88 #endif // _libint2_src_bin_libint_shgshellordering_h_
Defaults definitions for various parameters assumed by Libint.
Definition: algebra.cc:24