-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathget_pdos_script.py
More file actions
76 lines (63 loc) · 1.97 KB
/
get_pdos_script.py
File metadata and controls
76 lines (63 loc) · 1.97 KB
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
#!/bin/python3
"""
Este script verifica listas de funcoes de ondas dos orbitais p e s para determinados atomos (que tambem devem ser listados) e executa o modulo plotband.x do Quantum Espresso para plot da estrutura de bandas projetadas
"""
import os
filename = "ag977.bands_final"
fermi = "3.85"
atom_list = [52,31,38,48,42,41]
s_list1 = [[460],[271],[334],[370],[388],[361]]
p_list1 = [[461,462,463],[272, 273, 274], [335,336,337],[371,372,373],[389,390,391],[362,363,364]]
table = []
for j in range(len(atom_list)):
atom_number=atom_list[j]
s_list=s_list1[j]
s_orbital=['s']
p_list=p_list1[j]
p_orbital =['px','py','pz']
remove = 'rm banda.ps plot.out'
plot = 'plotband.x < plot.in > plot.out'
os.system(f'mkdir {atom_number}_s' )
for i in range(len(s_list)):
f = open("plot.in", "w")
f.write(filename) # nome do arquivo bands
f.write("\n")
f.write(f" {s_list[i]}")# lista de orbitais
f.write("\n")
f.write(" -4 9")# lintervalo de energia
f.write("\n")
f.write(f"atom_{atom_number}"f"_{s_orbital[i]}.gnu")# output de bands
f.write("\n")
f.write("banda.ps")
f.write("\n")
f.write(f" {fermi}")
f.write("\n")
f.write("\n")
f.write(f"2.0 {fermi}")
f.close()
os.system(plot)
os.system(remove)
file = 'atom'+'_'+str(atom_number)+'_'+f'{s_orbital[i]}'+'.gnu'
os.system(f'mv {file} {atom_number}_s' )
os.system(f'mkdir {atom_number}_p' )
for i in range(len(p_list)):
f = open("plot.in", "w")
f.write(filename) # nome do arquivo bands
f.write("\n")
f.write(f" {p_list[i]}")# lista de orbitais
f.write("\n")
f.write(" -4 9")# lintervalo de energia
f.write("\n")
f.write(f"atom_{atom_number}"f"_{p_orbital[i]}.gnu")# output de bands
f.write("\n")
f.write("banda.ps")
f.write("\n")
f.write(f" {fermi}")
f.write("\n")
f.write("\n")
f.write("2.0 {fermi}")
f.close()
os.system(plot)
os.system(remove)
file = 'atom'+'_'+str(atom_number)+'_'+f'{p_orbital[i]}'+'.gnu'
os.system(f'mv {file} {atom_number}_p' )