Determine converged Yambo BSE optical-spectrum parameters by extracting physically meaningful first peaks and comparing higher-parameter runs with strict delta thresholds. Use when analyzing multiple parameterized absorption-spectrum directories and producing a single converged parameter report.
analysis.txt) with exact key/value formatting.Locate real data roots before analysis.
Check common mount points (/data, /inputs, project subdirs), not only /workspace.
Enumerate runs and parse parameters from directory names.
Extract (bands, kpoints, cutoff) via regex from folder names like bands_120_kpoints_64_cutoff_8.0.
Load spectrum data robustly.
Ignore comments/blank lines; parse two numeric columns (energy, intensity).
Use a constrained detector:
~3.0–3.5 eV; broader fallback 2.5–4.5 eV).Evaluate convergence against higher-parameter runs.
For each candidate run, compare to runs with bands>=, kpoints>=, cutoff>= and at least one strictly higher:
|Δpeak_energy| < 0.05 eV|Δpeak_intensity| / peak_intensity < 5%Select the minimum converged candidate and write exact output format.
Write exactly:
bands=<int>kpoints=<int>cutoff=<float>peak_energy=<float>find /) and drowning in /proc//sys noise./data, project dirs).Numerical sanity checks
Convergence checks
ΔE and max %ΔI for selected candidate versus all dominating higher-parameter runs.Output contract checks
key=value format.Directory existence checks (task + harness compatibility)
>= in all params, one strict >)