CheMPS2
Tensor3RDM.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 TENSOR3RDM_CHEMPS2_H
21 #define TENSOR3RDM_CHEMPS2_H
22 
23 #include "TensorT.h"
24 #include "TensorL.h"
25 #include "TensorOperator.h"
26 #include "SyBookkeeper.h"
27 
28 namespace CheMPS2{
34  class Tensor3RDM : public TensorOperator{
35 
36  public:
37 
39 
46  Tensor3RDM(const int boundary, const int two_j1_in, const int two_j2, const int nelec, const int irrep, const bool prime_last, const SyBookkeeper * book);
47 
49  virtual ~Tensor3RDM();
50 
52 
53  int get_two_j1() const;
54 
56 
57  int get_two_j2() const;
58 
60 
63  void a1(TensorOperator * Sigma, TensorT * denT, double * workmem);
64 
66 
69  void b1(TensorOperator * Sigma, TensorT * denT, double * workmem);
70 
72 
75  void c1(TensorOperator * denF, TensorT * denT, double * workmem);
76 
78 
81  void d1(TensorOperator * denF, TensorT * denT, double * workmem);
82 
84 
85  void extra1(TensorT * denT);
86 
88 
91  void extra2(TensorL * denL, TensorT * denT, double * workmem);
92 
94 
97  void extra3(TensorL * denL, TensorT * denT, double * workmem);
98 
100 
103  void extra4(TensorL * denL, TensorT * denT, double * workmem);
104 
106 
108  double contract( Tensor3RDM * buddy ) const;
109 
111 
112  bool get_prime_last() const;
113 
114  private:
115 
116  int two_j1;
117 
118  };
119 }
120 
121 #endif
void extra1(TensorT *denT)
Make diagram extra1.
Definition: Tensor3RDM.cpp:356
Definition: CASPT2.h:42
void c1(TensorOperator *denF, TensorT *denT, double *workmem)
Make diagram c1.
Definition: Tensor3RDM.cpp:204
bool prime_last
Convention in which the tensor operator is stored (see class information)
Tensor3RDM(const int boundary, const int two_j1_in, const int two_j2, const int nelec, const int irrep, const bool prime_last, const SyBookkeeper *book)
Constructor.
Definition: Tensor3RDM.cpp:29
bool get_prime_last() const
Get whether the tensor convention is prime last.
Definition: Tensor3RDM.cpp:50
double contract(Tensor3RDM *buddy) const
Make the in-product of two Tensor3RDMs.
Definition: Tensor3RDM.cpp:543
void extra3(TensorL *denL, TensorT *denT, double *workmem)
Make diagram extra3.
Definition: Tensor3RDM.cpp:430
void a1(TensorOperator *Sigma, TensorT *denT, double *workmem)
Make diagram a1.
Definition: Tensor3RDM.cpp:52
void extra2(TensorL *denL, TensorT *denT, double *workmem)
Make diagram extra2.
Definition: Tensor3RDM.cpp:391
int get_two_j1() const
Get the intermediary spin coupling value of the Tensor3RDM.
Definition: Tensor3RDM.cpp:46
void d1(TensorOperator *denF, TensorT *denT, double *workmem)
Make diagram d1.
Definition: Tensor3RDM.cpp:280
virtual ~Tensor3RDM()
Destructor.
Definition: Tensor3RDM.cpp:44
void extra4(TensorL *denL, TensorT *denT, double *workmem)
Make diagram extra4.
Definition: Tensor3RDM.cpp:469
void b1(TensorOperator *Sigma, TensorT *denT, double *workmem)
Make diagram b1.
Definition: Tensor3RDM.cpp:128
int get_two_j2() const
Get the spin value of the Tensor3RDM.
Definition: Tensor3RDM.cpp:48