Initial Conditions
Here we explain how to implement the initial conditions for the different matter sectors.
Singlet scalars
Default scalar singlet initialization
The default initialization of scalar singlet fluctuations follows the prescription described in Section Initialization of fluctuations of the scalar-singlet example. If no external spectrum is provided for scalar field i, meaning that ext_PSi is absent or set to none, CosmoLattice samples the field and its conjugate momentum from the default Gaussian vacuum prescription.
For a scalar singlet \(f\), in \(\mathcal{C}\mathtt{osmo}\mathcal{L}\mathtt{attice}\) we introduce by default a continuum spectrum mimics quantum vaccum fluctuations as
In program variables, the initial Fourier modes are built from two independent fields (represeting left- and right-moving waves)
In these expressions, \(\delta \tilde f_{1,2}\) are both complex fields, each with their real and imaginary parts, say \(\delta \tilde f_{\rm R} + i\delta \tilde f_{\rm I}\). At each point \(\tilde{\bf n}\) of the reciprocal lattice, the code draws independent random realizations of the real (\(\delta \tilde f_{\rm R}\)) and imaginary (\(\delta \tilde f_{\rm I}\)) parts of each of the fields \(\delta \tilde f_{1,2}\), from a Gaussian distribution with vanishing mean and variance
Note -. Eq.\(~\)\eqref{eq_ICDefaultScalarVariance} is the expression implemented in the code for simulations in 3-spatial dimensions. In 1- and 2-dimensional spatial simulations, the prefactors are modified as shown in the same function; See Section 7.1 of \(\mathtt{The~Art-II}\) (Ref. 1).
The scalar initializer does the above oeprations through
The mode frequency and the optional UV cutoff entering the fluctuation amplitude are built as
For three-dimensional simulations, the normalization of each real Gaussian component of the Fourier mode is
This normalization multiplies a random Gaussian field,
and the sampled left- and right-moving modes are combined into the field fluctuation as
The conjugate momentum fluctuation uses the same two sampled modes, with the relative phase and Hubble term shown in the scalar-singlet prescription:
After the fluctuations are set, the homogeneous modes supplied by initial_amplitudes and initial_momenta are added in program variables:
External power spectrum for scalar singlet initialization
Scalar singlet fields can be initialized from a user-supplied external power spectrum. For the scalar field with index i, the corresponding input parameter is
ext_PS0 refers to scalar field 0, ext_PS1 to scalar field 1, and so on. If the value is none, CosmoLattice initializes that field with the default scalar prescription. If a file path is supplied, the external spectrum fixes the variance of the initial Fourier modes of that scalar field.
For a scalar singlet field \(f\), the continuum spectrum may be written as
On the lattice, the external spectrum is interpreted through the discrete counterpart of this continuum definition,
PS_type, referred to as PSType internally, selects how this multiplicity factor is treated. PSType = 1 selects Type-I spectra, which use the exact lattice multiplicity \(\#_{R(\tilde{\bf n})}\) and keep \(\Upsilon_{|\tilde{\bf n}|}\) explicitly. PSType = 2 selects Type-II spectra, which use the continuum shell multiplicity \(\#_{R(\tilde{\bf n})}=4\pi|\tilde{\bf n}|^2\), so \(\Upsilon_{|\tilde{\bf n}|}=1\).
In the scalar initializer, a non-empty ext_PSi entry dispatches the corresponding scalar field and its conjugate momentum to the external-spectrum initializer:
Identifying the shell average with the statistical average of the Gaussian realization gives the variances used to initialize each Fourier mode from the external spectrum. In program units,
The two choices of PS_type are implemented by the following normalization factors. For Type-I spectra, the exact lattice multiplicity enters through MomentumMultiplicity:
For Type-II spectra, the continuum shell multiplicity has already been assumed:
CosmoLattice then draws the real and imaginary parts of \(\tilde f(\tilde{\bf n})\) and \(\tilde f'(\tilde{\bf n})\) from Gaussian distributions with zero mean and variance equal to one half of the expressions above. Equivalently, one may view the same initialization as drawing random phases and Rayleigh-distributed amplitudes whose expected square amplitudes are fixed by the supplied spectrum. In the code this is the product of the normalization factor with a random Gaussian field:
Finally, the sampled left- and right-moving Gaussian modes are combined to build the Fourier-space initial field configuration,
and the corresponding conjugate momentum configuration:
The same power-spectrum normalization also applies to any supplied initial spectrum for \(\delta f'\). In that case the spectrum fixes \(\left\langle \delta f'^2 \right\rangle\), with the additional \(a^{2\alpha}\) scaling associated with the \(\alpha\)-time derivative used by CosmoLattice. The convention used to produce the external file should match the value of PS_type in the run that reads it, and momenta in the external file must be expressed in the units expected by the initializer, namely the same units as \(\omega_*\).
Note
Type-I external-spectrum initialization is supported for three-dimensional lattices. For lower-dimensional runs, adapt \(\Upsilon_{|\tilde{\bf n}|}\) according to the dimension \(d\).
Complex scalars
Complex scalars are initialized by the Abelian-sector initializer, even in models with complex scalars but no dynamical U(1) gauge field. There is no independent input flag ICtype_CS. Instead, the complex scalar initialization is selected when the U(1) initial-condition type is RandomWithMatter, or when ICtype_U1 = Default and the model contains at least one complex scalar.
The initializer first samples fluctuations for each complex scalar and then adds the homogeneous values supplied by the model. In input-parameter language these homogeneous values are usually set by the model through initial_amplitudes and initial_momenta, or by model-specific aliases for the complex scalar initial norm and initial momentum norm.
The purpose of this special initialization is to generate charged matter fluctuations without introducing a homogeneous charge density. As in the singlet case, each real component is written as a sum of left- and right-moving waves. For charged fields, however, the left- and right-moving amplitudes of each real component are taken equal, and some phases are constrained. This is the minimal condition used by the code to make the zero mode of the electric charge density vanish before the gauge momenta are solved from Gauss' law.
For a complex scalar written as two real components \(\varphi_0\) and \(\varphi_1\), the Fourier-space fluctuation is built as
The zero-mode electric charge condition is enforced mode by mode through
The conjugate momenta are built from the difference of the two waves and include the Hubble-drag term, in direct analogy with the scalar singlet case,
The corresponding code path is initializeCScalar and addFluctuationsCScalarFromPhases in include/CosmoInterface/initializers/u1initializer.h. The constrained phase choice is implemented as
and the field and momentum modes are then assigned through
Doublet scalars
SU(2) doublet scalars are initialized by the non-Abelian-sector initializer. They do not have an independent run-parameter flag analogous to ICtype_S. When a model contains SU(2) doublets, CosmoLattice initializes the doublet fields first and then uses their charge density to initialize the non-Abelian gauge momenta.
The structure is the same as for the complex scalar initialization, but now the doublet is represented by four real components \(h_a\), with \(a=0,1,2,3\). The homogeneous doublet norm supplied by the model is distributed among the real components by the model definition. Fluctuations are then added component by component,
IC.txt,
The momenta are initialized as
The corresponding code path is initializeSU2Doublet and addFluctuationsSU2DoubletFromPhases in include/CosmoInterface/initializers/su2initializer.h. The constrained right-moving phases are set by
and the doublet field and momentum modes are assigned through
Abelian gauge fields
The Abelian sector is controlled by the input parameter ICtype_U1. If ICtype_U1 = Default, the model chooses the initialization according to its matter content:
| Matter content | Default Abelian IC |
|---|---|
| Complex scalars present | RandomWithMatter |
| No complex scalars, but scalar-U(1) axion couplings present | BunchDavisTransverseU1 |
| Otherwise | PlaneWavesZeroB |
The U(1) initializer implements three choices: RandomWithMatter, PlaneWavesZeroB, and BunchDavisTransverseU1. Other names may be accepted by the parser, such as PlaneWaves, DefectsNetwork, and DefectsWhiteNoise, but they are not dispatched by the U(1) initializer and lead to an error.
Random matter with constrained Abelian gauge momenta
For ICtype_U1 = RandomWithMatter, CosmoLattice first initializes the complex scalar fields as described in Section Complex scalars. If the model also contains U(1) gauge fields, their initial vector potentials are set to zero and their momenta are determined by the lattice Gauss constraint sourced by the matter charge density.
This is the lattice version of the continuum prescription \(A_i(\mathbf{x},\eta_*)=0\), with only the electric field initialized. Since the vector potential vanishes initially, the magnetic energy is initially zero. The electric field is then fixed by
In Fourier space, the code solves
The corresponding code path is initializeRandomWithMatterU1 in include/CosmoInterface/initializers/u1initializer.h:
Transverse plane waves with zero magnetic field
For ICtype_U1 = PlaneWavesZeroB, CosmoLattice generates transverse plane-wave fluctuations for the gauge momentum using two polarizations. The gauge field itself is then set to zero,
The corresponding code path is initializePlaneWavesZeroBU1 in include/CosmoInterface/initializers/u1initializer.h.
Bunch-Davies transverse Abelian fields
When ICtype_U1 = BunchDavisTransverseU1 is selected, CosmoLattice initializes the gauge and electric fields using the Bunch-Davies (BD) vacuum solution. The BD solutions for the chiral modes are given by:
To achieve this, the initialization routine calls BunchDavisTransverseU1 (located in \(\texttt{CosmoInterface/initializers/externalpowerspectruminitializer.h}\)), which executes the following sequence of steps:
-
RGF Initialization: First, it generates Random Gaussian Field fluctuations with a unit variance for both the gauge and electric fields. This is performed in the exact same way as described in External power spectrum for scalar singlet initialization, but applied independently to each spatial component of the vector field.
-
Transverse Projection: A transverse projector is constructed and applied to the generated fluctuations. The discrete lattice transverse projector in momentum space is defined as:
\[ \Pi^{L}_{ij}(\tilde{\mathbf{n}}) = \delta_{ij} - \frac{k_{\text{L},i} k_{\text{L},j}}{k_{\text{L}}^2} \;. \]Physically, the BD vacuum solutions correspond to the chiral basis. To ensure the absence of a longitudinal part in the Cartesian basis (i.e., enforcing \(\nabla \cdot \mathbf{E} = 0\)), we must project out the longitudinal modes. Since the BD amplitudes for both the plus (\(+\)) and minus (\(-\)) chiral polarizations are identical, applying this standard symmetric transverse projector is entirely sufficient. This avoids the need for the chiral projector utilized in Output of Axion-Gauge Interactions.
-
Phase Shift Application: The correct relative phase shift between the gauge field and the electric field is properly established. In complex space, the BD vacuum solution dictates a strict \(\pi/2\) phase difference between the field and its conjugate momentum. Assigning this phase accurately is crucial to eliminate unphysical fluctuations during the subsequent temporal evolution.
-
Amplitude Assignment: Finally, the physical BD amplitudes are assigned accordingly.
In the specific case of the axion-gauge coupling, combining these transverse initial conditions for the Abelian field with a strictly homogeneous initial scalar (axion) field guarantees that the Gauss constraint is satisfied to machine precision at the beginning of the simulation.
Non-Abelian gauge fields
The implemented non-Abelian initialization is tied to the SU(2) doublet sector. The model initializer calls the SU(2) initializer when SU(2) doublets are present. First the doublet matter fluctuations are generated, as described in Section Doublet scalars. Then the SU(2) gauge links and gauge momenta are initialized from the non-Abelian Gauss constraint.
The gauge links are set to the identity, equivalently the gauge field starts from zero. As in the Abelian case, the initial magnetic energy vanishes and only the electric components are initialized. In the continuum this corresponds to solving
The corresponding code path is initializeSU2 in include/CosmoInterface/initializers/su2initializer.h:
There is currently no independent ICtype_SU2 input parameter and no independent non-Abelian vacuum plane-wave initializer in this initialization path.
-
J. Baeza-Ballesteros, D. G. Figueroa, A. Florio, J. Lizarraga, N. Loayza, K. Marschall, T. Opferkuch, B. A. Stefanek, F. TorrentÃ, and A. Urio. The art of simulating the early universe. part ii. non-canonical cases & gravitational waves. JCAP, 06:087, 2026. arXiv:2512.15627, doi:10.1088/1475-7516/2026/06/087. ↩