A shim is a device used to adjust the homogeneity of a magnetic field. Shims received their name from the purely mechanical shims used to adjust position and parallelity of the pole faces of an electromagnet. Coils used to adjust the homogeneity of a magnetic field by changing the current flowing through it were called "electrical current shims" because of their similar function.