Skip to content

reeveskeefe/massgap-field-analyzer-4D

Repository files navigation

Lattuce_Guage — Analysis & Field Visualizations

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).


Directory layout

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

Quickstart (run from analysis/)

1) Generate fields (skip if the .npz files already exist)

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.npz

2) Visualize with field_visualizer.py

Flux-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.png

Vortex 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.png

Vortex 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)

Vortex diagnostics (scripts/snippets that produced the figures)

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)
PY

Divergence (≈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)
PY

Streamlines (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)
PY

Radial average of curl → results/vortex_curl_radial.png
(Produced by a small snippet in the discussion; optional.)


Circulation profile tool — circulation_profile.py

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 $end:math:text$.

  • 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.py

If your generator used a different σ, edit the SIGMA constant near the top of the script before running.


Absolute-path examples

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"

Why this helps the proof (and the 4D problem)

  • 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.


Compile the LaTeX report

cd "analysis"
pdflatex -interaction=nonstopmode -halt-on-error report.tex
pdflatex -interaction=nonstopmode -halt-on-error report.tex
open report.pdf

Troubleshooting / gotchas

  • If you see a path like .../analysis/analysis/field_visualizer.py, you’re already inside analysis/. Drop the extra analysis/ in your command.
  • Streamlines must use the transposed arrays shown above; the non-transposed orientation looks saddle-like.
  • Ensure numpy + matplotlib are installed:
    pip install numpy matplotlib

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors