Bending of vacuum level in semiconductor junctions I am currently learning about semiconductor physics and have some problems understanding the band shifting which occurs at PN-junctions, heterojunctions or even metal-semiconductor junctions.
In most books the beding of bands at the interface of two materials is explained the following way: The Fermi energy (chemical potential) in both materials has to be the same. If we set the Fermi energy equal, the bands have to bend because the electron affinity (the distance from the fermi to vacuum level) does stay constant. A picture to make this clear is attached. It was also explained like this in the video here: https://youtu.be/Y_OpjTYALLw
Now to my question: It is assumed that the vacuum level shifts the same way as conduction or valence bands (see picture). But how is this even possible? The vacuum level is the energy level that a particle far away from the material would have. This should be the same everywhere in space and for all materials i.e. for the metal and semiconductor. Why is it assumed to bend?

 A: After a lot of digging, I found an answer.
There is a certain ambiguity in the definition of the vacuum level. There are two definitions commonly used:

*

*The vacuum level is the energy of removing the electron to just above the surface of the material. This is the definition which is used often in semiconductor physics. In this definition it is also possible, that the vacuum level bends. This is due to local electric field, defects, surface effects,… or of course, external electric fields. It’s a valid approach, but in my opinion not the most intuitive one.


*The second definition ist the definition I used above: The vacuum level is the energy of an electron far away from the sample. This vacuum level is constant and an absolute measure, because far away no defects or electric fields are present. In this definition we have to rethink the drawing of the energy levels as addressed in the question: In this definition of the vacuum level, the work function/electron affinity are no longer constant, but change. As an example, look at a p-n-junction. In the depletion Region there is an electric field, so there is an potential (energy difference) between electrons on the p- and n-site due to the electric field. If one wants to take an electron from the n-site and put it far away, it takes more energy (work function is higher) than if I take an electron from the p-site. This is because you have to overcome the electric field.
The same applies to other junctions like metal-semiconductor or heterojunctions.
Nevertheless, this is not the usual definition of work function or electron affinity. One hast to be careful in this regard.
Reference to the definition of the vacuum level
