Self-contained tools and figures to study confinement-like patterns on a lattice: a Gaussian flux tube and a chromo-flux vortex, with diagnostics (curl, divergence, circulation). Use these as unit tests, teaching aids, and quick checks that align with the constructive proof program (BKAR/KP control, reflection positivity, RG contraction).
analysis/
├── ReadMe.md
├── circulation_profile.py # Circulation Γ(R) in world units (+ analytic comparator)
├── field_visualizer.py # CLI: heatmap, quiver, plaquette, polyakov
├── fieldGenerators/
│ ├── Guassian_Field.npz # (typo in name; see note below)
│ ├── generate_gaussian_field.py # builds a flux-tube-like scalar/vector field
│ ├── generate_vortex_field.py # builds a vortex-like chromo-flux field
│ └── vortex_field.npz # saved vortex field
├── report.tex # LaTeX report (compile to report.pdf)
├── report.pdf
└── results/
├── circulation_vs_radius.png
├── flux_tube_heatmap.png
├── quiver_xy_stride2.png
├── vortex_curl_radial.png
├── vortex_curl_xy.png
├── vortex_divergence_xy.png
├── vortex_energy_density_xy.png
└── vortex_streamlines_xy_transposed.png
Name fix (optional)
If present, rename the Gaussian file for consistency:mv analysis/fieldGenerators/Guassian_Field.npz analysis/fieldGenerators/gaussian_field.npz
Gaussian (flux tube)
python fieldGenerators/generate_gaussian_field.py
# writes: fieldGenerators/gaussian_field.npz (rename from Guassian_* if needed)Vortex (circulating chromo-flux)
python fieldGenerators/generate_vortex_field.py
# writes: fieldGenerators/vortex_field.npzFlux-tube heatmap (scalar)
python field_visualizer.py \
--input fieldGenerators/gaussian_field.npz --dataset plaquette \
--mode heatmap --plane xy --t 0 --z 0 \
--outdir results
# output: results/flux_tube_heatmap.pngVortex energy density (scalar)
python field_visualizer.py \
--input fieldGenerators/vortex_field.npz --dataset energy \
--mode heatmap --plane xy --t 0 --z 0 \
--outdir results
# output: results/vortex_energy_density_xy.pngVortex flux quiver (vector)
python field_visualizer.py \
--input fieldGenerators/vortex_field.npz --dataset E \
--mode quiver --plane xy --t 0 --z 0 --stride 2 \
--outdir results
# output: results/quiver_xy_stride2.png (you may rename to vortex_flux_quiver_xy.png)Curl (vortex core signal) → results/vortex_curl_xy.png
python - <<'PY'
import numpy as np, matplotlib.pyplot as plt
d=np.load('fieldGenerators/vortex_field.npz')
Ex=d['E'][0,:,:,0,0]; Ey=d['E'][0,:,:,0,1]
curl = np.gradient(Ey, axis=0) - np.gradient(Ex, axis=1)
plt.figure(figsize=(7,6)); plt.imshow(curl, origin='lower', aspect='auto'); plt.colorbar()
plt.title('Curl (vortex core signal)'); plt.tight_layout()
plt.savefig('results/vortex_curl_xy.png', dpi=160)
PYDivergence (≈0 off-core) → results/vortex_divergence_xy.png
python - <<'PY'
import numpy as np, matplotlib.pyplot as plt
d=np.load('fieldGenerators/vortex_field.npz')
Ex=d['E'][0,:,:,0,0]; Ey=d['E'][0,:,:,0,1]
div = np.gradient(Ex, axis=0) + np.gradient(Ey, axis=1)
plt.figure(figsize=(7,6)); plt.imshow(div, origin='lower', aspect='auto'); plt.colorbar()
plt.title('Divergence (should be ~0 off-core)'); plt.tight_layout()
plt.savefig('results/vortex_divergence_xy.png', dpi=160)
PYStreamlines (correct orientation) → results/vortex_streamlines_xy_transposed.png
python - <<'PY'
import numpy as np, matplotlib.pyplot as plt
d=np.load('fieldGenerators/vortex_field.npz')
Ex = d['E'][0,:,:,0,0].T # transpose for plotting coords
Ey = d['E'][0,:,:,0,1].T
ny, nx = Ex.shape; x=np.arange(nx); y=np.arange(ny)
X,Y = np.meshgrid(x,y)
plt.figure(figsize=(7,6))
plt.streamplot(X,Y,Ex,Ey,density=1.3,arrowsize=1.2)
plt.title('Vortex streamlines (correct orientation)')
plt.tight_layout(); plt.savefig('results/vortex_streamlines_xy_transposed.png', dpi=160)
PYRadial average of curl → results/vortex_curl_radial.png
(Produced by a small snippet in the discussion; optional.)
This script computes the circulation $begin:math:text$\Gamma(R)=\oint \vec E\cdot d\vec\ell$end:math:text$ on concentric rings in
world coordinates using bilinear interpolation, and compares it to the analytic model
$begin:math:text$\Gamma_{\text{model}}(R)=2\pi R f(R)$end:math:text$ for $begin:math:text$ \vec E = f(r)\,\hat e_\phi
- Input:
fieldGenerators/vortex_field.npz - Config inside the script:
SIGMA(should match the sigma used by your vortex generator),
R_MAX,N_THETA(sampling settings). - Output:
results/circulation_vs_radius.png(blue = measured; orange dashed = model)
Run:
python circulation_profile.pyIf your generator used a different σ, edit the
SIGMAconstant near the top of the script before running.
python "analysis/field_visualizer.py" \
--input "analysis/fieldGenerators/gaussian_field.npz" \
--dataset plaquette --mode heatmap --plane xy --t 0 --z 0 \
--outdir "analysis/results"
python "analysis/field_visualizer.py" \
--input "analysis/fieldGenerators/vortex_field.npz" \
--dataset E --mode quiver --plane xy --t 0 --z 0 --stride 2 \
--outdir "analysis/results"- Localization (flux-tube heatmaps) → visual proxy for area-law behavior and a mass gap.
- Topological flow (vortex streamlines, curl/div) → tests correlation structure that BKAR/KP control.
- t-slices → transfer-matrix/reflection-positivity intuition about spectral gaps.
- With real link configs, plaquette and Polyakov maps become quantitative probes of confinement ↔ deconfinement.
Save different slices to different
--outdirs to avoid overwriting plots with the same filename.
cd "analysis"
pdflatex -interaction=nonstopmode -halt-on-error report.tex
pdflatex -interaction=nonstopmode -halt-on-error report.tex
open report.pdf- If you see a path like
.../analysis/analysis/field_visualizer.py, you’re already insideanalysis/. Drop the extraanalysis/in your command. - Streamlines must use the transposed arrays shown above; the non-transposed orientation looks saddle-like.
- Ensure
numpy+matplotlibare installed:pip install numpy matplotlib