Overview
TheSchrodingerBackend uses a learned 2-channel spectral neural network for direct wavefunction propagation. It processes complex wavefunctions represented as [real, imaginary] channels and learns the full time evolution operator from training data.
Fallback: If the checkpoint is unavailable, automatically falls back to HamiltonianBackend.
Architecture
The backend uses aSchrodingerSpectralNet with an expansion-contraction structure:
Network Parameters
| Parameter | Default | Description |
|---|---|---|
grid_size | 16 | Spatial grid resolution (G×G) |
hidden_dim | 32 | Hidden layer dimensionality |
expansion_dim | 64 | Expanded feature dimension |
num_spectral_layers | 2 | Number of spectral convolution layers |
Initialization
From SimulatorConfig (quantum_computer.py)
From FrameworkConfig (quantum_simulator.py)
Checkpoint File
Default Path:weights/schrodinger_crystal_final.pth
The checkpoint contains the trained weights for the Schrödinger network:
- Expected keys:
model_state_dict(preferred) or direct state dict - Architecture match required: Must match
grid_size,hidden_dim,expansion_dim, andnum_spectral_layers - Fallback behavior: If missing or load fails, falls back to
HamiltonianBackendfor evolution
Methods
apply() / evolve_amplitude()
- Add batch dimension:
amp.unsqueeze(0)→(1, 2, G, G) - Forward pass through network:
out = net(amp) - Remove batch dimension:
out.squeeze(0)→(2, G, G) - Normalize:
out / sqrt(sum(out²) + eps) - Return evolved amplitude
HamiltonianBackend, the time step dt is not explicitly used during inference. The network learns a fixed evolution step from training.
Example:
apply_phase()
HamiltonianBackend for phase operations.
Technical Details
Expansion-Contraction Pattern
The network architecture follows an expansion-contraction design:- Input projection: 2 channels →
hidden_dimchannels - Expansion:
hidden_dim→expansion_dim(typically 2×) - Spectral processing: Multiple spectral convolution layers at high dimension
- Contraction:
expansion_dim→hidden_dim - Output projection:
hidden_dim→ 2 channels
- Capture complex dynamics in expanded feature space
- Apply spectral operations efficiently
- Project back to physical wavefunction representation
Spectral Layers
EachSpectralLayer operates in Fourier domain:
- Global spatial interactions
- Efficient long-range propagation
- Learned frequency filtering
Automatic Fallback
If the checkpoint fails to load:Usage in Quantum Circuits
Advanced: Free Evolution
SchrodingerBackend is applied to each amplitude independently during the evolve step.
Configuration Reference
SimulatorConfig Parameters
Training Considerations
The Schrödinger network is trained to:- Learn accurate wavefunction propagation
- Preserve unitarity (approximately)
- Match ground truth Schrödinger evolution
- Generalize across different potential landscapes
schrodinger_crystal_final.pth suggests training on crystal/lattice potentials.
Performance Notes
- Speed: Faster than Hamiltonian backend for long evolution (single network pass)
- Accuracy: Depends on training quality and generalization
- Memory: Additional overhead from expansion dimension
- GPU: Strongly recommended for real-time performance
Comparison with HamiltonianBackend
| Feature | SchrodingerBackend | HamiltonianBackend |
|---|---|---|
| Network input | 2-channel wavefunction | Single-channel field |
| Evolution method | Direct learned propagation | First-order H operator |
| Time step | Implicit (learned) | Explicit dt parameter |
| Complexity | Higher (expansion) | Lower (spectral only) |
| Fallback | Yes (to Hamiltonian) | No (uses Laplacian) |
Source Code
- quantum_computer.py: Lines 589-636
- quantum_simulator.py: Lines 468-501
See Also
- HamiltonianBackend - Hamiltonian operator backend
- DiracBackend - Relativistic spinor evolution
- IPhysicsBackend - Abstract backend interface