# Superconducting Phases in Neutron Star Cores
## Appendix C Weakly Nonlinear Lattice Solution  
We consider a rectangular domain that contains an integer number of fluxtubes, \(N\), with area \(aN\). We have shown in Section 4.3 that the non-superconducting state is linearly unstable for \(a>2\pi/H_{\text{c2}}\), where \(H_{\text{c2}}\) is given by Equation (49). Our goal is to compute weakly nonlinear solutions for \(a=2\pi/H_{\text{c2}}+\delta a\), where \(\delta a\ll 1\). To do so we will roughly follow the same procedure as [PERSON] (1965), except that by working with a finite domain and quasi-periodic boundary conditions we avoid having to manipulate products of infinite series. It is convenient at this point to redefine our length scale, so that the area of the domain is normalized to unity, and remains fixed as the parameter \(a\) is varied. At the same time, we will also rescale \(\mathbf{A}\) so that the boundary conditions have no dependence on \(a\). Under the rescaling \(\mathbf{x}\to(aN)^{1/2}\mathbf{x}\) and \(\mathbf{A}\to(aN)^{-1/2}\mathbf{A}\), the free energy (12) becomes  
\[F[\psi_{\text{P}},\psi_{\text{n}},\mathbf{A}] =\frac{1}{2}(1-|\psi_{\text{P}}|^{2})^{2}+\frac{R^{2}}{2\epsilon }(1-|\psi_{\text{n}}|^{2})^{2}+\frac{\alpha}{e}(1-|\psi_{\text{P}}|^{2})(1-| \psi_{\text{n}}|^{2})\] \[\qquad\qquad+\frac{1}{aN}\big{|}(\boldsymbol{\
abla}-\mathrm{i} \mathbf{A})\psi_{\text{P}}\big{|}^{2}+\frac{1}{eaN}|\boldsymbol{\
abla}\psi_{ \text{n}}|^{2}+\frac{\kappa^{2}}{(aN)^{2}}|\boldsymbol{\
abla}\times\mathbf{A} |^{2}\] \[+\frac{h_{1}}{\epsilon aN}\big{|}(\boldsymbol{\
abla}-\mathrm{i} \mathbf{A})(\psi_{\text{n}}^{*}\psi_{\text{P}})\big{|}^{2}+\frac{(h_{2}-h_{1} )}{2\epsilon aN}\boldsymbol{\
abla}(|\psi_{\text{P}}|^{2})\cdot\boldsymbol{ \
abla}(|\psi_{\text{n}}|^{2})\] \[\qquad\qquad\qquad\qquad\qquad\qquad+\frac{h_{3}}{4 aN}\bigg{(} \big{|}\boldsymbol{\
abla}(|\psi_{\text{P}}|^{2})\big{|}^{2}+\frac{1}{ \epsilon^{2}}\big{|}\boldsymbol{\
abla}(|\psi_{\text{n}}|^{2})\big{|}^{2} \bigg{)}\,. \tag{60}\]  
Our domain now has the dimensions \(\Gamma\times(1/\Gamma)\), say, and we have the (quasi)periodic boundary conditions:  
\[\mathbf{A}(\mathbf{x}+\mathbf{L}) =\mathbf{A}(\mathbf{x})+\pi N\mathbf{e}_{z}\times\mathbf{L}\,, \tag{61}\] \[\psi_{\text{P}}(\mathbf{x}+\mathbf{L}) =\psi_{\text{P}}(\mathbf{x})\exp(\mathrm{i}\pi N\mathbf{e}_{z} \times\mathbf{L}\cdot\mathbf{x})\,,\] (62) \[\psi_{\text{n}}(\mathbf{x}+\mathbf{L}) =\psi_{\text{n}}(\mathbf{x})\,, \tag{63}\]  
where \(\mathbf{L}\) represents either of the translation symmetries \((\Gamma,0)\) or \((0,1/\Gamma)\). The free energy per magnetic flux quantum (in the unscaled units) is  
\[\mathcal{F}(a)=a\overline{F}\,, \tag{64}\]  
where the overbar represents the spatial average, which is equivalent to the area integral over the rescaled rectangular domain. Because the quantity \(a\) now appears only as a coefficient in the free energy, we can directly compute the derivative of \(\mathcal{F}(a)\), which leads to the formula (60). In the rescaled units, the non-superconducting solution has the form \(|\psi_{\text{P}}|=0\), \(|\psi_{\text{n}}|=\sqrt{1+\alpha/R^{2}}\), \(\mathbf{A}=\pi N\mathbf{e}_{z}\times\mathbf{x}\). At the critical point \(a=2\pi/H_{\text{c2}}\), this solution becomes unstable to perturbations \(\delta\psi_{\text{P}}\) that lie in the kernel of the linear operator  
\[\mathcal{L}\equiv(\boldsymbol{\
abla}-\mathrm{i}\pi N\mathbf{e}_{z}\times \mathbf{x})^{2}+2\pi N\,. \tag{65}\]  
These perturbations have the form \(\delta\psi_{\text{P}}=\mathrm{e}^{\mathrm{i}\pi Ny(x+\mathrm{i}y)}\phi(x+ \mathrm{i}y)\), for some function \(\phi\), which must be chosen to match the quasi-periodic boundary condition (62).