Skip to content

Units & Conventions

JaxLatt uses natural units throughout, setting \(\hbar = c = 1\). This means all quantities are expressed in terms of a single dimension—energy—and lengths, times, and masses share a common scale.

Physical Scales

In natural units, the key physical scales are:

Quantity Dimension Relation
Length \([E^{-1}]\) \(\ell \sim 1/m\)
Time \([E^{-1}]\) \(t \sim 1/m\)
Mass \([E]\) \(m\)

Here \(m\) denotes the relevant mass parameter (e.g., the scalar field mass in a quadratic potential).

Lattice Definitions

The code defines a discrete lattice with:

  • size: Number of grid points in each dimension, e.g., (128, 128, 128)
  • length: Physical extent of the simulation box in natural units, e.g., (10.0, 10.0, 10.0)
  • dx: Lattice spacing, computed as dx = length / size
  • dV: Volume element per grid cell, dV = dx^d where \(d\) is the number of spatial dimensions

Spatial Derivatives

All spatial derivatives are computed using finite differences scaled by dx:

  • Laplacian (second-order central difference):
\[ \nabla^2 \phi = \sum_i \frac{\phi(n+\hat{i}) + \phi(n-\hat{i}) - 2\phi(n)}{dx^2} \]
  • Gradient (central difference):
\[ \partial_i \phi = \frac{\phi(n+\hat{i}) - \phi(n-\hat{i})}{2\, dx} \]

Resolution Requirements

For accurate simulations, two conditions must be satisfied:

  1. UV cutoff: The lattice spacing must resolve the shortest physical scale: \(m \cdot dx \ll 1\)
  2. IR cutoff: The box must be larger than the longest physical scale: \(L \gg 1/m\)

In practice, choosing \(m \cdot dx \lesssim 0.1\) and \(m \cdot L \gtrsim 10\) provides good accuracy.

Computing Observables

Energy Densities

The total energy density is a sum of kinetic, gradient, and potential contributions:

\[\rho = \rho_{\rm kin} + \rho_{\rm grad} + \rho_{\rm pot}\]

Each component is computed pointwise on the lattice:

Component Expression Code
Kinetic \(\frac{1}{2} \dot{\phi}^2\) 0.5 * velocity**2
Gradient \(\frac{1}{2}\nabla\phi^2\)
Potential \(V(\phi)\) potential.V(field)

Volume Averages

To obtain spatially-averaged quantities, sum over all lattice sites and divide by the total number of points:

\[\langle \rho \rangle = \frac{1}{N} \sum_n \rho(n)\]

where \(N = \prod_i \text{size}_i\) is the total number of grid points.

Total Energy

The total energy in the simulation box is:

\[E_{\rm tot} = \sum_n \rho(n) \cdot dV = \langle \rho \rangle \cdot V\]

where \(V = \prod_i \text{length}_i\) is the physical volume of the box.

Power Spectra

For Fourier-space observables, the code uses the discrete wavenumbers:

\[k_i = \frac{2\pi n_i}{L_i}, \quad n_i = 0, 1, \ldots, N_i - 1\]

The power spectrum \(P(k)\) is computed by binning \(|\tilde{\phi}(k)|^2\) in spherical shells of radius \(|k|\).

Mass and Potential Parameters

Masses enter through the scalar potential. For example:

  • Quadratic potential: \(V(\phi) = \frac{1}{2} m^2 |\phi|^2\)
  • Quartic potential: \(V(\phi) = \frac{1}{2} m^2 |\phi|^2 + \frac{1}{4} \lambda |\phi|^4\)

The mass parameter \(m\) has dimensions of energy in natural units. To ensure a well-resolved simulation, the lattice spacing should satisfy \(m \cdot dx \ll 1\).

Cosmological Simulations

For expanding universe simulations, the code uses conformal time \(\tau\), related to physical time by \(dt = a(\tau) d\tau\). The reduced Planck mass \(M_{\rm pl}\) sets the gravitational scale, with a default value of \(M_{\rm pl} = 1\).