Magnets exert forces and torques on each other through the interaction of their magnetic fields. The forces of attraction and repulsion are a result of these interactions. The magnetic field of each magnet is due to microscopic currents of electrically charged electrons orbiting nuclei and the intrinsic magnetism of fundamental particles (such as electrons) that make up the material. Both of these are modeled quite well as tiny loops of current called magnetic dipoles that produce their own magnetic field and are affected by external magnetic fields. The most elementary force between magnets is the magnetic dipole–dipole interaction. If all magnetic dipoles for each magnet are known then the net force on both magnets can be determined by summing all the interactions between the dipoles of the first magnet and the dipoles of the second magnet.
It is often more convenient to model the force between two magnets as being due to forces between magnetic poles having magnetic charges spread over them. Positive and negative magnetic charge is always connected by a string of magnetized material; isolated magnetic charge does not exist. This model works well in predicting the forces between simple magnets where good models of how the magnetic charge is distributed are available.
Magnetic poles vs. atomic currents
The field of a magnet is the sum of fields from all magnetized volume elements, which consist of small magnetic dipoles on an atomic level. The direct summation of all those dipole fields requires three-dimensional integration to obtain the field of one magnet, which may be intricate.
For homogeneous magnetization, the problem can be simplified in two different ways, using Stokes' theorem. Upon integration along the direction of magnetization, all dipoles along the line of integration cancel each other, except at the magnet's end surface. The field then emerges only from those (mathematical) magnetic charges spread over the magnet's end facets. On the contrary, when integrating over a magnetized area orthogonal to the direction of magnetization, the dipoles within this area cancel each other, except at the magnet's outer surface, where they (mathematically) sum up to a ring current. This is called the Ampèrian loop model. In both models, only two-dimensional distributions over the magnet's surface have to be considered, which is simpler than the original three-dimensional problem.
Magnetic pole model: In the magnetic pole model, the pole surfaces of a permanent magnet are imagined to be covered with so-called magnetic charge, north pole particles on the north pole and south pole particles' on the south pole, that are the source of the magnetic field lines. The field due to magnetic charges is obtained through Coulomb's law with magnetic instead of electric charges. If the magnetic pole distribution is known, then the magnetic pole model gives the exact distribution of the magnetic field intensity H both inside and outside the magnet. The surface charge distribution is uniform, if the magnet is homogeneously magnetized and has flat end facets (such as a cylinder or prism).
Ampèrian loop model: In the Ampèrian loop model, all magnetization is due to the effect of microscopic, or atomic, circular bound currents, also called Ampèrian currents throughout the material. The net effect of these microscopic bound currents is to make the magnet behave as if there is a macroscopic electric current flowing in loops in the magnet with the magnetic field normal to the loops. The field due to such currents is obtained through the Biot–Savart law. The Ampèrian loop model gives the correct magnetic flux density B both inside and outside the magnet. It is sometimes difficult to calculate the Ampèrian currents on the surface of a magnet.
Magnetic dipole moment
Far away from a magnet, its magnetic field is almost always described (to a good approximation) by a dipole field characterized by its total magnetic dipole moment, m. This is true regardless of the shape of the magnet, so long as the magnetic moment is non-zero. One characteristic of a dipole field is that the strength of the field falls off inversely with the cube of the distance from the magnet's center.
The magnetic moment of a magnet is therefore a measure of its strength and orientation. A loop of electric current, a bar magnet, an electron, a molecule, and a planet all have magnetic moments. More precisely, the term magnetic moment normally refers to a system's magnetic dipole moment, which produces the first term in the multipole expansion of a general magnetic field.