Skip to content

Instantly share code, notes, and snippets.

View ahmadabdulnasir's full-sized avatar
🏠
Working from home

Ahmad Abdulnasir Shuaib ahmadabdulnasir

🏠
Working from home
View GitHub Profile
@ahmadabdulnasir
ahmadabdulnasir / schrodingersim.py
Created February 12, 2018 17:08 — forked from martin2250/schrodingersim.py
Simulate Schrodinger Equation in 1D with python
#!/usr/bin/python
from __future__ import print_function
from __future__ import division
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.animation as animation
def D_wrap(A, dX):
d = A - np.roll(A, 1)
d = 0.5 * (d + np.roll(d, -1))