Electric and magnetic fields can be written in terms of scalar and vector potentials. However, there are many different potentials which can generate the same fields. We have come across this problem ...Electric and magnetic fields can be written in terms of scalar and vector potentials. However, there are many different potentials which can generate the same fields. We have come across this problem before. It is called gauge invariance.