In physics, a magnetic field is that part of the electromagnetic field that exerts a force on a moving charge. A magnetic field can be caused either by another moving charge (i.e., by an electric current) or by a changing electric field. The magnetic field is a vector quantity, and has SI units of tesla, 1 T= 1 kg·s−1·C−1.
There are two quantities that physicists may refer to as the magnetic field, notated H and B. In a vacuum, they are equal. Although the term "magnetic field" was historically reserved for H, with B being termed the "magnetic induction," B is now understood to be the more fundamental entity, and most modern writers refer to B as the magnetic field, except when context fails to make it clear whether the quantity being discussed is H or B.
Einstein explained in 1905 that a magnetic field is the relativistic part of an electric field. When an electric charge is moving from the perspective of an observer, the electric field of this charge due to space contraction is no longer seen by the observer as spherically symmetric due to non-radial time dilation, and it must be computed using the Lorentz transformations. One of the products of these transformations is the part of the electric field which only acts on moving charges — and we call it the "magnetic field".
The quantum-mechanical motion of electrons in atoms produces the magnetic fields of permanent ferromagnets. Spinning charged particles also have magnetic moment. Some electrically neutral particles (like the neutron) with non-zero spin also have magnetic moment due to the charge distribution in their inner structure. Particles with zero spin never have magnetic moment.
A magnetic field is a vector field: it associates with every point in space a (pseudo-)vector that may vary through time. The direction of the field is the equilibrium direction of a magnetic dipole (like a compass needle) placed in the field.
The Lorentz transformation of a spherically-symmetric proper electric field E of a moving electric charge (for example, the electric field of an electron moving in a conducting wire) from the charge's reference frame to the reference frame of a non-moving observer results in the following term which we can define or label as "magnetic field". We use the symbol B for the magnetic field and for the sake of mathematical simplicity (one symbol instead of seven). Intuitively B can be seen as a vector whose direction gives the axis of the possible directions of the force on a charged particle due to the magnetic field; the possible directions being at right angles to the axis B, and the exact direction being at right angles to both the velocity of the particle and B. The magnitude of B is the amount of force per unit of charge multiplied by the speed of the particle.
is velocity of the electric charge, measured in metres per second
indicates a vector cross product
c is the speed of light measured in metres per second
E is the electric field measured in newtons per coulomb or volts per metre
As seen from the definition, the unit of magnetic field is newton-second per coulomb-metre (or newton per ampere-metre) and is called the tesla. Like the electric field, the magnetic field exerts force on electric charge — but unlike an electric field, only on moving charge:
F is the force produced, measured in newtons
is electric charge that the magnetic field is acting on, measured in coulombs
is velocity of the electric charge , measured in metres per second
Because magnetic field is the relativistic product of Lorentz transformations, the force it produces is called the Lorentz force.
The force due to the magnetic field is different in different frames — moving magnetic fields transform partially or fully back into electric fields under Lorentz transformations. This results in Faraday's law of induction.
 Magnetic field of current flow of charged particles
Charged particle drifts in a homogenous magnetic field. (A) No disturbing force (B) With an electric field, E (C) With an independent force, F (eg. gravity) (D) In an inhomgeneous magnetic field, grad HSubstituting into the definition of magnetic field
the proper electric field of point-like charge (see Coulomb's law)
results in the equation of magnetic field of moving charge, which is usually called the Biot-Savart law:
q is electric charge, whose motion creates the magnetic field, measured in coulombs
v is velocity of the electric charge q that is generating B, measured in metres per second
B is the magnetic field (measured in teslas)
 Lorentz force on wire segment
Integrating the Lorentz force on an individual charged particle over a flow (current) of charged particles results in the Lorentz force on a stationary wire carrying electric current:
F = force, measured in newtons
I = current in wire, measured in amperes
B = magnetic field, measured in teslas
l = length of wire, measured in metres
In the equation above, the current vector I is a vector with magnitude equal to the scalar current, I, and direction pointing along the wire in which the current is flowing.
Alternatively, instead of current, the wire segment l can be considered a vector.
The Lorentz force on a macroscopic current carrier is often referred to as the Laplace force.
 Symbols and terminology
Magnetic field is usually denoted by the symbol . Historically, was called the magnetic flux density or magnetic induction. A distinct quantity, , was called the magnetic field (strength), and this terminology is still often used to distinguish the two in the context of magnetic materials (non-trivial permeability μ). Otherwise, however, this distinction is often ignored, and both quantities are frequently referred to as "the magnetic field." (Some authors call H the auxiliary field, instead.) In linear materials, such as air or free space, the two quantities are linearly related:
is the magnetic permeability of the medium, measured in henries per metre.
In SI units, and are measured in teslas (T) and amperes per metre (A/m), respectively; or, in cgs units, in gauss (G) and oersteds (Oe), respectively. Two parallel wires carrying an electric current in the same direction will generate a magnetic field that will cause a force of attraction between them. This fact is used to define the value of an ampere of electric current. While like charges repel and unlike ones attract, the opposite holds for currents: if the current in one of the two parallel wires is reversed, the two will repel.
Maxwell did much to unify static electricity and magnetism, producing a set of four equations relating the two fields. However, under Maxwell's formulation, there were still two distinct fields describing different phenomena. It was Albert Einstein who showed, using special relativity, that electric and magnetic fields are two aspects of the same thing (a rank-2 tensor), and that one observer may perceive a magnetic force where a moving observer perceives only an electrostatic force. Thus, using special relativity, magnetic forces are a manifestation of electrostatic forces of charges in motion and may be predicted from knowledge of the electrostatic forces and the velocity of movement (relative to some observer) of the charges.
A thought experiment one can do to show this is with two identical infinite and parallel lines of charge having no motion relative to each other but moving together relative to an observer. Another observer is moving alongside the two lines of charge (at the same velocity) and observes only electrostatic repulsive force and acceleration. The first or "stationary" observer seeing the two lines (and second observer) moving past with some known velocity also observes that the "moving" observer's clock is ticking more slowly (due to time dilation) and thus observes the repulsive acceleration of the lines more slowly than that which the "moving" observer sees. The reduction of repulsive acceleration can be thought of as an attractive force, in a classical physics context, that reduces the electrostatic repulsive force and also that is increasing with increasing velocity. This pseudo-force is precisely the same as the electromagnetic force in a classical context.
A changing magnetic field is mathematically the same as a moving magnetic field (see relativity of motion). Thus, according to Einstein's field transformation equations (that is, the Lorentz transformation of the field from a proper reference frame to a non-moving reference frame), part of it is manifested as an electric field component. This is known as Faraday's law of induction and is the principle behind electric generators and electric motors.
 Magnetic field lines
Magnetic field lines shown by iron filingsThe direction of the magnetic field vector follows from the definition above. It coincides with the direction of orientation of a magnetic dipole, such as a small magnet, a small loop of current in the magnetic field, or a cluster of small particles of ferromagnetic material (see figure).
 Pole labelling confusions
The end of a compass needle that points north was historically called the "north" magnetic pole of the needle. Since dipoles are vectors and align "head to tail" with each other, the magnetic pole located near the geographic North Pole is actually the "south" pole.
The "north" and "south" poles of a magnet or a magnetic dipole are labelled similarly to north and south poles of a compass needle. Near the north pole of a bar or a cylinder magnet, the magnetic field vector is directed out of the magnet; near the south pole, into the magnet. This magnetic field continues inside the magnet (so there are no actual "poles" anywhere inside or outside of a magnet where the field stops or starts). Breaking a magnet in half does not separate the poles but produces two magnets with two poles each.
Earth's magnetic field is produced by electric currents in its liquid core.
 Field density
Magnetic field density, otherwise known as magnetic flux density, is essentially what the layman knows as a magnetic field — akin to a gravitational or electric field. It is a response of a medium to the presence of a magnetic field. The SI unit of magnetic flux density is the tesla. 1 tesla = 1 weber per square metre.
It can be more easily explained if one works backwards from the equation:
B is the magnitude of flux density, measured in teslas
F is the force experienced by a wire, measured in Newtons
I is the current, measured in amperes
L is the length of the wire, measured in metres
Demonstration of Fleming's left hand ruleFor a magnetic flux density to equal 1 tesla, a force of 1 newton must act on a wire of length 1 metre carrying 1 ampere of current.
1 newton of force is not easily accomplished. For example: the most powerful superconducting electromagnets in the world have flux densities of 'only' 20 T. This is true obviously for both electromagnets and natural magnets, but a magnetic field can only act on moving charge — hence the current, I, in the equation.
The equation can be adjusted to incorporate moving single charges, ie protons, electrons, and so on via
Q is the charge in coulombs, and
v is the velocity of that charge in metres per second.
Fleming's left hand rule for motion, current and polarity can be used to determine the direction of any one of those from the other two, as seen in the example. It can also be remembered in the following way. The digits from the thumb to second finger indicate 'Force', 'B-field', and 'I(Current)' respectively, or F-B-I in short. For professional use, the right hand grip rule is used instead which originated from the definition of cross product in the right hand system of coordinates.
Other units of magnetic flux density are
1 gauss = 10−4 teslas = 100 microteslas (µT)
1 gamma = 10−9 teslas = 1 nanotesla (nT)
 Rotating magnetic fields
Main article: Alternator
The rotating magnetic field is a key principle in the operation of alternating-current motors. A permanent magnet in such a field will rotate so as to maintain its alignment with the external field. This effect was conceptualized by Nikola Tesla, and later utilised in his, and others, early AC (alternating-current) electric motors. A rotating magnetic field can be constructed using two orthogonal coils with 90 degrees phase difference in their AC currents. However, in practice such a system would be supplied through a three-wire arrangement with unequal currents. This inequality would cause serious problems in standardization of the conductor size and so, in order to overcome it, three-phase systems are used where the three currents are equal in magnitude and have 120 degrees phase difference. Three similar coils having mutual geometrical angles of 120 degrees will create the rotating magnetic field in this case. The ability of the three-phase system to create a rotating field, utilized in electric motors, is one of the main reasons why three-phase systems dominate the world's electrical power supply systems.
Because magnets degrade with time, synchronous motors and induction motors use short-circuited rotors (instead of a magnet) following the rotating magnetic field of a multicoiled stator. The short-circuited turns of the rotor develop eddy currents in the rotating field of the stator, and these currents in turn move the rotor by the Lorentz force.
In 1882, Nikola Tesla identified the concept of the rotating magnetic field. In 1885, Galileo Ferraris independently researched the concept. In 1888, Tesla gained U.S. Patent 381968 for his work. Also in 1888, Ferraris published his research in a paper to the Royal Academy of Sciences in Turin.
 Hall effect
Main article: Hall effect
Because the Lorentz force is charge-sign-dependent (see above), it results in charge separation when a conductor with current is placed in a transverse magnetic field, with a buildup of opposite charges on two opposite sides of conductor in the direction normal to the magnetic field, and the potential difference between these sides can be measured.
The Hall effect is often used to measure the magnitude of a magnetic field as well as to find the sign of the dominant charge carriers in semiconductors (negative electrons or positive holes).
 Magnetic field of celestial bodies
It has been suggested that this section be split into a new article. (Discuss)
A rotating body of conductive gas or liquid develops self-amplifying electric currents, and thus a self-generated magnetic field, due to a combination of differential rotation (different angular velocity of different parts of body), Coriolis forces and induction. The distribution of currents can be quite complicated, with numerous open and closed loops, and thus the magnetic field of these currents in their immediate vicinity is also quite multitwisted. At large distances, however, the magnetic fields of currents flowing in opposite directions cancel out and only a net dipole field survives, slowly diminishing with distance. Because the major currents flow in the direction of conductive mass motion (equatorial currents), the major component of the generated magnetic field is the dipole field of the equatorial current loop, thus producing magnetic poles near the geographic poles of a rotating body.
The magnetic fields of all celestial bodies are more or less aligned with the direction of rotation. Another feature of this dynamo model is that the currents are AC rather than DC. Their direction, and thus the direction of the magnetic field they generate, alternates more or less periodically, changing amplitude and reversing direction, although still more or less aligned with the axis of rotation.
The Sun's major component of magnetic field reverses direction every 11 years (so the period is about 22 years), resulting in a diminished magnitude of magnetic field near reversal time. During this dormancy time, the sunspots activity is maximized (because of the lack of magnetic braking on plasma) and, as a result, massive ejection of high energy plasma into the solar corona and interplanetary space takes place. Collisions of neighboring sunspots with oppositely directed magnetic fields result in the generation of strong electric fields near rapidly disappearing magnetic field regions. This electric field accelerates electrons and protons to high energies (kiloelectronvolts) which results in jets of extremely hot plasma leaving the Sun's surface and heating coronal plasma to high temperatures (millions of K).
Compact and fast-rotating astronomical objects (white dwarfs, neutron stars and black holes) have extremely strong magnetic fields. The magnetic field of a newly born fast-spinning neutron star is so strong (up to 108 teslas) that it electromagnetically radiates enough energy to quickly (in a matter of few million years) damp down the star rotation by 100 to 1000 times. Matter falling on a neutron star also has to follow the magnetic field lines, resulting in two hot spots on the surface where it can reach and collide with the star's surface. These spots are literally a few feet (about a metre) across but tremendously bright. Their periodic eclipsing during star rotation is believed to be the source of pulsating radiation (see pulsars).
Jets of relativistic plasma are often observed along the direction of the magnetic poles of active black holes in the centers of young galaxies.
If the gas or liquid is very viscous (resulting in turbulent differential motion), the reversal of the magnetic field may not be very periodic. This is the case with the Earth's magnetic field, which is generated by turbulent currents in a viscous outer core.