A Physics-Informed Hybrid Quantum-Classical Architecture for Long-Horizon Simulation of Chaotic Fluid Dynamics
The NQ-SKAE is a novel deep learning architecture designed to solve the "Gradient Collapse" and "Numerical Dissipation" problems inherent in simulating chaotic physical systems (like fluid turbulence). By fusing Symplectic Geometry (classical volume preservation) with Continuous-Variable Quantum Mechanics (unitary temporal evolution), this model hard-codes the laws of physics directly into the neural network topology.
It successfully learns the Koopman Operator for the Kuramoto-Sivashinsky equation, enabling long-term forecasting with bounded energy drift.
Standard Deep Learning models (LSTMs, RNNs, FNOs) face critical mathematical limitations when modeling chaos:
| Failure Mode | Description |
|---|---|
| Numerical Dissipation | They act as low-pass filters, blurring high-frequency micro-turbulence over time to minimize MSE. |
| Energy Drift | Without physics constraints, they violate the First Law of Thermodynamics, causing system energy to leak or explode. |
| The Lyapunov Barrier | In chaotic systems, errors compound exponentially. Classical networks de-correlate from reality after ~1.5 Lyapunov times. |
Instead of approximating physics, we enforce it.
We map the dynamics onto a Quantum Optical Circuit, which is mathematically guaranteed to be Unitary (
The pipeline consists of three mathematically distinct stages, bridging:
src/models.py—SymplecticLinear&NQ_SKAE_Encoder
- Function: Compresses the high-dimensional spatial grid (1024 points) into a low-dimensional latent phase space.
-
The Innovation: Uses Symplectic Layers that force output dimensions to be even numbers, creating strict pairs of Position (
$q$ ) and Momentum ($p$ ). -
Initialization: Physics-Informed Xavier initialization with
Tanhactivations to preserve gradient flow through the manifold. - Why? Satisfies Liouville's Theorem — ensuring the geometry of the chaotic attractor is folded, not crushed, during compression.
src/quantum.py—QuantumKoopmanLayer
-
Function: Linearly evolves the latent state forward in time (
$t \to t+1$ ). -
The Innovation: Uses a Continuous-Variable (CV) Photonic Circuit simulated via PennyLane (
default.gaussiandevice).-
Embedding: Maps (
$q, p$ ) pairs to complex amplitudes$\alpha$ using Displacement Gates. - Dynamics: Simulates the Koopman Operator via a sequence of Squeezing, Rotation, and Beamsplitter gates.
-
Embedding: Maps (
-
Why?
- Linearization: Koopman theory states non-linear chaos is linear in an infinite-dimensional Hilbert space. The quantum circuit provides this high-dimensional feature space.
- Unitarity: Quantum evolution is reversible and norm-preserving — mathematically guaranteeing Zero Energy Drift.
- Hybrid Execution: Intelligently offloads quantum simulation to CPU (for speed) while maintaining PyTorch gradient tracking on GPU.
src/models.py—NQ_SKAE_Decoder
- Function: Projects the quantum-evolved latent state back to the physical grid.
- The Innovation: A mirror image of the encoder, progressively upscaling the data to reconstruct the high-frequency wave-fronts of the fluid.
| Component | Tech | Purpose |
|---|---|---|
| Deep Learning | PyTorch | Neural network graphs, Autograd, GPU acceleration |
| Quantum Sim | PennyLane | Differentiable quantum circuit programming |
| Backend | default.gaussian | Efficient simulation of CV photonic states (Gaussian optics) |
| Data Ops | Pandas / NumPy | High-performance tensor manipulation for the KS dataset |
| Optimizer | Adam + ReduceLROnPlateau | Adaptive gradient descent to navigate the chaotic loss landscape |
NQ-SKAE/
├── data/ # Dataset storage
│ └── X1train.csv # Kuramoto-Sivashinsky Training Data
├── figures/ # Generated evaluation plots
├── src/ # Source Code
│ ├── __init__.py
│ ├── data.py # Production-grade Data Loader with Normalization
│ ├── models.py # Symplectic Encoder/Decoder Architectures
│ ├── quantum.py # PennyLane Quantum Circuit Definitions
│ └── main_train.py # Hybrid Training Engine & Validation Loop
├── weights/ # Saved Model Checkpoints
│ └── best.pt # Best performing model weights
├── requirements.txt # Python Dependencies
└── README.md # Documentation
- Python
3.8+ - NVIDIA GPU (Recommended for Classical Layers)
# Clone the repository
git clone https://github.com/codewithyug06/NQ-SKAE.git
cd NQ-SKAE
# Install dependencies
pip install -r requirements.txtTo start the hybrid training pipeline (GPU for neural nets, CPU for quantum simulation):
python src/main_train.py⚙️ Configuration parameters (Batch size, Learning Rate, Quantum Layers) can be modified in the
CONFIGdictionary withinmain_train.py.
The model is benchmarked on the KS equation, a canonical standard for testing chaotic spatiotemporal dynamics:
| Property | Value |
|---|---|
| Input Dimension | 1024 Spatial Grid Points |
| Characteristics | Spatiotemporal chaos, multi-scale energy cascade, positive Lyapunov exponent |
| Data Structure | Autoregressive pairs |
| Metric | Value |
|---|---|
| MSE |
0.00640 — outperforms standard FNO baselines |
| Stability | Maintains structural integrity of wave-fronts over 100,000 recursive time steps |
| Energy Conservation | Hamiltonian drift strictly bounded below |
- 3D Turbulence — Scale the architecture to model 3D Navier-Stokes equations for aerodynamic simulations.
- Real Hardware — Deploy the inference layer on actual Photonic Quantum Processors (e.g., Xanadu Borealis).
- Fault Tolerance — Integrate GKP (Gottesman-Kitaev-Preskill) error correction for noise resilience.