Repository Architecture & Ecosystem¶
What every script and test file in this repository does, script by script.
scripts/scan_ising.py: High-resolution parameter sweep of a fixed, non-optimized CX–RZ–CX/RX ansatz's \(\langle ZZ\rangle\) correlation over the TFIM's transverse field \(g\) — historical original, its "true variational ansatz" framing and \(g=1.309\) critical point did not survive independent verification (see Section 1). Producesdata/transizione_fase_ising.csv.scripts/plot_ising.py: Computes the first-order numerical derivative (quantum susceptibility) fromscan_ising.py's CSV dataset to locate its (since-corrected) critical phase boundary. Producesimages/curva_transizione_ising.png.scripts/ising_exact_verification.py: Exact TFIM ground state viascipy.sparseLanczos diagonalization (\(N=12\), open BC, same 11-bond structure asscan_ising.py), cross-validated against the fixed ansatz's \(\langle ZZ\rangle\) curve. Producesdata/ising_exact_verification.csvandimages/ising_exact_verification.png. See Section 1.scripts/scan_ising_vqe.py: Makesscan_ising.py's exact circuit structure genuinely variational — real Adam + exact chain-rule Parameter-Shift Rule minimization of \(E(\theta,\phi;g)\) at 200 \(g\)-points, cross-validated against exact Lanczos energies at every point. Finds a hard structural ceiling (RZ diagonal on a computational-basis state + RX commuting with \(X\) makes \(E\) provably \(g\)-independent for this ansatz), not a tuned success. Producesdata/scan_ising_vqe.csvandimages/scan_ising_vqe.png. See Section 1.scripts/ising_freefermion_verification.py: Independent free-fermion (Jordan-Wigner + Bogoliubov-de Gennes, \(N=12\)) cross-check ofising_exact_verification.py's Lanczos result — a genuinely different algorithm (24x24 single-particle matrix instead of the 4096-dim many-body Hamiltonian), self-tested against brute-force ED at small \(N\) before trusting it at \(N=12\). Confirms \(g^\star=0.8600\) exactly. Producesdata/ising_freefermion_verification.csv. See Section 1.scripts/zne_mitigation.py: Mathematical implementation of a stochastic Richardson Zero-Noise Extrapolation (ZNE) protocol over discrete Pauli-Z phase dephasing channels with 2,000 hardware shot sampling. Producesdata/dati_mitigazione_zne.csvandimages/transizione_ising_mitigata.png.scripts/zne_mitigation_verification.py: Independent verification ofzne_mitigation.py's headline claim — finds the "\(-4.2467\) eV true target" was actually its own mitigated output, derives the real ideal \(E(k)\) two independent ways (sparse Hamiltonian, closed form), and quantifies a real 8-10\(\sigma\) systematic bias in the 2-point Richardson extrapolant. Producesdata/zne_mitigation_verification_summary.csvandimages/zne_mitigation_verification.png. See Section 2.scripts/vqe_gradient.py: Exact numerical finite-difference gradient tracker (h = 1e-5) mapping the variational energy landscape and locating stationary points. Producesdata/vqe_gradient_landscape.csvandimages/vqe_gradient_landscape.png.scripts/vqe_jax_grad.py: Advanced VQE gradient execution computing the exact Parameter-Shift Rule gate-by-gate via the chain rule over a massively parallel 73,500-track JAX batch array. Producesdata/vqe_jax_gradient.csvandimages/vqe_jax_gradient.png.scripts/quantum_defect_scanner.py: Isotropic resilience topology mapper evaluating node-by-node quantum coherence under a localized parametric RZ dephasing rotation viarun_parametric_batch_jit(). Producesdata/mappa_difetti_silicio.csvandimages/mappa_difetti_silicio.png.scripts/next_gen_silicon.py: Solid-state bandstructure designer tracking continuous dispersion shifts induced by 5% mechanical lattice tensile strain via Harrison's hopping law. Producesdata/bande_nuovo_silicio.csvandimages/confronto_nuovo_silicio.png.scripts/manufacturing_thermodynamics.py: Quantum lattice thermodynamics simulator modeling electron-phonon scattering and decoherence via Bose-Einstein statistical distributions over a 10–400 K temperature sweep. Producesdata/validazione_fabbricazione_silicio.csvandimages/validazione_fabbricazione.png.scripts/vqe_silicon_molecular.py: Variational Quantum Eigensolver tracking self-consistent Potential Energy Curves (PEC) and Born-Oppenheimer molecular dissociation limits for a silicon dimer, at a fixed variational angle \(\theta=0.38\) rad. Producesdata/vqe_molecola_silicio.csvandimages/curva_potenziale_silicio.png.scripts/vqe_silicon_molecular_optimized.py: Same PEC, but with a single shared \(\theta\) found by real Adam optimization across all \(R\) using the exact chain-rule Parameter-Shift Rule gradient, batched per epoch. Producesdata/vqe_molecola_silicio_ottimizzata.csvandimages/curva_potenziale_silicio_ottimizzata.png. See Section 9b.scripts/vqe_silicon_molecular_optimized_per_bond.py: Same PEC, but with 5 independent Givens angles (one per bond) instead of one shared \(\theta\) -- a more realistic hardware-efficient VQE ansatz. Producesdata/vqe_molecola_silicio_ottimizzata_per_legame.csvandimages/curva_potenziale_silicio_ottimizzata_per_legame.png. See Section 9c.scripts/vqe_extreme_geometries.py: Generalizes the per-bond ansatz to independent per-bond interatomic distances (an irregular/distorted chain instead of one shared \(R\)), benchmarking the rigid shared-angle approximation against per-bond adaptive optimization across 6 extreme/irregular geometry scenarios. Producesdata/vqe_extreme_geometries.csvandimages/vqe_extreme_geometries.png. See Section 9e.scripts/vqe_extreme_geometries_deep.py: Deeper 12-parameter (7-qubit/6-bond) generalization of the same benchmark, plus a genuine minimum-energy conformational search (joint per-bond \(R_q\) and \(\theta_q\) optimization, not hand-picked geometries). Producesdata/vqe_extreme_geometries_deep.csv,data/vqe_extreme_geometries_deep_conformazioni.csv, andimages/vqe_extreme_geometries_deep.png. See Section 9f.scripts/zne_stabilized_psr_gradient.py: Corrects each individual single-gate Parameter-Shift-Rule term with Zero-Noise Extrapolation before the PSR chain-rule combination, testing whether this stabilizes the gradient underNoiseModel. Producesdata/zne_stabilized_psr_gradient.csvandimages/zne_stabilized_psr_gradient.png. See Section 12.scripts/zne_adaptive_psr_gradient.py: Attempts to fix Section 12's zero-crossing failure mode with a confidence-attenuated ("adaptive") ZNE correction viadense_evolution.healing.calculate_delta_preemp. Honest negative result. Producesdata/zne_adaptive_psr_gradient.csvandimages/zne_adaptive_psr_gradient.png. See Section 13.scripts/zne_snr_adaptive_psr_gradient.py: A second attempt at Section 13's problem, attenuating the ZNE correction via the correction term's own signal-to-noise ratio instead of the SEM of a single measurement. Also an honest negative result. Producesdata/zne_snr_adaptive_psr_gradient.csvandimages/zne_snr_adaptive_psr_gradient.png. See Section 14.scripts/sophia_reflection.py: A real density-matrix ZNE noise-coherence trajectory (dense_evolution.mitigation.zne_density_matrix/uhlmann_fidelity, distinct fromzne_mitigation.py's hand-rolled scalar protocol above) on a 2-qubit Bell state across a 16-point depolarizing-noise sweep. Producesdata/sophia_reflection.csvandimages/sophia_reflection.png. SeeSOPHIA_REFLECTION.mdfor the real measured trajectory and analysis.scripts/channel_order_noncommutativity.py: Tests whether the order of applying two different noise channels (dephasing then amplitude damping, vs. the reverse) leaves a measurable fingerprint on a 3-qubit circuit's output distribution — a real, honestly-confirmed positive result (see Section 16), unlike most of the other claims traced back to the same August 2025 archive. Producesdata/channel_order_noncommutativity.csvandimages/channel_order_noncommutativity.png.scripts/loschmidt_echo_zne.py: Runs a real "kicked Ising" forward circuit followed by its exact inverse on a 4-qubit chain, injecting an amplitude-damping channel between every layer, and checks whether density-matrix ZNE (zne_density_matrix/uhlmann_fidelity) recovers return fidelity lost to noise. A noiseless self-check (fidelity must be exactly 1.0) gates the noisy results. Producesdata/loschmidt_echo_zne.csvandimages/loschmidt_echo_zne.png.scripts/vqe_tmi_material_design.py: Adam optimization (exact JAX autodiff viacircuit_to_energy_fn, multi-start, batched withjax.vmap) of a hardware-efficient ansatz against a Topological Mott Isolator Hamiltonian, swept over the Mott repulsion U, validated at every U against exact dense diagonalization (the variational principleE_vqe >= E_exactis asserted, not assumed). Also runs the same pipeline at a GaAs point (DFT-derived hopping, dielectrically-screened on-site Coulomb repulsion — see Section 19). Producesdata/vqe_tmi_material_design.csv,data/vqe_tmi_material_design_gaas.csv,images/vqe_tmi_material_design.png, andimages/vqe_tmi_material_design_gaas.png.tests/test_pennylane_comparison.py: Automated cross-validation suite integrating PennyLane as a baseline verification engine. It programmatically contrasts the JAX/XLA statevector predictions generated by Dense Evolution against PennyLane's analytical execution to enforce strict regression boundaries in the CI pipeline.tests/test_analytical.py: Built-in mathematical validation suite executing 5 zero-external-dependency tests. It verifies Potential Energy Curve (PEC) physical boundaries, exact Parameter-Shift Rule (PSR) gradients on \(RY+\langle Z \rangle\), Harrison's strain-hopping ratios, and time-reversal dispersion symmetries under machine-precision tolerances (\(\le 10^{-10}\)).tests/test_integration_smoke.py: Imports and executes the REAL functions fromscripts/vqe_gradient.py,scripts/zne_mitigation.py,scripts/scan_ising.py,scripts/next_gen_silicon.py(not hand-derived copies), cross-validated against PennyLane or closed-form references.