"""Single-mode reductions of the published spectra, the H3S single-mode ratio at fixed S, and force-constant sensitivity of a single mode. Used in the section on what 300 K costs. Run with the project environment: .venv/bin/python numerics/derived/pairing_reductions.py The printed output is stored beside this file as pairing_reductions.out.txt. """ import pathlib import sys, math sys.path.insert(0, str(pathlib.Path(__file__).resolve().parents[1])) from eliashberg import tc, moments, allen_dynes from spectra import SPECTRA K=11.6045 for name,s in SPECTRA.items(): modes=s['bins']; lam,wl,w2=moments(modes) t=tc(modes,0.13,10.0)*K # single mode at omega_log with same lambda; cutoff: same absolute cutoff as real spectrum (10*wmax) wmax=max(w for _,w in modes) t1=tc([(lam,wl)],0.13,10.0)*K t1b=tc([(lam,wl)],0.13,10.0*wmax/wl)*K t2=tc([(lam,w2)],0.13,10.0)*K print(f"{name}: lam={lam:.2f} wlog={wl:.1f} w2={w2:.1f} Tc real={t:.1f} single@wlog={t1:.1f} (same abs cutoff {t1b:.1f}) single@w2={t2:.1f}") # H3S single-mode rule at fixed S: lambda 2.64 -> 1.84 for mu in (0.10,0.13,0.16,0.20): phi=lambda l: tc([(l,1.0)],mu,10.0)/math.sqrt(l) r=phi(1.84)/phi(2.64) print('H3S single-mode ratio mu',mu, round(r,3), '-> from 250 K:', round(250*r)) # megabar single-mode rule at lambda_H f=lambda x: tc([(x,1.0/math.sqrt(x))],0.13,10.0) for L in (1.66,2.08,2.15,2.16,2.17): up=f(L/1.3)/f(L)-1; dn=f(L*1.3)/f(L)-1 print('lamH',L,'k x1.3:',round(up*100,1),'k /1.3:',round(dn*100,1)) for L in (1.5,2,3,4): up=f(L/1.3)/f(L)-1; dn=f(L*1.3)/f(L)-1 print('lam',L,'k x1.3:',round(up*100,1),'k /1.3:',round(dn*100,1))