Introduction

Neutron stars (NSs) are compact objects formed by core-collapse supernovae. Due to field amplification in the violent formation processes, most NSs are endowed with strong magnetic fields of 1011−13 G1. In some extreme cases, the magnetars can harbour even stronger magnetic fields of 1014−16 G, about 1000 times stronger than usual pulsars (for comparison, the magnetic field of a sunspot is 103 G2). Younger magnetars may carry even higher magnetic fields since they have been subjected to dissipative processes for shorter times3. It is widely believed that highly magnetized NSs are sources of some peculiar astronomical phenomena, including fast radio bursts, gamma-ray bursts, and superluminous supernovae4,5,6,7,8,9,10,11.

Extreme magnetic fields affect the structure and evolution of NSs. For instance, strong magnetic fields can deform NSs3,12. A direct consequence of structural deformations of NSs could be significant gravitational wave emissions13,14,15. The geometry of magnetic fields of the NSs is a crucial factor governing the physics of NSs. However, the field configuration inside the NS is unknown. Studies of equilibrium models with simple field configurations suggest that a purely toroidal field makes NSs prolate16,17,18 while a purely poloidal field forces the stars to become oblate19,20,21. Nevertheless, these simple geometries are expected to be unstable22,23,24,25,26. Numerical simulations suggest that the magnetic fields of the NSs are rearranged rapidly due to these instabilities, leading to a mixed configuration of toroidal and poloidal fields, which is roughly axisymmetric27,28,29,30. This mixed geometry is usually called “twisted torus".

Pulsations of NSs could be excited by various astrophysical events, such as core-collapse supernova and giant flares31. These pulsations are potential sources of gravitational waves, the spectra of which may serve as a sensitive probe of the structure and the equation of state (EoS) of NSs. Oscillation modes of non-magnetized NSs have been well studied using either perturbative calculations or dynamical simulations with or without spacetime evolutions32,33,34,35,36,37,38,39,40,41,42. Magnetic fields are also considered in studies based on either Newtonian approaches43,44,45,46,47 or general-relativistic approaches with Cowling approximation (evolving matter equations only while keeping the spacetime fixed)48,49,50,51,52,53,54,55. However, it has been shown that simulations using the Cowling approximation can overestimate the oscillation frequency up to a factor of 256,57. Therefore, it is important that, when computationally feasible, simulations with dynamical spacetime are conducted.

The major difficulties in studying magnetized NSs come from the non-linear nature of Einstein equations, and with Maxwell equations fully coupled, analytical calculations are generally impossible. Hence, numerical computations are inevitable to solve all the involved physics with a minimum number of assumptions. Until recently, due to breakthroughs in general-relativistic magnetohydrodynamics (GRMHD) simulations, dynamical studies of magnetized NSs have become possible15,30,58,59,60,61,62,63. Nonetheless, there is still no accurate eigenfrequency determination for oscillation modes in highly magnetized NSs.

A more rigorous approach to compute strongly magnetized equilibrium models is recently presented and demonstrated by an open-source code XNS3,64,65,66,67,68,69,70,71,72,73,74. Moreover, the GRMHD code Gmunu75,76,77,78 allows us to robustly evolve NSs in dynamical spacetime even with extreme magnetic fields of 1015−17 G. With these powerful tools in hand, we are now in a much better position to systematically investigate the oscillation modes of magnetized NSs.

In this work, we numerically study the oscillations of highly magnetized non-rotating axisymmetric (two-dimensional) NSs. Specifically, we first construct 12 equilibrium models with different magnetic to binding energy ratios \({{{{{{{\mathscr{H}}}}}}}}/{{{{{{{\mathscr{W}}}}}}}}\) using XNS, including one non-magnetized reference model named ‘REF’ and 11 magnetized models in ascending order of \({{{{{{{\mathscr{H}}}}}}}}/{{{{{{{\mathscr{W}}}}}}}}\) named T1K1, T1K2, ..., T1K11 (see the “Methods” section). Next, we utilize Gmunu to perturb and evolve the equilibrium models in dynamical spacetime, where we try three different initial fluid perturbations for excitation of stellar oscillations, namely \({{{{{\mathcal{l}}}}}}\) = 0, \({{{{{\mathcal{l}}}}}}\) = 2, and \({{{{{\mathcal{l}}}}}}\) = 4 perturbations (see the “Methods” section). After that, we perform a Fourier analysis of the simulation results to examine how the eigenfrequencies of oscillation modes vary with \({{{{{{{\mathscr{H}}}}}}}}/{{{{{{{\mathscr{W}}}}}}}}\) of the NS (see the “Methods” section), and we discuss possible reasons behind our results.

Results

Magnetization effects on oscillations of NSs

In total, six dominant oscillation modes are observed in our numerical study, namely the fundamental quasi-radial (\({{{{{\mathcal{l}}}}}}\) = 0) mode F and its first overtone H1, the fundamental quadrupole (\({{{{{\mathcal{l}}}}}}\) = 2) mode 2f and its first overtone 2p1, as well as the fundamental hexadecapole (\({{{{{\mathcal{l}}}}}}\) = 4) mode 4f and its first overtone 4p1 (we follow the notations in the work from Dimmelmeier et al.57). Each mode is predominantly excited under the initial perturbation with the corresponding \({{{{{\mathcal{l}}}}}}\) index, and each eigenfunction qualitatively agrees with the spherical harmonic in the corresponding perturbation function, as shown in Fig. 1. The measured eigenfrequencies of the six modes in the 12 different NS models are summarized in Table 1, where the undetermined eigenfrequencies denoted by ‘N/A’ in different columns stem from different reasons below. For the column of F mode, the missing eigenfrequencies are due to unsatisfactory data quality in Gmunu simulations of T1K8 and T1K11 models under \({{{{{\mathcal{l}}}}}}\) = 0 perturbation. On the other hand, for the columns of 4f and 4p1 modes, some eigenfrequencies are missing because the hexadecapole (\({{{{{\mathcal{l}}}}}}\) = 4) modes are masked by the quadrupole (\({{{{{\mathcal{l}}}}}}\) = 2) modes and are no longer the dominant modes in Gmunu simulations of the most magnetized models under \({{{{{\mathcal{l}}}}}}\) = 4 perturbation. To better illustrate the results in Table 1, we plot in Fig. 2 the eigenfrequencies feig of the six modes as functions of the magnetic to binding energy ratio \({{{{{{{\mathscr{H}}}}}}}}/{{{{{{{\mathscr{W}}}}}}}}\) of the NS model.

Fig. 1: Visualizations of eigenfunctions of the six dominant oscillation modes using the data of three equilibrium models (T1K1, T1K3 and T1K7).
figure 1

The fundamental quasi-radial (\({{{{{\mathcal{l}}}}}}\) = 0) mode F and its first overtone H1 are predominantly excited under \({{{{{\mathcal{l}}}}}}\) = 0 perturbation; the fundamental quadrupole (\({{{{{\mathcal{l}}}}}}\) = 2) mode 2f and its first overtone 2p1 are predominantly excited under \({{{{{\mathcal{l}}}}}}\) = 2 perturbation; the fundamental hexadecapole (\({{{{{\mathcal{l}}}}}}\) = 4) mode 4f and its first overtone 4p1 are predominantly excited under \({{{{{\mathcal{l}}}}}}\) = 4 perturbation. Each polar colour plot shows the spatial map of FFT amplitude at the eigenfrequency of the mode, where the radial axis is normalized to the equatorial radius re of each model. On top of each colour plot, there is a polar line plot visualizing the θ-part of the spherical harmonic in the corresponding perturbation function, where the distance from the origin to the line measures the magnitude of the spherical harmonic in that θ-direction, while the solid and dotted portions represent the positive and negative parts of the spherical harmonic, respectively. Each line plot is scaled arbitrarily for clearer illustration. It can be seen that the eigenfunctions of the higher-order quadrupole (\({{{{{\mathcal{l}}}}}}\) = 2) and hexadecapole (\({{{{{\mathcal{l}}}}}}\) = 4) modes have more nodes in the θ-direction compared to the quasi-radial (\({{{{{\mathcal{l}}}}}}\) = 0) modes, while the eigenfunction of each first overtone has more nodes in the r-direction compared to its fundamental mode. Furthermore, each eigenfunction qualitatively agrees with the spherical harmonic in the corresponding perturbation function.

Table 1 Measured eigenfrequencies of the six dominant oscillation modes in the 12 NS models.
Fig. 2: Effects of magnetization on eigenfrequencies of oscillation modes.
figure 2

Eigenfrequencies feig of the excited oscillation modes are plotted against the magnetic to binding energy ratio \({{{{{{{\mathscr{H}}}}}}}}/{{{{{{{\mathscr{W}}}}}}}}\) of the NS model, if \({{{{{\mathcal{l}}}}}}\) = 0 (a), \({{{{{\mathcal{l}}}}}}\) = 2 (b), and \({{{{{\mathcal{l}}}}}}\) = 4 (c) perturbations are applied respectively. The FWHMs in the parabolic interpolations of FFT peaks are taken as the error bars for feig. For all the modes, the data points at H/W ~ 0 (corresponding to REF-T1K5 models) show a nearly horizontal trend, even though these models span a few orders of magnitude in \({{{{{{{\mathscr{H}}}}}}}}/{{{{{{{\mathscr{W}}}}}}}}\) and can achieve a maximum field strength of 1015−17 G. This implies magnetization has negligible effects on stellar oscillations for NSs with \({{{{{{{\mathscr{H}}}}}}}}/{{{{{{{\mathscr{W}}}}}}}}\lesssim 1{0}^{-2}\). However, feig noticeably decreases with \({{{{{{{\mathscr{H}}}}}}}}/{{{{{{{\mathscr{W}}}}}}}}\) for \({{{{{{{\mathscr{H}}}}}}}}/{{{{{{{\mathscr{W}}}}}}}}\gtrsim 1{0}^{-1}\) in general, and as explained in the caption of Table 1, the expected higher-order hexadecapole (\({{{{{\mathcal{l}}}}}}\) = 4) modes are suppressed or even disappear in the most magnetized models under \({{{{{\mathcal{l}}}}}}\) = 4 perturbation. Hence, we can see that stellar oscillations are significantly suppressed by stronger magnetization for NSs with \({{{{{{{\mathscr{H}}}}}}}}/{{{{{{{\mathscr{W}}}}}}}}\gtrsim 1{0}^{-1}\).

We have observed an \({{{{{{{\mathscr{H}}}}}}}}/{{{{{{{\mathscr{W}}}}}}}}\) threshold for stellar magnetization to start affecting the oscillations of NSs. For NSs with \({{{{{{{\mathscr{H}}}}}}}}/{{{{{{{\mathscr{W}}}}}}}} \, \lesssim \, 1{0}^{-2}\), stellar oscillations are insensitive to magnetization effects. This can be seen from Table 1 that feig of every oscillation mode is nearly the same for the first six models (REF-T1K5) even though these models span a few orders of magnitude in \({{{{{{{\mathscr{H}}}}}}}}/{{{{{{{\mathscr{W}}}}}}}}\) and can achieve a maximum field strength of 1015−17 G; this can also be seen from Fig. 2 that the data points at \({{{{{{{\mathscr{H}}}}}}}}/{{{{{{{\mathscr{W}}}}}}}} \sim 0\) show a nearly horizontal trend. On the other hand, for NSs with \({{{{{{{\mathscr{H}}}}}}}}/{{{{{{{\mathscr{W}}}}}}}} \, \gtrsim \, 1{0}^{-1}\), stellar oscillations are significantly suppressed by stronger magnetization. Refer to the data points at \({{{{{{{\mathscr{H}}}}}}}}/{{{{{{{\mathscr{W}}}}}}}} > 1{0}^{-1}\) in Fig. 2, feig decreases with \({{{{{{{\mathscr{H}}}}}}}}/{{{{{{{\mathscr{W}}}}}}}}\) in general, and all the oscillation modes are pushed towards the low-frequency region, leading to the near-degeneracy of H1 and 2p1 modes. Moreover, as afore-explained about the undetermined eigenfrequencies, \({{{{{\mathcal{l}}}}}}\) = 4 perturbation excites the quadrupole (\({{{{{\mathcal{l}}}}}}\) = 2) modes preferentially over the expected hexadecapole (\({{{{{\mathcal{l}}}}}}\) = 4) modes in the most magnetized models, hinting at suppression or even disappearance of higher-order oscillation modes in a more magnetized NS for \({{{{{{{\mathscr{H}}}}}}}}/{{{{{{{\mathscr{W}}}}}}}} \, \gtrsim \, 1{0}^{-1}\). To summarize, magnetization effects start to hinder stellar oscillations if \({{{{{{{\mathscr{H}}}}}}}}/{{{{{{{\mathscr{W}}}}}}}}\) of the NS passes the threshold somewhere between 10−2 and 10−1.

Compactness as an underlying factor

The magnetization effects on NS oscillations discussed above may be understood by studying the compactness M/Rcirc of the NS, where M is the gravitational mass and Rcirc is the circumferential radius. As shown in the work from Hartle and Friedman79, the eigenfrequencies of the fundamental quasi-radial and quadrupole modes are related to the stellar compactness for non-magnetized NSs, and we suspect this correlation also holds for highly magnetized NSs. Thus, based on our NS models, we plot in Fig. 3 the compactness M/Rcirc against the magnetic to-binding energy ratio \({{{{{{{\mathscr{H}}}}}}}}/{{{{{{{\mathscr{W}}}}}}}}\). We find that M/Rcirc remains nearly unchanged for \({{{{{{{\mathscr{H}}}}}}}}/{{{{{{{\mathscr{W}}}}}}}} \, \lesssim \, 1{0}^{-2}\) but decreases dramatically for \({{{{{{{\mathscr{H}}}}}}}}/{{{{{{{\mathscr{W}}}}}}}} > 1{0}^{-1}\), which agrees with the trends of \({f}_{{{{{{{{\rm{eig}}}}}}}}}({{{{{{{\mathscr{H}}}}}}}}/{{{{{{{\mathscr{W}}}}}}}})\) shown in Fig. 2 and indeed reveals a correlation between eigenfrequencies of oscillation modes and stellar compactness. We also plot in Fig. 4, feig against M/Rcirc. For all the modes, feig decreases together with M/Rcirc in an almost linear way. Therefore, we found a quasilinear relation between feig and M/Rcirc for magnetized NSs. The complete physical interpretation of our results is that a strong toroidal field can cause deformation of the NS3 and alter the stellar compactness, so the propagation of seismic activities inside the NS is affected. In consequence, the eigenfrequencies of oscillation modes are correspondingly modified.

Fig. 3: Effect of magnetization on stellar compactness.
figure 3

Compactness M/Rcirc is plotted against the magnetic to binding energy ratio \({{{{{{{\mathscr{H}}}}}}}}/{{{{{{{\mathscr{W}}}}}}}}\) of the NS model, where M is the gravitational mass and Rcirc is the circumferential radius. M/Rcirc remains nearly unchanged for \({{{{{{{\mathscr{H}}}}}}}}/{{{{{{{\mathscr{W}}}}}}}}\lesssim 1{0}^{-2}\) but decreases dramatically for \({{{{{{{\mathscr{H}}}}}}}}/{{{{{{{\mathscr{W}}}}}}}} > 1{0}^{-1}\). This agrees with the trends of \({f}_{{{{{{{{\rm{eig}}}}}}}}}({{{{{{{\mathscr{H}}}}}}}}/{{{{{{{\mathscr{W}}}}}}}})\) shown in Fig. 2 and reveals a correlation between eigenfrequencies of oscillation modes and stellar compactness for magnetized NSs.

Fig. 4: Quasilinear correlation between eigenfrequencies of oscillation modes and stellar compactness.
figure 4

Eigenfrequencies feig of the excited oscillation modes are plotted against compactness M/Rcirc of the NS model, where M is the gravitational mass and Rcirc is the circumferential radius. The FWHMs in the parabolic interpolations of FFT peaks are taken as the error bars for feig. All data points show that feig decreases together with M/Rcirc in an almost linear way. Hence, this demonstrates a quasilinear relation between eigenfrequencies of oscillation modes and stellar compactness for magnetized NSs.

Discussion

In this work, we systematically investigate how a strong purely toroidal magnetic field with a field strength of 1015−17 G affects the oscillations of non-rotating NSs via two-dimensional axisymmetric simulations. We carefully extract the eigenfrequencies of the excited oscillation modes and construct the corresponding eigenfunctions from the simulated data. We have found that stellar oscillations are insensitive to magnetization effects for NSs with magnetic to-binding energy ratio \({{{{{{{\mathscr{H}}}}}}}}/{{{{{{{\mathscr{W}}}}}}}} \, \lesssim \, 1{0}^{-2}\), even though the maximum magnetic field strength \({B}_{\max }\) can reach \({{{{{{{\mathcal{O}}}}}}}}(1{0}^{17})\) G in the star. However, stellar oscillations are suppressed significantly by stronger magnetization if \({{{{{{{\mathscr{H}}}}}}}}/{{{{{{{\mathscr{W}}}}}}}} \, \gtrsim \, 1{0}^{-1}\). This behaviour can be understood by the decrease in stellar compactness due to strong magnetic fields. We show that the compactness has the same dependence on \({{{{{{{\mathscr{H}}}}}}}}/{{{{{{{\mathscr{W}}}}}}}}\) as the eigenfrequencies and demonstrate that the correlation between eigenfrequencies and compactness exists not only in non-magnetized NSs79 but also in highly magnetized NSs.

We compare our results with previous Newtonian studies43,46. These studies considered either perturbative or self-consistent MHD to construct the equilibrium models in the Newtonian regime. Both approaches found that the magnetic distortion and frequency shift in oscillation modes due to toroidal fields are minor corrections approximately proportional to B2 (or roughly \({{{{{{{\mathscr{H}}}}}}}}/{{{{{{{\mathscr{W}}}}}}}}\) in this work). However, in our GRMHD simulations, the equilibrium models are constructed by solving self-consistent general-relativistic magnetohydrostatic equations in the code XNS3,64,65,66,67,68,69,70,71,72,73,74. When \({{{{{{{\mathscr{H}}}}}}}}/{{{{{{{\mathscr{W}}}}}}}} \, \gtrsim \, 1{0}^{-1}\), the magnetic deformations are far from small corrections, and thus the stellar compactness is significantly reduced. Therefore, the effect of decreasing compactness dominates and results in the suppression of oscillation modes. Besides, we compare our results with those under the Cowling approximation and we corroborate what has been shown in the literature56,57, namely that the Cowling approximation can lead to errors of factors of 2 (see Supplementary Note 1).

The strongest magnetic field strength of 1017 G in this work is not expected to be observed in the exterior of ordinary pulsars and magnetars. Nevertheless, since the toroidal fields are enclosed inside the NSs, this ultra-high field could exist in the interior regions. Moreover, such field strength could also be generated during the formation of a proto-NS3, and binary neutron star mergers80. The excited oscillation modes in these scenarios are potential sources for gravitational waves, and they could be detected with the next-generation detectors, such as the kamioka gravitational wave detector (KAGRA)81, the Einstein telescope (ET)82, and the Neutron Star Extreme Matter Observatory (NEMO)83.

This work presents the first step to understanding how magnetic fields with different geometries affect the oscillations of NSs. Since stellar models with purely toroidal fields are generally unstable23, the instability is only suppressed due to the restriction to 2D axisymmetry in this work. Therefore, a natural extension considers strong purely poloidal fields and the more realistic twisted torus configuration. Since these field configurations extend to the regions outside NSs, an accurate and robust resistive GRMHD solver could be used to model these regions. This solver has already been implemented into Gmunu78 for future studies. In addition to different configurations of magnetic fields, the rotation should also be taken into account to work towards a more realistic problem, as the observed NSs are suggested to be rotating. Furthermore, introducing realistic EoSs is essential since one of the most important purposes of oscillation studies is to probe the structure and the EoSs of NSs.

Methods

Equilibrium models

Equilibrium models of NSs are constructed by the code XNS3,64,65,66,67,68,69,70,71,72,73,74. XNS is a branch of the X-ECHO code64 developed to compute equilibrium models of highly magnetized axisymmetric NSs with rotations. Different magnetic field configurations3, uniformly and differentially rotating profiles64, and polytropic and non-polytropic tabulated equations of state73 are admitted. XNS enforces the 3 + 1 formulism, the conformal flatness condition, and the assumption of axisymmetric and stationary space–time so that the line element can be written as

$${{{{{{{\rm{d}}}}}}}}{s}^{2}=-{\alpha }^{2}{{{{{{{\rm{d}}}}}}}}{t}^{2}+{\psi }^{4}\left[{{{{{{{\rm{d}}}}}}}}{r}^{2}+{r}^{2}{{{{{{{\rm{d}}}}}}}}{\theta }^{2}+{r}^{2}{\sin }^{2}\theta {\left({{{{{{{\rm{d}}}}}}}}\phi +{\beta }^{\phi }{{{{{{{\rm{d}}}}}}}}t\right)}^{2}\right],$$
(1)

where α(r, θ) is the lapse function, ψ(r, θ) is the conformal factor, and βϕ(r, θ) is the shift vector (βϕ = 0 for non-rotating configurations).

We assume a polytropic EoS p = Kργ for the stellar fluid, where p is the pressure, K is the polytropic constant, ρ is the density, and γ is the adiabatic index; as well as a polytropic expression \({B}_{\phi }={\alpha }^{-1}{K}_{{{{{{{{\rm{m}}}}}}}}}{(\rho h{\varpi }^{2})}^{m}\) for the toroidal field, where Km is the toroidal magnetization constant, h is the specific enthalpy, \({\varpi }^{2}={\alpha }^{2}{\psi }^{4}{r}^{2}{\sin }^{2}\theta\), and m ≥ 1 is the toroidal magnetization index. Although the field configuration of an isolated NS is expected to be a mixture of toroidal and poloidal fields, it is important first to assess how a simpler field geometry would affect the oscillations of NSs before we move on to the more complicated "twisted torus" case.

In total, 12 equilibrium models are computed with XNS, where one of them is a non-magnetized reference model named ‘REF’, and the remaining 11 models are magnetized. All 12 models share the same rest mass M0 = 1.68M, and the same K = 1.6 × 105 cm5 g−1 s−2 and γ = 2 in the fluid EoS. The 11 magnetized models have the same m = 1 but different values of Km in the Bϕ expression, and they are arranged in ascending order of magnetic to binding energy ratio \({{{{{{{\mathscr{H}}}}}}}}/{{{{{{{\mathscr{W}}}}}}}}\), where the one with the lowest ratio is named ‘T1K1’, and the one with the second-lowest ratio is named ‘T1K2’, so on and so forth. (‘T1’ specifies the toroidal magnetization index being 1 and ‘K’ stands for Km). The detailed properties of all 12 models are summarized in Table 2.

Table 2 Stellar properties of the 12 equilibrium models constructed by the XNS code.

Initial perturbations to excite oscillations

Consulting a similar study on rotating non-magnetized NSs done by Dimmelmeier et al.57, we try the following three types of initial fluid perturbations for exciting oscillations in the equilibrium models.

First, we have the \({{{{{\mathcal{l}}}}}}\) = 0 perturbation on the r-component of the three-velocity field,

$$\delta {v}^{r}=a\sin \left[\pi \frac{r}{{r}_{{{{{{{{\rm{s}}}}}}}}}(\theta )}\right],$$
(2)

where rs(θ) locates the surface of the NS, and the perturbation amplitude a (in unit of c) is chosen to be 0.001.

Second, we have the \({{{{{\mathcal{l}}}}}}\) = 2 perturbation on the θ-component of the three-velocity field,

$$\delta {v}^{\theta }=a\sin \left[\pi \frac{r}{{r}_{{{{{{{{\rm{s}}}}}}}}}(\theta )}\right]\sin \theta \cos \theta ,$$
(3)

where a is chosen to be 0.01.

Lastly, we have the \({{{{{\mathcal{l}}}}}}\) = 4 perturbation on the θ-component of the three-velocity field,

$$\delta {v}^{\theta }=a\sin \left[\pi \frac{r}{{r}_{{{{{{{{\rm{s}}}}}}}}}(\theta )}\right]\sin \theta \cos \theta (3-7{\cos }^{2}\theta ),$$
(4)

where a is again set to be 0.01.

All three perturbation functions comprise a sine function of r and the θ-part of a spherical harmonic with the corresponding \({{{{{\mathcal{l}}}}}}\) index. The sine function of r has its nodes at the centre and on the surface of the NS to avoid initial perturbations on sensitive boundaries of the problem and minimize any potential numerical errors. On the other hand, spherical harmonics are a natural choice for exciting oscillations on a sphere-like object. Moreover, for the higher-order \({{{{{\mathcal{l}}}}}}\) = 2 and \({{{{{\mathcal{l}}}}}}\) = 4 perturbations, the perturbation amplitude a has to be larger to induce any observable oscillations.

Simulations

Simulations are performed with our code Gmunu75,76,77,78. For each of the 12 equilibrium models, we execute Gmunu three times, once for each initial perturbation function. Hence, 12 × 3 = 36 simulations are carried out in total. In all 36 simulations, the models evolved over a time span of 10 ms with the polytropic EoS p = Kργ, under the same setting as in the computation of equilibrium models, namely, γ = 2 and K = 110. The lowest allowed rest mass density (‘atmosphere’) is set to be \({\rho }_{{{{{\mbox{atmo}}}}}}={\rho }_{\max }\left(t=0\right)\times 1{0}^{-10}\), and the ratio of ρatmo to threshold density ρthr is ρatmo/ρthr = 0.99. For completeness, we also perform simulations under the Cowling approximation, with other settings unchanged. For the simulation results under the Cowling approximation, we plot the eigenfunctions and eigenfrequenices of the excited oscillation modes in Supplementary Figs. 1 and 2, respectively, and we list the numerical values of the eigenfrequencies in Supplementary Table 1. Furthermore, we provide in Supplementary Table 2 the relative differences in eigenfrequencies between the simulations with and without the Cowling approximation.

The two-dimensional computational domain covers 0 ≤ r ≤ 60, 0 ≤ θ ≤ π with the resolution Nr × Nθ = 64 × 16 where each block has 82 cells, thus allowing 4 AMR level (an effective resolution of 512 × 128). The grid refinement used in this study is identical to the GR simulations in a previous work about Gmunu77. In particular, we define a relativistic gravitational potential Φ  1−α. As Φ is almost proportional to M/R, we can use Φ−1 as a measure of the characteristic length-scale77. For any Φ larger than the maximum potential Φmax (which is set as 0.2 in this work), the block is set to be the finest. While for the second-finest level, the same check is performed with a new maximum potential which is half of the previous one, so on and so forth. To avoid the rigorous Courant–Friedrichs–Lewy (CFL) condition at the centre of the star, the grids are enforced to be coarsened for keeping rΔθ ~ Δr when r is smaller than 0.5. (Unless otherwise specified, all quantities in this subsection are in dimensionless units c = G = M = 1.)

Extraction of eigenfrequencies and eigenfunctions

We analyse the data from a Gmunu simulation in the following three steps. For the first step, we extract the time evolutions of the initially perturbed component of the three-velocity field at 361 (r, θ)-points in the NS model and compute the fast Fourier transform (FFT) of the temporal data at each (r, θ)-point. Hence, 361 FFT spectra, plots of magnitude of the complex FFT in the frequency domain, are obtained altogether. According to Dimmelmeier et al.57, our initial perturbation amplitudes are small enough such that the overall evolution of the input model in a Gmunu simulation can be described as a superposition of a few global oscillation modes. We verify this by observing that the FFT spectra obtained at different spatial points show discrete peaks and agree well on the peak positions.

For the second step, we extract the eigenfrequencies of the excited oscillation modes. Usually, the FFT spectrum at a spatial point where the initial perturbation function has a large magnitude can reveal FFT peaks loud enough for further analysis (e.g. at (r, θ)  (re/2, π/2), (re/2, π/4), and (re/2, 2π/15) for \({{{{{\mathcal{l}}}}}}\) = 0, \({{{{{\mathcal{l}}}}}}\) = 2, \({{{{{\mathcal{l}}}}}}\) = 4 perturbations, respectively). Nevertheless, occasionally, we may have to integrate the FFT spectra along a radial line for sharper FFT peaks (along θ = π/2, π/4, and 2π/15 for \({{{{{\mathcal{l}}}}}}\) = 0, \({{{{{\mathcal{l}}}}}}\) = 2, \({{{{{\mathcal{l}}}}}}\) = 4 perturbations, respectively). Since our study here is in the ideal GRMHD regime with no physical damping of the oscillations, we apply parabolic interpolation instead of Lorentzian fitting to the peaks in the single-point or integrated FFT spectrum for simplicity (see Fig. 5 as an example). We then take the interpolated peak positions as the measured eigenfrequencies feig and the full-width-at-half-maximums (FWHMs) of the parabolic interpolations as the uncertainties in eigenfrequency extraction.

Fig. 5: Single-point FFT spectrum obtained from the Gmunu simulation of T1K6 model under \({{{{{\mathcal{l}}}}}}\) = 0 perturbation.
figure 5

The FFT data are computed from the time evolution of the r-component of three velocity fields at the spatial point (r, θ)  (re/2, π/2). The parabolic interpolations of the prominent peaks are shown as an example. The FFT spectrum at a single spatial point usually shows peaks that are sharp enough for analysis.

For the third step, we extract the eigenfunctions of the excited oscillation modes. According to some previous studies57,84, the eigenfunction of a mode is correlated to the spatial map of FFT amplitude at the eigenfrequency of the mode, where FFT amplitude is the magnitude of the FFT multiplied by the sign of its real part. Using our FFT data computed at the 361 points, we spatially map the FFT amplitude at the frequency to which the measured eigenfrequency is the closest in the discretized frequency domain of our FFT analysis for simplicity. The eigenfunction visualized by such a spatial map can serve as a unique trademark to help us identify the same oscillation mode excited in different Gmunu simulations so that we can investigate the dependence of eigenfrequency feig of a particular mode on the magnetic to binding energy ratio \({{{{{{{\mathscr{H}}}}}}}}/{{{{{{{\mathscr{W}}}}}}}}\) of the input model.

In the end, we can obtain the curves of \({f}_{{{{{{{{\rm{eig}}}}}}}}}({{{{{{{\mathscr{H}}}}}}}}/{{{{{{{\mathscr{W}}}}}}}})\) for different oscillation modes to examine the magnetization effects on oscillations of NSs. Lastly, we determine the correspondence between the modes found in our study and the modes in the literature by comparing the eigenfrequencies at zero magnetic energy, \({f}_{{{{{{{{\rm{eig}}}}}}}}}({{{{{{{\mathscr{H}}}}}}}}/{{{{{{{\mathscr{W}}}}}}}}=0)\), of the modes we found here with the mode frequencies previously reported for a non-magnetized non-rotating NS model with a similar gravitational mass57.