- Euler, Crank-Nicolson -
cn.py
- Finite difference methods -
iter_diff.py
&matrix_diff.py
- Alternating-direction implicit method -
adi_sparse.py
&adi_tridiag.py
- Split-step Fourier method -
ssfm.py
&torch_ssfm.py
from methods import Method # wrapper za razlicne solverje
L, T, N, Nt = 5, 10, 128, 10000 # parametri mreze
n, a_x, a_y, lam = 0, 1, 0, 0 # parametri potenciala
M = Method(N=N, Nt=Nt, method_name="tridiag_adi")
M.init_grid(L=L, T=T)
M.init_pot(n=n, a_x=a_x, a_y=a_y, lam=lam)
res = M.start_method(check_overflow=False, save_every=Nt // 100)
See animations directory for results of time propagation.