Strong magnetic fields are believed to power many high-energy phenomena, like gamma-ray bursts, jets from active galactic nuclei and other compact objects. Without these fields being hundreds of trillion times stronger that the Earth’s magnetic field, neutron stars would not have been detected in the 1960s. The EU-funded project NSMAG (Magnetic fields in neutron stars via numerical simulations) was designed to shed light on the role of magnetic fields in neutron stars. These are leftover dense cores of massive stars that burn themselves out after a million or so years and terminate their life in a supernova explosion. Scientists developed XNS to model differentially rotating neutron stars and toroidal or poloidal magnetic fields as well as in mixed configurations. This numerical code simultaneously solves Einstein’s equations that describe the space-time metric and those of the magnetohydrostatic equilibrium, which provide the distribution of matter. Einstein's equations are solved using an approximation known as extended conformally flat condition (XCFC) for the metric in spherical coordinates. This strategy was selected as it allows for casting them in a numerically stable form and then, for decoupling so they can be solved hierarchically. The use of spherical harmonics ensures correct behaviour along the axis, correct parity at the centre and correct asymptotic trend at the other distances. Solutions are searched in terms of spherical harmonics. Scientists verified that 20 spherical harmonics are sufficient to achieve convergent results. The results of the XNS code were compared with other codes, including the rotstar code available in the language objet pour la relativité numérique (LORENE) library. This was both a test on its performance and the accuracy of the XCFC approximation. NSMAG scientists modelled rotating and non-rotating stars with poloidal and toroidal magnetic fields in the non-linear general relativistic regime. XNS results were consistent with those obtained for extremely magnetised models of stars with field strengths of the order of 10^13 G. In addition, there were computational benefits in using the XCFC approximation. However, NSMAG aimed for a solution that is more physically acceptable than one that is mathematically correct and made significant strides in this direction.
Numerical code, neutron stars, magnetic fields, NSMAG, XNS code