-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwrite_ph.py
128 lines (126 loc) · 5.11 KB
/
write_ph.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
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
def write_ph(nq, ecutrho, nbnd):
#
# ph.in : Phonon
#
with open("ph.in", 'w') as f:
print("Phonon", file=f)
print("&INPUTPH", file=f)
print(" lshift_q = .true.", file=f)
print(" ldisp = .true.", file=f)
print(" search_sym = .false.", file=f)
print(" reduce_io = .true.", file=f)
print(" tr2_ph = 1.0d-15", file=f)
print(" only_init = .true.", file=f)
print(" lqdir = .true.", file=f)
print(" alpha_mix = 0.1", file=f)
print(" fildvscf = \'dv\'", file=f)
print(" nq1 = %d" % nq[0], file=f)
print(" nq2 = %d" % nq[1], file=f)
print(" nq3 = %d" % nq[2], file=f)
print(" nk1 = %d" % (nq[0]*2), file=f)
print(" nk2 = %d" % (nq[1]*2), file=f)
print(" nk3 = %d" % (nq[2]*2), file=f)
print(" start_q = 1", file=f)
print(" last_q = 1", file=f)
print("/", file=f)
#
# elph.in : Electron-phonon
#
with open("elph.in", 'w') as f:
print("Electron-phonon", file=f)
print("&INPUTPH", file=f)
print(" lshift_q = .true.", file=f)
print(" ldisp = .true.", file=f)
print(" search_sym = .false.", file=f)
print(" reduce_io = .true.", file=f)
print(" lqdir = .true.", file=f)
print(" nq1 = %d" % nq[0], file=f)
print(" nq2 = %d" % nq[1], file=f)
print(" nq3 = %d" % nq[2], file=f)
print(" start_q = ", file=f)
print(" last_q = ", file=f)
print(" fildvscf = \'dv\'", file=f)
print(" electron_phonon = \'lambda_tetra\'", file=f)
print(" nk1 = %d" % (nq[0]*4), file=f)
print(" nk2 = %d" % (nq[1]*4), file=f)
print(" nk3 = %d" % (nq[2]*4), file=f)
print("/", file=f)
print("&INPUTA2F", file=f)
print(" nfreq = %d" % 100, file=f)
print("/", file=f)
#
# epmat.in : Electron-phonon matrix for SCDFT
#
with open("epmat.in", 'w') as f:
print("Electron-phonon matrix", file=f)
print("&INPUTPH", file=f)
print(" lshift_q = .true.", file=f)
print(" ldisp = .true.", file=f)
print(" search_sym = .false.", file=f)
print(" reduce_io = .true.", file=f)
print(" lqdir = .true.", file=f)
print(" nq1 = %d" % nq[0], file=f)
print(" nq2 = %d" % nq[1], file=f)
print(" nq3 = %d" % nq[2], file=f)
print(" start_q = ", file=f)
print(" last_q = ", file=f)
print(" fildvscf = \'dv\'", file=f)
print(" electron_phonon = \'scdft_input\'", file=f)
print(" nk1 = %d" % nq[0], file=f)
print(" nk2 = %d" % nq[1], file=f)
print(" nk3 = %d" % nq[2], file=f)
print(" elph_nbnd_min = ", file=f)
print(" elph_nbnd_max = ", file=f)
print("/", file=f)
#
# phdos.in : Phonon DOS
#
with open("phdos.in", 'w') as f:
print("&INPUT", file=f)
print(" flfrc = \'ifc.dat\'", file=f)
print(" fldos = \'matdyn.dos\'", file=f)
print(" flfrq = \' \'", file=f)
print(" flvec = \' \'", file=f)
print(" fleig = \' \'", file=f)
print(" fldyn = \' \'", file=f)
print(" fltau = \' \'", file=f)
print(" la2f = .true.", file=f)
print(" dos = .true.", file=f)
print(" asr = \'crystal\'", file=f)
print(" nk1 = %d" % (nq[0]*2), file=f)
print(" nk2 = %d" % (nq[1]*2), file=f)
print(" nk3 = %d" % (nq[2]*2), file=f)
print(" ndos = %d" % 100, file=f)
print("/", file=f)
#
# scdft.in : Input file for scdft.x
#
with open("sctk.in", 'w') as f:
print("&CONTROL", file=f)
print(" calculation = \"kel\"", file=f)
print("/", file=f)
print("&KEL", file=f)
print(" start_q = 1", file=f)
print(" last_q = 1", file=f)
print(" nci = 10", file=f)
print(" laddxc = 0", file=f)
print(" lsf = 1", file=f)
print(" ecutfock = %f" % (ecutrho * 0.25), file=f)
print(" nq1 = %d" % nq[0], file=f)
print(" nq2 = %d" % nq[1], file=f)
print(" nq3 = %d" % nq[2], file=f)
print("/", file=f)
print("&SCDFT", file=f)
print(" temp = -0.1", file=f)
print(" fbee = 1", file=f)
print(" lbee = %d" % nbnd, file=f)
print(" xic = -1.0", file=f)
print(" nmf = 10", file=f)
print(" nx = 100", file=f)
print(" ne = 50", file=f)
print(" emin = 1.0e-7", file=f)
print(" emax = 5.0", file=f)
print(" electron_maxstep = 100", file=f)
print(" conv_thr = 1.0e-15", file=f)
print(" spin_fluc =.false.", file=f)
print("/", file=f)