Does a magnetic field arise from a moving charge or from its spin, or both?

The way you've asked your question (especially part 3), it sounds like you're trying to understand how magnetic dipole moments and moving charges are related to each other. But they're not. Moving charges and magnetic dipole moments don't describe a magnetic field, they produce a magnetic field.

Off the top of my head, I can actually think of three ways that magnetic fields are produced:

  • Moving electric charge: any time you have an electrically charged object in motion, it will produce a magnetic field. Electric currents fall into this category. This is usually the first way that physics students learn to generate a magnetic field; it's described by Ampere's law (one of Maxwell's equations).

  • Changing electric field: any time an electric field changes in time, it will produce a magnetic field, even if there is no current around. This is usually the second way that physics students learn that a magnetic field can be generated. It's also described by Ampere's law (technically the "Maxwell correction" term).

  • Static magnetic multipoles: this one is a little more complicated because it's not described by any of Maxwell's equations, at least not directly.

    Let me start with an analogy. Hopefully you know that a charged object produces an electric field. But you don't have to have a net charge to produce a field. If you take a positive charge and a negative charge of equal magnitude and put them very close to each other, you'll still get an electric field, because the field from the positive charge and the field from the negative charge don't exactly cancel each other out. This is an example of an electric dipole. You can think of this as a "secondary source" of the field, which depends not on the total amount of charge, but on how the charge is distributed within the object.

    Normally, when the total amount of charge is nonzero, the distribution of the charge has a small enough effect that we don't have to care about it, but when there is no net charge, the way the charge is distributed becomes important. Obviously, in order to do physics we need to have a physical quantity that describes the distribution. This is the electric dipole moment.

    In fact, we can measure the electric dipole moment of an object and use it to do useful calculations even if we don't know anything about the charge distribution - or even if there may not be a charge distribution at all. In other words, one could imagine that there might be some unknown physical mechanism, completely separate from electric charge, that causes some object to have an electric dipole moment. So it makes sense to define an "electric dipole" as "something that has a nonzero electric dipole moment," whether or not that thing has a charge distribution.

    The same thing applies to magnetic dipoles and the magnetic dipole moment. It works just like the electric dipole moment, except with the magnetic field and "magnetic charge" instead of electric field and electric charge. The thing is, as far as we know, there are no magnetically charged objects (the so-called "magnetic monopoles"). So the magnetic dipole moment never gets masked by magnetic charge, the way the electric dipole moment usually does.

    As with the electric dipole, a magnetic dipole of any sort will generate a magnetic field. One kind of magnetic dipole is a small loop of current. If the current is made of physical charges moving around in a circle, then it will have some angular momentum. So once it was discovered that the electron has intrinsic angular momentum (spin), physicists naturally wondered whether that angular momentum was due to constituent particles moving in circles inside the electron. One way to test this theory would be to measure the magnetic dipole moment of the electron and calculate whether it corresponds to the prediction of the current-loop model. As it turns out, it doesn't. So evidently something else is going on; the magnetic dipole moment of the electron is not just produced by classical charges moving in a circle. It's something intrinsic to the electron. (Quantum electrodynamics correctly predicts the exact value of the electron's magnetic dipole moment, but it doesn't offer a simple physical picture.)


In the end it is all moving charge.

To see that this is also the case for the magnetic field from the spin you need to perform the so-called Gordon decomposition on the charge-current density of the electron as defined by Dirac's equation.

see for instance 18.2 in this chapter of my book:

http://physics-quest.org/Book_Chapter_Gordon_Decomposition.pdf

The Gordon decomposition of the charge-current density of the electron shows an additional part due to the magnetic moment of the electron. This additional part is equivalent to the classical "current from magnetization" given by:

$j=\nabla\times M$

Where M is the magnetization of the medium. Figure 18.1 of the link above shows how this is just the familiar Stokes theorem in action. The current $j$ is an effective current caused by the inherent magnetization of the electron field. This is the current which is the source of the magnetic field due to the magnetic moment of the electron. For Stokes theorem see:

http://www.math.umn.edu/~nykamp/m2374/readings/stokesidea/

Regards, Hans