Skip to content

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). Produces data/transizione_fase_ising.csv.
  • scripts/plot_ising.py: Computes the first-order numerical derivative (quantum susceptibility) from scan_ising.py's CSV dataset to locate its (since-corrected) critical phase boundary. Produces images/curva_transizione_ising.png.
  • scripts/ising_exact_verification.py: Exact TFIM ground state via scipy.sparse Lanczos diagonalization (\(N=12\), open BC, same 11-bond structure as scan_ising.py), cross-validated against the fixed ansatz's \(\langle ZZ\rangle\) curve. Produces data/ising_exact_verification.csv and images/ising_exact_verification.png. See Section 1.
  • scripts/scan_ising_vqe.py: Makes scan_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. Produces data/scan_ising_vqe.csv and images/scan_ising_vqe.png. See Section 1.
  • scripts/ising_freefermion_verification.py: Independent free-fermion (Jordan-Wigner + Bogoliubov-de Gennes, \(N=12\)) cross-check of ising_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. Produces data/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. Produces data/dati_mitigazione_zne.csv and images/transizione_ising_mitigata.png.
  • scripts/zne_mitigation_verification.py: Independent verification of zne_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. Produces data/zne_mitigation_verification_summary.csv and images/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. Produces data/vqe_gradient_landscape.csv and images/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. Produces data/vqe_jax_gradient.csv and images/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 via run_parametric_batch_jit(). Produces data/mappa_difetti_silicio.csv and images/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. Produces data/bande_nuovo_silicio.csv and images/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. Produces data/validazione_fabbricazione_silicio.csv and images/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. Produces data/vqe_molecola_silicio.csv and images/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. Produces data/vqe_molecola_silicio_ottimizzata.csv and images/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. Produces data/vqe_molecola_silicio_ottimizzata_per_legame.csv and images/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. Produces data/vqe_extreme_geometries.csv and images/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). Produces data/vqe_extreme_geometries_deep.csv, data/vqe_extreme_geometries_deep_conformazioni.csv, and images/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 under NoiseModel. Produces data/zne_stabilized_psr_gradient.csv and images/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 via dense_evolution.healing.calculate_delta_preemp. Honest negative result. Produces data/zne_adaptive_psr_gradient.csv and images/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. Produces data/zne_snr_adaptive_psr_gradient.csv and images/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 from zne_mitigation.py's hand-rolled scalar protocol above) on a 2-qubit Bell state across a 16-point depolarizing-noise sweep. Produces data/sophia_reflection.csv and images/sophia_reflection.png. See SOPHIA_REFLECTION.md for 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. Produces data/channel_order_noncommutativity.csv and images/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. Produces data/loschmidt_echo_zne.csv and images/loschmidt_echo_zne.png.
  • scripts/vqe_tmi_material_design.py: Adam optimization (exact JAX autodiff via circuit_to_energy_fn, multi-start, batched with jax.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 principle E_vqe >= E_exact is asserted, not assumed). Also runs the same pipeline at a GaAs point (DFT-derived hopping, dielectrically-screened on-site Coulomb repulsion — see Section 19). Produces data/vqe_tmi_material_design.csv, data/vqe_tmi_material_design_gaas.csv, images/vqe_tmi_material_design.png, and images/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 from scripts/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.