Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/rreusser/schrodinger-equation-1d-demo

The Schrödinger Equation with a potential barrier in 1D
https://github.com/rreusser/schrodinger-equation-1d-demo

Last synced: 2 months ago
JSON representation

The Schrödinger Equation with a potential barrier in 1D

Awesome Lists containing this project

README

        

# schrodinger-equation-1d-demo

> [The Schrödinger Equation with a potential barrier in 1D](https://rreusser.github.io/schrodinger-equation-1d-demo/)

[![experimental][stability-experimental]][stability-url]

## Introduction

This demo solves [Schrödinger's Equation](https://en.wikipedia.org/wiki/Schr%C3%B6dinger_equation) in the presence of a potential. That is,

i\hbar {\frac {\partial }{\partial t}}\Psi (\mathbf {r} ,t)=\left[{\frac {-\hbar ^{2}}{2\mu }}\nabla ^{2}+V(\mathbf {r} ,t)\right]\Psi (\mathbf {r} ,t)

with `hbar = 1` and `µ = 1`. (Actually, please don't rely on the scale factors! I haven't carefully verified them since they don't affect the behavior to within a constant multiple of the inputs.)

This simulation uses [RK-4](https://github.com/scijs/ode-rk4) temporal integration and spectral differentiation (differentiation via the [FFT](https://github.com/scijs/ndarray-fft)) in space. Spectral derivatives resolve wavenumbers perfectly, as opposed to typical second order finite differences which tend to lead to heavy dispersion. The boundary conditions are implemented using the Perfectly Matched Layer (PML) of Berenger [1].

## Examples

- [Reflection and transmission across a potential barrier](https://rreusser.github.io/schrodinger-equation-1d-demo/#integration=%7B%22dt%22%3A0.0001%2C%22stepsPerIter%22%3A5%2C%22method%22%3A%22rk4%22%7D&pml=%7B%22width%22%3A0.05%2C%22exponent%22%3A1%2C%22gamma%22%3A1.5707963267948966%7D&potential=%7B%22width%22%3A0.1%2C%22magnitude%22%3A1000%2C%22inverted%22%3Afalse%2C%22center%22%3A1%2C%22exponent%22%3A2%7D&pulse=%7B%22center%22%3A0.5%2C%22width%22%3A0.1%2C%22magnitude%22%3A1%2C%22wavenumber%22%3A200%7D&pulse2=%7B%22center%22%3A1.5%2C%22width%22%3A0.1%2C%22magnitude%22%3A0%2C%22wavenumber%22%3A-200%7D)
- [Spreading of the wave packet (higher-frequency components move faster)](https://rreusser.github.io/schrodinger-equation-1d-demo/#integration=%7B%22dt%22%3A0.0001%2C%22stepsPerIter%22%3A5%2C%22method%22%3A%22rk4%22%7D&pml=%7B%22width%22%3A0.05%2C%22exponent%22%3A1%2C%22gamma%22%3A1.5707963267948966%7D&potential=%7B%22width%22%3A0.1%2C%22magnitude%22%3A0%2C%22inverted%22%3Afalse%2C%22center%22%3A1%2C%22exponent%22%3A1.98%7D&pulse=%7B%22center%22%3A0.5%2C%22width%22%3A0.012%2C%22magnitude%22%3A1%2C%22wavenumber%22%3A400%7D&pulse2=%7B%22center%22%3A1.5%2C%22width%22%3A0.1%2C%22magnitude%22%3A0%2C%22wavenumber%22%3A-200%7D)
- [Bouncing in a potential well](https://rreusser.github.io/schrodinger-equation-1d-demo/#integration=%7B%22dt%22%3A0.0001%2C%22stepsPerIter%22%3A5%2C%22method%22%3A%22rk4%22%7D&pml=%7B%22width%22%3A0.05%2C%22exponent%22%3A1%2C%22gamma%22%3A1.5707963267948966%7D&potential=%7B%22width%22%3A0.7%2C%22magnitude%22%3A5000%2C%22inverted%22%3Atrue%2C%22center%22%3A1%2C%22exponent%22%3A50%7D&pulse=%7B%22center%22%3A1%2C%22width%22%3A0.106%2C%22magnitude%22%3A1%2C%22wavenumber%22%3A220%7D&pulse2=%7B%22center%22%3A1.5%2C%22width%22%3A0.1%2C%22magnitude%22%3A0%2C%22wavenumber%22%3A-200%7D)



Reflection and transmission from a potential barrier

[View demo →](https://rreusser.github.io/schrodinger-equation-1d-demo/)

In the demo, the blue and green lines are the real and imaginary components of the wavefunction, with the envelope displayed in black. The red represents the potential barrier with scale displayed on the right, and the gray represents the perfectly matched layer which suppresses reflections.

## To Do

- Verify and tighten up the constant scale factors

## References

[1] Berenger, J.-P. "[A Perfectly Matched Layer for the Absorption of Electromagnetic Waves](http://web.stanford.edu/class/ee256/Berenger1994.pdf)", Journal of Computational Physics. 114, 185-200 (1994).

## License

© 2016 Ricky Reusser. MIT License.

[travis-image]: https://travis-ci.org/rreusser/schrodinger-equation-1d-demo.svg?branch=master
[travis-url]: https://travis-ci.org//schrodinger-equation-1d-demo

[npm-image]: https://badge.fury.io/js/schrodinger-equation-1d-demo.svg
[npm-url]: https://npmjs.org/package/schrodinger-equation-1d-demo

[david-dm-image]: https://david-dm.org/rreusser/schrodinger-equation-1d-demo.svg?theme=shields.io
[david-dm-url]: https://david-dm.org/rreusser/schrodinger-equation-1d-demo

[semistandard-image]: https://img.shields.io/badge/code%20style-semistandard-brightgreen.svg?style=flat-square
[semistandard-url]: https://github.com/Flet/semistandard

[stability-url]: https://github.com/badges/stability-badges
[stability-deprecated]: http://badges.github.io/stability-badges/dist/deprecated.svg
[stability-experimental]: http://badges.github.io/stability-badges/dist/experimental.svg
[stability-unstable]: http://badges.github.io/stability-badges/dist/unstable.svg
[stability-stable]: http://badges.github.io/stability-badges/dist/stable.svg
[stability-frozen]: http://badges.github.io/stability-badges/dist/frozen.svg
[stability-locked]: http://badges.github.io/stability-badges/dist/locked.svg