Gauge Operators
gauge
Gauge field operators for U(1) lattice gauge theory.
Implements:
- Plaquettes and staples
- Magnetic field extraction
- Electric field operations
- Gauge forces and constraints
plaquette(links, i, j)
Compute spatial plaquette \(U_{ij}\) for all lattice sites.
For U(1), this is a complex number with \(|U_{ij}| \leq 1\). In the continuum limit: \(U_{ij} \approx \exp(-i g \, dx^2 F_{ij})\).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
links
|
Array
|
Link variables (3, N, N, N) complex |
required |
i
|
int
|
First spatial direction (0, 1, or 2) - static for JIT |
required |
j
|
int
|
Second spatial direction (0, 1, or 2) - static for JIT |
required |
Returns:
| Type | Description |
|---|---|
Array
|
Plaquette values at all sites (N, N, N) complex |
Source code in jaxlatt/operators/gauge.py
all_plaquettes(links)
Compute all three spatial plaquettes (xy, yz, zx).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
links
|
Array
|
Link variables (3, N, N, N) |
required |
Returns:
| Type | Description |
|---|---|
tuple[Array, Array, Array]
|
Tuple of (U_01, U_12, U_20) plaquettes, each (N, N, N) complex |
Source code in jaxlatt/operators/gauge.py
magnetic_field(links, dx, g)
Compute magnetic field \(B_k\) from plaquettes.
where \(\epsilon_{kij}\) is the Levi-Civita symbol.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
links
|
Array
|
Link variables (3, N, N, N) |
required |
dx
|
float
|
Lattice spacing |
required |
g
|
float
|
Gauge coupling |
required |
Returns:
| Type | Description |
|---|---|
Array
|
Magnetic field components (3, N, N, N) real |
Source code in jaxlatt/operators/gauge.py
staple(links, i)
Compute staple \(S_i(n)\) for link \(i\) at all sites.
The staple is the sum of 4 plaquettes touching link \(U_i(n)\), needed for computing the force \(\partial H / \partial A_i\).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
links
|
Array
|
Link variables (3, N, N, N) |
required |
i
|
int
|
Direction of link - static for JIT |
required |
Returns:
| Type | Description |
|---|---|
Array
|
Staple values at all sites (N, N, N) complex |
Source code in jaxlatt/operators/gauge.py
all_staples(links)
Compute staples for all three link directions.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
links
|
Array
|
Link variables (3, N, N, N) |
required |
Returns:
| Type | Description |
|---|---|
Array
|
Staples for all directions (3, N, N, N) complex |
Source code in jaxlatt/operators/gauge.py
gauge_force(links, dx, g)
Compute force \(F_i = \partial H_\mathrm{mag} / \partial \theta_i\) for the magnetic Hamiltonian.
\(H_\mathrm{mag} = \frac{1}{2}\int B^2 \, dV\) with \(B_k = \operatorname{Im}(U_{ij})/(2g \, dx^2)\), giving
The exact gradient is:
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
links
|
Array
|
Link variables (3, N, N, N) |
required |
dx
|
float
|
Lattice spacing |
required |
g
|
float
|
Gauge coupling |
required |
Returns:
| Type | Description |
|---|---|
Array
|
Force components (3, N, N, N) real |
Source code in jaxlatt/operators/gauge.py
magnetic_energy_density(links, dx, g)
Compute total magnetic energy \(E_B = \frac{1}{2} \int B^2 \, dV\).
On the lattice:
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
links
|
Array
|
Link variables |
required |
dx
|
float
|
Lattice spacing |
required |
g
|
float
|
Gauge coupling |
required |
Returns:
| Type | Description |
|---|---|
Array
|
Total magnetic energy (as JAX scalar) |
Source code in jaxlatt/operators/gauge.py
electric_energy_density(E, dx)
Compute total electric energy \(E_E = \frac{1}{2} \int E^2 \, dV\).
On the lattice:
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
E
|
Array
|
Electric field components (3, N, N, N) |
required |
dx
|
float
|
Lattice spacing |
required |
Returns:
| Type | Description |
|---|---|
Array
|
Total electric energy (as JAX scalar) |
Source code in jaxlatt/operators/gauge.py
divergence_3d(field, dx)
Compute divergence of a 3-component vector field.
Uses backward difference: \((F_i(n) - F_i(n-\hat{i})) / dx\).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
field
|
Array
|
Vector field components (3, N, N, N) |
required |
dx
|
float
|
Lattice spacing |
required |
Returns:
| Type | Description |
|---|---|
Array
|
Divergence at each site (N, N, N) |
Source code in jaxlatt/operators/gauge.py
gauss_constraint(links, E, dx)
Compute Gauss constraint violation \(G(n) = \nabla \cdot E\) for pure gauge (no sources).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
links
|
Array
|
Link variables (not used, kept for interface consistency) |
required |
E
|
Array
|
Electric field (3, N, N, N) |
required |
dx
|
float
|
Lattice spacing |
required |
Returns:
| Type | Description |
|---|---|
Array
|
Gauss violation at each site (N, N, N) |
Source code in jaxlatt/operators/gauge.py
gauss_violation_norm(links, E, dx)
Compute RMS norm of Gauss constraint violation.
Returns \(\sqrt{\langle |\nabla \cdot E|^2 \rangle}\).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
links
|
Array
|
Link variables (not used, kept for interface consistency) |
required |
E
|
Array
|
Electric field (3, N, N, N) |
required |
dx
|
float
|
Lattice spacing |
required |
Returns:
| Type | Description |
|---|---|
Array
|
RMS Gauss violation (scalar) |
Source code in jaxlatt/operators/gauge.py
gauge_energy(links, E, dx, g)
Compute all energy components for pure gauge field.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
links
|
Array
|
Gauge links (3, N, N, N) |
required |
E
|
Array
|
Electric field (3, N, N, N) |
required |
dx
|
float
|
Lattice spacing |
required |
g
|
float
|
Gauge coupling |
required |
Returns:
| Type | Description |
|---|---|
dict
|
Dictionary with JAX scalar 'electric', 'magnetic', and 'total' energies |
Source code in jaxlatt/operators/gauge.py
evolve_links_half_step(links, E, dt)
Evolve gauge links by half time step: \(U o U \exp(i E \, d\tau/2)\).
This is the position update in the leapfrog scheme. Links are normalized to maintain unitarity.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
links
|
Array
|
Gauge links (3, N, N, N) complex |
required |
E
|
Array
|
Electric field (3, N, N, N) real |
required |
dt
|
float
|
Time step |
required |
Returns:
| Type | Description |
|---|---|
Array
|
Updated links (3, N, N, N), normalized to unit modulus |
Source code in jaxlatt/operators/gauge.py
evolve_links_full_step(links, E, dt)
Evolve gauge links by full time step: \(U o U \exp(i E \, d\tau)\).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
links
|
Array
|
Gauge links (3, N, N, N) complex |
required |
E
|
Array
|
Electric field (3, N, N, N) real |
required |
dt
|
float
|
Time step |
required |
Returns:
| Type | Description |
|---|---|
Array
|
Updated links (3, N, N, N), normalized to unit modulus |
Source code in jaxlatt/operators/gauge.py
gauge_force_single_direction(phi, links, direction, g, dx)
Compute force on electric field \(E_i\) including scalar current.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
phi
|
Array
|
Scalar field (N, N, N) |
required |
links
|
Array
|
Gauge links (3, N, N, N) |
required |
direction
|
int
|
Direction (0=x, 1=y, 2=z) — static for JIT |
required |
g
|
float
|
Gauge coupling |
required |
dx
|
float
|
Lattice spacing |
required |
Returns:
| Type | Description |
|---|---|
Array
|
Force on \(E_i\) (real-valued, shape (N, N, N)) |
Source code in jaxlatt/operators/gauge.py
gauge_force_all_directions(phi, links, g, dx)
Compute coupled gauge-force for all three directions (flat spacetime).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
phi
|
Array
|
Scalar field array. |
required |
links
|
Array
|
Gauge links array. |
required |
g
|
float
|
Gauge coupling. |
required |
dx
|
float
|
Lattice spacing. |
required |
Returns:
| Type | Description |
|---|---|
Array
|
Force array of shape |
Source code in jaxlatt/operators/gauge.py
gauge_force_expanding(phi, links, direction, g, dx, a)
Compute force on electric field in one direction for an FRW background.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
phi
|
Array
|
Scalar field |
required |
links
|
Array
|
Gauge links |
required |
direction
|
int
|
Direction (0, 1, 2) — static for JIT |
required |
g
|
float
|
Gauge coupling |
required |
dx
|
float
|
Comoving lattice spacing |
required |
a
|
float
|
Scale factor |
required |
Returns:
| Type | Description |
|---|---|
Array
|
Force on \(E_i\) (shape (N, N, N)) |
Source code in jaxlatt/operators/gauge.py
gauge_force_all_directions_expanding(phi, links, g, dx, a)
Compute coupled gauge-force for all three directions in an FRW background.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
phi
|
Array
|
Scalar field array. |
required |
links
|
Array
|
Gauge links array. |
required |
g
|
float
|
Gauge coupling. |
required |
dx
|
float
|
Comoving lattice spacing. |
required |
a
|
float
|
Scale factor. |
required |
Returns:
| Type | Description |
|---|---|
Array
|
Force array of shape |
Source code in jaxlatt/operators/gauge.py
Coupled Scalar-Gauge Operators
coupled
Coupled scalar-gauge operators for Abelian Higgs model.
Implements gauge-covariant operations for charged scalar fields:
- Covariant derivatives and Laplacian
- Covariant gradient energy
- Scalar forces with gauge coupling
- Charge density and current
- Gauss law with scalar sources
covariant_derivative(phi, links, direction, dx)
Compute covariant derivative \(D_i \phi = (U_i(n) \phi(n+\hat{i}) - \phi(n)) / dx\).
For a charged field, the covariant derivative includes the gauge link to maintain gauge invariance.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
phi
|
Array
|
Complex scalar field (N, N, N) |
required |
links
|
Array
|
Gauge links (3, N, N, N) |
required |
direction
|
int
|
Direction (0=x, 1=y, 2=z) - static for JIT |
required |
dx
|
float
|
Lattice spacing |
required |
Returns:
| Type | Description |
|---|---|
Array
|
\(D_i \phi\): Covariant derivative (N, N, N) |
Source code in jaxlatt/operators/coupled.py
covariant_gradient_squared(phi, links, dx)
Compute \(\Sigma_i |D_i \phi|^2\) at each site.
This is the kinetic energy density for the scalar field in the presence of gauge fields.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
phi
|
Array
|
Complex scalar field (N, N, N) |
required |
links
|
Array
|
Gauge links (3, N, N, N) |
required |
dx
|
float
|
Lattice spacing |
required |
Returns:
| Type | Description |
|---|---|
Array
|
\(|\nabla_\mathrm{cov} \phi|^2\): Covariant gradient squared (N, N, N) |
Source code in jaxlatt/operators/coupled.py
covariant_laplacian(phi, links, dx)
Compute covariant Laplacian \(\Delta_\mathrm{cov} \phi\) for a gauge-coupled scalar field.
This is the gauge-covariant kinetic term in the scalar equation of motion.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
phi
|
Array
|
Complex scalar field (N, N, N) |
required |
links
|
Array
|
Gauge links \(U_i\) (3, N, N, N) |
required |
dx
|
float
|
Lattice spacing |
required |
Returns:
| Type | Description |
|---|---|
Array
|
Covariant Laplacian (N, N, N) |
Source code in jaxlatt/operators/coupled.py
scalar_force(phi, links, m, lambda_, dx)
Compute force on scalar field: \(F_\phi = -\delta H / \delta \phi^*\).
Includes:
- Covariant Laplacian (gauge-covariant kinetic term)
- Mass term
- Self-interaction term
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
phi
|
Array
|
Complex scalar field (N, N, N) |
required |
links
|
Array
|
Gauge links (3, N, N, N) |
required |
m
|
float
|
Mass parameter |
required |
lambda_
|
float
|
Self-coupling |
required |
dx
|
float
|
Lattice spacing |
required |
Returns:
| Type | Description |
|---|---|
Array
|
\(F_\phi\): Force on phi (N, N, N) |
Source code in jaxlatt/operators/coupled.py
scalar_charge_density(phi, pi, g)
Compute scalar field charge density \(\rho = g \operatorname{Im}(\phi^* \pi)\).
This appears as a source in the Gauss law: \(\nabla \cdot E = -g \rho\).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
phi
|
Array
|
Complex scalar field (N, N, N) |
required |
pi
|
Array
|
Conjugate momentum (N, N, N) |
required |
g
|
float
|
Gauge coupling |
required |
Returns:
| Type | Description |
|---|---|
Array
|
\(\rho\): Charge density (N, N, N) |
Source code in jaxlatt/operators/coupled.py
scalar_current_density(phi, links, direction, g, dx)
Compute scalar field current density in direction \(i\).
This is the physical U(1) conserved current (matches \(j_i = g \operatorname{Im}(\phi^* D_i \phi)\) in the continuum limit).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
phi
|
Array
|
Complex scalar field (N, N, N) |
required |
links
|
Array
|
Gauge links (3, N, N, N) |
required |
direction
|
int
|
Direction (0=x, 1=y, 2=z) - static for JIT |
required |
g
|
float
|
Gauge coupling |
required |
dx
|
float
|
Lattice spacing |
required |
Returns:
| Type | Description |
|---|---|
Array
|
\(j_i\): Current density in direction \(i\) (N, N, N) |
Source code in jaxlatt/operators/coupled.py
gauss_constraint_with_source(links, E, phi, pi, dx)
Compute Gauss constraint with scalar field source.
The lattice Hamiltonian uses \(E\) conjugate to the link angle \(\theta_i\) (not the physical gauge field \(A_i = \theta_i / (g \, dx)\)). In this convention the conserved Gauss law is:
This is exact: the scalar-current term in the gauge force is \(\operatorname{Im}(\phi^* U_i \phi_{n+\hat{i}}) / dx^2\), whose lattice divergence is \(\operatorname{Im}(\phi^* \Delta_\mathrm{cov} \phi) / dx\), matching \(d/d\tau[(1/dx) \operatorname{Im}(\phi^* \pi)] = (1/dx) \operatorname{Im}(\phi^* \Delta_\mathrm{cov} \phi)\).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
links
|
Array
|
Gauge links (not used, kept for interface consistency) |
required |
E
|
Array
|
Electric field (3, N, N, N) |
required |
phi
|
Array
|
Complex scalar field (N, N, N) |
required |
pi
|
Array
|
Conjugate momentum (N, N, N) |
required |
dx
|
float
|
Lattice spacing |
required |
Returns:
| Name | Type | Description |
|---|---|---|
G |
Array
|
Gauss constraint violation (N, N, N) |
Source code in jaxlatt/operators/coupled.py
gauss_violation_norm_with_source(links, E, phi, pi, dx)
Compute RMS norm of Gauss constraint violation.
Returns \(\sqrt{\langle |\nabla \cdot E + \operatorname{Im}(\phi^* \pi)/dx|^2 \rangle}\).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
links
|
Array
|
Gauge links (not used, kept for interface consistency) |
required |
E
|
Array
|
Electric field (3, N, N, N) |
required |
phi
|
Array
|
Complex scalar field (N, N, N) |
required |
pi
|
Array
|
Conjugate momentum (N, N, N) |
required |
dx
|
float
|
Lattice spacing |
required |
Returns:
| Type | Description |
|---|---|
Array
|
\(\|G\|_2\): RMS Gauss violation (scalar) |
Source code in jaxlatt/operators/coupled.py
coupled_energy(phi, pi, links, E, dx, m, lambda_, g)
Compute total energy of coupled scalar-gauge system.
where the terms are scalar kinetic, scalar gradient, scalar potential, electric energy, and magnetic energy respectively.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
phi
|
Array
|
Scalar field (N, N, N) |
required |
pi
|
Array
|
Conjugate momentum (N, N, N) |
required |
links
|
Array
|
Gauge links (3, N, N, N) |
required |
E
|
Array
|
Electric field (3, N, N, N) |
required |
dx
|
float
|
Lattice spacing |
required |
m
|
float
|
Scalar mass |
required |
lambda_
|
float
|
Self-coupling |
required |
g
|
float
|
Gauge coupling |
required |
Returns:
| Type | Description |
|---|---|
dict
|
dict with JAX scalar energy components and total |