bijx.lattice.gauge

Gauge field theory utilities.

This module provides computational tools for SU(N) gauge theories on discrete lattices with periodic boundary conditions.

Functions

apply_gauge_sym(lat, gs)

Apply gauge transformation to lattice gauge field configuration.

flip_axis(lat, axis)

Apply lattice reflection transformation along specified axis.

rotate_lat(lat[, ax0, ax1])

Apply 90-degree rotation in the plane spanned by two spatial axes.

swap_axes(lat[, ax0, ax1])

Apply lattice coordinate transformation swapping two spatial axes.

wilson_action(lat, beta)

Compute Wilson gauge action for lattice gauge theory.

wilson_log_prob(lat, beta)

Compute log probability under Wilson gauge action.

bijx.lattice.gauge.swap_axes(lat, ax0=0, ax1=1)[source]

Apply lattice coordinate transformation swapping two spatial axes.

Performs a coordinate swap transformation on gauge field configurations, properly handling both the spatial coordinate permutation and the corresponding gauge field index transformation.

Parameters:
  • lat – Gauge field configuration of shape \((L_0, ..., L_{d-1}, d, N, N)\) where the last three dimensions are (direction, matrix_row, matrix_col).

  • ax0 – First spatial axis to swap (default: 0).

  • ax1 – Second spatial axis to swap (default: 1).

Returns:

Transformed gauge field configuration with swapped coordinates and corresponding gauge field indices.

Note

This is part of the discrete symmetry group of the lattice, preserving the gauge action under coordinate transformations.

bijx.lattice.gauge.flip_axis(lat, axis)[source]

Apply lattice reflection transformation along specified axis.

Performs a parity transformation (reflection) along one spatial axis, properly handling the gauge field transformation under coordinate inversion. Under reflection \(x_\mu \to -x_\mu\), gauge links transform as: \(U_\mu(x) \to U_\mu^\dagger(x - \hat{\mu})\)

This ensures gauge invariance is preserved under the reflection symmetry.

Parameters:
  • lat – Gauge field configuration of shape \((L_0, ..., L_{d-1}, d, N, N)\).

  • axis (int) – Spatial axis along which to apply the reflection.

Returns:

Reflected gauge field configuration with proper gauge field transformation applied.

Example

>>> # Apply reflection symmetry to 2D gauge field
>>> lat_reflected = flip_axis(lat, axis=0)
>>> # Wilson action should be preserved
>>> S_orig = wilson_action(lat, beta=1.0)
>>> S_refl = wilson_action(lat_reflected, beta=1.0)
>>> jnp.allclose(S_orig, S_refl)
Array(True, dtype=bool)
bijx.lattice.gauge.rotate_lat(lat, ax0=0, ax1=1)[source]

Apply 90-degree rotation in the plane spanned by two spatial axes.

Performs a discrete rotation transformation by 90 degrees in the plane defined by axes \((ax0, ax1)\). This combines a coordinate swap followed by a reflection to achieve the rotation.

The transformation maps \((x_{ax0}, x_{ax1}) \to (-x_{ax1}, x_{ax0})\), implementing a counterclockwise rotation by 90 degrees.

Parameters:
  • lat – Gauge field configuration of shape \((L_0, ..., L_{d-1}, d, N, N)\).

  • ax0 – First axis defining the rotation plane.

  • ax1 – Second axis defining the rotation plane.

Returns:

Rotated gauge field configuration with proper gauge field transformations applied.

Example

>>> # Four 90-degree rotations should return to original
>>> lat_orig = lat
>>> for _ in range(4):
...     lat = rotate_lat(lat, 0, 1)
>>> jnp.allclose(lat, lat_orig)
Array(True, dtype=bool)
bijx.lattice.gauge.apply_gauge_sym(lat, gs)[source]

Apply gauge transformation to lattice gauge field configuration.

Performs a local SU(N) gauge transformation on the gauge field configuration. Under a gauge transformation \(g(x) \in SU(N)\), gauge links transform as: \(U_\mu(x) \to g(x) U_\mu(x) g^\dagger(x + \hat{\mu})\)

Parameters:
  • lat – Gauge field configuration of shape \((L_0, ..., L_{d-1}, d, N, N)\).

  • gs – Gauge transformation matrices of shape \((L_0, ..., L_{d-1}, N, N)\).

Returns:

Gauge-transformed field configuration with the same shape as input.

Example

>>> # Gauge transformation preserves Wilson action
>>> S_orig = wilson_action(lat, beta=1.0)
>>> lat_transformed = apply_gauge_sym(lat, gauge_matrices)
>>> S_transformed = wilson_action(lat_transformed, beta=1.0)
>>> jnp.allclose(S_orig, S_transformed)
Array(True, dtype=bool)
bijx.lattice.gauge.wilson_log_prob(lat, beta)[source]

Compute log probability under Wilson gauge action.

Evaluates the Wilson gauge action for SU(N) lattice gauge theory:

\[\log P[U] = \frac{\beta}{N} \sum_{x,\mu<\nu} \text{Re} \text{Tr}[U_{\mu\nu}(x)]\]

where \(U_{\mu\nu}(x)\) is the elementary plaquette:

\[U_{\mu\nu}(x) = U_\mu(x) U_\nu(x+\hat{\mu}) U_\mu^\dagger(x+\hat{\nu}) U_\nu^\dagger(x)\]
Parameters:
  • lat (Array) – Gauge field configuration with shape \((L_0, ..., L_{d-1}, d, N, N)\).

  • beta (float) – Inverse coupling constant \(\beta=2N/g^2\) where \(g\) is the gauge coupling.

Return type:

Array

Returns:

Log probability for each configuration in the batch, with shape matching the leading (batch) dimensions of the input.

Example

>>> # Single 4x4 SU(2) configuration
>>> lat = jax.random.normal(key, (4, 4, 2, 2, 2))
>>> # Ensure SU(2) matrices (simplified for example)
>>> log_prob = wilson_log_prob(lat, beta=2.4)
>>> log_prob.shape
()
bijx.lattice.gauge.wilson_action(lat, beta)[source]

Compute Wilson gauge action for lattice gauge theory.

Evaluates the Wilson action \(S_W[U] = -\log P[U]\) where \(P[U]\) is the probability weight from wilson_log_prob().

Parameters:
  • lat (Array) – Gauge field configuration (see wilson_log_prob()).

  • beta (float) – Inverse coupling constant.

Return type:

Array

Returns:

Wilson action values with shape matching the batch dimensions.

Note

This is simply the negative of wilson_log_prob(), following the convention \(\text{action} = -\log(\text{probability})\).

Example

>>> action = wilson_action(lat, beta=2.4)
>>> # Action increases with disorder (larger beta favors order)
>>> log_prob = wilson_log_prob(lat, beta=2.4)
>>> jnp.allclose(action, -log_prob)
Array(True, dtype=bool)