-
Notifications
You must be signed in to change notification settings - Fork 3
/
Gvec_build.m
48 lines (34 loc) · 957 Bytes
/
Gvec_build.m
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
% This program computes the Reciprocal lattice vectors Gvec that is needed in the
% epm model. According to Dragica Vasileska (Arizona Satae University), the reciprocal
% lattice vector up to and includingthe 10th-nearest neighbours are sufficient and correspond
% to 137 plane waves
% https://nanohub.org/resources/1524/download/empiricalpseudopotentialmethod_word.pdf
close all
clear all
clc
NN_neighbours=10;
ig2_mag=[0, 3, 4, 8, 11, 12, 16, 19, 20, 24];
ig2_mag=ig2_mag(1:NN_neighbours);
icount=0;
for i=1:NN_neighbours
ig2=ig2_mag(i);
ia=floor(sqrt(double(ig2)));
ic=0;
for i=-ia:ia
for j=-ia:ia
for k=-ia:ia
idx = i^2 + j^2 + k^2;
if (idx==ig2)
ic=ic+1;
gx(ic+icount)=i;
gy(ic+icount)=j;
gz(ic+icount)=k;
end
end
end
end
icount=icount+ic;
end
Gvec=[gx' gy' gz'];
size(Gvec)
save('Gvec.txt','Gvec')