YAP
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
ClebschGordan.h
1 /* YAP - Yet another PWA toolkit
2  Copyright 2015, Technische Universitaet Muenchen,
3  Authors: Daniel Greenwald, Johannes Rauch
4 
5  This program is free software: you can redistribute it and/or modify
6  it under the terms of the GNU General Public License as published by
7  the Free Software Foundation, either version 3 of the License, or
8  (at your option) any later version.
9 
10  This program is distributed in the hope that it will be useful,
11  but WITHOUT ANY WARRANTY; without even the implied warranty of
12  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  GNU General Public License for more details.
14 
15  You should have received a copy of the GNU General Public License
16  along with this program. If not, see <http://www.gnu.org/licenses/>.
17  */
18 
19 #ifndef yap_ClebschGordan_h
20 #define yap_ClebschGordan_h
21 
22 #include <cstdlib>
23 #include <string>
24 
25 namespace yap {
26 
30 namespace ClebschGordan {
31 
39 std::string to_string(unsigned two_j1, int two_m1, unsigned two_j2, int two_m2, unsigned two_J, int two_M);
40 
47 inline std::string to_string(unsigned two_j1, int two_m1, unsigned two_j2, int two_m2, unsigned two_J)
48 { return to_string(two_j1, two_m1, two_j2, two_m2, two_J, two_m1 + two_m2); }
49 
57 const bool nonzeroCoefficient(unsigned two_j1, int two_m1, unsigned two_j2, int two_m2, unsigned two_J, int two_M);
58 
65 inline const bool nonzeroCoefficient(unsigned two_j1, int two_m1, unsigned two_j2, int two_m2, unsigned two_J)
66 { return nonzeroCoefficient(two_j1, two_m1, two_j2, two_m2, two_J, two_m1 + two_m2); }
67 
76 const double coefficient(unsigned two_j1, int two_m1, unsigned two_j2, int two_m2, unsigned two_J, int two_M);
77 
84 inline const double coefficient(unsigned two_j1, int two_m1, unsigned two_j2, int two_m2, unsigned two_J)
85 { return coefficient(two_j1, two_m1, two_j2, two_m2, two_J, two_m1 + two_m2); }
86 
95 inline const bool nonzeroCoupling(unsigned two_j1, int two_lambda1, unsigned two_j2, int two_lambda2, unsigned l, unsigned two_s, unsigned two_J)
96 { return nonzeroCoefficient(2 * l, 0, two_s, two_lambda1 - two_lambda2, two_J) and nonzeroCoefficient(two_j1, two_lambda1, two_j2, -two_lambda2, two_s); }
97 
107 double const couple(unsigned two_j1, int two_lambda1, unsigned two_j2, int two_lambda2, unsigned l, unsigned two_s, unsigned two_J);
108 
112 const bool consistent(unsigned two_J, int two_M);
113 
114 } // ClebschGordon namespace
115 
116 } // yap namespace
117 
118 #endif
std::string to_string(const CachedValue::Status &S)
streaming operator for CachedValue::Status
Definition: CachedValue.cxx:27