Hi Nguyen, 

 I would say if you want to get something out of your PDOS file you have to 
mine the data yourself. Below I am sharing a script I generated in matlab; it's 
got a number of lines hardcoded (so it could be better coded for a general 
purpose) but it does what I need. You would need to rename the input file, and 
you also need to know the norbitals line (norbitals=sum over i of  
atom_type(i)*basis size, where i is the total number of atoms). In my case I 
have two species, so I retrieve and sum the projected densities per species. I 
do other things that you may not need, so you can take this file as a starting 
point. 



 I don't know of a pre-done package that will mine the file for you, though I 
may exist. About the COHP thing, I've never used it ; I've never seen how the 
file is formatted, so I can not help with that. But hopefully this gives you 
some idea on how to proceed. 



Cheers, 

-Salvador. 





clear 

clc 



even=0; 

counter_row=1; 

orbital_count=0; 



file= 'ti.PDOS' ; 

fid=fopen(file); 



tline = fgetl(fid); 

text= sscanf(tline, '%c' ); 'ti.PDOS' ; 

fid=fopen(file); 



tline = fgetl(fid); 

text= sscanf(tline, '%c' ); '%c' ); 

if text== '<pdos>' disp( 'Reading PDOS file' ) text== '<pdos>' disp( 'Reading 
PDOS file' ) 

else disp( 'Format error in input file' ) disp( 'Format error in input file' ) 

end 



tline = fgetl(fid); 

text= sscanf(tline, '%c' ); '%c' ); 

if (text== '<nspin>1</nspin>' ) 

spin=1; 

disp( 'One spin component' ); (text== '<nspin>1</nspin>' ) 

spin=1; 

disp( 'One spin component' ); 'One spin component' ); 

elseif (text== '<nspin>2</nspin>' ) 

spin=2; 

disp( 'Two spin components' ) (text== '<nspin>2</nspin>' ) 

spin=2; 

disp( 'Two spin components' ) 'Two spin components' ) 

end 



tline = fgetl(fid); 

text= sscanf(tline, '%c' ); 

n=size(text,2) 



norbitals=0; '%c' ); 

n=size(text,2) 



norbitals=0; 

for j=1:n-23 

num=text(n-11-j); 

norbitals=norbitals+(num-48)*10^(j-1); j=1:n-23 

num=text(n-11-j); 

norbitals=norbitals+(num-48)*10^(j-1); 

end 



norbitals=4240 

%norbitals=11716 





tline = fgetl(fid); 

text= sscanf(tline, '%f' ); '%f' ); 

if text>-10.0 disp( 'this is a number' ) text>-10.0 disp( 'this is a number' ) 

end 



counter=1; 

tline = fgetl(fid); 

text= sscanf(tline, '%f' ); 

Energy(counter,1)=text; 

counter=counter+1; 

'%f' ); 

Energy(counter,1)=text; 

counter=counter+1; 



while text>-31.0 

tline = fgetl(fid); 

text= sscanf(tline, '%f' ); 

if text>-31.0 

Energy(counter,1)=text; 

counter=counter+1; 

end 

end 

text>-31.0 

tline = fgetl(fid); 

text= sscanf(tline, '%f' ); 

if text>-31.0 

Energy(counter,1)=text; 

counter=counter+1; 

end 

end 

'%f' ); 

if text>-31.0 

Energy(counter,1)=text; 

counter=counter+1; 

end 

end 

if text>-31.0 

Energy(counter,1)=text; 

counter=counter+1; 

end 

end 

end 

end 



counter=counter-1; 

disp( 'The number of energy values is' ) 

counter 

disp( 'on the interval (eV)' ) 

Energy(1),Energy(counter) 





PDOSC =zeros(2,counter); 

PDOSCz =zeros(80,counter); 

PDOSTi=zeros(2,counter); 



'The number of energy values is' ) 

counter 

disp( 'on the interval (eV)' ) 

Energy(1),Energy(counter) 





PDOSC =zeros(2,counter); 

PDOSCz =zeros(80,counter); 

PDOSTi=zeros(2,counter); 



'on the interval (eV)' ) 

Energy(1),Energy(counter) 





PDOSC =zeros(2,counter); 

PDOSCz =zeros(80,counter); 

PDOSTi=zeros(2,counter); 





for j=1:norbitals 

for i=1:2 

tline = fgetl(fid); 

end j=1:norbitals 

for i=1:2 

tline = fgetl(fid); 

end for i=1:2 

tline = fgetl(fid); 

end end 



text=fgetl(fid) 





tline = fgetl(fid); 

text= sscanf(tline, '%c' ); 

n=size(text,2); 

if n==13 text(14)= ' ' ; 

end 

'%c' ); 

n=size(text,2); 

if n==13 text(14)= ' ' ; 

end 

if n==13 text(14)= ' ' ; 

end 

end 



text 



text1= ' species="Ti" ' ; 

text2= ' species="C" ' ; 



if (text==text1) 

for i=1:7 

tline = fgetl(fid); 

end ' species="Ti" ' ; 

text2= ' species="C" ' ; 



if (text==text1) 

for i=1:7 

tline = fgetl(fid); 

end ' species="C" ' ; 



if (text==text1) 

for i=1:7 

tline = fgetl(fid); 

end if (text==text1) 

for i=1:7 

tline = fgetl(fid); 

end for i=1:7 

tline = fgetl(fid); 

end end 

for i=1:counter 

tline = fgetl(fid); 

vals=sscanf(tline, '%f' ); 

PDOSTi(1,i)=PDOSTi(1,i)+vals(1); 

end 

tline = fgetl(fid); 

tline = fgetl(fid); 

end for i=1:counter 

tline = fgetl(fid); 

vals=sscanf(tline, '%f' ); 

PDOSTi(1,i)=PDOSTi(1,i)+vals(1); 

end 

tline = fgetl(fid); 

tline = fgetl(fid); 

end '%f' ); 

PDOSTi(1,i)=PDOSTi(1,i)+vals(1); 

end 

tline = fgetl(fid); 

tline = fgetl(fid); 

end end 

tline = fgetl(fid); 

tline = fgetl(fid); 

end end 





if (text==text2) 

for i=1:7 

tline = fgetl(fid); 

end (text==text2) 

for i=1:7 

tline = fgetl(fid); 

end for i=1:7 

tline = fgetl(fid); 

end end 

for i=1:counter 

tline = fgetl(fid); 

vals=sscanf(tline, '%f' ); 

PDOSC(1,i)=PDOSC(1,i)+vals(1); 

PDOSCz(counter_row,i)=PDOSCz(counter_row,i)+vals(1); 

end 



orbital_count=orbital_count+1; 

if (orbital_count==13) 

orbital_count; 

text; 

counter_row; for i=1:counter 

tline = fgetl(fid); 

vals=sscanf(tline, '%f' ); 

PDOSC(1,i)=PDOSC(1,i)+vals(1); 

PDOSCz(counter_row,i)=PDOSCz(counter_row,i)+vals(1); 

end 



orbital_count=orbital_count+1; 

if (orbital_count==13) 

orbital_count; 

text; 

counter_row; '%f' ); 

PDOSC(1,i)=PDOSC(1,i)+vals(1); 

PDOSCz(counter_row,i)=PDOSCz(counter_row,i)+vals(1); 

end 



orbital_count=orbital_count+1; 

if (orbital_count==13) 

orbital_count; 

text; 

counter_row; end 



orbital_count=orbital_count+1; 

if (orbital_count==13) 

orbital_count; 

text; 

counter_row; if (orbital_count==13) 

orbital_count; 

text; 

counter_row; 

% pause 

even=mod(even+1,2); 

orbital_count=0; 

if (even==0) 

counter_row=counter_row+1; 

end ; 

end if (even==0) 

counter_row=counter_row+1; 

end ; 

end end ; 

end end 



tline = fgetl(fid); 

tline = fgetl(fid); 

end 







end 



%closing input file 

%=============================================== 

fclose(fid); 

%=============================================== 

----- Original Message -----
From: "Nguyen Doan Sau" <[email protected]> 
To: [email protected] 
Sent: Wednesday, October 20, 2010 10:56:39 AM 
Subject: [SIESTA-L] Integrated PDOS and COHP questions... 

Hi Siesta users, 
I have two quick questions. 
First, how do we get the integrated Pdos in Siesta 
Second, how do we get the integrated COHP in Siesta. 
Could anyone help me on those question quickly! 
Thanks, 
Sau Nguyen 
U of Houston 
-- 
Salvador Barraza-Lopez 
Postdoctoral Fellow 
School of Physics 
The Georgia Institute of Technology 

Office N205 
837 State Street Atlanta, Georgia 30332-0430 U.S.A 
Tel: (404) 894-0892 Fax: (404) 894-9958 

Responder a