HubbardGPU
Hubbard diagonalisation on the GPU (and CPU)
 All Classes Files Functions Variables Typedefs Friends Macros
hamsparse.h
Go to the documentation of this file.
1 /* Copyright (C) 2012-2014 Ward Poelmans
2 
3 This file is part of Hubbard-GPU.
4 
5 Hubbard-GPU 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 3 of the License, or
8 (at your option) any later version.
9 
10 Hubbard-GPU 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
16 along with Hubbard-GPU. If not, see <http://www.gnu.org/licenses/>.
17 */
18 
19 #ifndef HAMSPARSE_H
20 #define HAMSPARSE_H
21 
26 template<class Ham>
27 class SparseHamiltonian: public Ham
28 {
29  public:
30  SparseHamiltonian(int L, int Nu, int Nd, double J, double U);
31  virtual ~SparseHamiltonian();
32 
33  void BuildHam();
34 
35  void BuildSparseHam();
36 
37  void PrintSparse() const;
38 
39  void PrintRawELL() const;
40 
41  virtual void mvprod(double *, double *, double) const;
42 
43  double* Umatrix() const;
44 
45  protected:
46 
48  double *Up_data;
50  double *Down_data;
51 
53  unsigned int *Up_ind;
55  unsigned int *Down_ind;
56 
58  int size_Up;
60  int size_Down;
61 
62 };
63 
64 #endif /* HAMSPARSE_H */
65 
66 /* vim: set ts=8 sw=4 tw=0 expandtab :*/