Bash scripts: Difference between revisions

From The Yambo Project
Jump to navigation Jump to search
No edit summary
No edit summary
Line 56: Line 56:
  rep 'References/o-HF_7Ry.hf' u 3:($4-$3) w p t "7Ry"
  rep 'References/o-HF_7Ry.hf' u 3:($4-$3) w p t "7Ry"
  rep 'References/o-HF_15Ry.hf' u 3:($4-$3) w p t "15Ry"
  rep 'References/o-HF_15Ry.hf' u 3:($4-$3) w p t "15Ry"
=== parse_gap_hf.sh (shell script to parse the HF gap correction) ===
#!/bin/bash
kpts='GAMMA 2x2x2 4x4x4 6x6x6 8x8x8'
NK=(1 8 64 216 512)
j=0
for i in ${kpts}
  do
    VBMo=`grep " 1.00000      4.00000 " $i/References/o-01HF_corrections.hf | awk '{print $3}'`
    VBM=`grep " 1.00000      4.00000 " $i/References/o-01HF_corrections.hf  | awk '{print $4}'`
    CBMo=`grep " 2.576" $i/References/o-01HF_corrections.hf | grep " 5.000" | awk '{print $3}'`
    CBM=`grep " 2.576" $i/References/o-01HF_corrections.hf | grep " 5.000" | awk '{print $4}'`
    echo  ${NK[$j]} $VBMo $VBM $CBMo $CBM | awk '{print $1 " " $5-$3 }' >>  "hf_direct_gap_vs_kpoints.dat"
  j=`expr $j + 1`
done


== Links ==
== Links ==
* [[Tutorials|Back to tutorials menu]]
* [[Tutorials|Back to tutorials menu]]
* [[How to obtain the quasi-particle band structure of a bulk material: h-BN | Back to How to obtain the quasiparticle band structure of a bulk material: h-BN  ]]
* [[How to obtain the quasi-particle band structure of a bulk material: h-BN | Back to How to obtain the quasiparticle band structure of a bulk material: h-BN  ]]

Revision as of 09:12, 5 November 2019

Hexagonal-BN tutorial

generate_inputs_1.sh (NGsBlkXp and BndsRnXp convergence input files)

#!/bin/bash 
bands='10 20 30 40'
blocks='1 2 3 4 5'
for i in ${bands}
 do
  for j in ${blocks}
   do
    sed  -e "s/1 | 10/1 | $i/g"  gw_ppa.in  > tmp$i
    sed  -e "s/NGsBlkXp= 1/ NGsBlkXp= $j/g"  tmp$i > gw_ppa_$i'b_'$j'Ry.in'
    rm tmp*
   done
 done

parse_qps.sh (parse QP energies from output files calculated with BndsRnXp bands and put them in files ordered by NGsBlkXp)

#!/bin/bash 
grep "NGsBlkXp" o-10b_* | awk '{print $4}' > tmp1
grep "used" o-10b_* |awk '{print $5}' > tmp2
cat o-10b* | grep "8.000" |  awk '{print $3+$4}' > tmp3
cat o-10b* | grep "9.000" |  awk '{print $3+$4}' > tmp4
paste tmp1 tmp2 tmp3 tmp4 > 10b.dat
rm tmp1 tmp2 tmp3 tmp4


generate_inputs_2.sh (Gbnd convergence input files)

#!/bin/bash 
bands='10 20 30 40 50 60 70 80'
for i in ${bands}
 do
   sed  -e "s/1 | 40/1 | $i/g"  gw_ppa_30b_3Ry.in  >  gw_ppa_Gbnd$i'.in'
 done


generate_inputs_3.sh (Real axis convergence input files)

#!/bin/bash 
bands='10 20 50 100 150 200 250'
for i in ${bands}
do
  sed  -e "s/ETStpsXd= 100/ETStpsXd=$i/g"  gw_ff.in  >  gw_ff$i'.in'
done

Silicon Tutorial

hf_vs_cutoff.gnuplot (Gnuplot script to plot the HF corrections)

set xrange [-2:8]
set yrange [-5:10]
set xlabel "Eo [eV]"
set ylabel "E_hf-Eo [eV]"
p 'References/o-HF_3Ry.hf' u 3:($4-$3) w p t "3Ry"
rep 'References/o-HF_6Ry.hf' u 3:($4-$3) w p t "6Ry"
rep 'References/o-HF_7Ry.hf' u 3:($4-$3) w p t "7Ry"
rep 'References/o-HF_15Ry.hf' u 3:($4-$3) w p t "15Ry"

parse_gap_hf.sh (shell script to parse the HF gap correction)

#!/bin/bash 
kpts='GAMMA 2x2x2 4x4x4 6x6x6 8x8x8'
NK=(1 8 64 216 512)
j=0
for i in ${kpts}
 do 
   VBMo=`grep " 1.00000      4.00000 " $i/References/o-01HF_corrections.hf | awk '{print $3}'`
   VBM=`grep " 1.00000      4.00000 " $i/References/o-01HF_corrections.hf  | awk '{print $4}'`
   CBMo=`grep " 2.576" $i/References/o-01HF_corrections.hf | grep " 5.000" | awk '{print $3}'`
   CBM=`grep " 2.576" $i/References/o-01HF_corrections.hf | grep " 5.000" | awk '{print $4}'`
   echo  ${NK[$j]} $VBMo $VBM $CBMo $CBM | awk '{print $1 " " $5-$3 }' >>  "hf_direct_gap_vs_kpoints.dat"
  j=`expr $j + 1`
done

Links