Work function > vacuum energy? (EFERMI = MIDGAP)

Queries about input and output files, running specific calculations, etc.


Moderators: Global Moderator, Moderator

Message
Author
reynaldo.putra
Newbie
Newbie
Posts: 40
Joined: Wed Jan 24, 2024 7:33 pm

Work function > vacuum energy? (EFERMI = MIDGAP)

#1 Post by reynaldo.putra » Mon Nov 17, 2025 9:52 pm

Hello,

I have conducted a work function calculation using the planar-averaged Hartree potential (LVHAR = T), and I applied EFERMI = MIDGAP since I am working with semiconductor materials. I then conduct the post-processing (extracting the planar-averaged potential plot, DOS, PDOS) using the VASPKIT module.

I have calculated the work function and the vacuum level for many slabs of the same class of materials using the specifications above. However for one particular slab, it has the work function being greater than the vacuum energy by ~0.1 eV. Currently, I am retrying the calculation without using EFERMI = MIDGAP.

Aside from this setting is there something else I should be wary about? Thank you for your time.

You do not have the required permissions to view the files attached to this post.

reynaldo.putra
Newbie
Newbie
Posts: 40
Joined: Wed Jan 24, 2024 7:33 pm

Re: Work function > vacuum energy? (EFERMI = MIDGAP)

#2 Post by reynaldo.putra » Tue Nov 18, 2025 1:53 pm

reynaldo.putra wrote: Mon Nov 17, 2025 9:52 pm

Currently, I am retrying the calculation without using EFERMI = MIDGAP.

Hello everyone, I have reconducted the calculation without EFERMI = MIDGAP, and the Fermi level is shown to be even more negative. The WF is now ~0.9 eV higher than the vacuum level.

Does someone has experience on what to investigate next? Thank you.


fabien_tran1
Global Moderator
Global Moderator
Posts: 502
Joined: Mon Sep 13, 2021 11:02 am

Re: Work function > vacuum energy? (EFERMI = MIDGAP)

#3 Post by fabien_tran1 » Wed Nov 19, 2025 2:55 pm

Hi,

A few points:

1) The orbitals energies, the Fermi energy and the vacuum level have themselves no physical meaning. Only a difference between these quantities has a physical interpretation (e.g., work function or band gap). Comparing the work function with the vacuum level makes no sense. The only physical requirement is to have a vacuum level that is higher than the valence band maximum (VBM), i.e. a positive work function.

2) As explained at Computing the work function, the work function is calculated using the Fermi energy. However, in the case of a semiconductor/insulator, the Fermi energy can be defined arbitrarily within the band gap (e.g., EFERMI=MIDGAP chooses the middle of the band gap, which is really inappropriate for calculating the work function). The quantity to consider is the VBM, and in your case it is quite simple to extract it from your OUTCAR since you use only one k-point (VBM is -1.3871 eV, while the Fermi energy is at -0.1136 eV). Note that even with EFERMI=LEGACY, the Fermi energy may be noticeably higher than the VBM because of the smearing SIGMA.

3) I did not repeat your calculation using VASPKIT. Instead, I used a version of VASP that is more recent than VASP.6.4.2 that you used, and has a feature (LVACPOTAV) that conveniently calculates the vacuum level. I obtained 5.130 eV for the vacuum level and -1.3871 eV for the VBM, which leads to 5.130-(-1.3871)=6.5171 eV for the work function (OUTCAR is attached). Which value did you obtain for the vacuum level with VASPKIT? Also note that the average potential can be plotted with py4vasp.

4) Quality of your calculation: Your are using only one k-point. One k-point is appropriate in the direction of the vacuum, but certainly not enough for the directions parallel to the slab.

5) Your system is non-magnetic, therefore you could have used ISPIN=1, which makes the calculation faster.

You do not have the required permissions to view the files attached to this post.

reynaldo.putra
Newbie
Newbie
Posts: 40
Joined: Wed Jan 24, 2024 7:33 pm

Re: Work function > vacuum energy? (EFERMI = MIDGAP)

#4 Post by reynaldo.putra » Wed Nov 19, 2025 6:29 pm

Hello,

Thank you very much for looking into this issue.

1) The orbitals energies, the Fermi energy and the vacuum level have themselves no physical meaning. Only a difference between these quantities has a physical interpretation (e.g., work function or band gap). Comparing the work function with the vacuum level makes no sense. The only physical requirement is to have a vacuum level that is higher than the valence band maximum (VBM), i.e. a positive work function.

1) I see, thank you for clarifying whether they have physical meaning. I specifically mentioned WF and the vacuum level because these are the values extracted from VASPKIT when plotting the planar-averaged potentials. More specifically, the issue I am having is that the Fermi energy has a negative value, both with and without EFERMI = MIDGAP.
Additionally, the vacuum level is important for me because I would like to align the band gaps of different materials with respect to the vacuum level (i.e., I will set the vacuum level as the 0 eV reference).

2) As explained at Computing the work function, the work function is calculated using the Fermi energy. However, in the case of a semiconductor/insulator, the Fermi energy can be defined arbitrarily within the band gap (e.g., EFERMI=MIDGAP chooses the middle of the band gap, which is really inappropriate for calculating the work function). The quantity to consider is the VBM, and in your case it is quite simple to extract it from your OUTCAR since you use only one k-point (VBM is -1.3871 eV, while the Fermi energy is at -0.1136 eV). Note that even with EFERMI=LEGACY, the Fermi energy may be noticeably higher than the VBM because of the smearing SIGMA.

2) I see. I did not expect this to be inappropriate because EFERMI = MIDGAP was recommended on the EFERMI tutorial. What keyword do I use to find the VBM level in the OUTCAR?

3) I did not repeat your calculation using VASPKIT. Instead, I used a version of VASP that is more recent than VASP.6.4.2 that you used, and has a feature (LVACPOTAV) that conveniently calculates the vacuum level. I obtained 5.130 eV for the vacuum level and -1.3871 eV for the VBM, which leads to 5.130-(-1.3871)=6.5171 eV for the work function (OUTCAR is attached). Which value did you obtain for the vacuum level with VASPKIT? Also note that the average potential can be plotted with py4vasp.

3) Yes, I also obtained the vacuum level of 5.130 eV with VASPKIT. Without MIDGAP, the fermi level is assigned -0.917 eV, giving the work function of 6.047 eV. As for the average potential, I used the VASPKIT-generated files and plotted them using GNUPlot.

4) Quality of your calculation: Your are using only one k-point. One k-point is appropriate in the direction of the vacuum, but certainly not enough for the directions parallel to the slab.

4) I see. Should I try increasing the KPOINTS in the directions parallel to the slab and use ISMEAR = -5 if possible? So far, this is the only calculation that shows negative E-fermi even with 1x1x1 k-points.

5) Your system is non-magnetic, therefore you could have used ISPIN=1, which makes the calculation faster.

5) Alright, I shall try for the later calculations.

Thank you for your time and attention!

Last edited by reynaldo.putra on Wed Nov 19, 2025 7:31 pm, edited 3 times in total.

fabien_tran1
Global Moderator
Global Moderator
Posts: 502
Joined: Mon Sep 13, 2021 11:02 am

Re: Work function > vacuum energy? (EFERMI = MIDGAP)

#5 Post by fabien_tran1 » Wed Nov 19, 2025 8:24 pm

More specifically, the issue I am having is that the Fermi energy has a negative value, both with and without EFERMI = MIDGAP.

As I wrote in my previous post, only differences between quantities have a physical meaning. Alone, the Fermi energy has no meaning, and whether it is positive or negative is irrelevant. Furthermore, for a system with a gap this is the VBM and not the Fermi energy that one should use to calculate the work function (this is something that should be made more clear on the VASP manual).

I see. I did not expect this to be inappropriate because EFERMI = MIDGAP was recommended on the EFERMI tutorial.

It depends for which purpose. Here, EFERMI=MIDGAP is certainly not adapted. In general, we need to understand what we are doing.

What keyword do I use to find the VBM level in the OUTCAR?

There is the BANDGAP tag, but it is available only since VASP.6.4.3. With older versions, you need to extract the VBM yourself by looking at the occupation of the orbitals (search for "occupation" in OUTCAR).

Yes, I also obtained the vacuum level of 5.130 eV with VASPKIT. Without MIDGAP, the fermi level is assigned -0.917 eV, giving the work function of 6.047 eV. As for the average potential, I used the VASPKIT-generated files and plotted them using GNUPlot.

That is reassuring that the different procedures to get the vacuum level lead to the same value.

I see. Should I try increasing the KPOINTS in the directions parallel to the slab and use ISMEAR = -5 if possible? So far, this is the only calculation that shows negative E-fermi even with 1x1x1 k-points.

Some recommendations for ISMEAR are provided at smearing technique. As already mentioned, the value and sign of the Fermi energy are of no importance.


reynaldo.putra
Newbie
Newbie
Posts: 40
Joined: Wed Jan 24, 2024 7:33 pm

Re: Work function > vacuum energy? (EFERMI = MIDGAP)

#6 Post by reynaldo.putra » Thu Nov 20, 2025 3:33 pm

Thank you again for your response. Forgive me for repeating some questions! I might still not have grasped fully the situation.

So, the value of the Fermi level in a semiconductor, be it positive or negative, does not have a physical meaning. Instead, it'd be more reliable to obtain the work function (WF) from the VBM. Here are some questions I have with regards to this statement.

1) In some literature (page 3), they mention the distance from the VBM to the vacuum as ionization energy instead of WF. But specifically for DFT calculations this is what we use instead because it is more reliable. Is this correct?

2) I'd like to confirm that calculating the energy of the VBM to the vacuum can allow me to align the DOS of different materials by using the the vacuum level as the 0 eV reference.

Lastly,

Some recommendations for ISMEAR are provided at smearing technique. As already mentioned, the value and sign of the Fermi energy are of no importance.

I conducted some convergence tests, comparing the band gap width, WF and vacuum between 1x1x1 and 2x2x1, and for a system with reported experimental data, the values were comparable, hence why I felt confident using 1x1x1 only. Even after choosing these criteria, is there anything else I should be aware of? I understand that the tutorial you shared is for a more general guideline; I would also use ISMEAR = -5 if possible because the material is a semiconductor. But when I use 1x1x1, I had no choice but to use ISMEAR = 0 and SIGMA.

Thank you again for your patience, and have a great day!


reynaldo.putra
Newbie
Newbie
Posts: 40
Joined: Wed Jan 24, 2024 7:33 pm

Re: Work function > vacuum energy? (EFERMI = MIDGAP)

#7 Post by reynaldo.putra » Thu Nov 20, 2025 7:51 pm

Hello,

I have just one additional question because I am interested in the positions of the VBM and CBM for photocatalysis.

you need to extract the VBM yourself by looking at the occupation of the orbitals (search for "occupation" in OUTCAR).

Is it appropriate to use the values from the 'band energies occupation' as VBM and CBM for band alignment using the vacuum level as the 0 eV reference?

Thank you!


fabien_tran1
Global Moderator
Global Moderator
Posts: 502
Joined: Mon Sep 13, 2021 11:02 am

Re: Work function > vacuum energy? (EFERMI = MIDGAP)

#8 Post by fabien_tran1 » Fri Nov 21, 2025 4:59 pm

Hi,

In order to give more specific advice, I would need to know more details about the goal and procedure that you want to follow.

In any case, using a 1x1 k-mesh for the directions parallel to the slab is not recommended. It is underconverged and may lead to inaccurate results for the electronic structure in general.


reynaldo.putra
Newbie
Newbie
Posts: 40
Joined: Wed Jan 24, 2024 7:33 pm

Re: Work function > vacuum energy? (EFERMI = MIDGAP)

#9 Post by reynaldo.putra » Fri Nov 21, 2025 5:26 pm

Hello,

The goal I have is to check the alignments of the VBM and CBM with respect to the potentials of a photocatalytic half reactions (in this case, H+/H2 (-4.44 eV vs vacuum) and O2/H2O (-5.67 eV vs vacuum) for water splitting). To do so, I obtain the DOS and vacuum energies of different materials so that I can align them by setting the vacuum level as the 0 eV reference.

The procedure I am following:
1) ionic relaxation
2) DOS, work function (LVHAR), and vacuum level calculation
3) DOS alignment using vacuum level as 0 eV

What I'd like to confirm is that, since using the VBM-vacuum difference is more reliable than the Fermi level-vacuum difference, should I use the band energy occupation positioning as described in the OUTCAR and the generated vacuum level for the purposes of aligning to the vacuum?

Please let me know if there are any more details I should provide.

Last edited by reynaldo.putra on Fri Nov 21, 2025 5:38 pm, edited 1 time in total.

reynaldo.putra
Newbie
Newbie
Posts: 40
Joined: Wed Jan 24, 2024 7:33 pm

Re: Work function > vacuum energy? (EFERMI = MIDGAP)

#10 Post by reynaldo.putra » Tue Nov 25, 2025 10:16 pm

Hello,

I have another related question.

it is quite simple to extract it from your OUTCAR since you use only one k-point (VBM is -1.3871 eV, while the Fermi energy is at -0.1136 eV).

I checked in another calculation using several k-points and that they have differing energy levels for the VBM occupations at different k-points. Other than using the BANDGAP tag from VASP 6.4.3, what are other tools can I use to extract/properly process the differing VBM occupations across different k-points?

Thank you for your time.


fabien_tran1
Global Moderator
Global Moderator
Posts: 502
Joined: Mon Sep 13, 2021 11:02 am

Re: Work function > vacuum energy? (EFERMI = MIDGAP)

#11 Post by fabien_tran1 » Wed Nov 26, 2025 3:07 pm

reynaldo.putra wrote: Tue Nov 25, 2025 10:16 pm

I checked in another calculation using several k-points and that they have differing energy levels for the VBM occupations at different k-points. Other than using the BANDGAP tag from VASP 6.4.3, what are other tools can I use to extract/properly process the differing VBM occupations across different k-points?

A bash script for extracting the VBM and CBM is attached. If it does not work, try changing the number of blanks around $homo and $lumo at lines 5 and 6.

You do not have the required permissions to view the files attached to this post.

reynaldo.putra
Newbie
Newbie
Posts: 40
Joined: Wed Jan 24, 2024 7:33 pm

Band alignment based on work function and vacuum level

#12 Post by reynaldo.putra » Wed Nov 26, 2025 3:20 pm

Hello everyone,

I would like to confirm whether the procedure I am doing is already correct or not.

I aim to align the band gaps of several slab materials with the vacuum level as the 0 eV reference to see whether the band gaps are suitable for water splitting or not.

Based on the literature, the potentials for water splitting half-reactions are -4.44 eV vs vacuum (H+/H2) and -5.67 vs vacuum (O2/H2O).

Below, I have calculated the vacuum reference and the VBM energy as follows:
Vacuum: 5.602 eV
VBM: 1.842 eV

From here, the work function can be calculated as 3.76 eV.

My question is, when I have the DOS plotted, have I correctly aligned the DOS with respect to the vacuum level if I have the vacuum level at 0 eV and the VBM at -3.76 eV? If so, I am having doubts because having the VBM at -3.76 eV means the band gap is highly misaligned with respect to the H2 and O2 evolution potentials.

Before vacuum alignment (VBM = 0 eV)

DOS-VBM=0.png

After vacuum alignment

DOS-vacuum=0.png

I apologize for asking here because I have hard time finding papers that explicitly lay out the steps to align to vacuum. Thank you for your time and attention.

You do not have the required permissions to view the files attached to this post.

fabien_tran1
Global Moderator
Global Moderator
Posts: 502
Joined: Mon Sep 13, 2021 11:02 am

Re: Work function > vacuum energy? (EFERMI = MIDGAP)

#13 Post by fabien_tran1 » Wed Nov 26, 2025 3:27 pm

I have moved your last post in the previous topic that you already created. A colleague of mine, who knows more about the topic you are working on, will try to help you soon.


christopher_sheldon1
Global Moderator
Global Moderator
Posts: 142
Joined: Mon Mar 25, 2024 1:36 pm

Re: Band alignment based on work function and vacuum level

#14 Post by christopher_sheldon1 » Wed Nov 26, 2025 4:37 pm

reynaldo.putra wrote: Wed Nov 26, 2025 3:20 pm

My question is, when I have the DOS plotted, have I correctly aligned the DOS with respect to the vacuum level if I have the vacuum level at 0 eV and the VBM at -3.76 eV? If so, I am having doubts because having the VBM at -3.76 eV means the band gap is highly misaligned with respect to the H2 and O2 evolution potentials.

I apologize for asking here because I have hard time finding papers that explicitly lay out the steps to align to vacuum. Thank you for your time and attention.

Hi Reynaldo,

This approach seems reasonable. Finding an absolute reference for a potential relative to the vacuum is something that is done in literature (cf. https://doi.org/10.1039/D4SC03378G for electrochemical cells). If the absolute value of the VBM is -3.76 eV, then this will be too low a potential to catalyse the reaction (-4.44 eV and -5.67 eV relative to vacuum), hence the alignment looks strange. Your VBM of +1.842 is a odd. I would expect it to be negative, like Fabien's -1.38 eV from earlier. I also see that your VBM from your first report is -1.3871 eV (band 368):

Code: Select all

    366      -1.4890      1.00000
    367      -1.4538      1.00000
    368      -1.3871      1.00000
    369       1.1596      0.00000
    370       1.1708      0.00000
    371       1.4623      0.00000

This would give a vacuum level of 5.130-(-1.3871)=6.5171 eV, which would be enough to catalyse the reaction. Perhaps there is a problem with the value for your valence band maximum?

Best,

Chris


reynaldo.putra
Newbie
Newbie
Posts: 40
Joined: Wed Jan 24, 2024 7:33 pm

Re: Work function > vacuum energy? (EFERMI = MIDGAP)

#15 Post by reynaldo.putra » Wed Nov 26, 2025 5:02 pm

Hello,

Firstly, Fabien thank you for sharing the shell script and transferring my post to this topic!

Secondly, Christopher, thank you very much for confirming my approach.

Your VBM of +1.842 is a odd. I would expect it to be negative, like Fabien's -1.38 eV from earlier. I also see that your VBM from your first report is -1.3871 eV (band 368):

So yes, I was using a different example on the second post, hence the difference from what Fabien and me have posted initially. I see that this example somehow cannot catalyze the reaction that well...

This would give a vacuum level of 5.130-(-1.3871)=6.5171 eV, which would be enough to catalyse the reaction.

As for this one, yes, I calculated it and found that it was enough to catalyze the reaction. Thank you!


Post Reply