CheMPS2
TensorQ.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 TENSORQ_CHEMPS2_H
21 #define TENSORQ_CHEMPS2_H
22 
23 #include "TensorT.h"
24 #include "TensorL.h"
25 #include "TensorOperator.h"
26 #include "TensorF0.h"
27 #include "TensorF1.h"
28 #include "SyBookkeeper.h"
29 #include "Problem.h"
30 
31 namespace CheMPS2{
37  class TensorQ : public TensorOperator{
38 
39  public:
40 
42 
48  TensorQ(const int boundary_index, const int Idiff, const bool moving_right, const SyBookkeeper * denBK, const Problem * Prob, const int site);
49 
51  virtual ~TensorQ();
52 
54 
55  void AddTermSimple(TensorT * denT);
56 
58 
62  void AddTermsL(TensorL ** Ltensors, TensorT * denT, double * workmem, double * workmem2);
63 
65 
70  void AddTermsAB(TensorOperator * denA, TensorOperator * denB, TensorT * denT, double * workmem, double * workmem2);
71 
73 
78  void AddTermsCD(TensorOperator * denC, TensorOperator * denD, TensorT * denT, double * workmem, double * workmem2);
79 
80  private:
81 
83  const Problem * Prob;
84 
86  int site;
87 
88  //Internal stuff
89  void AddTermSimpleRight(TensorT * denT);
90  void AddTermSimpleLeft(TensorT * denT);
91  void AddTermsLRight(TensorL ** Ltensors, TensorT * denT, double * workmem, double * workmem2);
92  void AddTermsLLeft(TensorL ** Ltensors, TensorT * denT, double * workmem, double * workmem2);
93  void AddTermsABRight(TensorOperator * denA, TensorOperator * denB, TensorT * denT, double * workmem, double * workmem2);
94  void AddTermsABLeft(TensorOperator * denA, TensorOperator * denB, TensorT * denT, double * workmem, double * workmem2);
95  void AddTermsCDRight(TensorOperator * denC, TensorOperator * denD, TensorT * denT, double * workmem, double * workmem2);
96  void AddTermsCDLeft(TensorOperator * denC, TensorOperator * denD, TensorT * denT, double * workmem, double * workmem2);
97 
98  };
99 }
100 
101 #endif
void AddTermsL(TensorL **Ltensors, TensorT *denT, double *workmem, double *workmem2)
Add terms after update/clear with previous TensorL's.
Definition: TensorQ.cpp:106
Definition: CASPT2.h:42
bool moving_right
Whether or not moving right.
void AddTermsCD(TensorOperator *denC, TensorOperator *denD, TensorT *denT, double *workmem, double *workmem2)
Add terms after update/clear with previous C-tensors and D-tensors.
Definition: TensorQ.cpp:601
virtual ~TensorQ()
Destructor.
Definition: TensorQ.cpp:43
void AddTermSimple(TensorT *denT)
Add terms after update/clear without previous tensors.
Definition: TensorQ.cpp:45
TensorQ(const int boundary_index, const int Idiff, const bool moving_right, const SyBookkeeper *denBK, const Problem *Prob, const int site)
Constructor.
Definition: TensorQ.cpp:27
void AddTermsAB(TensorOperator *denA, TensorOperator *denB, TensorT *denT, double *workmem, double *workmem2)
Add terms after update/clear with previous A-tensors and B-tensors.
Definition: TensorQ.cpp:386