Take ZrH2 as an example.
1.
Post-processing:
Calculate linewidth at different q-points:
Phono3py--fc3--fc2--dim="2 2 2" --loglevel=2 --mesh=" c6> " -C Poscar-unitcell--ga="0 0 0 1 1 1 2 2 2 3 3 3 4 4 4 5 5 5 6 6 6 7 7 7 8 8 8 9 9 9 10 10 10 11 11 11 12 12 12 13 13 13 14 14 14 15 15 15 16 16 16 17 17 17 18 18 18 19 19 19 20 20 20 21 21 21 22 22 22 23 23 23 24 24 24 2 5(+)---------" --lw--bi="1,2,3,4,5 , 6,7,8,9,10,11,12,13,14,15,16,17,18"
This will take 64*64*64 to BZ and then calculate a Q point for each of the three values in Ga.
Draw the phonon linewidth distribution map:
1 #!/usr/bin/env python2 3 ImportOS4 ImportSYS5 ImportNumPy as NP6 ImportMatplotlib.pyplot as Plt7 8Lw_dir ="linewidth"9Freq_file ="M646464.out"Tentemp = 10#Temperature OneLw_factor = 10.0#Magnified Factor A - defReadoutput (file_name): -With open (file_name,'RB') as F: theAll_lines =F.readlines () - -All_found =0 - forIinchRange (len (all_lines)): + ifAll_found = = 3: - Break + elif "Mesh Sampling" inchAll_lines[i]: AMesh = map (int, all_lines[i].split () [3:6]) atAll_found + = 1 - elif "Band Indices" inchAll_lines[i]: -Band_index = map (int, all_lines[i].replace ('[',"'). Replace (']',"'). Split () [2:]) -All_found + = 1 - elif "Grid Point to" inchAll_lines[i]: -Gp_index = map (int, all_lines[i+1].split () [:]) inAll_found + = 1 - to returnmesh, Band_index, Gp_index + - defGETLW (Grid_index, temp, mesh, N_band): theLw_grid = [] *Mesh_file_name ="'. Join (Map (str, mesh)) $ forIinchRange (N_band):Panax Notoginsengfile_name = Os.path.join (Lw_dir,'linewidth-m'+mesh_file_name+'- G'+str (Grid_index) +'- b'+str (i+1) +'. Dat') -With open (file_name,'RB') as F: theAll_lines =F.readlines () + A forLineinchAll_lines: the #add space and 0000 to avoid alias + if(" "+STR (Float (temp)) +"0000")inchLine : -Lw_grid.append (Float (Line.split () [1])) $ $ ifLen (lw_grid)! =N_band: - Print("error!\n") -Sys.exit (1) the - returnLw_gridWuyi the defgetfreq (Grid_index, N_band): -Freq_grid = [] WuWith open (Freq_file,'RB') as F: -All_lines =F.readlines () About $ forIinchRange (len (all_lines)): - if "Grid Point" inchAll_lines[i] andInt (All_lines[i].split () [3]) = =Grid_index: - #May has different lines for the this data block - forJinchRange (i+5, i+9): AFreq_grid.extend (Map (float, All_lines[j].strip (). Lstrip ('['). Rstrip (']'). Split () [:]) + if ']' not inchAll_lines[i+8]: theFreq_grid.extend (Map (float, All_lines[i+9].strip (). Lstrip ('['). Rstrip (']'). Split () [:]) - $ ifLen (freq_grid)! =N_band: the Print("error!\n") theSys.exit (1) the the returnFreq_grid - in the #Main Routine theMesh, band_index, Gp_index =readoutput (freq_file) About theFreq = [] theLW = [] theN_band =Len (band_index) +x =Range (len (gp_index)) - the forGrid_indexinchGp_index:BayiLw_tmp =GETLW (Grid_index, temp, mesh, N_band) the lw.append (lw_tmp) the -Freq_tmp =getfreq (Grid_index, N_band) - freq.append (freq_tmp) the theLw_upper = Np.add (Freq, 0.5*lw_factor*Np.array (LW)) theLw_lower = Np.add (Freq, -0.5*lw_factor*Np.array (LW)) the -Freq_plot = Zip (*freq) theLw_plot = Zip (*LW) theLw_upper_plot = Zip (*lw_upper) theLw_lower_plot = Zip (*lw_lower)94 theFig,ax =plt.subplots () the forIinchRange (N_band): theAx.plot (x, Freq_plot[i], color='Black')98Ax.plot (x, Lw_upper_plot[i], X, Lw_lower_plot[i], linestyle='--', Linewidth=1, color='Red') AboutAx.fill_between (x, Lw_upper_plot[i], lw_lower_plot[i], Where=np.array (Lw_upper_plot[i]) >= Np.array (lw_lower_ Plot[i]), Facecolor=none, interpolate=True) - #ax.fill_between (x, Lw_upper_plot[i], lw_lower_plot[i], Where=np.array (Lw_upper_plot[i]) >= Np.array (lw_ Lower_plot[i]), markerfacecolor= "None", Interpolate=true)101Ax.set_title ('ZrH2 phonon band structure with LineWidth')102Ax.set_xlabel ('kpoints')103Ax.set_ylabel ('Frequency (THz)')104Plt.show ()
vasp+phono3py Calculating phonon linewidth