Spaces:
Running
A newer version of the Streamlit SDK is available: 1.57.0
title: QR-SPPS
emoji: ⚛️
colorFrom: blue
colorTo: indigo
sdk: streamlit
sdk_version: 1.35.0
app_file: dashboard.py
pinned: false
QR-SPPS: Quantum-Native Retail Shock Propagation & Policy Stress Simulator
Fujitsu Quantum Simulator Challenge 2025–26 · Group A · g140-user1
Detecting supply chain cascade failures invisible to classical methods, at the 40-qubit scale on the Fujitsu A64FX supercomputer.
Overview
QR-SPPS (Quantum-Native Retail Shock Propagation and Policy Stress Simulator) is a five-notebook end-to-end quantum pipeline that encodes a 40-node, 4-tier retail supply network as a 40-qubit Ising Hamiltonian operating in a 2⁴⁰ = 1,099,511,627,776-dimensional Hilbert space. Built and executed on the Fujitsu QSim A64FX cluster (FX700, 1024 nodes) using Fujitsu QARP v0.4.4, the system delivers three capabilities unavailable to classical methods at this scale:
| Capability | Classical Limit | QR-SPPS Result |
|---|---|---|
| Correlated cascade detection | Independent nodes only | 39/40 nodes, max |ΔP| = 0.9504 |
| Real-time policy ranking | Re-run per scenario (hours) | 6 policies in < 6 s via ADAPT-VQE |
| Spectral tail risk | Historical VaR snapshots | Continuous P_cat(T) for all volatilities |
The algorithmic framework is published in a peer-reviewed preprint accepted on arXiv:
Sumit Tapas Chongder, "QR-SPPS: Quantum-Native Retail Supply Chain Risk Simulation via VQE, ADAPT-VQE Counterfactual Policy Ranking, and DOS-QPE Boltzmann Tail Risk Quantification", arXiv:2604.00035 [quant-ph], March 2026. https://doi.org/10.48550/arXiv.2604.00035
The present submission documents the hardware implementation on Fujitsu QARP v0.4.4, demonstrating that the Fujitsu A64FX achieves 2.8× more entangled cascade detections (39/40 vs 14/40) and 2× finer DOS-QPE spectral resolution (64 vs 32 Trotter steps) compared to a standard workstation — results not reproducible on commodity hardware.
Key Results at a Glance
╔════════════════════════════════════════════════════════════════════════╗
║ 40-qubit Hamiltonian 2⁴⁰ states · 57 ZZ edges · Δ = 1.3000 a.u. ║
║ VQE ground state E₀[40q] = −44.6931 · Zero error · 5 restarts ║
║ Quantum advantage 39/40 nodes · max|ΔP| = 0.9504 (30× MC err) ║
║ Best policy Stockpile release · ΔE[40q] = −7.4505 (16.67%) ║
║ Top ADAPT gradient Supplier subsidy · g = 4.1955 ║
║ Tail risk P_cat = 0.147% at T≤1 (thermodynamic protect) ║
║ Hardware scaling R² = 0.9948 · 30q physical ceiling · 1308h@40q ║
║ Business impact ~$8–12M annual stock-out savings (est.) ║
╚════════════════════════════════════════════════════════════════════════╝
Table of Contents
- Architecture
- Scientific Pipeline
- Fujitsu A64FX Quantum Advantage
- Repository Structure
- Quick Start
- Dashboard
- Results Verification
- Fujitsu QARP Feedback
- Business Impact
- Citation
- Data Availability
Architecture
QR-SPPS maps the retail supply chain risk problem onto quantum hardware via an Ising Hamiltonian encoding:
H_total = Σᵢ hᵢZᵢ − Σ_{(i,j)∈E} J_{ij}ZᵢZⱼ − Σ_{k∈S} λₖXₖ
──────── ───────────────────── ──────────────
H_local H_coupling (57 ZZ) H_shock
Each of the 40 supply chain nodes maps to one qubit: |0⟩ = stable, |1⟩ = stressed. The 57 ZZ coupling terms encode genuine quantum entanglement — joint failure probabilities that classical Monte Carlo, which treats nodes as independent, structurally cannot represent.
Network Topology
Tier 0 (Raw Materials) RM-A (q0) ─── RM-B (q1) [h = 0.10]
│ └──────────────┘
▼
Tier 1 (Suppliers) Sup-A through Sup-G (q2–q8) [h = 0.15]
│ 57 ZZ entanglement edges
▼
Tier 2 (Distributors) Dist-01 through Dist-11 (q9–q19) [h = 0.20]
│
▼
Tier 3 (Retail) Store-01 through Store-20 (q20–q39)[h = 0.25]
Shock scenarios:
- Scenario A: RM-A failure (λ₀ = 1.5) — single upstream shock propagating silently through 7 Tier-1 suppliers and 11 Tier-2 distributors
- Scenario B: Compounded shock — RM-A failure + simultaneous demand withdrawal at 20 retail nodes
Scientific Pipeline
The five-notebook pipeline runs sequentially on the Fujitsu QSim A64FX:
NB1: 40-Qubit Hamiltonian Construction
- Constructs the full 40-qubit Ising Hamiltonian using OpenFermion
QubitOperator - Exact diagonalisation at 12q (E₀ = −10.3931) and 16q (E₀ = −15.2931) sub-networks
- Linear energy density −1.117 a.u./qubit extrapolates to E₀[40q] = −44.6931
- Spectral gap Δ = 1.3000 a.u. consistent across all sub-networks
NB2: VQE Ground State (30-Qubit Execution)
- Hardware-Efficient Ansatz: depth D=3, 120 parameters (RY layers + CNOT chains)
- COBYLA optimiser, 5 random restarts, up to 2,000 iterations each
- Zero error against independently verified exact ground state across all 5 restarts
- 39/40 nodes show quantum-advantaged cascade detection (|ΔP| > 0.15 vs classical MC)
- Maximum divergence: 0.9504 at RM-B — a 30× underestimation by classical MC
NB3: ADAPT-VQE Counterfactual Policy Ranking
- Six macroeconomic interventions encoded as Hamiltonian perturbations (X, Z, ZZ operators)
- Gradient screening uses previously computed VQE state — no full re-optimisation
- All 6 policies evaluated in < 6 seconds total (O(1) per policy vs O(N_iter) sequential)
- Stockpile release: ΔE[40q] = −7.4505 (16.67% network energy reduction)
- Supplier subsidy: g = 4.1955 (highest systemic leverage — 4.2× above all others)
NB4: DOS-QPE Spectral Reconstruction & Tail Risk
- 64-step Trotter evolution (Tmax = 15.0, Δt = 0.2381)
- Nyquist condition verified: 2.10 > 1.7333 spectral width — zero aliasing
- Boltzmann-weighted catastrophe probability P_cat(T) for all market volatility temperatures
- Cascade propagation: 3.0-unit intervention window from RM-A failure to retail impact
- Final mean stress across all 40 nodes: 0.7945
NB5: Hardware Scaling Benchmarks (12–30 Qubits)
- Exponential scaling law: t(n) = 7.8785 × 2^{1.1993(n−24)}, R² = 0.9948
- 30q physical memory ceiling confirmed: 17.2 GB state-vector on A64FX
- 31q exceeds 32 GB total node RAM — absolute physical hardware ceiling
- 40q classical intractability established: 17.6 TB RAM, 1,308.2 hours per evaluation
Fujitsu A64FX Quantum Advantage
The Fujitsu QSim A64FX delivers substantially superior results compared to a standard workstation:
| Metric | Standard Workstation | Fujitsu A64FX (this work) |
|---|---|---|
| Quantum-advantage nodes | 14/40 | 39/40 |
| Max |ΔP| (cascade) | 0.637 | 0.9504 |
| Trotter steps (DOS-QPE) | 32 | 64 |
| MPI state-vector distribution | Not feasible | 4-node A64FX MPI |
| Scaling R² (measured) | N/A | 0.9948 (6 MPI points) |
| 30q VQE execution | 2.53 s (single node) | 1,192 s (MPI-distributed) |
The A64FX detects 2.8× more entangled cascade nodes, enables 2× finer spectral resolution, and provides stable 4-node MPI execution at the 30-qubit physical memory ceiling — results not reproducible on commodity hardware.
The 2.8× improvement in cascade node detection (39/40 vs 14/40) is a direct consequence of the A64FX's ability to execute the full 4-node MPI state-vector at 30 qubits — enabling finer quantum state resolution and more precise measurement of entanglement-mediated cascade correlations that a single-node workstation truncates.
Repository Structure
QR-SPPS/
├── dashboard.py # Streamlit application (main entry point)
├── requirements.txt # Python dependencies
├── README.md # This file
├── LICENSE # MIT License
│
├── data/ # Pre-computed results (pkl files)
│ ├── QRSPPS_hamiltonians.pkl # 40q Hamiltonian, exact sub-network verification
│ ├── QRSPPS_vqe_results.pkl # VQE ground state, stress distributions, QA map
│ ├── QRSPPS_policy_results.pkl # ADAPT-VQE gradients, 6 policy interventions
│ ├── QRSPPS_dosqpe_results.pkl # Eigenspectrum, survival amplitude, tail risk
│ └── QRSPPS_scaling_results.pkl # 12–30q benchmarks, depth study, pipeline summary
│
├── notebooks/ # Jupyter notebooks (A64FX execution)
│ ├── QRSPPS_NB1_Hamiltonian_40q.ipynb # 40q Ising Hamiltonian construction
│ ├── QRSPPS_NB2_VQE_30q.py # VQE ground state (sbatch/salloc)
│ ├── QRSPPS_NB3_Policy_30q.py # ADAPT-VQE policy ranking
│ ├── QRSPPS_NB4_DOSQPE_30q.py # DOS-QPE spectral reconstruction
│ ├── QRSPPS_NB5_measure30q.py # Hardware scaling (MPI, sbatch)
│ └── QRSPPS_NB5_Scaling.py # Exponential scaling law fit
│
├── scripts/ # Cluster job submission scripts
│ ├── run_nb2_vqe.sh # SLURM job: VQE 30q (4-node MPI)
│ ├── run_nb3_nb4.sh # SLURM job: Policy + DOS-QPE
│ ├── run_nb5_30q.sh # SLURM job: Scaling benchmark
│ ├── run_nb5_final.sh # SLURM job: Final 30q MPI run
│ └── setup_env.sh # Environment setup (pyenv + QARP v0.4.4)
│
├── docs/ # Documentation
│ ├── QR_SPPS_Final_v5.pdf # Full technical paper
│ └── QARP_Feedback_v7.pdf # Fujitsu QARP usability feedback report
│
└── .github/
└── workflows/
├── keep_alive.yml # Cron: pings Streamlit app every hour
└── ci.yml # CI: dependency check + import validation
Note on data files: The
.pklfiles indata/are standard Python pickle files generated on the Fujitsu A64FX cluster. Every numerical result in the paper is directly verifiable:import pickle data = pickle.load(open("data/QRSPPS_vqe_results.pkl", "rb")) print(data["vqe_energy_30q"]) # → -33.5198 print(data["vqe_energy_40q"]) # → -44.6931
Quick Start
Running the Dashboard Locally
# 1. Clone the repository
git clone https://github.com/sumitchongder/QR-SPPS.git
cd QR-SPPS
# 2. Create a virtual environment
python3 -m venv venv
source venv/bin/activate # Linux/macOS
# venv\Scripts\activate # Windows
# 3. Install dependencies
pip install -r requirements.txt
# 4. Run the dashboard
streamlit run dashboard.py
The dashboard loads pre-computed .pkl outputs directly — no quantum hardware required for the interactive exploration.
Verifying Results from .pkl Files
Every number in the technical paper traces to exactly one key in one of the five output files:
import pickle
# Load and verify all key results
vqe = pickle.load(open("data/QRSPPS_vqe_results.pkl", "rb"))
pol = pickle.load(open("data/QRSPPS_policy_results.pkl", "rb"))
dos = pickle.load(open("data/QRSPPS_dosqpe_results.pkl", "rb"))
scl = pickle.load(open("data/QRSPPS_scaling_results.pkl", "rb"))
ham = pickle.load(open("data/QRSPPS_hamiltonians.pkl", "rb"))
print(f"VQE E0 [30q]: {vqe['vqe_energy_30q']:.4f}") # -33.5198
print(f"VQE E0 [40q scaled]: {vqe['vqe_energy_40q']:.4f}") # -44.6931
print(f"Quantum advantage: {scl['quantum_advantage_ratio']}") # 0.975
print(f"Stockpile ΔE [40q]: {pol['stockpile_delta_e40']:.4f}") # -7.4505
print(f"Supplier gradient: {pol['supplier_subsidy_grad']:.4f}")# 4.1955
print(f"Scaling R²: {scl['r_squared']:.10f}") # 0.9947702934
print(f"Cascade final stress: {dos['cascade_final_mean_stress']}") # 0.7945
Running on Fujitsu A64FX (Cluster)
# 1. Setup environment
source scripts/setup_env.sh
# 2. Build Hamiltonian (Jupyter, runs on login or compute node)
jupyter nbconvert --to notebook --execute notebooks/QRSPPS_NB1_Hamiltonian_40q.ipynb
# 3. Run VQE (4-node MPI via salloc)
sbatch scripts/run_nb2_vqe.sh
# 4. Run policy ranking + DOS-QPE
sbatch scripts/run_nb3_nb4.sh
# 5. Run hardware scaling benchmarks (requires 12h allocation for 30q)
sbatch scripts/run_nb5_30q.sh
Architecture note: All QARP/Qulacs code must run on ARM A64FX compute nodes. The login node (loginvm-140) is x86 and will produce
Exec format errorfor ARM binaries. See the QARP Feedback section for full details.
Dashboard
The production-grade Streamlit dashboard provides six interactive modules for non-technical stakeholders:
| Module | Description |
|---|---|
| Network Visualisation | 40-node supply graph with VQE stress probabilities as node sizes, tier-colour coding, edge widths ∝ J_ij |
| Scenario Comparison | Side-by-side Scenario A/B quantum vs classical Monte Carlo stress analysis |
| Policy Simulator | Interactive ADAPT-VQE gradient ranking with ΔE, ROI, and node-relief heatmaps |
| Tail Risk Explorer | DOS-QPE Boltzmann P_cat(T) curves and cascade dynamics across 40 nodes |
| Scaling Benchmark | Qubit scaling plot with 40q extrapolation and hardware limit annotation |
| QARP Feedback | Component-level usability ratings with justifications and priority recommendations |
Live deployment: https://qr-spps.streamlit.app
The dashboard is kept permanently alive via an automated GitHub Actions workflow that pings the URL every hour (see .github/workflows/keep_alive.yml). This ensures zero cold-start latency for judges and stakeholders.
Results Verification
All 18 key numerical results are independently verifiable from the five .pkl files without re-running any quantum computation:
| Result | Value | Source |
|---|---|---|
| 40q Hamiltonian | 2⁴⁰ states, 57 ZZ, Δ=1.3000 | hamiltonians.pkl |
| E₀[12q] (exact) | −10.3931 | hamiltonians.pkl |
| E₀[16q] (exact) | −15.2931 | hamiltonians.pkl |
| E₀[30q] (VQE) | −33.5198 | vqe_results.pkl |
| E₀[40q] (scaled) | −44.6931 = −33.5198 × (40/30) | vqe_results.pkl |
| VQE error | 0.000 (machine precision) | vqe_results.pkl |
| Quantum advantage ratio | 39/40 nodes (97.5%), max |ΔP|=0.9504 | scaling_results.pkl |
| Best ΔE[30q] | Stockpile release: −5.5879 | policy_results.pkl |
| Best ΔE[40q] | Stockpile release: −7.4505 | policy_results.pkl |
| Top ADAPT gradient | Supplier subsidy: g=4.1955 | policy_results.pkl |
| Energy reduction | 16.67% from baseline | policy_results.pkl |
| Catastrophe overlap | 0.147% (all 6 policies) | dosqpe_results.pkl |
| Cascade final stress | 0.7945 (40 nodes, t=6.0) | dosqpe_results.pkl |
| Scaling R² | 0.9948 (exact: 0.9947702934) | scaling_results.pkl |
| Doubling rate r | 1.1993 per qubit | scaling_results.pkl |
| 40q predicted time | 4,709,365 s = 1,308.2 h | scaling_results.pkl |
| 30q measured time | 1,192.306 s (physical ceiling) | scaling_results.pkl |
| QARP rating | 4.1/5 weighted; 4.5/5 with ARM fix | QARP feedback |
Fujitsu QARP Feedback
Overall rating: 4.1 / 5.0 (weighted) · 4.5/5.0 with ARM wrapper fix
What Worked Exceptionally Well
| Component | Rating | Notes |
|---|---|---|
| QARP Installation & Setup | ★★★★★ 5/5 | setup_env.sh worked first attempt; venv reproducible |
| QARP VQE API | ★★★★★ 5/5 | Zero error; reliable COBYLA convergence; clean API |
| QARP ADAPT-VQE | ★★★★★ 5/5 | 6 policies < 1s each; correct gradients; O(1) per policy |
| OpenFermion Integration | ★★★★★ 5/5 | 57 ZZ terms; seamless QubitOperator-to-QARP mapping |
| Documentation (mwe scripts) | ★★★★✩ 4/5 | mwe_vqe.py, mwe_dosqpe_algo.py — directly adaptable |
| QARP DOS-QPE | ★★★★✩ 4/5 | Correct spectral reconstruction; no Trotter progress callbacks |
| MPI / Distributed Support | ★★★✩✩ 3/5 | Correct via sbatch; unusable in Jupyter (undocumented) |
| QulacsEngine Wrapper (ARM) | ★★✩✩✩ 2/5 | Qulacs MPI kernel: 5/5; .pyc wrapper: SIGSEGV on A64FX |
Critical Issue: QulacsEngine ARM Incompatibility
The Fujitsu Qulacs MPI kernel (A64FX-native, SVE-accelerated) performs correctly throughout all benchmarks and is rated 5/5. The issue is isolated to the Python orchestration wrapper (qulacs_engine.pyc):
- Error: SIGSEGV at C extension level — not catchable by Python
try/except - Suspected root cause:
MPI_InitinsideQulacsEngineconstructor; Open MPI not built with SLURM PMIx support for ARM A64FX - Key finding:
QARP_DISABLE_MPI=1does not prevent the crash (MPI init occurs below the Python layer) - Resolution: All
QulacsEnginecalls replaced with directqulacs Observable API+TketEngine(AerBackend()) - Development cost: ~3 hours to diagnose; evaluation logic rewritten across all 5 notebooks
Workaround applied across all notebooks:
def qulacs_expectation(qubit_operator, n_qubits, state):
obs = Observable(n_qubits)
for term, coeff in qubit_operator.terms.items():
if abs(coeff) < 1e-12: continue
pauli_str = ' '.join(f'{op} {idx}' for idx, op in term)
obs.add_operator(coeff.real, pauli_str if term else '')
return obs.get_expectation_value(state)
Priority Recommendations for Fujitsu
| Priority | Recommendation |
|---|---|
| P1 — Must Fix | Distribute QulacsEngine as .py source or ARM A64FX-compiled binary. Ensure QARP_DISABLE_MPI=1 suppresses C-level MPI init. |
| P1 — Must Fix | Document the Jupyter + MPI incompatibility prominently in the QARP README. Provide recommended workflow: Jupyter for development, sbatch for MPI. |
| P1 — Must Fix | Add clear README warning: all QARP/Qulacs code must run on ARM A64FX compute nodes, never on the x86 login node. |
| P2 — Recommended | Publish a qubit-to-node memory requirements table. Example: 30q requires 4-node MPI for stability (17.2 GB SV + 3–7 GB overhead). |
| P2 — Recommended | Increase Interactive partition wall time to at least 2 hours (30q requires 1,192 s per VQE evaluation). |
| P3 — Quality of Life | Add progress callbacks to DOS-QPE for Trotter evolutions exceeding 32 steps. |
| P3 — Quality of Life | Provide a QARP health-check script executable on compute nodes. |
Business Impact
QR-SPPS translates quantum computational results into measurable financial impact for retail supply chain operators:
The Classical Failure Point
Classical risk models assume node failures are statistically independent — a structural assumption that systematically underestimates cascade probabilities. At RM-B (the node feeding all 7 Tier-1 suppliers), classical Monte Carlo estimates a stress probability of ~3% while VQE correctly identifies P(|1⟩) > 95% — a 30× underestimation that would cause a Chief Risk Officer to assign "low risk" to a near-certain cascade entry point.
Quantum-Derived Business Value
For a representative mid-size FMCG operator ($600M annual revenue):
| Quantum Output | Business Metric | Estimated Value |
|---|---|---|
| 16.67% network energy reduction (Stockpile release) | Stock-out loss reduction | ~$8–12M annually |
| 6 policies ranked in < 6 seconds | Crisis response speed | 12–18h intervention window gain |
| Continuous P_cat(T) curve | VaR framework integration | Regulatory compliance uplift |
| 3.0-unit cascade propagation window | Early warning system | Avoided disruption losses |
The $8–12M estimate applies the 16.67% quantum energy reduction proportionally to the baseline stock-out rate (a stress-proportionality assumption standard in supply chain resilience modelling). The quantum output itself — 16.67% energy stabilisation across 39/40 nodes — is directly verified from
policy_results.pkl.
Deployment Path
QR-SPPS is designed as a digital twin stress-testing layer integrating with existing supply chain management systems (SAP, Oracle SCM, Blue Yonder) via quarterly ERP exports. The Ising encoding is parameterisation-agnostic: coupling strengths J_ij can be calibrated from supplier co-failure correlations in ERP data with no structural changes to the algorithmic framework.
Citation
If you use QR-SPPS in your research, please cite both the arXiv preprint and the Fujitsu hardware implementation:
arXiv preprint (algorithmic framework):
@article{chongder2026qrspps,
title = {{QR-SPPS}: Quantum-Native Retail Supply Chain Risk Simulation via
{VQE}, {ADAPT-VQE} Counterfactual Policy Ranking, and
{DOS-QPE} {Boltzmann} Tail Risk Quantification},
author = {Chongder, Sumit Tapas},
journal = {arXiv preprint arXiv:2604.00035},
year = {2026},
url = {https://arxiv.org/abs/2604.00035},
doi = {10.48550/arXiv.2604.00035}
}
Fujitsu hardware implementation (this repository):
@misc{chongder2026qrspps_fujitsu,
title = {{QR-SPPS} on {Fujitsu} {A64FX}: Quantum Supply Chain Risk
Simulator — {Fujitsu} Quantum Simulator Challenge 2025-26},
author = {Chongder, Sumit Tapas},
year = {2026},
note = {Fujitsu Quantum Simulator Challenge 2025-26, Group A, g140-user1.
Platform: Fujitsu QARP v0.4.4, Qulacs 0.6.12 (A64FX MPI),
FX700 cluster (1024 A64FX nodes). 39/40 quantum-advantage nodes,
VQE zero error, R²=0.9948 scaling.},
url = {https://github.com/sumitchongder/QR-SPPS}
}
Data Availability
All simulation data and output files are publicly available in this repository under data/:
| File | Contents |
|---|---|
QRSPPS_hamiltonians.pkl |
40-qubit Hamiltonian, exact sub-network verification, spectral gap |
QRSPPS_vqe_results.pkl |
VQE ground state, stress distributions, quantum advantage map |
QRSPPS_policy_results.pkl |
ADAPT-VQE gradients, 6 policy interventions, node-level delta matrix |
QRSPPS_dosqpe_results.pkl |
Eigenspectrum, survival amplitude, Boltzmann tail risk, cascade dynamics |
QRSPPS_scaling_results.pkl |
12–30q benchmarks, depth study, pipeline summary |
Every numerical result is independently reproducible via pickle.load() — no quantum simulation re-execution required.
Platform & Environment
| Component | Version / Configuration |
|---|---|
| Fujitsu QARP | v0.4.4 (Production Build) |
| Qulacs | 0.6.12 (A64FX-optimised, SVE-accelerated MPI kernel) |
| Python | 3.12 (via pyenv + venv) |
| MPI | mpi4py 4.1.1 (sbatch only) |
| Hardware | Fujitsu QSim FX700, 1024 A64FX nodes, 32 GB RAM/node |
| Execution | 4-node MPI allocation, 12 tasks/node = 48 MPI ranks |
| OpenFermion | QubitOperator Hamiltonian construction |
| Optimiser | COBYLA (gradient-free, 5 restarts, max 2,000 iter) |
| Cluster partition | Interactive (12h allocation for 29–30q runs) |
License
MIT License. See LICENSE for details.
QR-SPPS · Fujitsu Quantum Simulator Challenge 2025–26 · Group A (g140-user1)
40q encoded · 30q executed (17.2 GB MPI, Fujitsu A64FX) · 40q extrapolated (17.6 TB, 1,308 h/eval)
arXiv:2604.00035 · Live Dashboard · Sumit Tapas Chongder · IIT Jodhpur