silicon bandgap calculation
Posted: Mon Jan 13, 2025 6:16 pm
Dear all,
When calculating the K-points convergence in the section "COHSEX without empty bands" on the Yambo homepage (https://wiki.yambo-code.eu/wiki/index.php?title=Silicon), I am unable to obtain the same bandgap as shown in the image on the homepage. I am puzzled by the data extraction script file provided below, named parse_gap.sh( which was obtained from the folder \Silicon\YAMBO\.References ). For the *-Cohsex* calculations, why does it output $4+$5, which seems to imply that the bandgap is calculated as CBMo + CBM? Shouldn't it be necessary to subtract (VBMo+VBM) as well?
#!/bin/bash
if [ ! -f GAMMA/References/$1 ]
then
echo "File not found"
exit
fi
rm -f $2
kpts='GAMMA 2x2x2 4x4x4 6x6x6 8x8x8'
NK=(1 8 64 216 512)
j=0
for i in ${kpts}
do
VBMo=`grep " 1.000" $i/References/$1 | grep " 4.0000" | grep " 0.000" | awk '{print $3}'`
VBM=`grep " 1.000" $i/References/$1 | grep " 4.0000" | grep " 0.000" | awk '{print $4}'`
CBMo=`grep " 2.576" $i/References/$1 | grep " 5.000" | awk '{print $3}'`
CBM=`grep " 2.576" $i/References/$1 | grep " 5.000" | awk '{print $4}'`
case "$1" in
*-01HF*)
echo ${NK[$j]} $VBMo $VBM $CBMo $CBM | awk '{print $1 " " $5-$3 }' >> "$2"
;;
*)
echo ${NK[$j]} $VBMo $VBM $CBMo $CBM | awk '{print $1 " " $4+$5 }' >> "$2"
;;
esac
j=`expr $j + 1`
done
To further illustrate my issue, I have found a specific example case:
The calculation results in the file o-Cohsex_HF7Ry_X0Ry-nb10.qp, which was obtained from the folder \Silicon\YAMBO\4x4x4\.References provided by Yambo, are as follows:
# K-point Band Eo E-Eo Sc|Eo
#
...
1.000000 4.000000 0.000000 0.411350 1.732646
1.000000 5.000000 2.576077 1.659489 -2.763862
...
I believe the formula to calculate the bandgap should be:
2.576077+1.659489-(0.000000+0.411350) = 3.824216
However, the result in the file Cohsex_HF7Ry_X0Ry-nb10_gap_vs_kpoints, which was obtained from the folder \Silicon\YAMBO\.References provided by Yambo, is:
64 4.23557
It indicates that the formula for calculating the bandgap is:
2.576077+1.659489 = 4.23557
Why is there such a discrepancy? Could you please clarify the correct formula for calculating the bandgap in COHSEX and PPA?
Looking forward to your response.
Best wishes,
Xiao
When calculating the K-points convergence in the section "COHSEX without empty bands" on the Yambo homepage (https://wiki.yambo-code.eu/wiki/index.php?title=Silicon), I am unable to obtain the same bandgap as shown in the image on the homepage. I am puzzled by the data extraction script file provided below, named parse_gap.sh( which was obtained from the folder \Silicon\YAMBO\.References ). For the *-Cohsex* calculations, why does it output $4+$5, which seems to imply that the bandgap is calculated as CBMo + CBM? Shouldn't it be necessary to subtract (VBMo+VBM) as well?
#!/bin/bash
if [ ! -f GAMMA/References/$1 ]
then
echo "File not found"
exit
fi
rm -f $2
kpts='GAMMA 2x2x2 4x4x4 6x6x6 8x8x8'
NK=(1 8 64 216 512)
j=0
for i in ${kpts}
do
VBMo=`grep " 1.000" $i/References/$1 | grep " 4.0000" | grep " 0.000" | awk '{print $3}'`
VBM=`grep " 1.000" $i/References/$1 | grep " 4.0000" | grep " 0.000" | awk '{print $4}'`
CBMo=`grep " 2.576" $i/References/$1 | grep " 5.000" | awk '{print $3}'`
CBM=`grep " 2.576" $i/References/$1 | grep " 5.000" | awk '{print $4}'`
case "$1" in
*-01HF*)
echo ${NK[$j]} $VBMo $VBM $CBMo $CBM | awk '{print $1 " " $5-$3 }' >> "$2"
;;
*)
echo ${NK[$j]} $VBMo $VBM $CBMo $CBM | awk '{print $1 " " $4+$5 }' >> "$2"
;;
esac
j=`expr $j + 1`
done
To further illustrate my issue, I have found a specific example case:
The calculation results in the file o-Cohsex_HF7Ry_X0Ry-nb10.qp, which was obtained from the folder \Silicon\YAMBO\4x4x4\.References provided by Yambo, are as follows:
# K-point Band Eo E-Eo Sc|Eo
#
...
1.000000 4.000000 0.000000 0.411350 1.732646
1.000000 5.000000 2.576077 1.659489 -2.763862
...
I believe the formula to calculate the bandgap should be:
2.576077+1.659489-(0.000000+0.411350) = 3.824216
However, the result in the file Cohsex_HF7Ry_X0Ry-nb10_gap_vs_kpoints, which was obtained from the folder \Silicon\YAMBO\.References provided by Yambo, is:
64 4.23557
It indicates that the formula for calculating the bandgap is:
2.576077+1.659489 = 4.23557
Why is there such a discrepancy? Could you please clarify the correct formula for calculating the bandgap in COHSEX and PPA?
Looking forward to your response.
Best wishes,
Xiao