summaryrefslogtreecommitdiff
path: root/ep_run/eig_v2_depth.py
diff options
context:
space:
mode:
authorYuren Hao <yurenh2@illinois.edu>2026-07-03 07:57:22 -0500
committerYuren Hao <yurenh2@illinois.edu>2026-07-03 07:57:22 -0500
commitbcec9560cf5c9b113e9381a52d1a941daa8865f2 (patch)
treebae3baf6d742b816d90e642d70b9744a86a4d189 /ep_run/eig_v2_depth.py
parentc0b507fb1760be291e1e1ed33f33fb18f16d8c2d (diff)
omega/norm-family refuted as stability signal; fingerprint story retracted; eigreg v2 = true map-eigenvalue (spec_penalty)HEADmaster
- eig_control: fix plain-PI bug (shifted PI for lambda_max of indefinite Sym); add lead_rho + spec_penalty (soft one-sided cap on |lam|(I+eps*J_F), 2-D Rayleigh-Ritz, matvec-only) — aep 'spectral' ported. eig_penalty demoted to diagnostic. - eig_recheck.py (Lanczos audit): omega=+5..+13 on ALL operators incl the stablest (s2000 +12.8 while true alpha=-0.02); gap omega-alpha~10; old 'warm -10.14 vs scratch +1.11' numbers were PI-mixture artifacts. RETRACTED. - eig_v2_smoke/depth: v2 mechanics validated vs ARPACK; z_T1 readings >1 are unconverged-state contamination (150: 1.009 -> 400/800: 0.997-0.999, mu=-0.02..-0.006 matching eig_probe); fixed-point top = BAND of slow modes. - lt_ep_train: --eigreg now spec_penalty (--eig_margin 0.995 = rho target); --fingerprint reports rho/Re_mu instead of num_abscissa. - ONBOARDING §4-7 + FINDINGS 2026-07-03: retraction + verdict (fundamental quantity = finite-horizon path LE / resreg axis; de-cliff via floss-ept; spec_penalty = measure-mode scalpel for a detaching Hopf pair). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014FAPDWQ49M5Ye3NpTndTpn
Diffstat (limited to 'ep_run/eig_v2_depth.py')
-rw-r--r--ep_run/eig_v2_depth.py39
1 files changed, 39 insertions, 0 deletions
diff --git a/ep_run/eig_v2_depth.py b/ep_run/eig_v2_depth.py
new file mode 100644
index 0000000..ee597f1
--- /dev/null
+++ b/ep_run/eig_v2_depth.py
@@ -0,0 +1,39 @@
+"""Path-effect check: is the '|lam|~1.008 at s2000' reading an unconverged-state artifact?
+Measure ARPACK leading map-eigenvalues at z after 150 vs 400 vs 800 relax steps (same batch).
+If |lam| drops below 1 with depth -> the >1 reading is transient-state contamination and the
+fixed-point operator is stable (consistent with eig_probe's Re mu = -0.02 at 250 steps)."""
+import numpy as np, torch, scipy.sparse.linalg as sla
+from torch.autograd.functional import jvp
+import lt_ep_train as L
+
+EPS, B, C = 0.1, 6, 1.0
+torch.manual_seed(0)
+blk = L.EQBlock(512, 16, 256, 256, c=C, attn_mode='thick'); blk.qknorm = True
+ck = torch.load('runs/redx_traj/s2000.pt', map_location=L.dev)
+with torch.no_grad():
+ for p, w in zip(blk.allp, ck['allp']):
+ p.copy_(w.to(L.dev))
+torch.manual_seed(42)
+idx, _ = L.get_batch('train', B, 256)
+xin = blk.embed(idx).detach()
+kk = 1.0 - EPS * (1.0 + C)
+
+z = xin.clone()
+done = 0
+for steps in (150, 400, 800):
+ z = L.relax(blk, z, xin, steps - done, EPS); done = steps
+ res = (L.relax(blk, z, xin, 1, EPS) - z).norm().item()
+ sh, n = z.shape, z.numel()
+
+ def mv(x, z=z):
+ v = torch.from_numpy(np.asarray(x, dtype=np.float32)).to(L.dev).view(sh)
+ with torch.no_grad():
+ Mv = kk * v + EPS * jvp(blk.nc_force, z, v)[1]
+ return Mv.reshape(-1).double().cpu().numpy()
+
+ A = sla.LinearOperator((n, n), matvec=mv, dtype=np.float64)
+ vals = sorted(sla.eigs(A, k=4, which='LM', return_eigenvectors=False, maxiter=2000, tol=1e-4),
+ key=lambda x: -abs(x))
+ print(f"[s2000 @ {steps:4d} steps] res={res:.3e} " +
+ " ".join(f"|l|={abs(l):.5f}({l.real:+.4f}{l.imag:+.4f}j)" for l in vals[:3]), flush=True)
+print("EIG_V2_DEPTH_DONE", flush=True)