# Magnetic helicity in rotating neutron stars

Maxim Dvornikov
Pushkov Institute of Terrestrial Magnetism, Ionosphere
and Radiowave Propagation (IZMIRAN),
108840 Troitsk, Moscow, Russia<EMAIL_ADDRESS>
###### Abstract

We study the magnetic helicity evolution in neutron stars (NSs). First, we
analyze how the surface terms affect the conservation law for the sum of the
chiral imbalance of the charged particle densities and the density of the
magnetic helicity. Our results are applied to a system with a finite volume,
which can be a magnetized NS. We show that the contribution of these surface
terms can potentially lead to the reconnection of magnetic field lines
followed by X-ray or gamma bursts observed in magnetars. Comparing the new
quantum surface term with the classical contribution known in the standard
magnetic hydrodynamics, we obtain that its contribution dominates over the
classical term only for NS with a rigid rotation. Second, we study the
dynamics of chiral electrons which interact electroweakly with a background
fermions having the velocity, arbitrarily depending on spatial coordinates,
and the nonuniform density. We derive the the kinetic equations and the
effective action for right and left particles. The correction to the Adler
anomaly and to the anomalous electric current are obtained in the case of a
rotating matter. Then, the obtained results are applied for the study of the
magnetic helicity flow inside a magnetized rotating NS. We compute the
characteristic time of the helicity change and demonstrate that it coincides
with the the magnetic cycle period of certain pulsars.

##  1 Introduction

Studies of various phenomena taking place in the systems of chiral fermions,
apart from a solely theoretical interest, have various applications in
astroparticle physics, cosmology, solid state and accelerator physics. By
chiral media we mean the situations when either the temperature or the
chemical potential being much greater than the particle mass.

One should mention, first, the chiral magnetic effect (the CME), which is the
generation the anomalous electric current along an external magnetic field.
Such a current can exist only in matter with a nonzero chiral imbalance, i.e.
the chemical potentials of left and right fermions should be different. We
also recall that an ultrarelativistic fermion has a certain projection of its
spin $\mathbf{s}$ on the particle momentum $\mathbf{p}$. If
$\mathbf{s}\upuparrows\mathbf{p}$, we speak about right particles. The
opposite situation of $\mathbf{s}\updownarrows\mathbf{p}$ corresponds to left
fermions. The existence of an anomalous current
$\mathbf{j}\parallel\mathbf{B}$ in vacuum is forbidden by the parity
conservation in electrodynamics. The CME was predicted first by Vilenkin
(1980a) and, then, reconsidered by Fukushima et al. (2008).

The next important chiral phenomenon to mention is the chiral vortical effect
(the CVE). It is the excitation of an electric current along the vorticity of
matter in a rotating system of ultrarelativistic fermions. The CVE is also
forbidden in vacuum. The existence of the CVE was also predicted theoretically
by Vilenkin (1980b). We also recall the chiral separation effect (the CSE)
which consists in the production of an axial current along an external
magnetic field. Other interesting chiral phenomena are summarized in the
review by Kharzeev et al. (2016).

Kharzeev et al. (2016); Zhao and Wang (2019) suggested that one can explain
the asymmetry in collisions of heavy ions on the basis of the CME and the CVE.
The CME and the CSE were reported to be observed in magnetized atomic gases
(Huang, 2016) and in Weyl and Dirac semimetals (Armitage et al., 2018).

There are numerous applications of the chiral phenomena in cosmology. For
instance, Boyarsky et al. (2012) showed that the evolution of magnetic fields
in a primordial plasma is strongly affected by the quantum chiral anomaly at
temperatures $T>10\,\text{MeV}$. Boyarsky et al. (2012) also found that the
magnetic helicity in plasma of the early universe after the electroweak phase
transition becomes long scale. This process leads to the production of the
lepton asymmetry in the primordial plasma cooling down to $T\sim
10\,\text{MeV}$. Giovannini and Shaposhnikov (1998) assumed that a plasma
before the electroweak phase transition ($T>100\,\text{GeV}$) can be permeated
by a primordial hypermagnetic field. This field can be transformed to the
fermionic number owing to the anomalous coupling. The influence of primordial
magnetic fields on the electroweak phase transition was analyzed. The
production of the baryon asymmetry in some specific configurations of the
magnetic field was studied.

There are applications of the CME and the CVE in astrophysics. They are
related to the possible explanation of the strong magnetic fields existence in
some compact stars. Kaspi and Beloborodov (2017) showed that magnetic fields
with the strength $B>10^{15}\,\text{G}$ are observed in magnetars. Yamamoto
(2016) accounted for the chirality of neutrinos in the conventional
hydrodynamics and the kinetic theory. It was suggested that a dense gas of
chiral neutrinos can be important in generation of a strong helical magnetic
field in a core-collapsing supernova. Yamamoto (2016) provided a mechanism for
the transformation of the gravitational energy of a collapsing star to the
electromagnetic energy and explained strong magnetic fields in magnetars.
Masada et al. (2018) used the chiral magnetohydrodynamics to describe the
macroscopic evolution of relativistic charged matter with a chiral imbalance.
Real-time evolutions of magnetic fields and the properties of the chiral MHD
turbulence were studied numerically. The inverse cascade of the magnetic
energy was observed. The application of the results for the generation of
strong magnetic fields in magnetars was discussed by Masada et al. (2018).
Kaminski et al. (2016) studied the neutrino emission along the vorticity or
the magnetic field in dense matter of a neutron star (NS) taking into account
for the effects of the anomalous hydrodynamics. The results were applied to
account for the great linear velocities $\sim
10^{3}\,\text{km}\cdot\text{s}^{-1}$ observed of some pulsars. Sigl and Leite
(2016) examined the effect of the chiral instability of the spectra of the
magnetic energy density and the helicity density during the early cooling
phase of a hot protoneutron star. The generation of a magnetic field with the
strength close to that observed in magnetars was predicted. The density
fluctuations and the turbulence spectrum of matter were found to affect the
generation of the magnetic field. The scale of the magnetic field was obtained
to be from the submillimeter to cm range.

Dvornikov and Semikoz (2015a, b, c) suggested that the instability of a
magnetic field caused by the electroweak correction to the CME leads to the
generation of strongs fields observed in magnetars. Analogous mechanism was
used by Dvornikov (2016a, 2018) in quark stars. Dvornikov (2020) accounted for
the electroweak interaction between chiral electrons and background matter in
a rotating NS. Dvornikov and Semikoz (2018, 2019) studied the evolution of the
magnetic helicity and the magnetic field in NS with inhonogeneous matter using
the Anomalous MagnetoHydroDynamics (AMHD) and applied the results for various
problems of magnetars. Dvornikov et al. (2020) applied the CME and the CSE in
a nonuniformly heated medium of a protoneutron star to explain strong magnetic
fields of magnetars.

In the present work, we continue our previous research on the evolution of
magnetic fields in compact stars. We tackle two main problems. First, we
examine how AMHD is modified when we account for the presence of a nonzero
electron mass in a magnetized plasma. We recall that one assumes the zero
electron mass, $m=0$, to support the CME based on the anomalous current
(Fukushima et al., 2008) (see Eqs. (2.7) and (3.15 below, as well as works by
Boyarsky et al. (2012); Brandenburg et al. (2017)) in the AMHD.

Note that the particles are massive, $m_{e}\neq 0$, in realistic cosmological
and astrophysical media, e.g., in the ultrarelativistic degenerate electron
gas in a supernova, where $p_{\mathrm{F}_{e}}\gg m_{e}$, or in a hot
primordial plasma of the early universe with $T\gg m_{e}$. Dvornikov (2016b)
demonstrated that it results in a very rapid washing out of a chiral
imbalance, $\mu_{5}\to 0$, because of the spin-flip in particle collisions.

If we take into account the nonzero mass $m_{e}\neq 0$ for left and right
electrons or positrons, the CME is no longer valid. Nevertheless, Ioffe (2006)
showed that the Adler-Bell-Jackiw anomaly still takes place since it is valid
for massive particles as well. Thus, the standard MHD and the AMHD are
compatible. It happens under the following additional condition: a change of
the magnetic helicity within a domain volume is given by the new quantum
effect consisting in the nonzero flux of the averaged spin through the surface
of that domain. The evolution of the magnetic helicity accounts for this new
term which can be comparable with the known helicity losses at the surface
within classical MHD (Priest, 2016). We recall that the evolution of the
magnetic helicity at a stellar surface is important for the reconnection of
magnetic field lines there. It can lead to the efficient conversion of the
magnetic energy into the kinetic and thermal energies of plasma causing a
strong electromagnetic emission of magnetars (Kaspi and Beloborodov, 2017).

In the present work, we also study the behavior of ultrarelativistic electrons
in plasma accounting for their electroweak interaction with nonrelativistic
background matter composed of protons and neutrons. The electroweak
interaction is treated within the Fermi approximation. We suppose that the
characteristics of this matter, such as the macroscopic velocity and the
number density can depend on spatial coordinates. We take that the electron
gas is degenerate, i.e. the Fermi momentum of electrons $p_{\mathrm{F}e}$ is
much greater than the mass of an electron $m_{e}$. The existence of such a
system is possible in NS. One can apply the chiral phenomena to such fermions
since these particles are ultrarelativistic: $p_{\mathrm{F}e}\gg m_{e}$. The
mixing between left and right fermions, mentioned above, depends on the spin-
flip rate in particle collisions. Anomalous electric currents of protons are
negligible since protons are nonrelativistic in NS. Hydrodynamic currents of
neutrinos, which are ultrarelativistic particles, can receive an anomalous
contribution. However, the fluxes of neutrinos are small for an old NS,
studied here. Thus, we neglect the neutrino contribution.

This work is organized in the following way. First, in Sec. 2.1, following
Dvornikov and Semikoz (2018), we remind some known results for the spin
magnetization in plasma and some formulas describing the electron density in
the relativistic degenerate electron gas of a magnetized NS. Then, in Sec.
3.1, we derive from the Adler-Bell-Jackiw anomaly the surface terms for the
modified CME accounting for all spin terms including that originated by the
pseudoscalar ($\sim\bar{\psi}\gamma_{5}\psi$). Here
$\gamma_{5}=\mathrm{i}\gamma^{0}\gamma^{1}\gamma^{2}\gamma^{3}$ and
$\gamma^{\mu}=(\gamma^{0},\bm{\gamma})$ are the Dirac matrices. In Sec. 3.2,
we derive the new magnetic helicity evolution equation, where, neglecting
chiral anomaly $n_{\mathrm{R}}-n_{\mathrm{L}}=0$ due to the spin-flip, we find
the contribution of the mean spin flux through the boundary of the volume to
the dynamics of the magnetic helicity known in classical MHD. In Sec. 3.3, we
compare estimates of magnetic helicity losses given by the classical MHD
(Priest, 2016) and our new (quantum) contribution given by that mean spin
flux.

Then, in Sec. 2.2, basing on the results of Dvornikov (2020), we formulate the
dynamics of chiral fermions in dense inhomogeneous matter, with the
electroweak interaction being accounted for. The evolution of chiral fermions
was described approximately basing on the Berry phase evolution. We find the
effective actions and the kinetic equations for chiral fermions in Sec. 2.2.
Then, in Sec. 2.3, we derive the corrections to the anomalous electric current
and to the Adler anomaly from the electroweak interaction with inhomogeneous
matter. Finally, we apply our results in Sec. 3.4 for the description of the
magnetic helicity evolution in a rotating NS and compare our prediction for
the period of the magnetic cycle with the astronomical observations. We
conclude in Sec. 4.

##  2 Theoretical background

In this section, we summarize the theoretical background necessary for the
application of the chiral phenomena to the evolution of magnetic fields in
NSs. First, in Sec. 2.1, we calculate the mean spin of relativistic electron
gas in an external magnetic field. Using the Berry phase approximation in Sec.
2.2, we derive the kinetic equation for electrons in rotating matter
accounting for the electroweak interaction between fermions. Basing on the
results of Sec. 2.2, we derive the correction to the electic currents and to
the Alder anomaly in Sec. 2.3.

###  2.1 Mean spin of the electron gas in an external magnetic field

Here, we remind the basic properties of plasma in an external magnetic field.
The motion of a relativistic charged particle in a magnetic field obeys the
Dirac equation. The energy levels of a $1/2$-spin fermion with the electric
charge $q$ in an external magnetic field ${\bf H}=(0,0,H)$ has the form
(Berestetskiĭ et al., 1998, pp. 121–122),

$\mathcal{E}(p_{z},n,\lambda)=\sqrt{m_{e}^{2}+p_{z}^{2}+|q|H(2n+1)-qH\lambda}.$
(2.1)

where $p_{z}$ is the conserved projection of the fermion momentum along the
magnetic field, $n=0,1,\dots$ is the discrete main quantum number, and
$\lambda=\pm 1$ is the eigenvalue of the matrix
$\Sigma_{z}=\gamma^{5}\gamma^{0}\gamma^{3}$, which appears in the squared
Dirac equation.111We remind that the commutator of the matrix $\Sigma_{z}$
with the Hamiltonian is nonzero for a moving Dirac particle (Berestetskiĭ et
al., 1998, p. 86). However, we shall use the quantity $\lambda$ in the energy
levels in Eq. (2.1). Negatively charged particles (electrons) should have
$q=-e$ and positively charged ones (positrons) possess $q=+e$. Here $e>0$ is
the absolute value of the elementary charge.

Let us consider $e^{\pm}$ plasma in the external magnetic field. Semikoz and
Valle (1997) found that the main Landau level with $n=0$ contributes the mean
spin of electrons and positrons, which has the form,

$\displaystyle\bm{\mathcal{S}}=$
$\displaystyle\langle\psi_{e}^{\dagger}\bm{\Sigma}\psi_{e}\rangle_{0}=-\frac{2e\mathbf{H}}{(2\pi)^{2}}$
$\displaystyle\times\int_{0}^{\infty}\mathrm{d}p_{z}\left\\{\frac{1}{\exp[(\sqrt{p_{z}^{2}+m_{e}^{2}}-\mu_{e})/T]+1}-\frac{1}{\exp[(\sqrt{p_{z}^{2}+m_{e}^{2}}+\mu_{e})/T]+1}\right\\},$
(2.2)

where $\psi_{e}$ is the bispinor exactly accounting for the contribution of
the external magnetic field, $\bm{\Sigma}=\gamma^{5}\gamma^{0}\bm{\gamma}$,
$\mu_{e}$ is the chemical potential of relativistic electrons, and $T$ is the
temperature of plasma.

We neglect the electron mass in a chiral plasma, $m_{e}\to 0$. Thus, the
integral in the last line is proportional to the chemical potential $\mu_{e}$.
This result does not dependent on the temperature. Therefore the mean spin in
of relativistic electron-positron plasma takes the form,

$\bm{\mathcal{S}}=-\frac{e\mu_{e}{\bf
H}}{2\pi^{2}}=-\left(\frac{\alpha_{\mathrm{em}}}{\pi}\right)\left(\frac{2\mu_{e}}{e}\right){\bf
H},$ (2.3)

where $\alpha_{\mathrm{em}}=e^{2}/4\pi\approx 7.3\times 10^{-3}$ is the fine
structure constant.

We can also consider a non-relativistic degenerate electron gas, e.g., forming
plasma in a metal. In this situation, using the chemical potential
$\mu_{e}=m_{e}+p^{2}_{\mathrm{F}_{e}}/2m_{e}$ in Eq. (2.1), one obtains the
paramagnetic magnetization term
$\mathbf{M}=-\mu_{\mathrm{B}}\bm{\mathcal{S}}$,222Here we account for the
negative magnetic moment of an electron: $-\mu_{\mathrm{B}}$.

$\frac{\mathbf{M}}{\mu_{\mathrm{B}}}=\frac{ep_{\mathrm{F}_{e}}}{2\pi^{2}}{\bf
H},$ (2.4)

where $\mu_{\mathrm{B}}=e/2m_{e}>0$ is the Bohr magneton. This result means
that the time independent paramagnetic susceptibility is equal to the known
value $\chi=\alpha_{\mathrm{em}}v_{\mathrm{F}_{e}}/\pi\ll 1$ where
$v_{\mathrm{F}_{e}}=p_{\mathrm{F}_{e}}/m_{e}$ is the Fermi velocity. It leads
to the standard definitions $\mathbf{M}=\chi\mathbf{H}$ and
$\mathbf{B}=\mu\mathbf{H}=(1+\chi)\mathbf{H}$ (Landau and Lifshitz, 1980, see
Eq. (59.5) on p. 173). Here $\mu$ is the magnetic permeability of the electron
gas. The approximation ${\bf B}\approx{\bf H}$ remains valid with a good
accuracy since $\chi\ll 1$.

Only electrons, which are on the main Landau level $n=0$, contribute to the
mean spin,

$\bm{\mathcal{S}}=-n_{0}\hat{\bf n}_{\mathrm{B}},\quad\hat{\bf
n}_{\mathrm{B}}=\frac{\bf B}{B},\quad
n_{0}=\frac{eBp_{\mathrm{F}_{e}}}{2\pi^{2}}.$ (2.5)

This fact is valid for a degenerate electron gas, both ultra-relativistic, as
in Eq. (2.3), and a non-relativistic, as in Eq. (2.4). Nunokawa et al. (1997)
obtained that $n_{0}$ is a part of the total electron density in the
degenerate electron gas in Eq. (2.5),

$n_{e}=\frac{eBp_{\mathrm{F}_{e}}}{2\pi^{2}}+\sum_{n=1}^{n_{\mathrm{max}}}\frac{2eB\sqrt{p_{\mathrm{F}_{e}}^{2}-2eBn}}{2\pi^{2}},$
(2.6)

where the sum is up to a maximal value
$n_{\mathrm{max}}=[p_{\mathrm{F}_{e}}^{2}/(2eB)]$ and $[\dots]$ stays for the
integer part of $p_{\mathrm{F}_{e}}^{2}/(2eB)$.

The sum in Eq. (2.6) is vanishing for strong magnetic fields,
$2eB>p_{\mathrm{F}_{e}}^{2}$. Thus all electrons populate the main Landau
level, $n_{e}=n_{0}$. Then, if we consider ultrarelativistic or massless
electrons, the total electric current becomes anomalous. It is the
manifestation of the CME (Fukushima et al., 2008; Kharzeev et al., 2016),

${\bf j}=\alpha{\bf B}=\frac{\alpha_{\mathrm{em}}\mu_{5}}{\pi}{\bf
B},\quad\mu_{5}=(\mu_{\mathrm{R}}-\mu_{\mathrm{L}})/2.$ (2.7)

This current in Eq. (2.7) is known to produce a forceless magnetic field,
${\bf j}\times{\bf B}=0$. The explicit form of such a field in three
dimensions, which is the solution of the equation $\nabla\times{\bf
B}=\alpha{\bf B}$, was found by Chandrasekhar and Kendall (1957).

If we deal with a magnetic field obeying $eB>p_{\mathrm{F}_{e}}^{2}/2$, a
realistic assumption $p_{\mathrm{F}_{e}}\sim 100\,{\rm MeV}$ is hard to
implement in the core of NS. It results from the fact that the magnetic field,
necessary for the condition $n_{e}=n_{0}$, is rather strong:
$B>10^{4}B_{\mathrm{cr}}/2\sim 2.2\times 10^{17}\,{\rm G}$. Here
$B_{\mathrm{cr}}=m_{e}^{2}/e=4.4\times 10^{13}\,\text{G}$ is the critical
magnetic field.

We can take a moderately strong magnetic field, $m_{e}^{2}\ll 2eB\ll
p_{\mathrm{F}_{e}}^{2}$. This situation can be implemented in magnetars, where
$B\sim 10^{15}\,{\rm G}$. Indeed, both electrons and protons in NS have
$p_{\mathrm{F}_{e}}=p_{\mathrm{F}_{p}}\sim 100\,{\rm MeV}$ in a electroneutral
plasma, $n_{e}=n_{p}$. In this case, the sum for Landau levels $1\leq n\leq
n_{\mathrm{max}}$ in Eq. (2.6) has a greater contribution to the total current
compared to the anomalous one. Therefore, the usual transverse components
${\bf B}\perp{\bf j}$ become greater leading to the existence of a Lorentz
force. It means that the CME turns out to be negligible since the population
of the main Landau level is small333We shall demonstrate below that such a
small correction leads to the very important term for the magnetic helicity
dissipation in the situation of the rigid rotation of a magnetar. in
comparison with the the total one (Nunokawa et al., 1997),

$n_{e}\approx\frac{p_{\mathrm{F}_{e}}^{3}}{3\pi^{2}}\left[1+\frac{3eB}{2p_{\mathrm{F}_{e}}^{2}}\right].$
(2.8)

The correction to the electron number density from the magnetic field in Eq.
(2.8) results in the dependence of the chemical potential on the magnetic
field; cf. Eq. (2.1).

###  2.2 Approximate description of chiral plasma based on the Berry phase
evolution

Now we study the motion of a chiral fermion in background matter accounting
for the electroweak interaction. We shall add the contribution of the
electromagnetic field later. One has to consider the Dirac equation for an
electron in the form,

$\mathrm{i}\dot{\psi}=\left[(\bm{\alpha}\cdot\hat{\mathbf{p}})+V_{\mathrm{R}}^{\mu}\gamma^{0}\gamma_{\mu}P_{\mathrm{R}}+V_{\mathrm{L}}^{\mu}\gamma^{0}\gamma_{\mu}P_{\mathrm{L}}\right]\psi,$
(2.9)

where $\hat{\mathbf{p}}=-\mathrm{i}\nabla$ is the operator of the electron
momentum, $\psi$ is the wavefunction of an electron,
$\bm{\alpha}=\gamma^{0}\bm{\gamma}$ are the Dirac matrices,
$P_{\mathrm{L,R}}=(1\pm\gamma^{5})/2$ are the projectors to the chiral states,
and
$V_{\mathrm{L},\mathrm{R}}^{\mu}=V_{\mathrm{L},\mathrm{R}}^{\mu}(\mathbf{x})=(V_{\mathrm{L},\mathrm{R}}^{0},\mathbf{V}_{\mathrm{L,R}})$
are the potentials of the interaction of the left and right chiral states with
the inhomogeneous matter.

Dvornikov and Semikoz (2015a) found the explicit expressions for
$V_{\mathrm{L},\mathrm{R}}^{0}\sim G_{\mathrm{F}}n_{f}$ for electrons. Here
$n_{f}$ is the density of background fermions and $G_{\mathrm{F}}=1.17\times
10^{-5}\,\text{GeV}^{-2}$ is the Fermi constant. Dvornikov and Studenikin
(2002) derived that
$\mathbf{V}_{\mathrm{L},\mathrm{R}}=V_{\mathrm{L},\mathrm{R}}^{0}\mathbf{v}$
for the arbitrarily moving unpolarized background matter. Here
$\mathbf{v}(\mathbf{x})$ is the velocity of plasma, in which all background
fermions are taken to move as a whole. We can consider the situation when the
density of background matter is also the function of coordinates,
$n_{f}=n_{f}(\mathbf{x})$. Since the electroweak forces violates parity, then
$V_{\mathrm{R}}^{\mu}\neq V_{\mathrm{L}}^{\mu}$.

We write down $\psi$ in the form of two chiral projections,
$\psi^{\mathrm{T}}=(\psi_{\mathrm{R}},\psi_{\mathrm{L}})$ if we adopt the
chiral representation for the Dirac matrices. Using Eq. (2.9), one obtains the
wave equations for $\psi_{\mathrm{L,R}}$,

$\mathrm{i}\dot{\psi}_{\mathrm{L,R}}=\left[\mp(\bm{\sigma}\cdot\hat{\mathbf{p}})+V_{\mathrm{L,R}}^{0}\pm(\bm{\sigma}\cdot\mathbf{V}_{\mathrm{L,R}})\right]\psi_{\mathrm{L,R}},$
(2.10)

where $\bm{\sigma}$ are the Pauli matrices.

One can hardly find the solution of Eq. (2.10) if the effective potentials
arbitrarily depend on coordinates,
$V_{\mathrm{L},\mathrm{R}}^{\mu}(\mathbf{x})$. However, we can apply the
quasiclassical method, based on the concept of the Berry phase (Berry, 1984),
for the analysis of the evolution of $\psi_{\mathrm{L,R}}$. For this purpose,
we replace the field theory approach with the classical mechanics. Namely, we
take that particles move along certain trajectories. Thus we should choose
some canonical coordinates $\\{\mathbf{x}(t),\mathbf{p}(t)\\}$. These
coordinates can be taken in numerous ways. Therefore, we replace the wave
functions $\psi_{\mathrm{L,R}}(\mathbf{x},t)$, depending on time $t$ and the
coordinates $\mathbf{x}$ with effective ones, depending on $t$ only,
$\psi_{\mathrm{L,R}}(t)$:
$\psi_{\mathrm{L,R}}(\mathbf{x},t)\to\exp(\mathrm{i}\Phi)\psi_{\mathrm{L,R}}(t)$.
The dependence on the canonical coordinates is in the phase
$\Phi=\Phi(\mathbf{x},\mathbf{p})$, which is not fixed yet.

Basing on Eq. (2.10), we get that the new spinors
$\psi_{\mathrm{L,R}}=\psi_{\mathrm{L,R}}(t)$ obey the following equation:

$\mathrm{i}\frac{\mathrm{d}}{\mathrm{d}t}{\psi}_{\mathrm{L,R}}=H_{\mathrm{L,R}}\psi_{\mathrm{L,R}},\quad
H_{\mathrm{L,R}}=V_{\mathrm{L,R}}^{0}\mp(\bm{\sigma}\bm{\Pi}),$ (2.11)

where $\bm{\Pi}=\nabla\Phi-\mathbf{V}_{\mathrm{L,R}}$. The Hamiltonians
$H_{\mathrm{L,R}}$ in Eq. (2.11) depend on time only since we assume that
$\mathbf{x}=\mathbf{x}(t)$.

Now we take that $H_{\mathrm{L,R}}$ change adiabatically. In this situation,
Vinitskiĭ et al. (1990) found that

$\psi_{\mathrm{L,R}}(t)=\exp(-\mathrm{i}\Theta_{\mathrm{L,R}})u_{\mathrm{L,R}},$
(2.12)

where $\Theta_{\mathrm{L,R}}=\Theta_{\mathrm{L,R}}(t)$ is the phase introduced
by Berry (1984). In our case, the Berry phase is different for left and right
electrons. In Eq. (2.12), $u_{\mathrm{L,R}}$ are the constant spinors.
Following Vinitskiĭ et al. (1990), we impose the constraints on
$\psi_{\mathrm{L,R}}$,

$\psi_{\mathrm{L,R}}^{\dagger}\dot{\psi}_{\mathrm{L,R}}=0,\quad\psi_{\mathrm{L,R}}^{\dagger}\psi_{\mathrm{L,R}}=1,$
(2.13)

which fix their amplitudes and the phases.

Vinitskiĭ et al. (1990) suggested to solve the Schrödinger equation,

$H_{\mathrm{L,R}}u_{\mathrm{L,R}}(\xi)=E_{\mathrm{L,R}}u_{\mathrm{L,R}}(\xi),$
(2.14)

to find $\Theta_{\mathrm{L,R}}$. In Eq. (2.14), the canonical variable
$\xi_{a}=\\{\mathbf{x},\mathbf{p}\\}$, $a=1,\dots,6$, is taken to be constant:
$\xi_{a}=\text{const}$. The solution of Eq. (2.14) has the form,

$E_{\mathrm{L,R}}=|\bm{\Pi}|+V_{\mathrm{L,R}}^{0},\quad
u_{\mathrm{L}}=\left(\begin{array}[]{c}-e^{-\mathrm{i}\varphi/2}\sin\dfrac{\theta}{2}\\\
e^{\mathrm{i}\varphi/2}\cos\dfrac{\theta}{2}\end{array}\right),\quad
u_{\mathrm{R}}=\left(\begin{array}[]{c}e^{-\mathrm{i}\varphi/2}\cos\dfrac{\theta}{2}\\\
e^{\mathrm{i}\varphi/2}\sin\dfrac{\theta}{2}\end{array}\right),\quad$ (2.15)

where the angles $\theta$ and $\varphi$ determine the direction of the vector
$\bm{\Pi}$.

Using the results of Vinitskiĭ et al. (1990), as well as Eqs. (2.11)-(2.14),
we obtain that the Berry phases $\Theta_{\mathrm{L,R}}$ satisfy the equation,

$\dot{\Theta}_{\mathrm{L,R}}=-\mathrm{i}u_{\mathrm{L,R}}^{\dagger}\frac{\partial
u_{\mathrm{L,R}}}{\partial\xi_{a}}\dot{\xi}_{a}.$ (2.16)

Vinitskiĭ et al. (1990) found that the solution of Eq. (2.16) has the form,

$\Theta_{\mathrm{L,R}}(t)=\int_{C}A_{a}^{(\mathrm{L,R})}(\xi)\mathrm{d}\xi_{a},$
(2.17)

where $C$ is the trajectory of an electron in the phase space and

$\mathrm{i}A_{a}^{(\mathrm{L,R})}=u_{\mathrm{L,R}}^{\dagger}\frac{\partial
u_{\mathrm{L,R}}}{\partial\xi_{a}},$ (2.18)

is the Berry connection.

Using two three-dimensional vectors, we rewrite the Berry connection in the
form,
$A_{a}^{(\mathrm{L,R})}=(\bm{\mathcal{B}}_{\mathrm{L,R}},\bm{\mathcal{A}}_{\mathrm{L,R}})$.
Basing on Eq. (2.18), we get that

$\displaystyle\mathcal{B}_{i}^{(\mathrm{L,R})}$
$\displaystyle=-\mathrm{i}u_{\mathrm{L,R}}^{\dagger}\frac{\partial
u_{\mathrm{L,R}}}{\partial
x_{i}}=-\mathrm{i}u_{\mathrm{L,R}}^{\dagger}\frac{\partial
u_{\mathrm{L,R}}}{\partial\Pi_{j}}\frac{\partial\Pi_{j}}{\partial x_{i}},$
$\displaystyle\mathcal{A}_{i}^{(\mathrm{L,R})}$
$\displaystyle=-\mathrm{i}u_{\mathrm{L,R}}^{\dagger}\frac{\partial
u_{\mathrm{L,R}}}{\partial
p_{i}}=-\mathrm{i}u_{\mathrm{L,R}}^{\dagger}\frac{\partial
u_{\mathrm{L,R}}}{\partial\Pi_{j}}\frac{\partial\Pi_{j}}{\partial p_{i}}.$
(2.19)

Thus, we replace the integration along the particle trajectory by the time
integration. Finally, we rewrite Eq. (2.17) as

$\Theta_{\mathrm{L,R}}(t)=\int_{t_{0}}^{t}\left(\bm{\mathcal{B}}_{\mathrm{L,R}}\dot{\mathbf{x}}+\bm{\mathcal{A}}_{\mathrm{L,R}}\dot{\mathbf{p}}\right)\mathrm{d}t=\int_{t_{0}}^{t}\mathcal{A}_{\bm{\Pi}j}^{(\mathrm{L,R})}\left[\frac{\partial\Pi_{j}}{\partial
p_{i}}\dot{p}_{i}+\frac{\partial\Pi_{j}}{\partial
x_{i}}\dot{x}_{i}\right]\mathrm{d}t,$ (2.20)

where

$\mathrm{i}\mathcal{A}_{\bm{\Pi}j}^{(\mathrm{L,R})}=u_{\mathrm{L,R}}^{\dagger}\frac{\partial
u_{\mathrm{L,R}}}{\partial\Pi_{j}},$ (2.21)

which stems from Eq. (2.2).

According to Eq. (2.12), the wavefunction evolves as
$\psi_{\mathrm{L,R}}(t)\sim\exp(-\mathrm{i}\Theta_{\mathrm{L,R}})$. If we
recall that the spinors $u_{\mathrm{L,R}}$ correspond to the energies
$E_{\mathrm{L,R}}$ in Eq. (2.15), as well as accounting for Eq. (2.20), we can
introduce the effective energies,

$E_{\mathrm{eff}}=\mathcal{A}_{\bm{\Pi}j}^{(\mathrm{L,R})}\left[\frac{\partial\Pi_{j}}{\partial
p_{i}}\dot{p}_{i}+\frac{\partial\Pi_{j}}{\partial
x_{i}}\dot{x}_{i}\right]+E_{\mathrm{L,R}}.$ (2.22)

Now we can take into account the electromagnetic interaction of chiral
electrons. We suppose that their electric charge is $e$ and one has the
external electromagnetic field with the vector potential
$A^{\mu}=(A_{0},\mathbf{A})$. Basing on Eq. (2.22), we get the effective
actions for right and left electrons,

$\displaystyle S_{\mathrm{eff}}^{(\mathrm{L,R})}[\mathbf{x},\mathbf{p}]=$
$\displaystyle\int_{t_{0}}^{t}\mathrm{d}t\bigg{\\{}\dot{\mathbf{x}}\left[\mathbf{p}+e\mathbf{A}(\mathbf{x})\right]-\mathcal{A}_{\bm{\Pi}j}^{(\mathrm{L,R})}\left[\frac{\partial\Pi_{j}}{\partial
p_{i}}\dot{p}_{i}+\frac{\partial\Pi_{j}}{\partial x_{i}}\dot{x}_{i}\right]$
$\displaystyle-\epsilon_{\mathrm{L,R}}(\mathbf{x})-eA_{0}(\mathbf{x})\bigg{\\}},$
(2.23)

where, following Son and Yamamoto (2013), we account for the dependence of the
electron energy on coordinates $\epsilon_{\mathrm{L,R}}(\mathbf{x})$.

We have not specified the canonical coordinates and $\bm{\Pi}$ yet. We take
$\\{\mathbf{x},\mathbf{p}\\}$ to have $\Phi=(\mathbf{px})$. In this situation,

$\bm{\Pi}=\mathbf{p}-\mathbf{V}_{\mathrm{L,R}},\quad\frac{\partial\Pi_{k}}{\partial
p_{i}}=\delta_{ik},\quad\frac{\partial\Pi_{k}}{\partial x_{i}}=-\frac{\partial
V_{k}^{(\mathrm{L,R})}}{\partial x_{i}},$ (2.24)

and
$\epsilon_{\mathbf{P}}^{(\mathrm{L,R})}(\mathbf{x})=V_{\mathrm{L,R}}^{0}+|\mathbf{P}|+\epsilon_{0}$.
Here where $\epsilon_{0}=\epsilon_{0}(\mathbf{x})$ is due to the coordinates
dependence of the electromagnetic field.

The effective action in Eq. (2.2) has the form,

$S_{\mathrm{eff}}^{(\mathrm{L,R})}=\int_{t_{0}}^{t}\mathrm{d}t\left\\{\dot{\mathbf{x}}\left[\mathbf{p}+e\mathbf{A}(\mathbf{x})\right]-\bm{\mathcal{A}}_{\mathrm{L,R}}\left[\dot{\mathbf{p}}-(\dot{\mathbf{x}}\nabla)\mathbf{V}_{\mathrm{L,R}}\right]-\epsilon_{\mathbf{P}}^{(\mathrm{L,R})}(\mathbf{x})-eA_{0}(\mathbf{x})\right\\},$
(2.25)

where the index $\mathbf{P}$ in the Berry connection is omitted:
$\bm{\mathcal{A}}_{\mathbf{P}}^{(\mathrm{L,R})}\to\bm{\mathcal{A}}_{\mathrm{L,R}}$.
Basing on the fact that
$\dot{\mathbf{P}}=\dot{\mathbf{p}}-(\dot{\mathbf{x}}\nabla)\mathbf{V}_{\mathrm{L,R}}$,
we can recast Eq. (2.25) as

$S_{\mathrm{eff}}^{(\mathrm{L,R})}[\mathbf{x},\mathbf{P}]=\int_{t_{0}}^{t}\mathrm{d}t\left\\{\dot{\mathbf{x}}\left[\mathbf{P}+e\mathbf{A}_{\mathrm{eff}}(\mathbf{x})\right]-\bm{\mathcal{A}}_{\mathrm{L,R}}\dot{\mathbf{P}}-\epsilon_{\mathbf{P}}^{(\mathrm{L,R})}(\mathbf{x})-eA_{0}(\mathbf{x})\right\\},$
(2.26)

where $\mathbf{A}_{\mathrm{eff}}=\mathbf{A}+\mathbf{V}_{\mathrm{L,R}}/e$. Now
we can utilize the new set of the canonical variables
$\Xi_{a}=\\{\mathbf{x},\mathbf{P}\\}$. These canonical variables were used by
Silva et al. (1999) to construct kinetic equations of fermions, electroweakly
interacting with inhomogeneous background matter.

Applying the approach of Son and Yamamoto (2013), as well as using Eq. (2.26),
we get the kinetic equation for the distribution functions of left and right
fermions, $f_{\mathrm{L,R}}(\mathbf{x},\mathbf{P},t)$, in the form,

$\displaystyle\frac{\partial f_{\mathrm{L,R}}}{\partial t}+$
$\displaystyle\frac{1}{1+e\mathbf{B}_{\mathrm{eff}}\bm{\Omega}}\bigg{\\{}\left[\mathbf{v}+e(\tilde{\mathbf{E}}\times\bm{\Omega}_{\mathbf{P}})+e(\mathbf{v}\cdot\bm{\Omega}_{\mathbf{P}})\mathbf{B}_{\mathrm{eff}}\right]\frac{\partial
f_{\mathrm{L,R}}}{\partial\mathbf{x}}$
$\displaystyle+\left[e\tilde{\mathbf{E}}+e(\mathbf{v}\times\mathbf{B}_{\mathrm{eff}})+e^{2}(\tilde{\mathbf{E}}\cdot\mathbf{B}_{\mathrm{eff}})\bm{\Omega}_{\mathbf{P}}\right]\frac{\partial
f_{\mathrm{L,R}}}{\partial\mathbf{P}}\bigg{\\}}=0,$ (2.27)

where
$\tilde{\mathbf{E}}=\mathbf{E}_{\mathrm{eff}}-e^{-1}\partial\epsilon_{\mathbf{P}}/\partial\mathbf{x}$,
$\mathbf{v}=\partial\epsilon_{\mathbf{P}}/\partial\mathbf{P}$,
$\mathbf{E}_{\mathrm{eff}}=-\nabla A_{0}-\nabla V_{\mathrm{L,R}}^{0}/e$,
$\mathbf{B}_{\mathrm{eff}}=(\nabla\times\mathbf{A}_{\mathrm{eff}})$, and
$\bm{\Omega}_{\mathbf{P}}=(\nabla_{\mathbf{P}}\times\bm{\mathcal{A}}_{\mathrm{L,R}})$
is the Berry curvature. To derive Eq. (2.2) we take
$\epsilon_{\mathbf{P}}^{(\mathrm{L,R})}=V_{\mathrm{L,R}}^{0}+\epsilon_{\mathbf{P}}$,
where
$\epsilon_{\mathbf{P}}(\mathbf{x})=|\mathbf{P}|+\epsilon_{0}(\mathbf{x})$.

Note that, if $\epsilon_{0}(\mathbf{x})=0$, Eq. (2.2) coincides with that
derived by Dvornikov and Semikoz (2017); Semikoz and Dvornikov (2018) for a
neutrino electroweakly interacting with electron-positron plasma since
$\tilde{\mathbf{E}}=\mathbf{E}_{\mathrm{eff}}=\mathbf{E}+\mathbf{E}_{\mathrm{EW}}$
and $\mathbf{B}_{\mathrm{eff}}=\mathbf{B}+\mathbf{B}_{\mathrm{EW}}$, where
$\mathbf{E}_{\mathrm{EW}}=-e^{-1}\nabla V_{\mathrm{L,R}}^{0}$ and
$\mathbf{B}_{\mathrm{EW}}=e^{-1}(\nabla\times\mathbf{V}_{\mathrm{L,R}})$ are
the effective corrections induced by the electroweak interaction to the
conventional electromagnetic field $F_{\mu\nu}=(\mathbf{E},\mathbf{B})$.

###  2.3 Electric current and Adler anomaly in inhomogeneous matter accounting
for the electroweak interaction

In this section, we derive the corrections to the anomalous current and to the
Adler anomaly arising from the electroweak interaction of chiral fermions with
inhomogeneous background matter. We consider the particular case of the
rotating matter.

Son and Yamamoto (2013) defined the number densities

$n_{\mathrm{L,R}}=\int\frac{\mathrm{d}^{3}P}{(2\pi)^{3}}\left[1+e\left(\mathbf{B}_{\mathrm{eff}}\cdot\bm{\Omega}_{\mathbf{P}}\right)\right]f_{\mathrm{L,R}}.$
(2.28)

and the currents

$\displaystyle\mathbf{j}_{\mathrm{L,R}}=$
$\displaystyle-\int\frac{\mathrm{d}^{3}P}{(2\pi)^{3}}\bigg{[}\epsilon_{\mathbf{P}}\frac{\partial
f_{\mathrm{L,R}}}{\partial\mathbf{P}}+e\left(\bm{\Omega}_{\mathbf{P}}\cdot\frac{\partial
f_{\mathrm{L,R}}}{\partial\mathbf{P}}\right)\epsilon_{\mathbf{P}}\mathbf{B}_{\mathrm{eff}}$
$\displaystyle+\epsilon_{\mathbf{P}}\left(\bm{\Omega}_{\mathbf{P}}\times\frac{\partial
f_{\mathrm{L,R}}}{\partial\mathbf{x}}\right)+e\left(\mathbf{E}_{\mathrm{eff}}\times\bm{\Omega}_{\mathbf{P}}\right)f_{\mathrm{L,R}}\bigg{]},$
(2.29)

Dvornikov and Semikoz (2017); Semikoz and Dvornikov (2018) obtained that the
quantities in Eqs. (2.28) and (2.3) satisfy the equation,

$\partial_{t}n_{\mathrm{L,R}}+(\nabla\cdot\mathbf{j}_{\mathrm{L,R}})=-e^{2}\int\frac{\mathrm{d}^{3}P}{(2\pi)^{3}}\left(\bm{\Omega}_{\mathbf{P}}\cdot\frac{\partial
f_{\mathrm{L,R}}}{\partial\mathbf{P}}\right)\left(\mathbf{E}_{\mathrm{eff}}\cdot\mathbf{B}_{\mathrm{eff}}\right).$
(2.30)

Dvornikov and Semikoz (2017); Semikoz and Dvornikov (2018) implied the
validity of the Maxwell equations for the effective electromagnetic fields,
$(\nabla\cdot\mathbf{B}_{\mathrm{eff}})=0$ and
$\partial_{t}\mathbf{B}_{\mathrm{eff}}+(\nabla\times\mathbf{E}_{\mathrm{eff}})=0$
to derive Eq. (2.13).

We shall consider the homogeneous distribution functions: $\partial
f_{\mathrm{L,R}}/\partial\mathbf{x}=0$. In this situation,
$\epsilon_{\mathbf{P}}=\mu_{\mathrm{L,R}}+\dotsb$, where $\mu_{\mathrm{L,R}}$
are the chemical potentials of right and left electrons. Moreover the zero
order terms in the Fermi constant $G_{\mathrm{F}}$ are kept. One gets that the
anomalous part of the current
$\mathbf{J}_{\mathrm{L,R}}=e\mathbf{j}_{\mathrm{L,R}}$ is expressed as

$\displaystyle\mathbf{J}_{\mathrm{L,R}}=$
$\displaystyle-\mu_{\mathrm{L,R}}e^{2}\mathbf{B}_{\mathrm{eff}}\int\frac{\mathrm{d}^{3}P}{(2\pi)^{3}}\left(\bm{\Omega}_{\mathbf{P}}\cdot\frac{\partial
f_{\mathrm{L,R}}}{\partial\mathbf{P}}\right)=\mp\frac{e^{2}}{4\pi^{2}}\mu_{\mathrm{L,R}}\mathbf{B}_{\mathrm{eff}}$
$\displaystyle=\mp\frac{e^{2}}{4\pi^{2}}\mu_{\mathrm{L,R}}\left[\mathbf{B}+\frac{1}{e}(\nabla\times\mathbf{V}_{\mathrm{L,R}})\right].$
(2.31)

The first term in Eq. (2.3), namely
$\mathbf{J}_{\mathrm{L,R}}\propto\mu_{\mathrm{L,R}}\mathbf{B}$, reproduces the
CME (Fukushima et al., 2008). We take the following distribution function:

$f_{\mathrm{L,R}}(\mathbf{P})=\frac{1}{\exp[\beta(|\mathbf{P}|-\mu_{\mathrm{L,R}})]+1},\quad\frac{\partial
f_{\mathrm{L,R}}}{\partial\mathbf{P}}=-\frac{\mathbf{P}}{|\mathbf{P}|}\frac{\beta\exp[\beta(|\mathbf{P}|-\mu_{\mathrm{L,R}})]}{\left\\{\exp[\beta(|\mathbf{P}|-\mu_{\mathrm{L,R}})]+1\right\\}^{2}},$
(2.32)

to derive Eq. (2.3). Here $\beta=1/T$ is the inverted temperature. We consider
the degenerate plasma with $\beta\to\infty$ and
$\nabla_{\mathbf{P}}f_{\mathrm{L,R}}\to\delta(|\mathbf{P}|-\mu_{\mathrm{L,R}})$
in Eqs. (2.3) and (2.32). Moreover we take into account the result of
Dvornikov and Semikoz (2017) that
$\bm{\Omega}_{\mathbf{P}}=\mp\mathbf{P}/2|\mathbf{P}|^{3}$.

The correction to the Adler anomaly can be calculated analogously Eq. (2.3)
using Eq. (2.30). First, one supposes that the density of background fermions
is homogeneous, i.e. $\nabla V_{\mathrm{L,R}}^{0}=0$. In this situation,
$\mathbf{E}_{\mathrm{eff}}=\mathbf{E}$, and

$\partial_{t}n_{\mathrm{L,R}}+(\nabla\cdot\mathbf{j}_{\mathrm{L,R}})=\mp\frac{e^{2}}{4\pi^{2}}\left(\mathbf{E}\cdot\mathbf{B}_{\mathrm{eff}}\right)=\mp\frac{e^{2}}{4\pi^{2}}\left[\left(\mathbf{E}\cdot\mathbf{B}\right)+\frac{1}{e}\left(\mathbf{E}\cdot\nabla\times\mathbf{V}_{\mathrm{L,R}}\right)\right].$
(2.33)

Integrating this expression and neglecting the boundary effects, we get that

$\frac{\mathrm{d}n_{5}}{\mathrm{d}t}=\frac{e^{2}}{2\pi^{2}V}\int\left[\left(\mathbf{E}\cdot\mathbf{B}\right)-\frac{1}{e}\left(\mathbf{E}\cdot\nabla\times\mathbf{V}_{5}\right)\right]\mathrm{d}^{3}x-\Gamma
n_{5},$ (2.34)

where $n_{5}=n_{\mathrm{R}}-n_{\mathrm{L}}$ is the imbalance of chiral
electrons and
$\mathbf{V}_{5}=(\mathbf{V}_{\mathrm{L}}-\mathbf{V}_{\mathrm{R}})/2$.
Moreover, one has that $(\nabla\times\mathbf{V}_{5})=V_{5}\bm{\omega}$, where
$V_{5}=(V_{\mathrm{L}}^{0}-V_{\mathrm{R}}^{0})/2$. Here $\bm{\omega}$ is the
angular velocity.

We take into account the fact that electrons are ultrarelativistic but not
massless particles in Eq. (2.34). It means that their helicity is changed in
collisions with other fermions. Thus we introduce the term $-\Gamma n_{5}$ in
the rhs of Eq. (2.34). Dvornikov (2016b) computed the spin-flip rate
$\Gamma\sim 10^{11}\,\text{s}^{-1}$ in degenerate matter of old NSs.

The correction to the anomalous current owing to the electroweak interaction
has the form,
$\delta\mathbf{J}_{\mathrm{anom}}=(\mathbf{J}_{\mathrm{L}}+\mathbf{J}_{\mathrm{R}})\propto\nabla\times(\mathbf{V}_{\mathrm{R}}-\mathbf{V}_{\mathrm{L}})\sim
V_{5}\bm{\omega}$. This expression in Eq. (2.3) reproduces the result of
Dvornikov (2015) except the factor $1/2\pi$ missed there. Dvornikov (2015)
named the generation of such anomalous current as the galvano-rotational
effect.

##  3 Astrophysical applications

In this section, we apply the results of Sec. 2 to study the evolution of
magnetic fields in compact stars. In Secs. 3.1-3.3, we analyze the magnetic
helicity evolution in NS taking into account the polarization of relativistic
electrons. In Sec. 3.4, we study the flux of the magnetic helicity through the
equator of a rotating NS and propose the possible explanation of the observed
magnetic cycles of some pulsars.

###  3.1 The quantum surface correction to the chiral anomaly in finite volume
of a neutron star

In this section, we analyze the system of AMHD equations for chiral fermions.
Then we study the modification of these equations when one accounts for a
particle mass. In particular, we consider the contribution of the nonzero
fermion mass to the Adler anomaly.

Pavlović et al. (2017) formulated the full set of AMHD equations,

$\displaystyle\rho\left[\frac{\partial\mathbf{v}}{\partial
t}+(\mathbf{v}\nabla)\mathbf{v}-\nu\nabla^{2}\mathbf{v}\right]=$
$\displaystyle-\nabla
p+\sigma_{\mathrm{cond}}[(\mathbf{E}\times\mathbf{B})+(\mathbf{v}\times\mathbf{B})\times\mathbf{B}],$
$\displaystyle\frac{\partial\rho}{\partial t}+\nabla(\rho\mathbf{v})=$
$\displaystyle 0,$ (3.1) $\displaystyle\frac{\partial\mathbf{B}}{\partial t}=$
$\displaystyle-(\nabla\times\mathbf{E}),$ (3.2)
$\displaystyle(\nabla\times\mathbf{B})=$
$\displaystyle\sigma_{\mathrm{cond}}\left[\mathbf{E}-\frac{e^{2}}{2\pi^{2}\sigma_{\mathrm{cond}}}\mu_{5}\mathbf{B}+(\mathbf{v}\times\mathbf{B})\right],$
(3.3) $\displaystyle\frac{\mathrm{d}\mu_{5}}{\mathrm{d}t}=$
$\displaystyle-\frac{e^{2}}{4\mu_{e}^{2}}\frac{\mathrm{d}h}{\mathrm{d}t},$
(3.4)

where $\rho$ is the density of matter, $\mathbf{v}$ is the velocity of plasma,
$p$ is the pressure, $\sigma_{\mathrm{cond}}$ is the electric conductivity,
$\mu_{5}=(\mu_{e\mathrm{R}}-\mu_{e\mathrm{L}})/2$ is the imbalance between
chiral right and left electrons, $h$ is the density of the magnetic helicity,
$\mu_{e}$ is the mean chemical potential of the electron gas, and $\nu$ is the
coefficient of the viscosity.

Continuity and Navier-Stokes equations are given in Eq. (3.1). In Eq. (3.3),
the anomalous current due to the CME is taken into account in the Maxwell
equation. The displacement current is omitted there. The induction equation,
coming from Eqs. (3.2) and (3.3), is changed due to the CME,

$\frac{\partial\mathbf{B}}{\partial
t}=\nabla\times(\mathbf{v}\times\mathbf{B})+\frac{1}{\sigma_{\mathrm{cond}}}\nabla^{2}\mathbf{B}-\frac{e^{2}}{2\pi^{2}\sigma_{\mathrm{cond}}}\nabla\times(\mu_{5}\mathbf{B}).$
(3.5)

Equation (3.4) results from the Adler-Bell-Jackiw anomaly, which is discussed
below, for massless particles. Note that we suppose that the electron gas is
degenerate in Eq. (3.4). We will change Eq. (3.4) to take into account a
nonzero mass of electrons.

We shall examine which terms are important for the Adler anomaly in a finite
volume, for instance, in NS. In particular, we compute the correction due to
the averaged mass term
$2\mathrm{i}m_{e}\langle\bar{\psi}\gamma_{5}\psi\rangle$ to the Adler-Bell-
Jackiw anomaly in QED known as the nonconservation of the axial current,

$\frac{\partial}{\partial
x^{\mu}}\bar{\psi}\gamma^{\mu}\gamma^{5}\psi=\frac{\partial
j_{\mathrm{R}}^{\mu}}{\partial x^{\mu}}-\frac{\partial
j_{\mathrm{L}}^{\mu}}{\partial
x^{\mu}}=2\mathrm{i}m_{e}\bar{\psi}\gamma_{5}\psi+\frac{2e^{2}}{16\pi^{2}}F_{\mu\nu}\tilde{F}^{\mu\nu},$
(3.6)

where left and right currents are not conserved separately even for massless
fermions due to the triangle anomaly in the presence of an elecromagnetic
field,

$\frac{\partial j_{\mathrm{L,R}}^{\mu}}{\partial
x^{\mu}}=\mp\mathrm{i}m_{e}\bar{\psi}\gamma_{5}\psi\mp\frac{e^{2}}{16\pi^{2}}F_{\mu\nu}\tilde{F}^{\mu\nu}.$
(3.7)

Using the fact that $\gamma^{0}\bm{\gamma}\gamma^{5}=\bm{\Sigma}$ and
averaging the lhs in Eq. (3.6), one obtains

$\int\frac{\mathrm{d}^{3}x}{V}\frac{\partial}{\partial
x^{\mu}}\langle\bar{\psi}\gamma^{\mu}\gamma^{5}\psi\rangle=\frac{{\rm d}}{{\rm
d}t}(n_{\mathrm{R}}-n_{\mathrm{L}})+\frac{1}{V}\oint\mathrm{d}^{2}S(\bm{\mathcal{S}}\cdot{\bf
n}),$ (3.8)

where $\bm{\mathcal{S}}$ is the averaged spin given in Eq. (2.3) for massless
fermions. Averaging the rhs of Eq. (3.6), we get

$\dots=-\frac{1}{V}\oint_{S}(\bm{\mathcal{S}}_{5}\cdot{\bf
n})\mathrm{d}^{2}S+\frac{2\alpha_{\mathrm{em}}}{\pi}\int\frac{\mathrm{d}^{3}x}{V}({\bf
E}\cdot{\bf B}),$ (3.9)

where the first term $\sim\bm{\mathcal{S}}_{5}$ is determined by the averaged
pseudoscalar,

$2\mathrm{i}m_{e}\int\frac{\mathrm{d}^{3}x}{V}\langle\bar{\psi}\gamma_{5}\psi\rangle=-\int\frac{\mathrm{d}^{3}x}{V}(\nabla\cdot\bm{\mathcal{S}}_{5}({\bf
x},t)).$ (3.10)

The second term in Eq. (3.9) gives the dissipation of the magnetic helicity
according to the standard MHD (Priest, 2016),

$2\int\frac{\mathrm{d}^{3}x}{V}({\bf E}\cdot{\bf B})=-\frac{{\rm d}h}{{\rm
d}t}-\oint({\bf n}\cdot\left[{\bf B}A_{0}+{\bf E}\times{\bf
A}\right])\frac{\mathrm{d}^{2}S}{V}.$ (3.11)

Equation (3.10) results from the spin distribution functions in a weakly
inhomogeneous electron-positron plasma:

$\bm{\mathcal{S}}_{5}({\bf
x},t)=-\int\frac{\mathrm{d}^{3}p}{\gamma(2\pi)^{3}}\left({\bf S}^{(e)}({\bf
p},{\bf x},t)-{\bf S}^{(\bar{e})}({\bf p},{\bf
x},t)\right)\left(\frac{2}{3}+\frac{1}{3\gamma}\right).$ (3.12)

Dvornikov and Semikoz (2018) provided the detailed derivation of Eq. (3.12).

Silin (1968) derived the equilibrium part of the total Wigner spin
distribution function of electrons, resulting from the paramagnetic
contribution in a inhomogeneous magnetic field,

${\bf S}^{(e)}_{\mathrm{eq}}(\varepsilon_{p},{\bf
x},t)=\frac{\mu_{\mathrm{B}}{\bf H}({\bf x},t)}{\gamma}\frac{{\rm
d}f^{(e)}_{\mathrm{eq}}(\varepsilon_{p})}{{\rm
d}\varepsilon_{p}},\quad\varepsilon_{p}=\sqrt{p^{2}+m_{e}^{2}}=\gamma m_{e},$
(3.13)

which are used in Eq. (3.12): ${\bf S}^{(e)}({\bf p},{\bf x},t)={\bf
S}^{(e)}_{\mathrm{eq}}(\varepsilon_{p},{\bf x},t)+\delta{\bf S}^{(e)}({\bf
p},{\bf x},t)$.

Basing on Eqs. (3.8) and (3.9), as well as taking into account Eq. (3.11) for
the magnetic helicity density $h(t)=\smallint\tfrac{\mathrm{d}^{3}x}{V}({\bf
A}\cdot{\bf B})$, we obtain the master equation,

$\displaystyle\frac{{\rm d}}{{\rm
d}t}\left(n_{\mathrm{R}}-n_{\mathrm{L}}+\frac{\alpha_{\mathrm{em}}}{\pi}h\right)=-\frac{\alpha_{\mathrm{em}}}{\pi
V}\oint_{S}([{\bf E}\times{\bf A}+A_{0}{\bf B}]\cdot{\bf
n})\mathrm{d}^{2}S-\oint_{S}([\bm{\mathcal{S}}+\bm{\mathcal{S}}_{5}]\cdot{\bf
n})\frac{\mathrm{d}^{2}S}{V}.$ (3.14)

If one neglects the surface terms in a plasma of chiral massless particles, we
obtain the conservation law for the sum of the chiral imbalance,
$n_{\mathrm{R}}-n_{\mathrm{L}}$, and the density of the magnetic helicity $h$,
accounting for the factor $\alpha_{\mathrm{em}}/\pi$,

$\frac{{\rm d}}{{\rm
d}t}\left(n_{\mathrm{R}}-n_{\mathrm{L}}+\frac{\alpha_{\mathrm{em}}}{\pi}h\right)=0.$
(3.15)

Equation (3.15) is crucial for AMHD since it describes the evolution of the
chiral imbalance, $\sim{\rm d}\mu_{5}/{\rm d}t$, in a magnetized plasma
(Fukushima et al., 2008; Boyarsky et al., 2012): a change of the imbalance
results in the production of the magnetic helicity, and vice versa.

Equation (3.14) includes the surface term known in classical MHD. It contains
the electromagnetic fields only. The new quantum correction results from the
sum of the spin terms,
$\bm{\mathcal{S}}_{\mathrm{eff}}=\bm{\mathcal{S}}+\bm{\mathcal{S}}_{5}$.
Below, we shall examine the latter term.

It is worth to be mentioned that the equilibrium distribution function of
spins for the positron gas possesses the same positive sign as that for
electrons in Eq. (3.13),

${\bf S}^{(\bar{e})}_{\mathrm{eq}}(\varepsilon_{p},{\bf
x},t)=\frac{\mu_{\mathrm{B}}{\bf H}({\bf x},t)}{\gamma}\frac{{\rm
d}f^{(\bar{e})}_{\mathrm{eq}}(\varepsilon_{p})}{{\rm d}\varepsilon_{p}}.$
(3.16)

Thus the pseudovector in Eq. (3.12) is given by the difference of the particle
and antiparticle contributions, due to the permutation of the operators
$\hat{d}\hat{d}^{+}\to-\hat{d}^{+}\hat{d}$ while deriving Eq. (3.12),

$\bm{\mathcal{S}}_{5}({\bf x},t)=-\frac{\mu_{\mathrm{B}}m_{e}^{2}{\bf H}({\bf
x},t)}{2\pi^{2}}\int\frac{p^{2}\mathrm{d}p}{\varepsilon_{p}^{2}}\left(\frac{{\rm
d}f^{(e)}_{\mathrm{eq}}}{{\rm d}\varepsilon_{p}}-\frac{{\rm
d}f^{(\bar{e})}_{\mathrm{eq}}}{{\rm
d}\varepsilon_{p}}\right)\left(\frac{2}{3}+\frac{1}{3\gamma}\right).$ (3.17)

If we integrate by parts in Eq. (3.17) and separate the Lande factor $g_{s}=2$
from the Fermi distributions functions
$f^{(e,\bar{e})}(\varepsilon_{p})=g_{s}[\exp(\varepsilon_{p}\mp\mu_{e})/T+1]^{-1}$,
we can rewrite the effective averaged spin
$\bm{\mathcal{S}}_{\mathrm{eff}}=\bm{\mathcal{S}}+\bm{\mathcal{S}}_{5}$
contributing the surface term in Eq. (3.14), as

$\displaystyle\bm{\mathcal{S}}_{\mathrm{eff}}=$ $\displaystyle-\frac{e{\bf
H}}{2\pi^{2}}\int_{0}^{\infty}\mathrm{d}p\left[1-\frac{1}{3\gamma^{2}}\left(\frac{2}{\gamma}+\frac{2}{\gamma^{2}}-1\right)\right]$
$\displaystyle\times\left(\frac{1}{\exp[(\varepsilon_{p}-\mu_{e})/T]+1}-\frac{1}{\exp[(\varepsilon_{p}+\mu_{e})/T]+1}\right).$
(3.18)

One has that $\varepsilon_{p}=\gamma m_{e}\approx m_{e}$ in a nonrelativistic
plasma. Thus, the total spin effect is vanishing,
$\bm{\mathcal{S}}_{\mathrm{eff}}=\bm{\mathcal{S}}+\bm{\mathcal{S}}_{5}\to 0$,
since both spin terms cancel each other. For instance, one gets that
$\bm{\mathcal{S}}=-\bm{\mathcal{S}}_{5}=-2em_{e}v_{\mathrm{F}_{e}}{\bf
B}/4\pi^{2}$, where $v_{\mathrm{F}_{e}}=p_{\mathrm{F}_{e}}/m_{e}\ll 1$ in a
degenerate electron gas, where the positron contribution is absent. The first
correction to the last equality appears owing to the decomposition
$\gamma^{-1}\approx 1-v^{2}/2$. It is quite small,
$\bm{\mathcal{S}}_{\mathrm{eff}}=em_{e}v_{\mathrm{F}_{e}}^{3}{\bf
B}/3\pi^{2}$. This correction is valid for weak magnetic fields, $m_{e}^{2}\gg
p_{\mathrm{F}_{e}}^{2}\gg eB$, where the Wentzel-Kramers-Brillouin (WKB)
approximation with large Landau numbers, $n\gg 1$, used for the calculation of
$\bm{\mathcal{S}}_{5}$, remains correct.

In the case of ultrarelativistic chiral plasma with $\gamma\gg 1$, one gets
from Eq. (3.1) that
$\bm{\mathcal{S}}_{\mathrm{eff}}\approx\bm{\mathcal{S}}=-e\mu_{e}(r,\theta){\bf
B}/2\pi^{2}$; cf. Eq. (2.3). Hence the effect of the magnetization becomes
great under the condition $\mu_{e}(r,\theta)\gg m_{e}$, which can be
implemented, for instance, in the NS core. It should be noted that, here, we
use an inhomogeneous chemical potential $\mu_{e}(r,\theta)$ that corresponds
to a realistic profile of spherically symmetric electron density in NS
(Lattimer and Prakash, 2001),
$n_{e}(r)=n_{\mathrm{core}}Y_{e}[1-r^{2}/R_{\mathrm{NS}}^{2}]$, where
$Y_{e}=0.04$ is the electron abundance and $n_{\mathrm{core}}\simeq
10^{38}\,\text{cm}^{-3}$ is the density in the center of a star.

For example, the anisotropy for the chemical potential results from the
magnetic field correction proportional to the total magnetic field entering
Landau levels,444We take a slightly nonuniform magnetic field, i.e., it can be
uniform at microscopic scales that are smaller than the mean distance between
particles in matter, $L<(n_{e})^{-1/3}$. This requirement is needed to receive
the energy levels in Eq. (2.1). Nevertheless ${\bf B}$ is taken to be
nonuniform at macroscopic length scales similar to $R_{\mathrm{NS}}$.
$B(r,\theta)=\sqrt{B_{p}^{2}(r,\theta)+B_{t}^{2}(r,\theta)}$, in rotating a
star, which is axially symmetric. Here $B_{t,p}$ are the toroidal and poloidal
components of the magnetic field (see Sec. 3.3). This anisotropy is derived
from inverted Eq. (2.8),555One means the cubic Eq. (2.8) written down as
$\mu^{3}_{e}+3eB\mu_{e}/2-3\pi^{2}n_{e}=0$, where $\mu_{e}\equiv
p_{\mathrm{F}_{e}}$. The parameter
$D=q^{2}+p^{3}=(eB)^{3}/8+9\pi^{4}n_{e}^{2}/4>0$ is positive for the Cartan
solution. Thus, we have one real root of this equation given in Eq. (3.19), as
well as two complex self adjoint ones.

$\mu_{e}(r,\theta)=[3\pi^{2}n_{e}(r)]^{1/3}\left[1-\frac{eB(r,\theta)}{2(3\pi^{2}n_{e}(r))^{2/3}}\right].$
(3.19)

Otherwise, the surface integral

$\oint_{S}(\bm{\mathcal{S}}\cdot{\bf
n})\frac{\mathrm{d}^{2}S}{V}=-\frac{e}{2\pi^{2}V}\oint_{S}\mu_{e}(r,\theta)({\bf
B}\cdot{\bf n})\mathrm{d}^{2}S,$ (3.20)

remaining in Eq. (3.14) for NS, is vanishing for the uniform spherically
symmetric $\mu_{e}(r)_{r=R}=\text{const}$ because of the Gauss law,
$\int\mathrm{d}^{3}x(\nabla\cdot{\bf B})=\oint({\bf B}\cdot{\bf
n})\mathrm{d}^{2}S=0$.

###  3.2 Magnetic helicity evolution as the averaged spin flux through the
boundary of a domain

We consider a realistic situation when the chiral imbalance is vanishing,
$n_{\mathrm{R}}-n_{\mathrm{L}}\to 0$, in relativistic plasmas taking into
account the nonzero electron mass, $m_{e}\neq 0$, because of the spin-flip. It
is necessary to reconcile the evolution of the magnetic helicity density in
Eq. (3.11) and statistically averaged Adler anomaly in chiral medium given in
Eq. (3.14). Dvornikov and Semikoz (2015a); Dvornikov (2016b) showed that this
situation happens very soon in the core of a young NS, during $\sim
10^{-12}\,\text{s}$. It takes place even when an initial difference is
positive $n_{\mathrm{R}}(t_{0})-n_{\mathrm{L}}(t_{0})>0$, which can arise in a
protoneutron star due to the direct Urca-process, $p+e_{\mathrm{L}}^{-}\to
n+\nu_{e\mathrm{L}}$. Boyarsky et al. (2012) found the similar decay of the
chiral imbalance $2\mu_{5}=\mu_{\mathrm{R}}-\mu_{\mathrm{L}}\to 0$ owing to
the spin-flip in the cooling universe with the temperatures below $T=10\,{\rm
MeV}$.

Then, at time $t\gg t_{0}$, we should modify the standard MHD Eq. (3.11) due
to Eq. (3.14), accounting for the magnetic flux through the volume surface
weighted by the nonuniform chemical potential $\mu_{e}(r,\theta)$ in Eq.
(3.19) that enters the quantum (magnetization) term in Eq. (3.20),

$\displaystyle\oint\mathrm{d}^{2}S\left(\bm{\mathcal{S}}_{\mathrm{eff}}\cdot{\bf
n}\right)\approx$
$\displaystyle-\frac{e}{2\pi^{2}}\oint_{S}\mu_{e}(r,\theta)({\bf B}\cdot{\bf
n})\mathrm{d}^{2}S$
$\displaystyle=\frac{\alpha_{\mathrm{em}}}{\pi[3\pi^{2}n_{e}(R)]^{1/3}}\oint
B(R,\theta)({\bf B}\cdot{\bf n})\mathrm{d}^{2}S.$ (3.21)

Here the nonuniform electron density
$n_{e}(R)=n_{\mathrm{core}}Y_{e}(1-R^{2}/R^{2}_{\text{NS}})$ should be large
enough to obey the inequality $2eB(R,\theta)\ll[3\pi^{2}n_{e}(R)]^{2/3}$ at
the surface with radius $R<R_{\mathrm{NS}}$ since the decomposition is made
over the small parameter $2eB/\mu_{e}^{2}\ll 1$ in Eq. (2.8). Then, we can
generalize standard Eq. (3.11) due to the Adler-Bell-Jackiw anomaly accounting
for the additional quantum correction in Eq. (3.2),

$\frac{{\rm d}H}{{\rm d}t}=-2\int_{V}\mathrm{d}^{3}x({\bf E}\cdot{\bf
B})-\oint_{S}({\bf n}\cdot[A_{0}{\bf B}+{\bf E}\times{\bf
A}])\mathrm{d}^{2}S+\frac{1}{\mu_{e}(R)}\oint_{S}B(R,\theta)B_{r}(R,\theta)\mathrm{d}^{2}S,$
(3.22)

where $B(R,\theta)=\sqrt{B_{r}^{2}+B_{\theta}^{2}+B_{\varphi}^{2}}$ is the
total magnetic field strength entering Landau levels. We also use a short
notation $\mu_{e}(R)=[3\pi^{2}n_{e}(R)]^{1/3}$.

Priest (2016) claims that the volume term in the lhs in Eq. (3.11) is
negligible at the evolution times smaller than the diffusion one:
$t\ll\tau_{\mathrm{D}}\sim L^{2}\sigma_{\mathrm{cond}}$. Thus the behavior of
the magnetic helicity is driven only by the second term in Eq. (3.22) or the
last term in Eq. (3.11). Schmitt and Shternin (2018) obtained that the
diffusion time is great, $\tau_{\mathrm{D}}\simeq
30\,\text{yr}(L/\text{cm})^{2}$, owing to a big electric conductivity in NS,
$\sigma_{\mathrm{cond}}\sim 10^{9}\,{\rm MeV}$, for $T=10^{8}\,\text{K}$. For
example, the diffusion time is longer than the age of the universe,
$\tau_{\mathrm{D}}\approx 3\times 10^{13}\,\text{yr}\gg
t_{\mathrm{Univ}}=1.4\times 10^{10}\,\text{yr}$, for the maximal length scale
$L=R_{\mathrm{NS}}=10^{6}\,\text{cm}$. Hence for such large scales there is no
a reason to take into account both the magnetic helicity diffusion and the
quantum term in Eq. (3.2) which both could be essential only at times
$t>\tau_{\mathrm{D}}$. However, at small scales $L\ll R_{\mathrm{NS}}$, the
magnetic helicity diffusion time is less than the age of young magnetars $\sim
10^{3}\,\text{yr}$, e.g., for $L=1\,\text{cm}$, $\tau_{\mathrm{D}}\sim
30\,\text{yr}\ll t\sim 10^{3}\,\text{yr}$. Therefore the quantum contribution
to the evolution Eq. (3.22), missed in classical approach (Priest, 2016), can
be essential for small-scale magnetic fields in NS at times
$t>\tau_{\mathrm{D}}$.

###  3.3 Evolution of the magnetic helicity in NS

The study of the magnetic helicity evolution is important for a possible
reconnection of magnetic field lines near the NS surface happening mostly
outside the crust in the NS magnetosphere. This process, in its turn, could
explain gamma or X-ray flares reported by Kaspi and Beloborodov (2017) to take
place in magnetars. However, it is interesting to study also how dissipation
of the magnetic helicity proceeds inside NS below the crust.

Using the gauge $A_{0}=0$ and $(\nabla\cdot{\bf A})=0$ in Eq. (3.11), valid in
classical MHD, and substituting the Ohm law ${\bf E}=-{\bf v}\times{\bf
B}+{\bf j}/\sigma_{\mathrm{cond}}$, one can rederive the result of Priest
(2016),

$\frac{{\rm d}H}{{\rm d}t}=-2\sigma_{\mathrm{cond}}^{-1}\int{\bf j}\cdot{\bf
B}\mathrm{d}^{3}x-\oint_{S}[({\bf B}\cdot{\bf A})({\bf v}\cdot{\bf n})-({\bf
v}\cdot{\bf A})({\bf B}\cdot{\bf n})]\mathrm{d}^{2}S,$ (3.23)

which is generalized in Eq. (3.22) in this gauge,

$\displaystyle\frac{{\rm d}H}{{\rm d}t}=$
$\displaystyle-2\sigma_{\mathrm{cond}}^{-1}\int{\bf j}\cdot{\bf
B}\mathrm{d}^{3}x-\oint_{S}[({\bf B}\cdot{\bf A})({\bf v}\cdot{\bf n})-({\bf
v}\cdot{\bf A})({\bf B}\cdot{\bf n})]\mathrm{d}^{2}S$ (3.24)
$\displaystyle+\frac{1}{\mu_{e}(R)}\oint_{S}B(R,\theta)({\bf B}\cdot{\bf
n})\mathrm{d}^{2}S.$

The last term in the rhs of Eq. (3.24) results from the quantum contribution
of the averaged spin flux through the surface $R_{\text{NS}}>R$. We shall show
below that it should be essential at small scales. Notice that the magnetic
helicity in Eq. (3.24) is conserved, ${\rm d}H/{\rm d}t=0$, inside a closed
volume, where $({\bf v}\cdot{\bf n})=0$ and $({\bf B}\cdot{\bf n})=0$. It
happens when one neglects the volume losses for an ideal plasma, $\sigma_{\rm
cond}\to\infty$. Both quantum and classical surface terms are different from
zero if a magnetic field penetrates the domain volume, i.e. when $({\bf
B}\cdot{\bf n})\neq 0$.

Let us estimate how big the new quantum contribution, i.e. the last term in
Eq. (3.24), is. This term does not explicitly depend on the NS rotation. We
can take the axially symmetric magnetic field consisting of the toroidal and
the quadrupole poloidal fields,

${\bf B}(r,\theta)=B_{p}(r)[\cos 2\theta{\bf e}_{r}+\sin 2\theta{\bf
e}_{\theta}]+B_{\varphi}(r)\cos\theta{\bf e}_{\varphi},$ (3.25)

proposed by Moss et al. (2008). Here the angle $\theta$ is measured from the
NS equator, that corresponds to $\theta=0$. Notice that the magnetic fields
components are nonzero at the NS equator. The structure of this magnetic field
is schematically shown in Fig. 1.

Figure 1: The structure of the magnetic field presented in Eq. (3.25). The
poloidal component of the magnetic field reads $\mathbf{B}_{p}=B_{p}(r)[\cos
2\theta{\bf e}_{r}+\sin 2\theta{\bf e}_{\theta}]$. The toroidal one is
$\mathbf{B}_{t}=B_{\varphi}(r)\cos\theta{\bf e}_{\varphi}$. The figure is
taken from the work by Dvornikov and Semikoz (2018).

The factors $({\bf B}\cdot{\bf n})=B_{r}=B_{p}\cos 2\theta$ at the spherical
surface where ${\bf n}={\bf e}_{r}$, and
$B(R,\theta)=\sqrt{B_{p}^{2}+B_{\varphi}^{2}\cos^{2}\theta}$ should be used in
the last term in Eq. (3.24). Then, one obtains such a surface term in the
form,

$\displaystyle\left(\frac{{\rm d}H}{{\rm d}t}\right)_{\mathrm{quant}}=$
$\displaystyle\frac{1}{\mu_{e}(R)}\oint_{S}B(R,\theta)({\bf B}\cdot{\bf
n})\mathrm{d}^{2}S$ $\displaystyle=-\left(\frac{2\pi
R^{2}B_{p}}{\mu_{e}}\right)\int_{-1}^{1}(2x^{2}-1)\sqrt{B_{p}^{2}+B_{\varphi}^{2}x^{2}}\mathrm{d}x$
$\displaystyle=\left(\frac{2\pi R^{2}B_{p}B_{\varphi}}{\mu_{e}}\right)\times
A\sim\frac{B^{2}R^{2}}{\mu_{e}},$ (3.26)

where $\mathrm{d}^{2}S=2\pi R^{2}\sin\theta\mathrm{d}\theta$. The factor $A$,

$\displaystyle A(B_{p}/B_{t})=$
$\displaystyle-\frac{1}{2}\left(\frac{B_{p}}{B_{\varphi}}\right)^{2}\sqrt{1+\left(\frac{B_{p}}{B_{\varphi}}\right)^{2}}+\left(\frac{B_{p}}{B_{\varphi}}\right)^{2}\left[1+\frac{1}{2}\left(\frac{B_{p}}{B_{\varphi}}\right)^{2}\right]$
$\displaystyle\times\ln\left(\frac{B_{\varphi}}{B_{p}}+\frac{B_{\varphi}}{B_{p}}\sqrt{1+\left(\frac{B_{p}}{B_{\varphi}}\right)^{2}}\right),$
(3.27)

depends on the ratio $B_{p}/B_{t}$. For example, for $B_{p}\sim B_{\varphi}$
one gets $A\approx-0.05$. Thus, last estimate in Eq. (3.3) is valid,
$|(\mathrm{d}H/\mathrm{d}t)_{\mathrm{quant}}|\sim B^{2}R^{2}/\mu_{e}$.

The factor $A$ can be rewritten in the case, when $B_{\varphi}\gg B_{p}$,

$A=A(B_{p}/B_{t})=\left(\frac{B_{p}}{B_{\varphi}}\right)^{2}\left[\ln\left(\frac{2B_{\varphi}}{B_{p}}\right)-\frac{1}{2}\right].$
(3.28)

In the opposite case, when $B_{p}\gg B_{\varphi}$, one gets

$\left(\frac{{\rm d}H}{{\rm d}t}\right)_{\mathrm{quant}}=\frac{4\pi
R^{2}B_{p}^{2}}{3\mu_{e}},$ (3.29)

which can be obtained from Eq. (3.3).

We should compare the result in Eq. (3.3) with the classical surface term,

$\displaystyle\left(\frac{{\rm d}H}{{\rm d}t}\right)_{\mathrm{class}}=$
$\displaystyle-\oint_{S}[({\bf B}\cdot{\bf A})({\bf v}\cdot{\bf n})-({\bf
v}\cdot{\bf A})({\bf B}\cdot{\bf n})]\mathrm{d}^{2}S$
$\displaystyle=\oint(vA_{\varphi})({\bf B}\cdot{\bf
n})\mathrm{d}^{2}S\sim-B^{2}_{p}R^{3}\langle v\rangle,$ (3.30)

where we take the azimuthal rotation velocity ${\bf v}=v{\bf e}_{\varphi}$,
i.e. the first term in Eq. (3.3) is negligible, $({\bf v}\cdot{\bf n})=0$. The
rotation velocity $v=\Omega R\cos\theta$ and $\langle v\rangle\approx\Omega R$
corresponds to the mean velocity after the integration over the polar angle in
Eq. (3.3). Notice that one can estimate the azimuthal potential
$A_{\varphi}\sim-B_{p}R\sin 2\theta$ at the sphere $R<R_{\mathrm{NS}}$ for the
poloidal component in Eq. (3.25)
$B_{\theta}=-r^{-1}\partial_{r}(rA_{\varphi})=B_{p}\sin 2\theta$.

If we compare the classical and the quantum surface terms in the total sum,

$\left(\frac{{\rm d}H}{{\rm d}t}\right)=\left(\frac{{\rm d}H}{{\rm
d}t}\right)_{\mathrm{class}}+\left(\frac{{\rm d}H}{{\rm
d}t}\right)_{\mathrm{quant}},$ (3.31)

we find that the quantum term is dominant only in the corotational reference
frame, $\langle v\rangle-\Omega R=\delta v\ll 1$, namely for
$R<\mu_{e}^{-1}/\delta v$. Using $R=10^{5}\,\text{cm}$ and
$\mu_{e}^{-1}=2\times 10^{-13}\,\text{cm}$ for $\mu_{e}=100\,{\rm MeV}$, one
obtains $\delta v<10^{-18}$. This result correspond to the rigid rotation,
$\partial_{\theta}\Omega=\partial_{r}\Omega=0$, i.e. $\Omega=\text{const}$. In
this situation, $\langle v\rangle-\Omega R\to 0$. Yakovlev and Pethick (2008)
found that the neutron component in NS, which can be superfluid, has some
deviations from the rigid rotation, $\delta v_{n}\neq 0$, contrary to the
proton one, $\delta v_{p}=0$. Thus, our assumption on the absence of any
differential rotation becomes invalid in such NSs.

The result in Eq. (3.3) can be interpreted as an intertwining of the two thin
tubes with magnetic fields having small base areas $S_{p}=\pi R_{p}^{2}$ and
$S_{t}=\pi R_{t}^{2}$. Such tubes are situated at the sphere with radius $R\gg
R_{p,t}$ (Priest, 2016),

$\left(\frac{{\rm d}H}{{\rm
d}t}\right)_{\mathrm{quant}}=\dot{\theta}_{\mathrm{pt}}F_{p}F_{t},$ (3.32)

where $F_{t}=B_{t}S_{t}$ and $F_{p}=B_{p}S_{p}$ are the fluxes of the magnetic
field which tear off the two different toroids resulting from the toroidal and
quadrupole poloidal components in Eq. (3.25). They penetrate the spherical
surface $R<R_{\mathrm{NS}}$ floating up. The parameter

$\dot{\theta}_{\mathrm{pt}}=\frac{A}{\pi^{2}}\times\left(\frac{R}{R_{p}}\right)^{2}\left(\frac{1}{R_{t}^{2}\mu_{e}}\right)$
(3.33)

provides the angular velocity of the twisting of the magnetic loop bases one
around other and causing the interlacing of the flux tubes. For instance, one
can evaluate the parameter in Eq. (3.32) as $\dot{\theta}_{\mathrm{pt}}\sim
10^{7}\times(6A/\pi^{2})\,\text{s}^{-1}$ for $R_{p}=R_{t}=1\,\text{cm}$,
$R=10^{5}\,\text{cm}$. Thus, within the time $t\sim 3\times
10^{-6}\,\text{s}\gg 10^{-12}\,\text{s}$,666We substitute for estimates
$A=-0.05$ for $B_{p}=B_{t}$ in Eq. (3.3) when already
$n_{\mathrm{R}}=n_{\mathrm{L}}$. It means that the CME is irrelevant in NS,
$\mu_{5}=0$. the magnetic helicity evolution in Eq. (3.33) leads to a flux
tangling with the linkage (topology) number
$L_{\mathrm{pt}}=\int\dot{\theta}_{\mathrm{pt}}dt=L_{12}\sim 1$ in the famous
Gauss formula $H=2L_{12}F_{1}F_{2}$ where $L_{12}=L_{\mathrm{pt}}=1$ is
conserved afterwards (Priest, 2016).

###  3.4 Magnetic helicity flow through the equator of a rotating NS

Now we turn to the problem of the magnetic helicity evolution in a rotating NS
accounting for the electroweak interaction between fermions. For this purpose,
we use Eq. (2.34). We mentioned in Sec. 2.3 that the spin-flip rate is huge in
NS. Hence, $\dot{n}_{5}\to 0$ in Eq. (2.34). Using Eq. (2.34), we get that the
chiral imbalance reaches the saturated value,

$n_{5}\to
n_{5}^{(\text{sat})}=\frac{e^{2}}{2\pi^{2}V\Gamma}\int\left[\left(\mathbf{E}\cdot\mathbf{B}\right)-\frac{1}{e}\left(\mathbf{E}\cdot\nabla\times\mathbf{V}_{5}\right)\right]\mathrm{d}^{3}x,$
(3.34)

We shall demonstrate below that we can neglect $n_{5}^{(\text{sat})}$ in an
old star. Thus, the saturated densities of left and right fermions are equal.

If both $n_{5}$ and $\dot{n}_{5}$ vanish in Eq. (2.34), then, taking into
account the fact that

$\frac{\mathrm{d}H}{\mathrm{d}t}=-2\int\left(\mathbf{E}\cdot\mathbf{B}\right)\mathrm{d}^{3}x,$
(3.35)

where

$H=\int\left(\mathbf{A}\cdot\mathbf{B}\right)\mathrm{d}^{3}x,$ (3.36)

is the magnetic helicity, we obtain the contribution of the electroweak
interaction to the evolution of the magnetic helicity in the form,

$\left(\frac{\mathrm{d}H}{\mathrm{d}t}\right)_{\mathrm{EW}}=-2\frac{V_{5}}{e}\int\left(\mathbf{E}\cdot\bm{\omega}\right)\mathrm{d}^{3}x=-2\frac{V_{5}}{e\sigma}\int\left(\nabla\times\mathbf{B}\cdot\bm{\omega}\right)\mathrm{d}^{3}x.$
(3.37)

Here we account for the Maxwell equations and the fact that
$\mathbf{E}=\mathbf{J}/\sigma=(\nabla\times\mathbf{B})/\sigma$, where
$\mathbf{J}$ is the ohmic electric current and $\sigma$ is the conductivity.
Note that the analogous consideration was made in Sec. 3.3.

Equation (3.37) should be included to the contribution of the classical MHD
for the magnetic helicity behavior (see Eq. (3.38)),

$\left(\frac{\mathrm{d}H}{\mathrm{d}t}\right)_{\mathrm{class}}=-\frac{2}{\sigma}\int\left(\mathbf{J}\cdot\mathbf{B}\right)\mathrm{d}^{3}x+2\oint\left[(\mathbf{B}\cdot\mathbf{A})(\mathbf{v}\cdot\mathbf{n})-(\mathbf{v}\cdot\mathbf{A})(\mathbf{B}\cdot\mathbf{n})\right]\mathrm{d}^{2}S,$
(3.38)

where $\mathbf{n}$ is the external normal to the surface of a star. The total
rate of the helicity variation is
$\dot{H}=(\dot{H})_{\mathrm{class}}+(\dot{H})_{\mathrm{EW}}$, where the
electroweak and the classical MHD contributions are present in Eqs. (3.37) and
(3.38). We omit the subscript EW since we are interested mainly in the
$(\dot{H})_{\mathrm{EW}}$ term here.

Equation (3.37) represents the new mechanism for the helicity evolution due to
the electroweak interaction of chiral electrons with an inhomogeneous
background matter. The inhomogeneity of the interaction of chiral fermions is
present in the dependence of
$\mathbf{V}_{\mathrm{L,R}}=V_{\mathrm{L,R}}^{0}\mathbf{v}$ on spatial
coordinates. It can be implemented if we consider a rotating matter with the
velocity $\mathbf{v}(\mathbf{x})=\bm{\omega}\times\mathbf{x}$. The anomalous
contribution to the helicity change in Eq. (3.37) takes place if
$(\nabla\times\mathbf{B})\parallel\bm{\omega}$. It can be the case in a
rotating NS having a toroidal component of the magnetic field.

We suppose that a compact star possesses the dipole configuration of the
magnetic field: the two tori of the toriodal magnetic field $\mathbf{B}_{t}$
and the poloidal field component $\mathbf{B}_{p}$. The directions of the field
in the tori are different in the opposite hemispheres of a star. It is
schematically depicted in Fig. 2. Braithwaite and Nordlund (2006) showed that
a stellar magnetic field, which has only either a toroidal or a poloidal
component, is unstable; cf. Fig. 1.

Figure 2: The schematic structure of the considered stellar magnetic field.
The toroidal field $\mathbf{B}_{t}$ is placed within two blue tori with
opposite directions above and below the equator of a star, which is filled by
the grey color. The poloidal field $\mathbf{B}_{p}$, which can nonzero outside
the star, is depicted by red lines. The fluctuations of the magnetic field are
shown with small green rings. They can exist in both hemispheres of a star.
The direction of the magnetic field $\mathbf{b}$ in such rings coincides with
that for the toroidal component. The figure is taken from the work by
Dvornikov (2020).

Let us assume that the toroidal field in one of the hemispheres of the star
produces magnetic field rings or vortices, which disattach from the
corresponding torus. Andersson et al. (2007) found that certain turbulence
processes, which occur inside some compact rotating stars, can result in the
formation of such rings. These vortices are depicted in Fig. 2 with green
color. We notice that the direction of the magnetic field in a ring coincides
with that in a torus, in which the toroidal component is concentrated. The
electroweak mechanism, given in Eq. (3.37), acts on these vortices.

The described process results in the modification of the magnetic field of a
star. Namely, the magnetic helicity starts to flow through the stellar
equator. Indeed, there are different signs of $\dot{H}$ in opposite
hemispheres since $\mathbf{B}_{t}$, as well as rings, has opposite directions
in the southern and northern hemispheres. Thus, the total helicity is
conserved,
$\dot{H}_{\mathrm{tot}}=\dot{H}_{\mathrm{S}}+\dot{H}_{\mathrm{N}}=0$. Here
$H_{\mathrm{S,N}}$ are the helicities of the southern and northern
hemispheres.

We take that the mean strength of the magnetic field in a ring is $\mathbf{b}$
and the mean width of a flux tube of a vortex is $r$. Assuming that all the
magnetic field in the northern hemisphere modifies into rings and taking into
account the conservation of the magnetic flux, we obtain that
$br^{2}N=B_{t}R_{t}^{2}$, where $N$ is the total number of rings and $R_{t}$
is the torus radius. Thus, we can evaluate $(\nabla\times\mathbf{B})$ in Eq.
(3.37) as

$(\nabla\times\mathbf{B})\sim N\frac{b}{r}\sim\frac{B_{t}R_{t}^{2}}{r^{3}}.$
(3.39)

Let us consider, for instance, the northern hemisphere. Using Eq. (3.37), we
have the rate of the helicity change in the form,

$\dot{H}_{\mathrm{N}}\sim-\frac{4}{3}\pi
B_{t}R_{t}^{2}\omega\frac{V_{5}}{e\sigma}\frac{R^{3}}{r^{3}},$ (3.40)

where $R\sim 10\,\text{km}$ is the radius of NS. The typical time of the
helicity change inside of the hemisphere is

$\tau\sim\frac{H_{\mathrm{N}}}{|\dot{H}_{\mathrm{N}}|}=\frac{3}{4\pi}\frac{eB_{p}\sigma
r^{3}}{\omega V_{5}R}.$ (3.41)

Berger (1999) proposed the alternative definition of the helicity compared to
that in Eq. (3.36): $H=2L\Phi_{1}\Phi_{2}$, where $\Phi_{1,2}$ are the
magnetic fluxes linked and $L=0,\pm 1,\dotsc$ is the linkage number (see also
Sec. 3.3). Such a definition is used in Eq. (3.41). We take that
$H_{\mathrm{N}}\sim B_{t}R_{t}^{2}B_{p}R^{2}$ is the total helicity in the
northern hemisphere in Eq. (3.41).

We apply the mechanism for the helicity change, proposed above, inside NS.
Dvornikov and Semikoz (2015a) obtained that
$V_{5}=G_{\mathrm{F}}n_{n}/2\sqrt{2}=6\,\text{eV}$ in this case. Here
$n_{n}=1.8\times 10^{38}\,\text{cm}^{-3}$ is the density of neutrons in NS.
The possibility to use the chiral phenomena for relativistic electrons in
dense matter of NS is justified by the fact that the Fermi momentum of such
particles $p_{\mathrm{F}e}=(3\pi^{2}n_{e})^{1/3}\sim 10^{2}\,\text{MeV}$ is
much greater than their masses. Here we take that the density of electrons
$n_{e}$ is about 5% of $n_{n}$ inside NS.

We suppose that $B_{p}=10^{12}\,\text{G}$ is the typical magnetic field of a
pulsar, $\omega=10^{3}\,\text{s}^{-1}$ is the angular velocity of a
millisecond pulsar. Schmitt and Shternin (2018) found that the electric
conductivity of the NS matter having the temperature $T\sim 10^{7}\,\text{K}$
is $\sigma=10^{6}\,\text{GeV}$. Gusakov and Dommes (2016) predicted the
existence of the magnetic flux tubes with $r\sim 6\times 10^{-5}\,\text{cm}$
in background matter of certain NSs. We obtain that $\tau=1.3\times
10^{11}\,\text{s}=4\times 10^{3}\,\text{yr}$ if we use the above values in Eq.
(3.41).

We describe the new possibility for the magnetic helicity to flow through the
equator of NS driven by the electroweak interaction of chiral fermions with
the rotating matter. Del Sordo et al. (2013) found that the helicity flux
through the equator is related to the periodic variation of the stellar
magnetic field. For instance, it can be the known solar cycle with the period
of $22\,\text{yr}$. Therefore we can conclude that the obtained $\tau\sim
10^{3}\,\text{yr}$ is related to a periodic variation of the magnetic field in
pulsars. We notice that Contopoulos (2007) observed analogous cycles in
certain NSs with $10^{2}\,\text{yr}<\tau<10^{4}\,\text{yr}$ by studying the
pulsars spin-down. The mechanism predicted in the present work is a possible
explanation of the observations of Contopoulos (2007).

Now, we show that we can omit $n_{5}^{(\text{sat})}$ in Eq. (3.34). It was
mentioned above that the total magnetic helicity of NS is conserved. The
second term in Eq. (3.34),
$\sim\left(\mathbf{E}\cdot\nabla\times\mathbf{V}_{5}\right)$, is important
while turbulent vortices of the magnetic field are produced. Thus we can
compute the contribution to $n_{5}^{(\text{sat})}$ at the beginning of the
process of the helicity change, that is from the first term in the integrand,
$\sim\left(\mathbf{E}\cdot\mathbf{B}\right)$. Accounting for that
$\mathbf{E}=(\nabla\times\mathbf{B})/\sigma$, we get that
$n_{5}^{(\text{sat})}\sim e^{2}B^{2}/2\pi^{2}R\sigma\Gamma$. If one takes the
typical magnetic field of a pulsar $B=10^{12}\,\text{G}$, the radius of NS
$R=10\,\text{km}$, the rate of the spin-flip $\Gamma=10^{11}\,\text{s}^{-1}$,
and the electric conductivity $\sigma=10^{6}\,\text{GeV}$, we obtain that
$n_{5}^{(\text{sat})}\sim 10^{12}\,\text{cm}^{-3}$.

We should compare the value of $n_{5}^{(\text{sat})}$ estimated with the
initial chiral imbalance $n_{5}(0)$ which is produced at the formation of NS.
Dvornikov and Semikoz (2015a) proposed that a seed chiral imbalance can be
created in the parity violating direct Urca processes leading to the washing
out of left electrons from NS. The energy scale of Urca processes is
$\mu_{5}(0)=m_{n}-m_{p}\sim 1\,\text{MeV}$, where
$\mu_{5}(0)=(\mu_{\mathrm{R}}-\mu_{\mathrm{L}})/2=\pi^{2}n_{5}(0)/p_{\mathrm{F}e}^{2}$
and $m_{p,n}$ are the masses of a proton and a neutron. Dvornikov and Semikoz
(2015a); Dvornikov (2016a); Dvornikov et al. (2020) used this value of
$\mu_{5}(0)$ to study the problem of magnetars with help of chiral phenomena.
Supposing that $p_{\mathrm{F}e}\sim 10^{2}\,\text{MeV}$, one obtains that
$n_{5}(0)\sim 10^{33}\,\text{cm}^{-3}$. Therefore, one can see that
$n_{5}^{(\text{sat})}\ll n_{5}(0)$. Hence, we are able to neglect both $n_{5}$
and $\dot{n}_{5}$ in Eq. (2.34) in matter of an old NS.

Nevertheless one can have a backreaction from the magnetic field to the chiral
imbalance. Dvornikov et al. (2020) studied this process recently and found
that there is a spike in the dependence of $n_{5}$ on time associated with the
change of the polarity of a young NS by considering the full set of the AMHD
equations. Concerning the problem discussed in our work, $n_{5}$ can grow
sharply within the time $\tau$ evaluated in Eq. (3.41). However, one needs a
separate study to clarify this issue.

##  4 Conclusion

In the present work, we have studied two different possibilities for the
evolution of the magnetic helicity in a compact star. First, we have derived
the new Eq. (3.14) accounting for the new quantum surface term in Eq. (3.1)
with the spin effects in plasma by averaging the Adler anomaly in Eq. (3.6).
This new term is important for the magnetic helicity evolution at the
spherical surface around a finite volume of a dense NS.

The evolution of the magnetic helicity could potentially cause the the
magnetic field lines reconnection at the surface and result in flares from
outer boundary of a star taking place in the stellar magnetosphere. We did not
solve such a problem in the present work. We are trying just to find how
strong the new magnetization effect should be deeply within NS core where our
approximations are still valid. For this purpose we had to consider small base
areas $L^{2}=(R\Delta\theta)^{2}\ll R^{2}$ at the surface with the radius
$R<R_{\mathrm{NS}}$ for the corresponding thin magnetic tubes intersecting
such a surface for both poloidal and toroidal components in Eq. (3.25). It
happens since both the magnetic helicity diffusion
$-2\int_{V}\mathrm{d}^{3}x({\bf E}\cdot{\bf B})$ and the new quantum term in
Eq. (3.2) are important only at small scales, $L\ll R$, when the evolution
time is greater than a long diffusion time for the high conductivity of matter
in NS, $t>\tau_{\mathrm{D}}=L^{2}\sigma_{\mathrm{cond}}$. Notice that the
contribution of the new term is not compared with the diffusion losses since
we consider above an ideal plasma in the limit
$\sigma_{\mathrm{cond}}\to\infty$.

We find that the inequalities $m_{e}^{2}\ll eB\ll p_{\mathrm{F}_{e}}^{2}$ are
fulfilled in magnetars with strong magnetic fields $B\sim 10^{15}\,{\rm G}$.
Moreover, one has that $p_{\mathrm{F}_{e}}=100\,{\rm MeV}$ within a core of
these NSs with ultrarelativistic electrons. Thus, the CME contribution occurs
small due to a small population of electrons at the main Landau level $n=0$;
cf. Eq. (2.8). Nevertheless, namely these electrons provide the magnetic
helicity diffusion through the new quantum contribution in the evolution Eq.
(3.22).

Note that the WKB approximation, with $n\gg 1$, in Eq. (2.8), when
paramagnetic (spin) contribution is a small correction in the Landau spectrum
Eq. (2.1), simplifies the derivation of the pseudoscalar term
$2\mathrm{i}m_{e}\langle\bar{\psi}\gamma_{5}\psi\rangle=\mu_{\mathrm{B}}^{-1}(\nabla\cdot\bm{\mathcal{S}}_{5})$
made by Dvornikov and Semikoz (2018).

The WKB approximation is invalid in the NS crust, where degenerate electrons
become nonrelativistic, $eB\gg m_{e}^{2}\gg p_{\mathrm{F}_{e}}^{2}$. It means
that they populate only the main Landau level $n=0$. In this situation, one
can calculate the pseudovector $\bm{\mathcal{S}}_{5}$ in such a medium. It is
expected to be comparable with the standard magnetization in Eq. (2.4). This
case should be of special interest since it corresponds to the outer NS
surface where the magnetic helicity evolution can lead to gamma or X-ray
bursts happening in magnetars.

The second task, considered in the present work, is related to the chiral
phenomena in spatially inhomogeneous matter accounting for the electroweak
interaction between chiral electrons and background fermions. In Sec. 2.2, we
have derived the wave equation for chiral electrons electroweakly interacting
a background matter having a nonuniform density and an arbitrary velocity. We
have analyzed this equation basing on the concept of the Berry phase. In Sec.
2.2, we have derived the kinetic equations for left and right particles, as
well as the effective actions which generalize the results of Dvornikov and
Semikoz (2017); Semikoz and Dvornikov (2018).

Then, in Sec. 2.3, we have derived the corrections to the Adler-Bell-Jackiw
anomaly and to the anomalous current from the electroweak interaction of
chiral electrons with inhomogeneous matter. In this situation, we have
considered a particular example of the rotating matter. The obtained
contribution to the anomalous current is consistent with the result of
Dvornikov (2015).

We have applied our results for the description of the evolution of magnetic
fields in dense matter of a compact star in Sec. 3.4. We have obtained the
contribution to the magnetic helicity evolution of a rotating NS due to the
electroweak interaction of chiral fermions with background neutrons by
supposing that the chiral imbalance vanishes in collisions between particles.
This effect generates the magnetic helicity flux through the equator of a
compact star. We have assumed that magnetic vortices in the form of rings are
formed because of the magnetic turbulence in NS. Then, we have computed the
typical time of the change of the magnetic helicity in one of the hemispheres
of a compact star. We have demonstrated that the total magnetic helicity of NS
is constant.

Del Sordo et al. (2013) showed that the flux of the magnetic helicity through
the stellar equator is related to the periodic cycle of the magnetic activity
of a star analogous to the known solar cycle. The typical time, obtained in
Sec. 3.4, is compared to the period of the cyclic electromagnetic activity of
certain pulsars observed by Contopoulos (2007). Therefore, the mechanism
developed in this work is a feasible explanation of the results of Contopoulos
(2007).

## References

  * Andersson et al. (2007) Andersson, N., Sidery, T., & Comer, G. L. (2007). Superfluid neutron star turbulence. Mon. Not. R. Astron. Soc., 381, 747–756. astro-ph/0703257.
  * Armitage et al. (2018) Armitage, N. P., Mele, E. J., & Vishwanath, A. (2018). Weyl and Dirac semimetals in three dimensional solids. Rev. Mod. Phys., 90, 15001. arXiv:1705.01111.
  * Berestetskiĭ et al. (1998) Berestetskiĭ, V. B., Lifshitz, E. M., & Pitaevskiĭ, L. P. (1998). Quantum Electrodynamics (2nd ed.). Oxford, Pergamon Press.
  * Berger (1999) Berger, M. A. (1999). Introduction to magnetic helicity. Plasma Phys. Control. Fusion, 41, B167.
  * Berry (1984) Berry, M. V. (1984). Quantal phase factors accompanying adiabatic changes. Proc. R. Soc. Lond. A, 392:45–57.
  * Braithwaite and Nordlund (2006) Braithwaite, J., & Nordlund, A. (2006). Stable magnetic fields in stellar interiors. Astron. Astrophys., 450, 1077–1095. astro-ph/0510316.
  * Brandenburg et al. (2017) Brandenburg, A., Schober, J., Rogachevskii, I., Kahniashvili, T., Boyarsky, A., Fröhlich, J., Ruchayskiy, O., & Kleeorin, N. (2017). Stable magnetic fields in stellar interiors. Astrophys. J. Lett., 845, L21. arXiv:1707.03385.
  * Boyarsky et al. (2012) Boyarsky, A., Fröhlich, J., & Ruchayskiy, O. (2012). Self-consistent evolution of magnetic fields and chiral asymmetry in the early Universe. Phys. Rev. Lett., 108, 031301. arXiv:1109.3350.
  * Chandrasekhar and Kendall (1957) Chandrasekhar, S., & Kendall, P. C. (1957). On force-free magnetic fields. Astrophys. J., 126, 457–460.
  * Contopoulos (2007) Contopoulos, I. (2007). A note on the cyclic evolution of the pulsar magnetosphere. Astron. Astrophys., 475, 639–642. arXiv:0709.3957.
  * Del Sordo et al. (2013) Del Sordo, F., Guerrero, G., & Brandenburg, A. (2013). Turbulent dynamos with advective magnetic helicity flux. Mon. Not. R. Astron. Soc., 429, 1686–1694. arXiv:1205.3502.
  * Dvornikov (2015) Dvornikov, M. (2015). Galvano-rotational effect induced by electroweak interactions in pulsars. J. Cosmol. Astropart. Phys., 05, 037. arXiv:1503.00608.
  * Dvornikov (2016a) Dvornikov, M. (2016a). Generation of strong magnetic fields in dense quark matter driven by the electroweak interaction of quarks. Nucl. Phys. B, 913, 79–92. arXiv:1608.04946.
  * Dvornikov (2016b) Dvornikov, M. (2016b). Relaxation of the chiral imbalance and the generation of magnetic fields in magnetars. J. Exp. Theor. Phys., 123, 967–978. arXiv:1510.06228.
  * Dvornikov (2018) Dvornikov, M. (2018). Magnetic fields in turbulent quark matter and magnetar bursts. Int. J. Mod. Phys. D, 27, 1750184. arXiv:1612.06540.
  * Dvornikov (2020) Dvornikov, M. (2020). Magnetic helicity in plasma of chiral fermions electroweakly interacting with inhomogeneous matter. Nucl. Phys. B, 955, 115049. arXiv:2005.09358.
  * Dvornikov and Semikoz (2015a) Dvornikov, M., & Semikoz, V. B. (2015a). Magnetic field instability in a neutron star driven by the electroweak electron-nucleon interaction versus the chiral magnetic effect. Phys. Rev. D, 91, 061301. arXiv:1410.6676.
  * Dvornikov and Semikoz (2015b) Dvornikov, M., & Semikoz, V. B. (2015b). Generation of the magnetic helicity in a neutron star driven by the electroweak electron-nucleon interaction. J. Cosmol. Astropart. Phys., 05, 032. arXiv:1503.04162.
  * Dvornikov and Semikoz (2015c) Dvornikov, M., & Semikoz, V. B. (2015c). Energy source for the magnetic field growth in magnetars driven by the electron-nucleon interaction. Phys. Rev. D, 92, 083007. arXiv:1507.03948.
  * Dvornikov and Semikoz (2017) Dvornikov, M. S., & Semikoz, V. B. (2017). Nonconservation of lepton current and asymmetry of relic neutrinos. J. Exp. Theor. Phys., 124, 731–739. arXiv:1603.07946.
  * Dvornikov and Semikoz (2018) Dvornikov, M., & Semikoz, V. B. (2018). Magnetic helicity evolution in a neutron star accounting for the Adler-Bell-Jackiw anomaly. J. Cosmol. Astropart. Phys., 08, 021. arXiv:1805.04910.
  * Dvornikov and Semikoz (2019) Dvornikov, M., & Semikoz, V. B. (2019). Permanent mean spin source of the chiral magnetic effect in neutron stars. J. Cosmol. Astropart. Phys., 06, 053. arXiv:1904.05768.
  * Dvornikov and Studenikin (2002) Dvornikov, M., & Studenikin, A. (2002). Neutrino spin evolution in presence of general external fields. J. High Energy Phys., 09, 016. hep-ph/0202113.
  * Dvornikov et al. (2020) Dvornikov, M., Semikoz, V. B., & Sokoloff, D. D. (2020). Generation of strong magnetic fields in a nascent neutron star accounting for the chiral magnetic effect. Phys. Rev. D, 101, 083009. arXiv:2001.08139.
  * Fukushima et al. (2008) Fukushima, K., Kharzeev, D. E., & Warringa, H. J. (2008). The chiral magnetic effect. Phys. Rev. D, 78, 074033. arXiv:0808.3382.
  * Giovannini and Shaposhnikov (1998) Giovannini, M., & Shaposhnikov, M. E. (1998). Primordial hypermagnetic fields and triangle anomaly. Phys. Rev. D, 57, 2186–2206. hep-ph/9710234.
  * Gusakov and Dommes (2016) Gusakov, M. E., & Dommes, V. A. (2016). Relativistic dynamics of superfluid-superconducting mixtures in the presence of topological defects and an electromagnetic field with application to neutron stars. Phys. Rev. D, 94, 083006. arXiv:1607.01629.
  * Huang (2016) Huang, X.-G. (2016). Simulating chiral magnetic and separation effects with spin-orbit coupled atomic gases. Sci. Rep., 6, 20601. arXiv:1506.03590.
  * Ioffe (2006) Ioffe, B. L. (2006). Axial anomaly: The modern status. Int. J. Mod. Phys. A, 21, 6249–6266. hep-ph/0611026.
  * Kaminski et al. (2016) Kaminski, M., Uhlemann, C. F., Bleicher, M., & Schaner-Bielich, J. (2016). Anomalous hydrodynamics kicks neutron stars. Phys. Lett. B, 760, 170–174. arXiv:1410.3833.
  * Kaspi and Beloborodov (2017) Kaspi, V. M., & Beloborodov, A. M. (2017). Magnetars. Annu. Rev. Astron. Astrophys., 55, 261. arXiv:1703.00068.
  * Kharzeev et al. (2016) Kharzeev, D. E., Liao, J., Voloshin, S. A., & Wang, G. (2016). Chiral magnetic and vortical effects in high-energy nuclear collisions—A status report. Prog. Part. Nucl. Phys., 88, 1–28. arXiv:1511.04050.
  * Landau and Lifshitz (1980) Landau, L. D., & Lifshitz, E. M. (1980). Statistical Physics (3rd ed.) Oxford, Pergamon Press.
  * Lattimer and Prakash (2001) Lattimer, J. M., & Prakash, M. (2001). Neutron star structure and the equation of state. Astrophys. J., 550, 426. astro-ph/0002232.
  * Masada et al. (2018) Masada, Y., Kotake, K., Takiwaki, T., & Yamamoto, N. (2018). Chiral magnetohydrodynamic turbulence in core-collapse supernovae. Phys. Rev. D, 98, 083018. arXiv:1805.10419.
  * Moss et al. (2008) Moss, D., Saar, S. H., & Sokoloff, D. (2008). What can we hope to know about the symmetry of stellar magnetic fields?. Mon. Not. R. Astron. Soc., 388, 416–420.
  * Nunokawa et al. (1997) Nunokawa, H., Semikoz, V. B., Smirnov, A. Yu., & Valle, J. W. F. (1997). Neutrino conversions in a polarized medium. Nucl. Phys. B, 501, 17–40. hep-ph/9701420.
  * Pavlović et al. (2017) Pavlović, P., Leite, N., & Sigl, G. (2017). Chiral magnetohydrodynamic turbulence. Phys. Rev. D, 96, 023504. arXiv:1612.07382.
  * Priest (2016) Priest, E. (2016). MHD structures in three-dimensional reconnection. In W. Gonzales, E. Parker (Eds.), Magnetic Reconnection: Concepts and Applications, Astrophys. Space Sci. Lib. (Vol. 427, pp. 101–142). Cham, Springer.
  * Schmitt and Shternin (2018) Schmitt, A., & Shternin, P. (2018). Reaction rates and transport in neutron stars. In L. Rezzolla, P. Pizzochero, D. Jones, N. Rea, I. Vidaña (Eds.), The Physics and Astrophysics of Neutron Stars, Astrophys. Space Sci. Lib. (Vol. 457, pp. 455–574). Cham, Springer. arXiv:1711.06520.
  * Semikoz and Dvornikov (2018) Semikoz, V. B., & Dvornikov, M. (2018). Generation of the relic neutrino asymmetry in a hot plasma of the early universe. Int. J. Mod. Phys. D, 27, 1841008. arXiv:1712.06565.
  * Semikoz and Valle (1997) Semikoz, V. B., & Valle, J. W. F. (1997). Erratum: Nucleosynthesis constraints on active sterile neutrino conversions in the early universe with random magnetic field. Nucl. Phys. B, 485, 545–547. hep-ph/9607208.
  * Sigl and Leite (2016) Sigl, G., & Leite, N. (2016). Chiral magnetic effect in protoneutron stars and magnetic field spectral evolution. J. Cosmol. Astropart. Phys., 01, 025. arXiv:1507.04983.
  * Silin (1968) Silin, V. P. (1968). Spin waves in non-ferromagnetic metals. In A. I. Akhiezer, V. G. Bary’achtar, S. V. Peletminsky (Eds.), Spin waves. Amsterdam, North-Holland Publishers Co.
  * Silva et al. (1999) Silva, L. O., Bingham, R., Dawson, J. M., Mendonça, J .T., & Shukla, P. K. (1999). Neutrino driven streaming instabilities in a dense plasma. Phys. Rev. Lett., 83, 2703–2706.
  * Son and Yamamoto (2013) Son, D. T., & Yamamoto, N. (2013). Kinetic theory with Berry curvature from quantum field theories. Phys. Rev. D, 87, 085016. arXiv:1210.8158.
  * Vilenkin (1980a) Vilenkin, A. (1980a). Equilibrium parity violating current in a magnetic field. Phys. Rev. D, 22, 3080–3084.
  * Vilenkin (1980b) Vilenkin, A. (1980b). Quantum field theory at finite temperature in a rotating system. Phys. Rev. D, 21, 2260–2269.
  * Vinitskiĭ et al. (1990) Vinitskiĭ, S. I., Derbov, V. L., Dubovik, V. M., Markovski, B. L., & Stepanovskiĭ, Yu. P. (1990). Topological phases in quantum mechanics and polarization optics. Phys.–Usp., 33, 403–428.
  * Yakovlev and Pethick (2008) Yakovlev, D. G., & Pethick, C. J. (2008). Neutron star cooling. Annu. Rev. Astron. Astrophys., 42, 169–210. astro-ph/0402143.
  * Yamamoto (2016) Yamamoto, N. (2016). Chiral transport of neutrinos in supernovae: Neutrino-induced fluid helicity and helical plasma instability. Phys. Rev. D, 93, 065017. arXiv:1511.00933.
  * Zhao and Wang (2019) Zhao, J., & Wang, F. (2019). Experimental searches for the chiral magnetic effect in heavy-ion collisions. Prog. Part. Nucl. Phys., 107, 200–236. arXiv:1906.11413.