system
Given the following post, respond as if you're commenting on Reddit:
human
How do neutron stars produce a magnetic field if neutrons have no charge?

I learned that magnetic fields are created by moving charges, so why would neutron stars be able to produce a magnetic field? Do the magnetic properties of the neutrons change once they are under all that gravitational pressure?
gpt
A neutron star is not *entirely* a ball of neutrons. It gets its name because the concentration of neutrons is much higher than is stable in normal atoms, but it's not 100% (maybe ~90%). For example, as you get near the surface of the neutron star the gravity and pressure aren't high enough to break apart normal atomic nuclei and you'd likely find lots of normal iron nuclei at the surface.

Even toward the core, although neutrons dominate there will be a nonzero number of protons (which may be in a superconducting state). It should be enough to produce and maintain the magnetic fields.