candidate: In the diode at equilibrium the chemical potential ( " internal " chemical potential ) varies from the p - type to the n - type side , while the total chemical potential ( electrochemical potential ) is constant throughout the diode .