Core Module
core
Core lattice structures and cosmology.
FRWUniverse
Bases: Module
FLRW universe parameters in conformal time.
Attributes:
| Name | Type | Description |
|---|---|---|
a |
Array
|
Scale factor (dimensionless, typically normalized to \(a(\tau_0) = 1\)) |
adot |
Array
|
Conformal time derivative \(da/d\tau\) (same units as a/time) |
tau |
Array
|
Conformal time coordinate \(\tau\) |
M_pl |
float
|
Reduced Planck mass in simulation units (sets gravity strength) |
Derived quantities:
- \(H = a'/a\): Conformal Hubble parameter
- \(\rho_{\mathrm{crit}} = 3M_{\mathrm{pl}}^2 H^2\): Critical density
H
property
Compute the conformal Hubble parameter.
Returns:
| Type | Description |
|---|---|
float
|
Value of \(H = a'/a\) for the current universe state. |
rho_crit
property
Compute the critical density.
Returns:
| Type | Description |
|---|---|
float
|
Critical density computed from |
copy()
Create a copy of the universe state.
Returns:
| Type | Description |
|---|---|
|
New |
replace(**kwargs)
Create a new universe with selected fields replaced.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
**kwargs
|
Fields to override (a, adot, tau). |
{}
|
Returns:
| Type | Description |
|---|---|
FRWUniverse
|
New |
Source code in jaxlatt/core/cosmology/frw.py
CoupledLattice
Bases: Module
Combined scalar and gauge field lattice for Abelian Higgs model.
Attributes:
| Name | Type | Description |
|---|---|---|
phi |
Array
|
Complex scalar field with shape |
pi |
Array
|
Conjugate momentum to |
links |
Array
|
U(1) gauge links with shape |
E |
Array
|
Electric field components with shape |
m |
float
|
Scalar mass parameter. |
lambda_ |
float
|
Scalar self-coupling. |
g |
float
|
Gauge coupling. |
dx |
float
|
Lattice spacing. |
size |
tuple[int, int, int]
|
Lattice dimensions |
length |
tuple[float, float, float]
|
Physical box lengths |
volume
property
Physical volume of the simulation box.
dV
property
Volume element (cell volume).
copy()
Create a deep copy of the coupled lattice.
Returns:
| Type | Description |
|---|---|
CoupledLattice
|
New |
Source code in jaxlatt/core/lattice.py
update(phi, pi, links, E)
Create a new CoupledLattice with updated dynamical fields.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
phi
|
Array
|
New scalar field. |
required |
pi
|
Array
|
New conjugate momentum. |
required |
links
|
Array
|
New gauge links. |
required |
E
|
Array
|
New electric field. |
required |
Returns:
| Type | Description |
|---|---|
CoupledLattice
|
New |
Source code in jaxlatt/core/lattice.py
replace(**kwargs)
Create a new lattice with selected attributes replaced.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
**kwargs
|
Field values or parameters to override. |
{}
|
Returns:
| Type | Description |
|---|---|
CoupledLattice
|
New |
Source code in jaxlatt/core/lattice.py
GaugeLattice(size, length, g=1.0, links=None, E=None, a=1.0, H=0.0)
Bases: Module
U(1) gauge fields on a 3D periodic lattice.
Uses compact formulation with link variables \(U_i \in \mathrm{U}(1)\).
Attributes:
| Name | Type | Description |
|---|---|---|
links |
Array
|
Complex link variables |
E |
Array
|
Electric field components |
dx |
float
|
Lattice spacing |
size |
tuple[int, int, int]
|
Lattice dimensions |
length |
tuple[float, float, float]
|
Physical box size |
g |
float
|
Gauge coupling |
a |
Array
|
Scale factor (cosmology) |
H |
Array
|
Conformal Hubble parameter (cosmology) |
Initialize a gauge lattice.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
size
|
tuple[int, int, int]
|
Lattice dimensions |
required |
length
|
float
|
Physical box length (assumed isotropic). |
required |
g
|
float
|
Gauge coupling. |
1.0
|
links
|
Array | None
|
Optional initial link variables. |
None
|
E
|
Array | None
|
Optional initial electric field. |
None
|
a
|
float
|
Cosmological scale factor. |
1.0
|
H
|
float
|
Conformal Hubble parameter. |
0.0
|
Source code in jaxlatt/core/lattice.py
volume
property
Compute the total physical lattice volume.
Returns:
| Type | Description |
|---|---|
float
|
Total box volume. |
dV
property
Compute the volume element for one lattice site.
Returns:
| Type | Description |
|---|---|
float
|
Cell volume |
copy()
Create a deep copy of the gauge lattice state.
Returns:
| Type | Description |
|---|---|
GaugeLattice
|
New |
Source code in jaxlatt/core/lattice.py
update(links, E, a=None, H=None)
Create a new gauge lattice with updated dynamical variables.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
links
|
Array
|
Updated link variables. |
required |
E
|
Array
|
Updated electric field. |
required |
a
|
Array | None
|
Optional updated scale factor. |
None
|
H
|
Array | None
|
Optional updated Hubble parameter. |
None
|
Returns:
| Type | Description |
|---|---|
GaugeLattice
|
New |
Source code in jaxlatt/core/lattice.py
replace(**kwargs)
Create a new lattice with selected dynamic attributes replaced.
Supports replacing links, E, a, and H.
To change static fields (g, size, length) construct a new
GaugeLattice directly.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
**kwargs
|
Dynamic field values to override. |
{}
|
Returns:
| Type | Description |
|---|---|
GaugeLattice
|
New |
Source code in jaxlatt/core/lattice.py
Lattice(size, length, field=None, field_dot=None)
Bases: Module
Represents a scalar field on a periodic lattice (supports 1D, 2D, 3D).
Attributes:
| Name | Type | Description |
|---|---|---|
field |
Array
|
Scalar field values (shape matches size tuple) |
field_dot |
Array
|
Time derivative of the field (same shape) |
dx |
float
|
Lattice spacing (assumed uniform, taken from first dimension) |
size |
tuple[int, ...]
|
Tuple of lattice grid counts per dimension (always a tuple internally) |
length |
tuple[float, ...]
|
Tuple of physical lengths per dimension (always a tuple internally) |
ndim |
int
|
Number of spatial dimensions |
Initialize a lattice with given size and physical length.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
size
|
int | tuple[int, ...]
|
Number of grid points (int for 1D, tuple for 2D) |
required |
length
|
float | tuple[float, ...]
|
Physical length (float for 1D, tuple for 2D) |
required |
field
|
Array | None
|
Initial field values (if None, initialized to zeros) |
None
|
field_dot
|
Array | None
|
Initial time derivative (if None, initialized to zeros) |
None
|
Source code in jaxlatt/core/lattice.py
volume
property
Compute the total physical lattice volume.
Returns:
| Type | Description |
|---|---|
float
|
Product of all box lengths. |
dV
property
Compute the volume element for one grid cell.
Returns:
| Type | Description |
|---|---|
float
|
Physical volume associated with a single lattice site. |
copy()
Create a deep copy of the lattice state.
Uses type(self) so a subclass copies to its own type rather than
being silently downcast to Lattice.
Returns:
| Type | Description |
|---|---|
Lattice
|
New instance of the same class, with independent array buffers. |
Source code in jaxlatt/core/lattice.py
update(field, field_dot)
Create a new lattice with updated field values.
Uses type(self), so a subclass keeps its own type.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
field
|
Array
|
New field values |
required |
field_dot
|
Array
|
New field time derivative |
required |
Returns:
| Type | Description |
|---|---|
Lattice
|
New instance of the same class, with updated values |
Source code in jaxlatt/core/lattice.py
replace(**kwargs)
Create a new lattice with selected dynamic attributes replaced.
Supports the dynamic fields field and field_dot. Static fields
(size, length, dx, ndim) are part of the pytree's
treedef rather than its leaves, so replacing one raises; construct a new
lattice directly instead.
CoupledLattice uses dataclasses.replace for this, which cannot
work here: Lattice takes a custom __init__ while dx and
ndim are init-eligible dataclass fields, so dataclasses.replace
would try to pass them and raise TypeError. GaugeLattice has the
same constraint and resolves it the same way, via eqx.tree_at.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
**kwargs
|
Array
|
Dynamic field values to override. |
{}
|
Returns:
| Type | Description |
|---|---|
Lattice
|
New instance of the same class with the given attributes replaced. |
Source code in jaxlatt/core/lattice.py
ScalarPotential(name, params)
dataclass
Unified potential representation with autodiff-derived forces.
This class encapsulates a potential function \(V(\phi)\) along with its parameters, providing automatic computation of forces via JAX autodiff. The frozen dataclass ensures hashability, enabling efficient JIT compilation caching.
Attributes:
| Name | Type | Description |
|---|---|---|
name |
str
|
Identifier for the potential type (e.g., |
params |
tuple
|
Tuple of parameters (must be hashable for caching) |
Example
__call__(field)
Evaluate potential energy density \(V(\phi)\) at each lattice point.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
field
|
Array
|
Scalar field configuration (real or complex) |
required |
Returns:
| Type | Description |
|---|---|
Array
|
Potential energy density array (same shape as field) |
Source code in jaxlatt/core/potentials.py
total_energy(field)
Compute total potential energy \(\sum V(\phi)\).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
field
|
Array
|
Scalar field configuration |
required |
Returns:
| Type | Description |
|---|---|
Array
|
Total potential energy (scalar) |
force(field)
Compute force \(F = -dV/d\phi\) using autodiff.
For complex fields, computes the Wirtinger derivative \(-dV/d\phi^*\).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
field
|
Array
|
Scalar field configuration |
required |
Returns:
| Type | Description |
|---|---|
Array
|
Force array (same shape as field) |
Source code in jaxlatt/core/potentials.py
quadratic(m=1.0)
staticmethod
Create quadratic potential \(V(\phi) = \frac{1}{2} m^2 |\phi|^2\).
This is the simplest non-trivial potential, commonly used in chaotic inflation models and free field theory.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
m
|
float
|
Mass parameter |
1.0
|
Returns:
| Type | Description |
|---|---|
ScalarPotential
|
|
Source code in jaxlatt/core/potentials.py
quartic(m, lambda_)
staticmethod
Create quartic potential \(V(\phi) = \frac{1}{2} m^2 |\phi|^2 + \frac{1}{4} \lambda |\phi|^4\).
Standard scalar field potential with mass term and self-interaction. Used in Higgs-like models and preheating studies.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
m
|
float
|
Mass parameter |
required |
lambda_
|
float
|
Quartic self-coupling |
required |
Returns:
| Type | Description |
|---|---|
ScalarPotential
|
|
Source code in jaxlatt/core/potentials.py
double_well(mu2=1.0, lam=1.0)
staticmethod
Create double-well potential \(V(\phi) = -\frac{1}{2} \mu^2 \phi^2 + \frac{1}{4} \lambda \phi^4\).
Has minima at \(\phi = \pm\sqrt{\mu^2/\lambda}\), used for symmetry breaking studies.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
mu2
|
float
|
Negative mass squared coefficient |
1.0
|
lam
|
float
|
Quartic coupling |
1.0
|
Returns:
| Type | Description |
|---|---|
ScalarPotential
|
|
Source code in jaxlatt/core/potentials.py
mexican_hat(lam=1.0, v=1.0)
staticmethod
Create Mexican hat potential \(V(\phi) = \lambda (|\phi|^2 - v^2)^2\).
Classic symmetry-breaking potential with circular minimum at \(|\phi| = v\).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
lam
|
float
|
Coupling constant |
1.0
|
v
|
float
|
Vacuum expectation value |
1.0
|
Returns:
| Type | Description |
|---|---|
ScalarPotential
|
|
Source code in jaxlatt/core/potentials.py
from_function(potential_fn, name='custom')
staticmethod
Create ScalarPotential from an arbitrary function.
Note: Custom functions may not cache as efficiently since they are identified by object id rather than parameters.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
potential_fn
|
PotentialFunction
|
Function \(V(\phi) \to\) energy density |
required |
name
|
str
|
Identifier for this potential |
'custom'
|
Returns:
| Type | Description |
|---|---|
ScalarPotential
|
|
Source code in jaxlatt/core/potentials.py
RealScalarLattice(size, length, field=None, field_dot=None)
Bases: Lattice
Real scalar field on a periodic lattice (1D / 2D / 3D).
Semantically equivalent to :class:Lattice, but named for a standalone
real scalar rather than the gauge-coupled sector's field.
Attributes:
| Name | Type | Description |
|---|---|---|
field |
Array
|
chi(x, tau) -- real scalar field values. |
field_dot |
Array
|
chi'(x, tau) -- conformal-time velocity. |
dx |
float
|
Lattice spacing (uniform in all directions). |
size |
tuple[int, ...]
|
Tuple of grid counts per dimension. |
length |
tuple[float, ...]
|
Tuple of physical box lengths. |
ndim |
int
|
Number of spatial dimensions. |
Source code in jaxlatt/core/lattice.py
create_frw_universe(a_initial=1.0, rho_initial=1.0, M_pl=1.0, *, w=1.0 / 3.0)
Initialize a generic FRW universe for a perfect fluid with equation of state \(p = w \rho\).
The first Friedmann equation in conformal time,
fixes the initial \(a'\) from \(\rho\) and \(a\) alone — \(w\) does not enter
the initial conditions. Pass the matching pressure function to
coupled_evolve_expanding to realize the intended dynamics:
- \(w = 1/3\) (radiation): use
make_radiation_pressure - \(w = 0\) (matter): use
make_matter_pressure - arbitrary: use
make_eos_pressure(w)
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
a_initial
|
float
|
Initial scale factor. |
1.0
|
rho_initial
|
float
|
Initial energy density. |
1.0
|
M_pl
|
float
|
Reduced Planck mass. |
1.0
|
w
|
float
|
Equation-of-state parameter \(p/\rho\). Does not affect the returned object; provided for call-site documentation. |
1.0 / 3.0
|
Returns:
| Type | Description |
|---|---|
FRWUniverse
|
Initialized |
Source code in jaxlatt/core/cosmology/frw.py
create_matter_universe(a_initial=1.0, rho_initial=1.0, M_pl=1.0)
Initialize FRW universe in matter-dominated era (\(w = 0\)).
See create_frw_universe for full documentation.
Pass make_matter_pressure to coupled_evolve_expanding for matter dynamics.
Source code in jaxlatt/core/cosmology/frw.py
create_radiation_universe(a_initial=1.0, rho_initial=1.0, M_pl=1.0)
Initialize FRW universe in radiation-dominated era (\(w = 1/3\)).
See create_frw_universe for full documentation.
Pass make_radiation_pressure to coupled_evolve_expanding for radiation dynamics.
Source code in jaxlatt/core/cosmology/frw.py
friedmann_acceleration(rho, p, M_pl, a)
Compute conformal acceleration \(a''\) from Friedmann equation.
In conformal time \(\tau\) (related to cosmic time \(t\) by \(dt = a(\tau)d\tau\)), the second Friedmann equation is:
where:
- \(a'' = d^2a/d\tau^2\)
- \(G = 1/M_{\mathrm{pl}}^2\) (gravitational constant)
- \(\rho\) = energy density
- \(p\) = pressure
Special cases:
- Radiation (\(p = \rho/3\)): \(a'' = 0\) \(\Rightarrow\) \(a(\tau)\) linear in \(\tau\)
- Matter (\(p = 0\)): \(a'' = \frac{4\pi G}{3} a^3 \rho\) \(\Rightarrow\) \(a(\tau) \propto \tau^2\)
References
- Dodelson & Schmidt, "Modern Cosmology" (2nd ed.), Eq. (2.26)
- Mukhanov, "Physical Foundations of Cosmology", Eq. (2.18)
- Baumann, "Cosmology", Eq. (2.35)
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
rho
|
float
|
Total energy density |
required |
p
|
float
|
Total pressure |
required |
M_pl
|
float
|
Reduced Planck mass (default: 1.0 in natural units) |
required |
a
|
float
|
Current scale factor |
required |
Returns:
| Type | Description |
|---|---|
Array
|
Conformal acceleration \(a''\) (second derivative with respect to \(\tau\)) |
Source code in jaxlatt/core/cosmology/frw.py
friedmann_step_leapfrog(universe, rho_func, pressure_func, dt)
Advance scale factor using leapfrog integration (symplectic).
Leapfrog for \(a(\tau)\):
This preserves symplectic structure if rho_func and pressure_func are Hamiltonian.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
universe
|
FRWUniverse
|
Current FRWUniverse state |
required |
rho_func
|
Callable[[float], float]
|
Function computing \(\rho(a)\) |
required |
pressure_func
|
Callable[[float], float]
|
Function computing \(p(a)\) |
required |
dt
|
float
|
Conformal timestep \(d\tau\) |
required |
Returns:
| Type | Description |
|---|---|
FRWUniverse
|
Updated |
Source code in jaxlatt/core/cosmology/frw.py
friedmann_step_predictor_corrector(universe, rho_func, pressure_func, dt)
Advance scale factor by one timestep using predictor-corrector.
This uses a 2nd-order accurate predictor-corrector scheme:
- Predictor: Euler step to estimate \(a(\tau + d\tau)\)
- Corrector: Trapezoidal rule using predicted value
The energy density \(\rho\) and pressure \(p\) are computed from field values via
rho_func and pressure_func, which may depend on \(a\) (for rescaled fields).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
universe
|
FRWUniverse
|
Current FRWUniverse state |
required |
rho_func
|
Callable[[float], float]
|
Function computing total energy density from scale factor.
Signature: |
required |
pressure_func
|
Callable[[float], float]
|
Function computing total pressure from scale factor.
Signature: |
required |
dt
|
float
|
Conformal timestep \(d\tau\) |
required |
Returns:
| Type | Description |
|---|---|
FRWUniverse
|
Updated |
Source code in jaxlatt/core/cosmology/frw.py
friedmann_step_predictor_corrector_from_state(universe, rho_p_callable, dt)
Advance scale factor using predictor-corrector with state-dependent ρ, p.
More general than :func:friedmann_step_predictor_corrector: instead of
separate rho_func(a) and pressure_func(a) callables, it accepts a
single rho_p_callable(universe) → (rho, p). Because the callable
receives the whole universe rather than just a, it can close over
lattice field state, which is what makes self-consistent field-sourced
expansion possible: the fields set ρ and p, which drive a(τ), which in turn
evolves the fields.
friedmann_step_predictor_corrector is a thin wrapper around this
function, so the two share one integrator and cannot drift apart.
The predictor-corrector scheme is identical to
:func:friedmann_step_predictor_corrector; the difference is purely in
how ρ and p are evaluated.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
universe
|
FRWUniverse
|
Current FRWUniverse state. |
required |
rho_p_callable
|
Callable[[FRWUniverse], tuple]
|
Callable |
required |
dt
|
float
|
Conformal timestep. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
Updated |
FRWUniverse
|
class: |
Source code in jaxlatt/core/cosmology/frw.py
make_eos_pressure(w, rho_func)
Create pressure function for equation of state \(p = w\rho\).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
w
|
float
|
Equation of state parameter |
required |
rho_func
|
Callable[[float], float]
|
Energy density function \(\rho(a)\) |
required |
Returns:
| Type | Description |
|---|---|
|
Function \(p(a) = w\rho(a)\) |
Source code in jaxlatt/core/cosmology/frw.py
make_matter_pressure(a=None)
Create matter pressure function \(p = 0\).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
a
|
float
|
Scale factor (unused, for API consistency) |
None
|
Returns:
| Type | Description |
|---|---|
|
Function \(p(a) = 0\) for matter |
Source code in jaxlatt/core/cosmology/frw.py
make_radiation_pressure(rho_initial, a_initial)
Create radiation pressure function \(p = \rho/3\) with \(\rho \propto a^{-4}\).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
rho_initial
|
float
|
Initial energy density |
required |
a_initial
|
float
|
Initial scale factor |
required |
Returns:
| Type | Description |
|---|---|
|
Function \(p(a)\) for radiation |
Source code in jaxlatt/core/cosmology/frw.py
make_radiation_rho(rho_initial, a_initial)
Create a radiation-era density function with \(\rho(a) \propto a^{-4}\).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
rho_initial
|
float
|
Reference density at |
required |
a_initial
|
float
|
Reference scale factor. |
required |
Returns:
| Type | Description |
|---|---|
|
Callable |
Source code in jaxlatt/core/cosmology/frw.py
matter_scaling_check(a_initial, a_final, rho_initial, rho_final)
Check if energy density scales as matter (\(\rho \propto a^{-3}\)).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
a_initial
|
float
|
Initial scale factor. |
required |
a_final
|
float
|
Final scale factor. |
required |
rho_initial
|
float
|
Initial energy density. |
required |
rho_final
|
float
|
Final energy density. |
required |
Returns:
| Type | Description |
|---|---|
float
|
Tuple |
float
|
measured exponent \(n\) in \(\rho \propto a^{-n}\) and |
tuple[float, float]
|
the deviation from \(n = 3\). |
Source code in jaxlatt/core/cosmology/frw.py
radiation_scaling_check(a_initial, a_final, rho_initial, rho_final)
Check if energy density scales as radiation (\(\rho \propto a^{-4}\)).
For pure radiation:
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
a_initial
|
float
|
Initial scale factor. |
required |
a_final
|
float
|
Final scale factor. |
required |
rho_initial
|
float
|
Initial energy density. |
required |
rho_final
|
float
|
Final energy density. |
required |
Returns:
| Type | Description |
|---|---|
float
|
Tuple |
float
|
measured exponent \(n\) in \(\rho \propto a^{-n}\) and |
tuple[float, float]
|
the deviation from \(n = 4\). |
Source code in jaxlatt/core/cosmology/frw.py
create_higgs_vev_lattice(size, length, m=1.0, lambda_=1.0, g=1.0, vev_amplitude=None)
Create a coupled lattice with Higgs field at vacuum expectation value.
For the symmetry breaking potential \(V = -\frac{m^2}{2}|\phi|^2 + \frac{\lambda}{4}|\phi|^4\), the VEV is \(|\phi| = \sqrt{m^2/\lambda}\).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
size
|
tuple[int, int, int]
|
Lattice dimensions |
required |
length
|
float | tuple[float, float, float]
|
Physical box size. |
required |
m
|
float
|
Scalar mass parameter. |
1.0
|
lambda_
|
float
|
Scalar self-coupling. |
1.0
|
g
|
float
|
Gauge coupling. |
1.0
|
vev_amplitude
|
float
|
Optional VEV amplitude. If |
None
|
Returns:
| Type | Description |
|---|---|
CoupledLattice
|
|
Source code in jaxlatt/core/fields.py
create_random_coupled_lattice(key, size, length, m=1.0, lambda_=1.0, g=1.0, amplitude=0.1)
Create a coupled lattice with random initial conditions.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
key
|
PRNGKey
|
Random number generator key. |
required |
size
|
tuple[int, int, int]
|
Lattice dimensions |
required |
length
|
float | tuple[float, float, float]
|
Physical box size. |
required |
m
|
float
|
Scalar mass. |
1.0
|
lambda_
|
float
|
Scalar self-coupling. |
1.0
|
g
|
float
|
Gauge coupling. |
1.0
|
amplitude
|
float
|
Amplitude of random perturbations. |
0.1
|
Returns:
| Type | Description |
|---|---|
CoupledLattice
|
|
Source code in jaxlatt/core/fields.py
create_random_gauge_lattice(key, size, length, g=1.0, amplitude=0.1)
Create a gauge lattice with small random perturbations.
Initializes links with small random phases and electric field with small random values, suitable for testing dynamics.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
key
|
PRNGKey
|
JAX random key |
required |
size
|
tuple[int, int, int]
|
Grid dimensions |
required |
length
|
float
|
Physical box size |
required |
g
|
float
|
Gauge coupling |
1.0
|
amplitude
|
float
|
Amplitude of random fluctuations |
0.1
|
Returns:
| Type | Description |
|---|---|
GaugeLattice
|
GaugeLattice with random initial conditions |
Source code in jaxlatt/core/fields.py
create_random_real_scalar_lattice(key, size, length, amplitude=0.001)
Initialise chi with small random perturbations, chi' = 0.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
key
|
Array
|
JAX PRNG key. |
required |
size
|
tuple[int, ...]
|
Grid dimensions. |
required |
length
|
float
|
Physical side length. |
required |
amplitude
|
float
|
Standard deviation of the Gaussian perturbation. |
0.001
|
Returns:
| Type | Description |
|---|---|
RealScalarLattice
|
class: |
Source code in jaxlatt/core/fields.py
create_vacuum_coupled_lattice(size, length, m=1.0, lambda_=1.0, g=1.0)
Create a coupled lattice in vacuum state.
Vacuum: \(\phi = 0, \pi = 0, U = 1, E = 0\)
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
size
|
tuple[int, int, int]
|
Lattice dimensions |
required |
length
|
float | tuple[float, float, float]
|
Physical box size. |
required |
m
|
float
|
Scalar mass. |
1.0
|
lambda_
|
float
|
Scalar self-coupling. |
1.0
|
g
|
float
|
Gauge coupling. |
1.0
|
Returns:
| Type | Description |
|---|---|
CoupledLattice
|
|
Source code in jaxlatt/core/fields.py
create_vacuum_gauge_lattice(size, length, g=1.0)
Create a gauge lattice in vacuum state (links=1, E=0).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
size
|
tuple[int, int, int]
|
Grid dimensions |
required |
length
|
float
|
Physical box size |
required |
g
|
float
|
Gauge coupling |
1.0
|
Returns:
| Type | Description |
|---|---|
GaugeLattice
|
GaugeLattice in vacuum configuration |
Source code in jaxlatt/core/fields.py
create_vacuum_real_scalar_lattice(size, length)
Initialise chi = 0, chi' = 0 (vacuum) on a periodic lattice.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
size
|
tuple[int, ...]
|
Grid dimensions, e.g. |
required |
length
|
float
|
Physical side length (same for all dimensions). |
required |
Returns:
| Type | Description |
|---|---|
RealScalarLattice
|
Zero-initialised :class: |