-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathGraphene.cpp
154 lines (118 loc) · 4.41 KB
/
Graphene.cpp
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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
// @author Wushi Dong
// Graphene.cpp
#include "Graphene.h"
Graphene::Graphene(const Parameters &rParameters)
{
mName = "Graphene";
mLatticeConstant = 2.46;
mNumWannier = 2;
mHopping = -2.8;
mFermiLevel = rParameters.mFermiLevelGr;
mNumUnitCellX = 2;
mNumUnitCellY = 4;
mUnitCellHamiltonian.set_size(mNumWannier * mNumUnitCellX, mNumWannier
* mNumUnitCellX);
SetUnitCellHamiltonian();
mUnitCellInteractionX.set_size(mNumWannier * mNumUnitCellX, mNumWannier
* mNumUnitCellX);
SetUnitCellInteractionX();
mUnitCellInteractionY.set_size(mNumWannier * mNumUnitCellX, mNumWannier
* mNumUnitCellX);
SetUnitCellInteractionY();
}
Graphene::~Graphene()
{
// cout << "Graphene deleted" << endl;
}
//void Graphene::SetFermiLevel(const Parameters *parameters)
//{
// mFermiLevel = parameters->mGrapheneFermiLevel;
//}
// Uses a unit cell of 4 carbon atoms
void Graphene::SetUnitCellHamiltonian()
{
mUnitCellHamiltonian << -mFermiLevel << mHopping << 0.0 << 0.0 << endr
<< mHopping << -mFermiLevel << mHopping << 0.0 << endr
<< 0.0 << mHopping << -mFermiLevel << mHopping << endr
<< 0.0 << 0.0 << mHopping << -mFermiLevel << endr;
}
void Graphene::SetUnitCellInteractionX()
{
mUnitCellInteractionX << 0.0 << 0.0 << 0.0 << 0.0 << endr
<< 0.0 << 0.0 << 0.0 << 0.0 << endr
<< 0.0 << 0.0 << 0.0 << 0.0 << endr
<< mHopping << 0.0 << 0.0 << 0.0 << endr;
}
void Graphene::SetUnitCellInteractionY()
{
mUnitCellInteractionY << 0.0 << 0.0 << 0.0 << 0.0 << endr
<< mHopping << 0.0 << 0.0 << 0.0 << endr
<< 0.0 << 0.0 << 0.0 << mHopping << endr
<< 0.0 << 0.0 << 0.0 << 0.0 << endr;
}
cx_mat Graphene::GetPrincipalLayerHamiltonian(const double phase) const
{
cx_mat PrincipalLayerHamiltonian(mNumWannier * mNumUnitCellX * mNumUnitCellY,
mNumWannier * mNumUnitCellX * mNumUnitCellY);
// Used by kron() to construct the Hamiltonian matrix of the supercell
mat f_Gr(mNumUnitCellY, mNumUnitCellY);
// Sets the off-diagonal entries
f_Gr.zeros();
f_Gr.diag(1) += 1;
PrincipalLayerHamiltonian = kron(f_Gr, mUnitCellInteractionY);
PrincipalLayerHamiltonian = PrincipalLayerHamiltonian
+ PrincipalLayerHamiltonian.t();
// Sets the diagonal entries
f_Gr.zeros();
f_Gr.diag(0) += 1;
PrincipalLayerHamiltonian = PrincipalLayerHamiltonian + kron(f_Gr,
mUnitCellHamiltonian);
// Sets the interaction with the neighbouring Cell along the periodic y axis
PrincipalLayerHamiltonian(mNumWannier * mNumUnitCellX * mNumUnitCellY - 3, 0)
+= mHopping * exp(constants::I * phase);
PrincipalLayerHamiltonian(mNumWannier * mNumUnitCellX * mNumUnitCellY - 2, 3)
+= mHopping * exp(constants::I * phase);
PrincipalLayerHamiltonian(0, mNumWannier * mNumUnitCellX * mNumUnitCellY - 3)
+= mHopping * exp(-constants::I * phase);
PrincipalLayerHamiltonian(3, mNumWannier * mNumUnitCellX * mNumUnitCellY - 2)
+= mHopping * exp(-constants::I * phase);
return PrincipalLayerHamiltonian;
}
// This term curently does not use the phase argument because we only include
// nearest-neighbor hoppings for graphene.
cx_mat Graphene::GetPrincipalLayerInteractionX(const double phase) const
{
cx_mat PrincipalLayerInteractionX(mNumWannier * mNumUnitCellX * mNumUnitCellY,
mNumWannier * mNumUnitCellX * mNumUnitCellY);
// Used by kron() to construct the Hamiltonian matrix of the supercell
mat f_Gr(mNumUnitCellY, mNumUnitCellY);
f_Gr.zeros();
f_Gr.diag(0) += 1;
PrincipalLayerInteractionX = kron(f_Gr, mUnitCellInteractionX);
return PrincipalLayerInteractionX;
}
//// Testing
//int main()
//{
// Graphene* pGraphene = new Graphene();
// pGraphene->Init();
//
// cout << "Graphene unit cell Hamiltonian (eV):" << endl;
// cout << pGraphene->GetUnitCellHamiltonian();
// cout << endl;
//
// cout << "Graphene unit cell interaction along x axis (eV):" << endl;
// cout << pGraphene->GetUnitCellInteractionX();
// cout << endl;
//
// cout << "Graphene unit cell interaction along y axis (eV):" << endl;
// cout << pGraphene->GetUnitCellInteractionY();
// cout << endl;
//
// cout << pGraphene->GetPrincipalLayerHamiltonian(0.);
// cout<< endl;
// cout << pGraphene->GetPrincipalLayerInteractionX(0.);
// cout<< endl;
//
// return 0;
//}