# Magnetic field compression?

## Main Question or Discussion Point

Hello All,

I am trying to understand something I read in an article about magnetars and pulsars. The article states that when a magnetic object, such as a star, is compressed, the magnetic field strength increases. Intuitively, this seems true, as the number of field lines will remain constant, but they will become more closely spaced. How is this explained more technically?

One website I visited said the following

"Note, if you compress a magnetic field 'adiabatically' you amplify its strength. For example, a solar magnetic field is on average a few gauss for a star about 1 million kilometers in radius. If you compress this to the size of a neutron star which is 20 kilometers in radius, the magnetic field energy density ( B^2/8 pi) is amplified by the ratio of the volumes which is 1.25 x 10^14. The field strength increases by the square root of 8 x pi times this number or 56 million Gauss for a 1 Gauss initial field. Neutron star fields can be higher than this because the process of core collapse is not exactly adiabatic (ie conserving the magnetic field energy). For highly-conducting bodies, the conserved quantity is the product of the field strength times the radius squared so that for a real star collapsing to a neutron star, the field will increase by (2,000,000/20)^2 = 10 billion times so that a 100 Gauss surface field for a progenitor star that supernovas to become a neutron star, is amplified to a 1 trillion Gauss neutron star surface field"

However i couldn't find anything similar anywhere else.