Basic implementation of a solver for the two-dimensional time-dependent Schrödinger equation for a single particle.
Here you can find the code needed for studying the time evolution of the wave function passing through different types of slits in a 2D frame.
This repo is mantained by group 100 of the course FYS3150/4150 at UiO.
In order to be able to run everything succesfully you will need:
- A
C++11compiler armadillo, an efficient linear algebra librarycmake, for building (optional, recommended)
This project also uses the header-only progressbar library, which is already included in this repository in include/progressbar.hpp.
Clone this repo with
git clone https://github.com/martapisci/quantum_slitor
git clone git@github.com:martapisci/quantum_slitIn order to build everything you need cmake. First you need to create a build/ directory and move into it
mkdir build; cd buildNow you just need to run
cmake ..If it outputs correctly you should be able to build the project by runnning
makefrom the same build/ directory.
The repo is organized as follows:
quantum_slit
│
└───build/
│ └───data/
│ └───plots/
│
└───include/
│
└───plots/
│
└───src/
│
└───demo/
Inside the build/ directory you can find the executables and two subfolders: build/data/ for storing the resulting data and build/plots/ for storing the plots of the same resulting data.
In the include/ directory are stored all the header files and in the src/ directory are stored the source files.
In plots/ you can find also the python scripts that make the graphs and store them in build/plots/. For example, to make the animations simply run
python3 animation.pyfrom plots/. In demo/ you have the output animations obtained following the steps explained in the section Demo.
There are two possible ways of running the code. You can either modify the parameters.txt file and then compile with cd build; make and run ./probability, OR you can just run the shell-script ./run.sh form the parent directory. Remember to make it executable, i.e.
chmod +rx run.shWhen running the shell-script you give the parameters as command line arguments (we modify file parameters.txt under the hood for you 😉):
./run.sh <M> <dT> <T> <xc> <yc> <sigmax> <sigmay> <px> <py> <v0> <nslit>An example would be
./run.sh 200 0.000025 0.008 0.25 0.5 0.05 0.1 200. 0. 1e10 3Here you can find a little demonstration of what you can do with our beautiful little program. First of all run
./run.sh 200 0.000025 0.003 0.25 0.5 0.05 0.2 200. 0. 0. 0
./run.sh 200 0.000025 0.003 0.25 0.5 0.05 0.2 200. 0. 1e10 1
./run.sh 200 0.000025 0.003 0.25 0.5 0.05 0.2 200. 0. 1e10 2
./run.sh 200 0.000025 0.003 0.25 0.5 0.05 0.2 200. 0. 1e10 3After all of them finished you can move to plots/ and make the animations with
python3 animation.pyThis is going to be the result:
The code here presented is released under version 3 of the GNU General Public License.




