CheMPS2
DMRGSCFmatrix.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 DMRGSCFMATRIX_CHEMPS2_H
21 #define DMRGSCFMATRIX_CHEMPS2_H
22 
23 #include "DMRGSCFindices.h"
24 
25 namespace CheMPS2{
33 
34  public:
35 
37 
39 
41  virtual ~DMRGSCFmatrix();
42 
44  void clear();
45 
47  void identity();
48 
50 
54  void set( const int irrep, const int p, const int q, const double val );
55 
57 
61  double get( const int irrep, const int p, const int q ) const;
62 
64 
66  double * getBlock( const int irrep );
67 
69 
71  double rms_deviation( const DMRGSCFmatrix * other ) const;
72 
74 
77  static void write( const string filename, const DMRGSCFindices * idx, double ** storage );
78 
80 
83  static void read( const string filename, const int n_irreps, double ** storage );
84 
85  #ifdef CHEMPS2_MPI_COMPILATION
86 
88  void broadcast( const int ROOT );
89  #endif
90 
91  protected:
92 
95 
97  double ** entries;
98 
101 
102  };
103 }
104 
105 #endif
106 
double * getBlock(const int irrep)
Get a matrix block.
const DMRGSCFindices * iHandler
The information on the occupied, active, and virtual spaces.
Definition: DMRGSCFmatrix.h:94
Definition: CASPT2.h:42
static void read(const string filename, const int n_irreps, double **storage)
Read the DMRGSCFmatrix from disk.
double ** entries
The matrix entries.
Definition: DMRGSCFmatrix.h:97
static void write(const string filename, const DMRGSCFindices *idx, double **storage)
Write a DMRGSCFmatrix to disk.
double rms_deviation(const DMRGSCFmatrix *other) const
Get the RMS deviation with another DMRGSCFmatrix.
DMRGSCFmatrix(const DMRGSCFindices *iHandler)
Constructor.
int num_irreps
The number of irreps.
void identity()
Make this matrix the identity matrix.
void clear()
Clear the matrix.
virtual ~DMRGSCFmatrix()
Destructor.