This repository contains a rigorous empirical study, raw datasets, and quantum error mitigation protocols executed on Dense Evolution (v8.1.21)—a high-performance Statevector quantum simulator. Utilizing 64-bit double precision (complex128) and hardware-accelerated static compilation via the JAX XLA engine, this project maps the non-linear physics of the Transverse Field Ising Model (TFIM), Tight-Binding Fermionic dynamics, and semiconductor solid-state thermodynamics.
Dense-Evolution-Ising-Tests/
├── scripts/ # 11 production scripts (see below) -- tracked in git
├── tests/ # pytest suite, run by CI on every push
├── data/ # CSV outputs -- NOT tracked (.gitignore); populated by running scripts/tests
├── images/ # PNG outputs -- NOT tracked (.gitignore); populated by running scripts/tests
└── README.md
git clone gives you exactly the scripts and tests, nothing pre-generated -- run anything and data//images/ fill up with fresh output, so there's never any ambiguity about whether what you're looking at is old or new. Pre-made results for browsing without running anything live as attachments on the Releases page instead (also what every image embedded in this README below links to).
-
scripts/scan_ising.py: Automated data pipeline responsible for high-resolution parameter sweeps and graphical rendering of the ideal ferromagnetic phase transition using a true variational ansatz. Producesdata/transizione_fase_ising.csv. -
scripts/plot_ising.py: Computes the first-order numerical derivative (quantum susceptibility) from the CSV dataset to locate the exact critical phase boundary. Producesimages/curva_transizione_ising.png. -
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/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. -
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.
We present a rigorous physical validation of the longitudinal spin-correlation order parameter
As the transverse field coupling strength
The ansatz deploys alternating CX–RZ–CX entangling blocks across all 11 nearest-neighbor qubit pairs on a 12-qubit chain, followed by parametric RX rotations scaled to the transverse field strength (<H_zz> order parameter is computed analytically from the statevector probability distribution via bitwise parity extraction.
To circumvent non-unitary noise without physical hardware overhead, a classical-quantum hybrid mitigation protocol was deployed under a realistic stochastic Pauli-Z dephasing Kraus channel. By scaling the noise density via stretching coefficients (
The protocol operates on Bloch wavevector states
The ZNE protocol successfully reconstructed the unperturbed, zero-noise ideal target trajectory, forcing the corrupted noisy minimum at
A brute-force numerical gradient sweep over the full VQE variational energy landscape was executed using a centered finite-difference scheme with step
The ansatz uses Givens rotation excitation-preserving blocks (CX–RY–CX–RY–CX chains) initialized from a single-excitation Fock state
The gradient landscape confirms the exact analytic minimum bound at:
with all stationary points and gradient zero-crossings fully resolved, and no vanishing gradient plateaus present under the compact excitation-preserving ansatz.
Note: This script (
vqe_gradient.py) uses classical finite-difference differentiation. For exact quantum-native analytical gradients via Parameter-Shift Rule, see Section 6 (vqe_jax_grad.py).
This ansatz shares one
calcola_energia_vqe's kinetic sum is periodic (
Verified exact (machine precision, calcola_energia_vqe across the full sweep, including at the printed checkpoints — e.g. scripts/vqe_gradient.py's energia_forma_chiusa(). tests/test_integration_smoke.py::test_vqe_gradient_closed_form_matches_real_circuit_exactly checks the identity at 7 points across the range.
Using the native run_parametric_batch_jit() engine, we mapped the isotropic resilience of an entangled state against localized dephasing noise. A 12-qubit entangled chain is prepared by uniform RY(
The evaluation maps the systematic loss of
Correction 1 (audit finding, dense-evolution 8.1.21):
run_parametric_batch_jit()assigns oneparameter_batchcolumn per rotation gate in the order the gates appear, even when a gate is given a literal float instead of a string placeholder — the literal is silently discarded. The batch grid used to have only 12 columns while the circuit has 24 rotation slots (12 fixed RY(π/4) + 12 varying RZ), so the RY gates absorbed the intended RZ values and the true RZ columns ran out of bounds (silently clipped by JAX instead of raising). Fixed by supplying all 24 slots explicitly.Correction 2 (found the same day, while trying to explain Correction 1's numbers):
DenseSVSimulatoruses MSB-first indexing internally ($\text{phys} = N_Q{-}1{-}\text{qubit}$ , see_cx_numpy/apply_cxindense_evolution/simulator.py) — gate-qubit$q$ lives at physical array bit$N_Q{-}1{-}q$ . The script's coherence measurement used1 << local_qubitdirectly on the gate-qubit index, reading a different physical qubit than the one that actually received that row's dephasing. The "70.71% / 50% / 43.88%" pattern originally reported here (and the "interplay between the RY layer and the CX ladder" explanation) was this indexing artifact, not real physics.
With both fixed, the true pattern is much simpler: 11 of the 12 nodes give an identical residual coherence,
We resolved the exact 1-electron fermionic Bloch state dispersion relation mapped via Jordan-Wigner transformations. By evaluating the pure exchange interactions (
This eliminates artificial scaling factors and rigid offsets, delivering an honest statevector simulation of tight-binding quantum dynamics under strict 1-fermion subspace conservation. The Bloch states are analytically constructed as
Correction (audit finding, dense-evolution 8.1.21): the original implementation shifted the shared variational parameter
$t$ by$\pm\pi/2$ and read the resulting energies straight off the batch. The textbook Parameter-Shift Rule is only exact when a single gate's own parameter is shifted while every other gate is held fixed — here each bond applies tworygates both driven by$t$ (param_vqe = t,param_vqe_inv = -t), so the shared-shift reading conflated their contributions. Verified against an independent finite-difference reference: the old heuristic could disagree with the true$dE/dt$ by 100%, including the wrong sign.
The corrected, mathematically exact gradient follows from the chain rule over every gate parameter individually:
where each
By packing every shifted configuration concurrently into run_parametric_batch_jit(), JAX XLA processed 73,500 continuous configurations (3,500
The exact quantum derivatives successfully map continuous trajectories, verifying the total absence of vanishing gradient dead-zones or artificial plateaus under compact excitation-conserving ansatze.
We modeled a continuous dispersion profile mapping a high-mobility Strained Silicon configuration under a
The high-resolution 3,500-point k-space parameter sweep executed via JAX maps the physical contraction of the modal hopping energy from the standard
A quantum-statistical simulation of electron-phonon scattering decoherence was executed over a 10–400 K temperature sweep at 3,500 discrete points, modeling the thermal degradation of coherent electronic hopping in a silicon lattice.
The Debye-Bose-Einstein phonon occupancy is computed as:
with
This captures the physical mechanism by which thermally-activated phonon scattering reduces long-range electronic coherence. A fixed Bloch state
We mapped the exact Born-Oppenheimer Potential Energy Curve (PEC) for a silicon dimer system via a classical-quantum hybrid variational loop. The effective Hamiltonian tracks electronic hopping integrals
with
vqe_silicon_molecular_optimized.py replaces the fixed run_parametric_batch_jit() call, rather than looping epochs inside a per-$R$ loop.
The result is a genuine physical insight, not just a better number:
Because
The 3,500-point variational sweep over
vqe_silicon_molecular_optimized_per_bond.py asks a sharper question: Section 9b's shared
It differentiates, and cleanly: the 5 bonds converge to
Section 9c's near-even
The amplitude at site
and the per-bond Givens angle that prepares this profile via the sequential construction has its own closed form (
No optimizer needed: plugging this formula directly into the circuit reproduces the numerically Adam-optimized result to machine precision (scripts/vqe_silicon_molecular_optimized_per_bond.py implements this as theta_ground_state_closed_form() / kinetic_max_closed_form(), and tests/test_vqe_molecular_per_bond.py verifies the identity exactly (test_closed_form_ground_state_matches_script_kinetic_maximum, test_closed_form_generalizes_across_chain_lengths).
scripts/quantum_scar_investigation/ contains a self-contained, honestly-reported investigation into whether a "quantum many-body scar" (the non-thermalizing phenomenon first observed in 2017 Rydberg-atom experiments) shows up in Dense Evolution's frustrated Ising simulations. Full writeup: report_indagine_scar.md (Italian).
Short version: an initial-looking scar signature on a 4x4 frustrated TFIM grid did not survive rigorous verification (entanglement entropy, Trotter convergence, and a systematic 25-combination parameter scan) — it turned out to be the wrong observable (energy instead of entanglement entropy) plus a gauge-equivalence coincidence between sign patterns. The verification pipeline was then validated against the PXP model (Rydberg blockade), where scars are known to genuinely exist — confirmed via fidelity revivals and the characteristic "tower" of low-entanglement eigenstates in the exact spectrum. Using Dense Evolution's own NoiseModel.apply_to_sv (real stochastic Kraus channel, averaged over 30 quantum trajectories), the PXP scars turned out to be extremely fragile: a 0.5-1% per-site depolarizing error rate destroys almost the entire revival signal. Projecting the noisy state back onto the exact 13-state scar tower recovers ~31x of the lost revival amplitude — an idealized theoretical bound (not a realizable hardware protocol as-is) showing the protection target exists.
Open for anyone who wants to pick it up: translating the PXP dynamics into an actual circuit and testing revival + a physically realizable protection protocol (e.g. constraint-postselection instead of exact-eigenstate projection) on real quantum hardware.
| Component | Version / Detail |
|---|---|
| Simulator | Dense Evolution v8.1.21 |
| Backend | DenseSVSimulator (Statevector) |
| Precision | complex128 (64-bit double) |
| Compilation | JAX XLA JIT static compilation |
| Parallelism | run_parametric_batch_jit() — up to 73,500 tracks/cycle |
| Gradient engine | Exact chain-rule Parameter-Shift Rule + finite-difference |
| Noise model | Stochastic Pauli-Z Kraus dephasing channel |
| Phonon model | Bose-Einstein / Debye |
| Bandstructure | Jordan-Wigner XY tight-binding, Harrison's law strain |
| Python deps | jax, jaxlib, numpy, pandas, matplotlib |
To guarantee the mathematical stability and absolute physical accuracy of the simulated quantum dynamics, the repository includes a strict continuous integration (CI) pipeline executed via GitHub Actions (ci.yml).
The test suite (test_pennylane_comparison.py) establishes an automated cross-validation layer by mirroring the statevector computations on two completely independent software architectures:
- Target Simulator: Dense Evolution (v8.1.21) accelerated via JAX XLA.
- Baseline Reference: PennyLane.
The pipeline runs on every code splotch or pull request, evaluating the numerical consistency of the 1D Transverse Field Ising Model (TFIM) expectation values, variational gradients, and Bloch state rotations. By testing the outputs across both engines, the CI automatically flags floating-point drift or algebraic regressions exceeding machine-epsilon tolerances.
To ensure absolute core-level stability without relying on third-party frameworks, the repository features a dedicated self-contained validation layer (test_analytical.py). This suite runs directly against exact mathematical identities and physics boundaries under machine-precision tolerances (
The suite enforces verification across five distinct physical and algorithmic benchmarks:
-
Potential Energy Curve (PEC) Topography (
test_pec_shape): Validates the qualitative Born-Oppenheimer energy landscape of molecular Silicon systems. It guarantees that the simulation resolves the correct three-region behavior: a steep repulsive wall at short range ($R = 1.4\text{ Å}, E > 0$ ), a stable binding well at intermediate distance ($R = 3.3\text{ Å}, E < 0$ ), and asymptotic stabilization near the dissociation limit ($R = 7.0\text{ Å}, |E| < 0.01\text{ eV}$ ). -
Bound-State Existence (
test_pec_minimum_is_negative): Scans the well core ($R \in [3.0, 4.5]\text{ Å}$ , empirically confirmed bound at every sampled point) and asserts$E < -0.01\text{ eV}$ at each one, proving a genuine stable ground state rather than merely finite output — tightened during the dense-evolution 8.1.21 audit, when this test was found asserting onlynp.isfinitedespite its docstring's stronger claim. -
Exact Parameter-Shift Rule (
test_psr_exactness_ry_z): Mathematically benchmarks the single-gate PSR primitive underlying the VQE gradient engine (vqe_jax_grad.py). By tracking an$RY(\theta)|0\rangle$ state followed by a$\langle Z \rangle$ measurement, it verifies that the computed gradient perfectly mirrors the exact analytical identity$\frac{dE}{d\theta} = -\sin(\theta)$ .tests/test_vqe_jax_gradient.pyextends this same exactness check to the full multi-gate, chain-rule PSR gradient used in production. -
Harrison's Hopping Law (
test_harrison_strain_ratio): Verifies the bandstructure deformation engine under mechanical stress (next_gen_silicon.py). It enforces that the exact ratio of strained to unstrained tight-binding energies follows Harrison's solid-state scaling law,$t(\varepsilon) = \frac{t_0}{(1+\varepsilon)^2}$ , at every non-trivial$k$ -point across the Brillouin zone. -
Time-Reversal Dispersion Symmetry (
test_dispersion_time_reversal_symmetry): Checks the underlying algebraic symmetry of the tight-binding Bloch states, ensuring that the dispersion relation satisfies the strict time-reversal constraint$E(k) \equiv E(-k)$ to isolate and prevent unphysical symmetry-breaking artifacts.
# Clone and install
git clone https://github.com/tatopenn-cell/Dense-Evolution-Ising-Tests.git
cd Dense-Evolution-Ising-Tests
pip install -r requirements-ci.txt
# Run the test suite (fast, ~2 minutes, no CSV/PNG needed)
pytest tests/ -v
# Or run the full experiments -- each creates data/*.csv and/or images/*.png,
# safe to run from the repo root regardless of your current directory:
python scripts/scan_ising.py
python scripts/plot_ising.py
python scripts/zne_mitigation.py
python scripts/vqe_gradient.py
python scripts/vqe_jax_grad.py
python scripts/quantum_defect_scanner.py
python scripts/next_gen_silicon.py
python scripts/manufacturing_thermodynamics.py
python scripts/vqe_silicon_molecular.py
python scripts/vqe_silicon_molecular_optimized.py
python scripts/vqe_silicon_molecular_optimized_per_bond.pydata/ and images/ are gitignored -- they exist only after you run something, so it's always unambiguous whether what you're looking at is fresh. Pre-made results are on the Releases page instead.
Hardware note: All benchmarks were executed on CPU. The JAX XLA engine will automatically utilize GPU acceleration if available via
use_gpu=Truein the simulator constructor.
All produced under data/ when you run the corresponding script (see Repository Layout); also downloadable from the Releases page without running anything.
| CSV File | Description | Rows |
|---|---|---|
transizione_fase_ising.csv |
TFIM order parameter vs transverse field g | 3,500 |
dati_mitigazione_zne.csv |
ZNE ideal / noisy / mitigated energies vs k | 25 |
vqe_gradient_landscape.csv |
VQE energy and finite-diff gradient vs θ | 3,500 |
vqe_jax_gradient.csv |
VQE energy and PSR gradient vs θ (JAX batch) | 3,500 |
mappa_difetti_silicio.csv |
Residual qubit coherence vs defect node position | 12 |
bande_nuovo_silicio.csv |
Strained Si valence/conduction bands vs k | 3,500 |
validazione_fabbricazione_silicio.csv |
Phonon occupancy and hopping energy vs temperature | 3,500 |
vqe_molecola_silicio.csv |
Born-Oppenheimer PEC vs interatomic distance R (fixed θ=0.38) | 3,500 |
vqe_molecola_silicio_ottimizzata.csv |
Adam-optimized PEC: shared θ*(R), E*(R), final gradient | 200 |
vqe_molecola_silicio_ottimizzata_per_legame.csv |
Adam-optimized PEC: 5 independent θ*(R) per bond, E*(R) | 200 |
MIT License — © 2026 Salvatore Pennacchio (tatopenn-cell) This repository depends on Dense Evolution, licensed under Business Source License 1.1. See https://github.com/tatopenn-cell/Dense-Evolution for license terms.









