CheMPS2
Wigner.h
1 /*
2  CheMPS2: a spin-adapted implementation of DMRG for ab initio quantum chemistry
3  Copyright (C) 2013-2016 Sebastian Wouters
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 2 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 along
16  with this program; if not, write to the Free Software Foundation, Inc.,
17  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
18 */
19 
20 #ifndef WIGNER_CHEMPS2_H
21 #define WIGNER_CHEMPS2_H
22 
23 #define CHEMPS2_WIGNER_FACTORIAL_MAX 191
24 #define CHEMPS2_WIGNER_MAX_2J 95 // Maximum factorial = (4j+1)! <=> 2j = 95
25 
26 namespace CheMPS2{
33  class Wigner{
34 
35  public:
36 
38  static int max_2j();
39 
41 
48  static double wigner3j( const int two_ja, const int two_jb, const int two_jc, const int two_ma, const int two_mb, const int two_mc );
49 
51 
58  static double wigner6j( const int two_ja, const int two_jb, const int two_jc, const int two_jd, const int two_je, const int two_jf );
59 
61 
71  static double wigner9j( const int two_ja, const int two_jb, const int two_jc, const int two_jd, const int two_je, const int two_jf, const int two_jg, const int two_jh, const int two_ji );
72 
73  private:
74 
75  // List of square roots of factorials
76  static const long double sqrt_fact[ CHEMPS2_WIGNER_FACTORIAL_MAX + 1 ];
77 
78  // Test triangle conditions
79  static bool triangle_fails( const int two_ja, const int two_jb, const int two_jc );
80 
81  // Delta function for the Wigner-6j terms
82  static long double sqrt_delta( const int two_ja, const int two_jb, const int two_jc );
83 
84  };
85 }
86 
87 #endif
static double wigner6j(const int two_ja, const int two_jb, const int two_jc, const int two_jd, const int two_je, const int two_jf)
Wigner-6j symbol (gsl api)
Definition: Wigner.cpp:294
Definition: CASPT2.h:42
static int max_2j()
Two times the maximum value of the angular momentum which is allowed.
Definition: Wigner.cpp:225
static double wigner3j(const int two_ja, const int two_jb, const int two_jc, const int two_ma, const int two_mb, const int two_mc)
Wigner-3j symbol (gsl api)
Definition: Wigner.cpp:243
static double wigner9j(const int two_ja, const int two_jb, const int two_jc, const int two_jd, const int two_je, const int two_jf, const int two_jg, const int two_jh, const int two_ji)
Wigner-9j symbol (gsl api)
Definition: Wigner.cpp:341