v2DM-DOCI  1.0
TwoIndex.h
Go to the documentation of this file.
1 /*
2  CheMPS2: a spin-adapted implementation of DMRG for ab initio quantum chemistry
3  Copyright (C) 2013, 2014 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 
41  TwoIndex(const TwoIndex &);
42 
44  virtual ~TwoIndex();
45 
47 
51  void set(const int irrep, const int i, const int j, const double val);
52 
54 
58  double get(const int irrep, const int i, const int j) const;
59 
61 
62  void save(const std::string name) const;
63 
64  void save2(const std::string name) const;
65 
67 
68  void read(const std::string name);
69 
70  void read2(const std::string name);
71 
73  void reset();
74 
75  private:
76 
77  //Contains the group number, the number of irreps, and the multiplication table
79 
80  //Array with length the number of irreps of the specified group, containing the number of orbitals of that irrep
81  int * Isizes;
82 
83  //storage[I_i][i+j*(j+1)/2] = mx_ij = mx_ji
84  double ** storage;
85 
86  };
87 }
88 
89 #endif
90 
Irreps SymmInfo
Definition: TwoIndex.h:78
void reset()
set everything to zero
Definition: TwoIndex.cpp:331
virtual ~TwoIndex()
Destructor.
Definition: TwoIndex.cpp:64
void read(const std::string name)
Load the TwoIndex object.
Definition: TwoIndex.cpp:148
TwoIndex(const int nGroup, const int *IrrepSizes)
Constructor.
Definition: TwoIndex.cpp:32
void read2(const std::string name)
Definition: TwoIndex.cpp:273
void set(const int irrep, const int i, const int j, const double val)
Set an element.
Definition: TwoIndex.cpp:72
double ** storage
Definition: TwoIndex.h:84
void save2(const std::string name) const
Definition: TwoIndex.cpp:208
void save(const std::string name) const
Save the TwoIndex object.
Definition: TwoIndex.cpp:86