| # Schrödinger Equation Dataset | |
| Numerical solutions to the 1D time-dependent Schrödinger equation with harmonic oscillator potential. | |
|  | |
| ## Equation | |
| **Time-dependent Schrödinger equation**: | |
| ``` | |
| iℏ ∂ψ/∂t = Ĥψ | |
| ``` | |
| where the Hamiltonian is: | |
| ``` | |
| Ĥ = -ℏ²/2m ∇² + V(x) | |
| ``` | |
| **Harmonic oscillator potential**: | |
| ``` | |
| V(x) = ½mω²x² | |
| ``` | |
| The complex wavefunction ψ = ψᵣ + iψᵢ is split into real and imaginary parts: | |
| - Real part: ∂ψᵣ/∂t = (ℏ/2m)∇²ψᵢ - V(x)ψᵢ/ℏ | |
| - Imaginary part: ∂ψᵢ/∂t = -(ℏ/2m)∇²ψᵣ + V(x)ψᵣ/ℏ | |
| ## Variables | |
| The dataset returns a dictionary with the following fields: | |
| ### Coordinates | |
| - `spatial_coordinates`: `(Nx,)` - 1D spatial grid points x ∈ [-Lx/2, Lx/2] | |
| - `time_coordinates`: `(time_steps,)` - Time evolution points | |
| ### Solution Fields | |
| - `psi_r_initial`: `(Nx,)` - Real part of initial wavefunction | |
| - `psi_i_initial`: `(Nx,)` - Imaginary part of initial wavefunction | |
| - `psi_r_trajectory`: `(time_steps, Nx)` - Real part evolution | |
| - `psi_i_trajectory`: `(time_steps, Nx)` - Imaginary part evolution | |
| - `state_trajectory`: `(time_steps, 2*Nx)` - Concatenated [ψᵣ, ψᵢ] for ML | |
| - `probability_density`: `(time_steps, Nx)` - |ψ|² probability density | |
| ### Physical Quantities | |
| - `potential`: `(Nx,)` - Harmonic oscillator potential V(x) = ½mω²x² | |
| - `total_energy`: `(time_steps,)` - Total energy over time (conservation check) | |
| ### Physical Parameters | |
| - `hbar`: Reduced Planck constant | |
| - `mass`: Particle mass | |
| - `omega`: Harmonic oscillator frequency | |
| ## Dataset Parameters | |
| - **Domain**: x ∈ [-10, 10] (symmetric around origin for harmonic oscillator) | |
| - **Grid points**: Nx = 256 (spectral resolution with Fourier basis) | |
| - **Time range**: [0, 2.0] (sufficient to see wave packet oscillations) | |
| - **Spatial resolution**: Δx ≈ 0.078 (domain length / grid points) | |
| - **Temporal resolution**: Δt = 1e-3 (RK4 time stepping) | |
| ### Physical Parameters | |
| - **Reduced Planck constant**: ℏ = 1.0 | |
| - **Particle mass**: m = 1.0 | |
| - **Harmonic oscillator frequency**: ω = 1.0 | |
| - **Boundary conditions**: Periodic (suitable for localized wave packets) | |
| ### Initial Conditions | |
| - **Wave packet type**: Gaussian wave packets with random parameters | |
| - **Center position**: x₀ ∼ Uniform([-5, 5]) | |
| - **Wave packet width**: σ ∼ Uniform([0.5, 2.0]) | |
| - **Initial momentum**: k₀ ∼ Uniform([-2.0, 2.0]) | |
| - **Amplitude**: A ∼ Uniform([0.5, 2.0]) (normalized after generation) | |
| ## Physical Context | |
| This dataset simulates **quantum harmonic oscillator dynamics** governed by the time-dependent Schrödinger equation. The equation models the quantum mechanical evolution of a particle in a harmonic potential well V(x) = ½mω²x². | |
| **Key Physical Phenomena**: | |
| - **Wave packet oscillation**: Gaussian wave packets oscillate back and forth in the harmonic potential | |
| - **Quantum tunneling**: Wave function can extend into classically forbidden regions | |
| - **Energy quantization**: Total energy is conserved and quantized in bound states | |
| - **Probability conservation**: |ψ|² integrates to 1 at all times | |
| - **Phase evolution**: Real and imaginary parts evolve with quantum phase relationships | |
| **Applications**: | |
| - **Quantum mechanics education**: Fundamental model system in quantum physics courses | |
| - **Atomic physics**: Models trapped atoms in harmonic potentials (laser cooling, optical traps) | |
| - **Quantum optics**: Describes coherent states and squeezed states of light | |
| - **Neural operator learning**: Provides rich training data for physics-informed machine learning | |
| - **Bose-Einstein condensates**: Mean-field dynamics in harmonic traps | |
| ## Usage | |
| ```python | |
| from dataset import SchrodingerDataset | |
| # Create dataset | |
| dataset = SchrodingerDataset( | |
| Lx=20.0, # Domain size | |
| Nx=256, # Grid resolution | |
| hbar=1.0, mass=1.0, omega=1.0, # Physical parameters | |
| stop_sim_time=2.0, # Simulation time | |
| timestep=1e-3 | |
| ) | |
| # Generate a sample | |
| sample = next(iter(dataset)) | |
| # Access solution data | |
| x = sample["spatial_coordinates"] # Spatial grid | |
| t = sample["time_coordinates"] # Time points | |
| psi_r = sample["psi_r_trajectory"] # Real part evolution | |
| psi_i = sample["psi_i_trajectory"] # Imaginary part evolution | |
| state = sample["state_trajectory"] # Combined [ψᵣ, ψᵢ] for ML | |
| prob = sample["probability_density"] # |ψ|² probability | |
| energy = sample["total_energy"] # Energy conservation | |
| ``` | |
| ## Visualization | |
| Run the plotting scripts to visualize samples: | |
| ```bash | |
| python plot_sample.py # Static visualization | |
| python plot_animation.py # Animated evolution | |
| ``` | |
| ## Data Generation | |
| Generate the full dataset: | |
| ```bash | |
| python generate_data.py | |
| ``` | |
| This creates train/test splits saved as chunked parquet files in the `data/` directory. |