Potentials
potentials
Potential functions for scalar field theory.
This module defines various potential functions \(V(\phi)\) and uses JAX's automatic differentiation to compute derivatives \(\frac{\partial V}{\partial \phi}\).
The ScalarPotential class provides a unified interface that:
- Encapsulates potential parameters for hashability (enables JIT caching)
- Provides autodiff-derived force \(F = -\frac{\partial V}{\partial \phi}\) automatically
- Supports both real and complex fields via Wirtinger derivatives
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
|
|