Skip to main content

Simplified 1D quantum tunneling solver with 4 classic test cases

Project description

1d-qt-ideal-solver: Idealized 1D Quantum Tunneling Solver

DOI Python License: MIT Numba PyPI

High-performance 1D quantum tunneling solver implementing the split-operator Fourier method with adaptive time stepping, Numba-accelerated parallel computation, and optional stochastic noise for idealized simulations of coherent tunneling dynamics in nanoscale barrier systems.

Physics

Solves the time-dependent Schrödinger equation in natural units ($\hbar = m_e = 1$):

$$i\frac{\partial \psi}{\partial t} = \hat{H}\psi = \left[-\frac{1}{2}\nabla^2 + V(x,t)\right]\psi$$

The wavefunction evolves via the split-operator method:

$$\psi(x, t+\delta t) = e^{-iV\delta t/2} \cdot \mathcal{F}^{-1}\left[e^{-ik^2\delta t/2}\mathcal{F}[\psi]\right] \cdot e^{-iV\delta t/2}$$

Key Observables:

  • Transmission coefficient: $T = \int_{x>x_b} |\psi(x,t_f)|^2 dx$
  • Reflection coefficient: $R = \int_{x<x_a} |\psi(x,t_f)|^2 dx$
  • Unitarity: $T + R \approx 1$

Features

  • Adaptive Time Stepping: Automatically adjusts $\delta t$ based on wavefunction dynamics
  • Numba JIT Compilation: 10-100× speedup via parallel CPU execution
  • Stochastic Environments: Ornstein-Uhlenbeck noise ($\tau_{\text{corr}}$) and decoherence ($\gamma$)
  • Conservation Monitoring: Real-time validation of $|\psi|^2 = 1$ and energy conservation
  • Professional Visualization: Parallel-rendered GIF animations with publication-quality aesthetics
  • NetCDF4 Output: Self-describing, compressed data format for reproducible research

Installation

From PyPI:

pip install 1d-qt-ideal-solver

From source:

git clone https://github.com/yourusername/1d-qt-ideal-solver.git
cd 1d-qt-ideal-solver
pip install -e .

Quick Start

Command-line interface:

# Run individual test case
qt1d-simulate case1                    # Rectangular barrier
qt1d-simulate case2 --cores 8          # Double barrier (8 cores)

# Run all 4 cases sequentially
qt1d-simulate --all

# Custom configuration
qt1d-simulate --config myconfig.txt

Python API:

from qt1d_ideal import QuantumTunneling1D, GaussianWavePacket

# Initialize solver
solver = QuantumTunneling1D(nx=2048, x_min=-10, x_max=10)

# Prepare initial Gaussian wave packet
psi0 = GaussianWavePacket(x0=-5.0, k0=5.0, sigma=0.5)(solver.x)

# Define rectangular barrier: V₀ = 2 eV, width = 2 nm
V = solver.rectangular_barrier(height=2.0, width=2.0)

# Solve dynamics
result = solver.solve(
    psi0=psi0, 
    V=V, 
    t_final=5.0,
    n_snapshots=200,
    noise_amplitude=0.05,      # 50 meV stochastic noise
    decoherence_rate=0.001     # T₂ ≈ 1 ps
)

print(f"T = {result['transmission_coefficient']:.2%}")
print(f"R = {result['reflection_coefficient']:.2%}")

Output Files

Simulation data (in outputs/):

  • *.nc — NetCDF4 format (wavefunction evolution, parameters, metadata)
  • *.gif — High-quality animations with statistics overlay

Diagnostics (in logs/):

  • *.log — Complete simulation records with conservation diagnostics

Physical Applications

Relevant for idealized studies of quantum tunneling in:

  • Nuclear Physics: α-decay (fm scale)
  • Surface Science: STM imaging, field emission (Å scale)
  • Chemical Dynamics: Proton transfer reactions (nm scale)
  • Nanoelectronics: Resonant tunneling diodes, Josephson junctions (μm scale)

Performance

  • Runtime: 10-30 seconds per case (2048 grid points, 200 frames)
  • Parallel Rendering: ~10× faster GIF generation via multiprocessing
  • Accuracy: Norm error < 0.1%, energy conservation < 1%

Citation

If you use this solver in your research, please cite:

@software{qt1d_solver_2025,
  author = {Kaban, Siti N. and Herho, Sandy H. S. and Prayogo, Sonny and Anwar, Iwan P.},
  title = {1D Quantum Tunneling Solver: Idealized Split-Operator Method},
  year = {2025},
  version = {0.0.1},
  url = {https://github.com/yourusername/1d-qt-ideal-solver},
  license = {MIT}
}

Authors

License

MIT License — See LICENSE for details.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

1d_qt_ideal_solver-0.0.2.tar.gz (20.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

1d_qt_ideal_solver-0.0.2-py3-none-any.whl (23.8 kB view details)

Uploaded Python 3

File details

Details for the file 1d_qt_ideal_solver-0.0.2.tar.gz.

File metadata

  • Download URL: 1d_qt_ideal_solver-0.0.2.tar.gz
  • Upload date:
  • Size: 20.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.1.3 CPython/3.12.2 Linux/6.11.9-100.fc39.x86_64

File hashes

Hashes for 1d_qt_ideal_solver-0.0.2.tar.gz
Algorithm Hash digest
SHA256 f9b740d432c15a385f0e859237c7970b41172f085b00b383c2817d13b5a5c3c1
MD5 21354c4742747ef42fda3bf03d6abd75
BLAKE2b-256 4df8ac1351af6d42ee42c034a2e018826470d47f291303301019b7f868729ec9

See more details on using hashes here.

File details

Details for the file 1d_qt_ideal_solver-0.0.2-py3-none-any.whl.

File metadata

  • Download URL: 1d_qt_ideal_solver-0.0.2-py3-none-any.whl
  • Upload date:
  • Size: 23.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.1.3 CPython/3.12.2 Linux/6.11.9-100.fc39.x86_64

File hashes

Hashes for 1d_qt_ideal_solver-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 4e1dc20cd6bf090d7366f5a4be622e6279590bf9656dc3590557a1bbba2efafe
MD5 084804d255934d0e297b433b45972714
BLAKE2b-256 7e9b193cd31ff60fcdea1e64d87bc1c0de96b1d6f4e140faec003e172e470687

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page