CheMPS2
TwoIndex.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 TWOINDEX_CHEMPS2_H
21 #define TWOINDEX_CHEMPS2_H
22 
23 #include <string>
24 #include "Irreps.h"
25 
26 namespace CheMPS2{
32  class TwoIndex{
33 
34  public:
35 
37 
39  TwoIndex(const int nGroup, const int * IrrepSizes);
40 
42  virtual ~TwoIndex();
43 
45  void Clear();
46 
48 
52  void set(const int irrep, const int i, const int j, const double val);
53 
55 
59  double get(const int irrep, const int i, const int j) const;
60 
62 
63  void save(const std::string name) const;
64 
66 
67  void read(const std::string name);
68 
69  private:
70 
71  //Contains the group number, the number of irreps, and the multiplication table
72  Irreps SymmInfo;
73 
74  //Array with length the number of irreps of the specified group, containing the number of orbitals of that irrep
75  int * Isizes;
76 
77  //storage[I_i][i+j*(j+1)/2] = mx_ij = mx_ji
78  double ** storage;
79 
80  };
81 }
82 
83 #endif
84 
void Clear()
Set all one-body matrix elements to zero.
Definition: TwoIndex.cpp:55
virtual ~TwoIndex()
Destructor.
Definition: TwoIndex.cpp:47
Definition: CASPT2.h:42
void read(const std::string name)
Load the TwoIndex object.
Definition: TwoIndex.cpp:140
TwoIndex(const int nGroup, const int *IrrepSizes)
Constructor.
Definition: TwoIndex.cpp:31
void save(const std::string name) const
Save the TwoIndex object.
Definition: TwoIndex.cpp:78