A magnetic field is a mathematical description of the magnetic influence of electric currents and magnetic materials. The magnetic field at any given point is specified by both a direction and a magnitude (or strength); as such it is a vector field. The magnetic field is most commonly defined in terms of the Lorentz force it exerts on moving electric charges. There are two separate but closely related fields to which the name ‘magnetic field’ can refer: a magnetic B field and a magnetic H field.
Magnetic fields are produced by moving electric charges and the intrinsic magnetic moments of elementary particles associated with a fundamental quantum property, their spin. In special relativity, electric and magnetic fields are two interrelated aspects of a single object, called the electromagnetic field tensor; the aspect of the electromagnetic field that is seen as a magnetic field is dependent on the reference frame of the observer. In quantum physics, the electromagnetic field is quantized and electromagnetic interactions result from the exchange of photons.
Magnetic fields have had many uses in ancient and modern society. The Earth produces its own magnetic field, which is important in navigation. Rotating magnetic fields are utilized in both electric motors and generators. Magnetic forces give information about the charge carriers in a material through the Hall effect. The interaction of magnetic fields in electric devices such as transformers is studied in the discipline of magnetic circuits.