forked from rgmelko/1D_NLC
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathGenHam.h
51 lines (35 loc) · 1.14 KB
/
GenHam.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
//c++ class for creating a general Hamiltonian in c++ vectors
//Roger Melko, November 2007
#ifndef GenHam_H
#define GenHam_H
#include <iostream>
#include <vector>
using namespace std;
#include <blitz/array.h>
BZ_USING_NAMESPACE(blitz)
typedef long double h_float; //precision for Hamiltonian storage
class GENHAM{
public:
int Vdim; //dimenson of reduced Hilbert space
vector<vector<long> > PosHam;
vector<vector<h_float> > ValHam;
//vector<double> DiagHam;
vector<long> Basis;
vector<long> BasPos;
Array<double,2> Ham; //full hamiltonian
GENHAM(const int N_ ,const h_float J_, const h_float h_, vector < pair<int,int> > BBond_, bool Low_);
void printg();
//double at(const int , const int );
Array<double,1> apply(const Array<double,1>&);
void SparseHamJQ();
private:
int Nsite; //number sites
bool LowField; //High or Low Field expansion
vector< pair < int,int> > Bond;
h_float JJ; //heisenberg exchange value
h_float hh; //next-nearest neighbor exchange value
double HdiagPart(const long, int);
double HOFFdBondX(const int, const long);
double HOFFdBondY(const int, const long);
};
#endif