- Home
- Library
- Computational Quantum Field Theory
- Learning to Sample Field Configurations
- Normalizing Flows for Fields
Normalizing Flows for Fields
An independent random number is easy to generate. An independent field configuration with the right correlations is harder. A normalizing flow addresses this problem by transforming a simple random vector through an invertible map. The map supplies both a configuration and its probability density, which makes the approximation testable and, with an acceptance step, correctable.
We first construct an exact correlated Gaussian field on two sites. We then replace the linear map by a trained nonlinear map for an interacting field. Independent draws from that map need not have the target distribution: the accompanying calculation includes a striking case in which a flow misses an entire well.
Preparation: Gaussian covariance, changes of variables and a positive Euclidean weight. The examples use dimensionless lattice variables and ordinary Lebesgue measure.
An exact correlated field from two independent normals
Consider a periodic two-site scalar with lattice spacing one and action
The two kinetic terms are both present. Introduce orthonormal coordinates
Their absolute Jacobian is one, and the action becomes
For the free case , , draw independently from the unit normal and set
Then and . Multiplying gives
The neighboring fields are correlated even though the input numbers were independent. The density is
where . This is an exact transport, with no training and no discretization of the field values. It is still a finite two-site regulator.
A map must carry its measure
Let be a differentiable bijection with nonzero Jacobian determinant. Conservation of probability between corresponding volume elements gives
and therefore
The inverse is needed when evaluating the density at an arbitrary field, including a current Markov-chain state that the map did not generate. For a composition , the log determinant is the sum of the layer log determinants, each evaluated at its own input [1, §§III.2–III.6].
An invertible map also carries support. A Gaussian base and a globally invertible map onto give a positive density everywhere. This prevents an exactly excluded open region, but it does not prevent assigning that region an astronomically small probability. Positive support is a mathematical condition; practical exploration is a separate question.
Affine coupling gives a tractable inverse
Split the current coordinates into a frozen part and an updated part . An affine coupling layer is
Once is known, its inverse is explicit:
The Jacobian is triangular,
Conditioner derivatives matter for gradients and the full Jacobian, even though the determinant depends only on its diagonal. Alternating the frozen coordinate allows both coordinates to change. A network inside a conditioner need not itself be invertible; the layer is inverted by holding its conditioner input fixed [1, §IV.3, equations (13)–(16)].
Our interacting map has six alternating layers. Each conditioner has one input, sixteen hidden units and two outputs, with
There are 396 real trainable parameters. A final fixed scaling produces and adds to the determinant. Bounded scales and shifts preserve the explicit inverse. The model does not impose the target's sign symmetry, so an imbalance is observable rather than hidden by construction.
The nonlinear map is a proposal for an interacting field
Set , zero source, and compare . The exact target is . For negative , the two uniform classical minima are
The origin-to-minimum action difference is . The strongest example has a barrier of 12, while the finite-volume target still satisfies and . Reference moments come from the checked two-site scalar calculation, with a new quadrature refinement only for the additional point.
The next article performs the training. Its first reverse-KL fit at produces no positive- configuration in 16,384 fresh model draws. A forward-KL fit produces a positive-sector fraction of . Both maps are invertible and have full support. Their different behavior comes from the learned probability allocation, not from a failure of the change-of-variables formula.
The target and the two learned proposals at fixed two-site volume and . Target curves integrate the checked action over ; proposal histograms use the 16,384 retained independent draws from each delivered map. The strong-barrier reverse fit concentrates in one well. These are model draws, before Metropolis correction.
The companion checks the nonlinear inverse, density identity and full finite-difference Jacobian at fixed nontrivial parameters. Round-trip errors are below and the density identity differs by less than on the tested points. These tests validate the implementation on those inputs; the separate target comparisons assess its learned distribution. Saved parameters can be checked and plotted without retraining.
Summary
A normalizing flow transforms both configurations and volume elements. The Gaussian example supplies an exact correlated field; affine coupling layers preserve an explicit inverse and density in the interacting example. Independent proposal draws are independent under , and become target draws only when or an appropriate correction succeeds. Continue to training against the action to see how the map is fitted and how its failures are measured.
Exercises
1. A nonlinear triangular layer
For independent unit normals , define and . Find the inverse, full Jacobian and normalized density. Are and independent when their covariance vanishes?
Solution
The inverse is , . The forward Jacobian is
Thus
Integrating first gives the unit-normal density of , so the total integral is one. Conditionally, has mean and variance . Its covariance with is zero: the noise term has zero conditional mean and . Nevertheless its conditional law depends on unless . Zero covariance is not independence for this nonlinear distribution.
2. Change the free mass
Repeat the free two-site construction at . Find the site covariance, determinant and normalized density. What is the integral of the expression obtained by omitting the determinant factor?
Solution
The normal modes have variances and . Therefore
The expression integrates to , not one. Dividing by that integral restores the determinant factor and the covariance above. The covariance follows from , not from treating the two correlated site variables as independent normals.
References
- M. S. Albergo et al., “Introduction to Normalizing Flows for Lattice Field Theory,” arXiv:2101.08176v3 (2021). Full text. §§III.2–III.6 derive transformed densities and composition; §IV.3 constructs affine coupling layers. The present action uses the explicitly stated convention.
Scrollable formula. Use Left and Right arrow keys to reveal hidden content.
Scrollable table. Use Left and Right arrow keys to reveal hidden columns.
Scrollable figure. Use Left and Right arrow keys to reveal hidden content.