HubbardGPU
Hubbard diagonalisation on the GPU (and CPU)
 All Classes Files Functions Variables Typedefs Friends Macros
ham-mom.h
Go to the documentation of this file.
1 /* Copyright (C) 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 HAM_MOM_H
20 #define HAM_MOM_H
21 
22 #include <vector>
23 #include <memory>
24 
25 #include "bare-ham.h"
26 
27 
34 {
35  public:
36  MomHamiltonian(int L, int Nu, int Nd, double J, double U);
37  virtual ~MomHamiltonian();
38 
39  void BuildBase();
40  void BuildFullHam();
41 
42  virtual void mvprod(double *x, double *y, double alpha) const;
43 
44  std::vector<double> ExactDiagonalizeFull(bool calc_eigenvectors);
45 
46  virtual std::vector< std::pair<int,double> > ExactMomDiagonalizeFull(bool calc_eigenvectors);
47 
48  void GenerateData(double Ubegin, double Uend, double step, std::string filename);
49 
50  protected:
51  double hopping(myint) const;
52 
53  int interaction(int, int, int, int) const;
54 
55  std::vector< std::vector< std::pair<int,int> > > mombase;
56 
57  std::vector< std::unique_ptr<double []> > blockmat;
58 };
59 
60 #endif /* HAM_MOM_H */
61 
62 /* vim: set ts=8 sw=4 tw=0 expandtab :*/