Manuscript En02-E@2 · En02-E-v2.tex · section · c2769986

Unexecuted reproducibility supplement

Unexecuted reproducibility supplement · lines 2288–2342

Back to manuscript

vals,V = np.linalg.eigh(herm(raw)) P = (V*np.maximum(vals,0))@V.conj().T+1e-12*np.eye(2*b) M = herm(ptout(P,2,b)) vals,V = np.linalg.eigh(M) need(vals.min()>0,"decoder normalization singular") G = (V*(1/np.sqrt(vals)))@V.conj().T fixed = kron(I,G)@P@kron(I,G) save(name+"_repaired_decoder",R=fixed) accept(name+"_repaired_decoder_feasibility","R":fixed, "TP":ptout(fixed,2,b)-np.eye(b)) recovered = decoder_apply(fixed,N) save(name+"_repaired_decoded", **{"unit_ channel_check(recovered,name+"_repaired_decoded",STOL) independent = independent_distance(recovered,name+"_independent") result = "recovery_estimate":value,"analytical_target":target, "repair_Frobenius_size":float(np.linalg.norm(fixed-raw)), "independent_error":independent,"certified":False jwrite(name+"_recovery_result",result) need(abs(value-target)<=GAP,"recovery analytical regression") need(abs(independent["dual_estimate"]-target)<=GAP, "repaired decoder analytical regression") return result

def solver_validation(N,a,dataset): import cvxpy as cp need("SCS" in cp.installed_solvers(),"SCS unavailable") tests = [ ("identity",(i,j):E for i,j,E in units(),0.), ("constant",(i,j):dep(E) for i,j,E in units(),.75), ("dephasing",(i,j):(E+Z@E@Z)/2 for i,j,E in units(),.5), ("calibrated_even",N,.75*(1-a))] for name,noise,target in tests: recovery_sdp(noise,dataset+"_"+name,target)

def compile_source(tex): source = Path(tex).resolve() need(source.exists(),"missing TeX") shutil.copy2(source,ROOT/source.name) for run in (1,2): result = subprocess.run( ["pdflatex","-interaction=nonstopmode","-halt-on-error",source.name], cwd=ROOT,stdout=subprocess.PIPE,stderr=subprocess.STDOUT,text=True) (ROOT/("pdflatex_ need(result.returncode==0,"pdfLaTeX failure") need((ROOT/(source.stem+".pdf")).exists(),"missing PDF") log = ROOT/(source.stem+".log") warnings = [] if log.exists(): warnings = [line for line in log.read_text(errors="replace").splitlines() if "Warning" in line or "Overfull" in line or "Underfull" in line] jwrite("compilation_warnings","warnings":warnings, "return_code_checks_passed":True,"human_warning_inspection_pending":True)

Nearby in this section