-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathDajeVu_test.py
110 lines (92 loc) · 5.75 KB
/
DajeVu_test.py
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
import numpy as np
from DajeVu import LatteOpera
lo = LatteOpera()
file_dir = 'D:/Projects/PhaseTransistor/Data/Simulation/Conductivity/Mobility/4/Orthogonal_supercell/14_8_1'
file_name = '4_relaxed_shifted.vasp'
#POSCAR = file_dir+file_name
a = np.array([3.1464252745889447,0.0000000000,0.0000000000])
b = np.array([0.0000000000,5.4498188782953569,0.0000000000])
c = np.array([0.0000000000,0.0000000000,44.5900000000000034])
lattice = [a, b, c]
#s = np.array([0.0000000000,0.0000000000,3.79])
#Tv = np.array([0.0000000000,0.0000000000,20.0])
#lattice_old = [a,a+2*b,s]
#lattice_new = [a,a+2*b,s+Tv]
#print(lattice_new)
# 2H
#pos = [[0.0000000000000000, 0.0000016507563097, 0.5000000000000000],
#[0.5000000000000000, 0.5000016507563095, 0.5000000000000000],
#[0.5000000000000000, 0.1666691746218486, 0.5682174630191978],
#[0.5000000000000000, 0.1666691746218486, 0.4317825369808021],
#[0.0000000000000000, 0.6666691746218486, 0.5682174630191978],
#[0.0000000000000000, 0.6666691746218486, 0.4317825369808021]]
# 1T
#pos = [[0.0000000000000000, 0.0000000000000000, 0.5004100000000022],
#[0.5000000000000000, 0.5000000000000000, 0.5004100000000022],
#[0.5000000000000000, 0.1667168300175193, 0.5703909595500125],
#[0.0000000000000000, 0.3332831699824806, 0.4304290404499850],
#[0.0000000000000000, 0.6667168300175195, 0.5703909595500125],
#[0.5000000000000000, 0.8332831699824805, 0.4304290404499850]]
# 1T_prime
#pos = [[-0.0000000000116523, 0.0142727856472211, 0.5186922458471422],
#[0.4999999999845273, 0.4127461552479360, 0.5120508710525412],
#[0.5000000000111523, 0.1318290722283811, 0.5882928707883931],
#[0.0000000000034336, 0.2949561642182194, 0.4424479959781702],
#[-0.0000000000062838, 0.6346827222974530, 0.5717565293768617],
#[0.5000000000188231, 0.7922131003607926, 0.4589794869568891]]
# quadrilayer MoS2_2H
#pos = [[0.0000000000000000, 0.0000191442777826, 0.2946235298069435],
#[0.5000000000000000, 0.5000191442777681, 0.2946235298069435],
#[0.5000000000000000, 0.1666549182972589, 0.4312688560212918],
#[0.0000000000000000, 0.6666549182972534, 0.4312688560212918],
#[0.0000000000000000, 0.0000150817027470, 0.5687311439787226],
#[0.5000000000000000, 0.5000150817027500, 0.5687311439787226],
#[0.5000000000000000, 0.1666508557222125, 0.7053764701930698],
#[0.0000000000000000, 0.6666508557222354, 0.7053764701930698],
#[0.5000000000000000, 0.1666849109710739, 0.3297316123902559],
#[0.5000000000000000, 0.1666873920805583, 0.2594863210801654],
#[0.0000000000000000, 0.6666849109710681, 0.3297316123902559],
#[0.0000000000000000, 0.6666873920805726, 0.2594863210801654],
#[0.0000000000000000, -0.0000121651846465, 0.4663792701115902],
#[0.0000000000000000, -0.0000121899549190, 0.3961618292191119],
#[0.5000000000000000, 0.4999878348153454, 0.4663792701115902],
#[0.5000000000000000, 0.4999878100450679, 0.3961618292191119],
#[0.5000000000000000, 0.1666821899549194, 0.6038381707808869],
#[0.5000000000000000, 0.1666821651846500, 0.5336207298884402],
#[0.0000000000000000, 0.6666821899549197, 0.6038381707808869],
#[0.0000000000000000, 0.6666821651846443, 0.5336207298884402],
#[0.0000000000000000, -0.0000173920805559, 0.7405136789198514],
#[0.0000000000000000, -0.0000149109710636, 0.6702683876097409],
#[0.5000000000000000, 0.4999826079194605, 0.7405136789198514],
#[0.5000000000000000, 0.4999850890289367, 0.6702683876097409]]
# quadrilayer MoS2_2H 14*8*1
pos = [[0.0000000000000000, 0.0000144841383986, 0.2942975963315604],
[0.5000000000000000, 0.5000144841384000, 0.2942975963315604],
[0.5000000000000000, 0.1666614054948715, 0.4311980840938672],
[0.0000000000000000, 0.6666614054948758, 0.4311980840938672],
[0.0000000000000000, 0.0000085945051330, 0.5688019159061460],
[0.5000000000000000, 0.5000085945051276, 0.5688019159061460],
[0.5000000000000000, 0.1666555158616057, 0.7057024036684370],
[0.0000000000000000, 0.6666555158616035, 0.7057024036684370],
[0.5000000000000000, 0.1666817332459094, 0.3294112142955040],
[0.5000000000000000, 0.1666814898919161, 0.2591527916657537],
[0.0000000000000000, 0.6666817332459000, 0.3294112142955040],
[0.0000000000000000, 0.6666814898919333, 0.2591527916657537],
[0.0000000000000000, -0.0000046922416745, 0.4663148066154800],
[0.0000000000000000, -0.0000056473461649, 0.3960834746511596],
[0.5000000000000000, 0.4999953077583212, 0.4663148066154800],
[0.5000000000000000, 0.4999943526538298, 0.3960834746511596],
[0.5000000000000000, 0.1666756473461683, 0.6039165253488370],
[0.5000000000000000, 0.1666746922416789, 0.5336851933845336],
[0.0000000000000000, 0.6666756473461717, 0.6039165253488370],
[0.0000000000000000, 0.6666746922416792, 0.5336851933845336],
[0.0000000000000000, -0.0000114898919121, 0.7408472083342478],
[0.0000000000000000, -0.0000117332459040, 0.6705887857044873],
[0.5000000000000000, 0.4999885101080688, 0.7408472083342478],
[0.5000000000000000, 0.4999882667541030, 0.6705887857044873]]
#pos_new = lo.LatticeTransform(pos,lattice_old,lattice_new)
shift_vec = np.array([0.0, 0.0, 0.2942975963315604])-np.array([0.0000000000000000, 0.0000144841383986, 0.2942975963315604])
pos_shifted = lo.ShiftCrystal(pos,shift_vec)
print(pos_shifted)
#pos_shifted_rounded = lo.CutOff(pos_shifted)
lo.WritePOSCAR(file_dir,lattice,[['Mo',8],['S',16]],pos_shifted,file_name=file_name)