Skip to content

Basic implementation of a solver for the two-dimensional time-dependent Schrödinger equation for a single particle.

License

Notifications You must be signed in to change notification settings

martapisci/quantum_slit

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

28 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

quantum_slit

License Language Size

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.

Table of contents

Requirements

In order to be able to run everything succesfully you will need:

  • A C++11 compiler
  • armadillo, an efficient linear algebra library
  • cmake, for building (optional, recommended)

This project also uses the header-only progressbar library, which is already included in this repository in include/progressbar.hpp.

Building

Clone this repo with

git clone https://github.com/martapisci/quantum_slit

or

git clone [email protected]:martapisci/quantum_slit

CMAKE

In order to build everything you need cmake. First you need to create a build/ directory and move into it

mkdir build; cd build

Now you just need to run

cmake ..

If it outputs correctly you should be able to build the project by runnning

make

from the same build/ directory.

Filesystem

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.py

from plots/. In demo/ you have the output animations obtained following the steps explained in the section Demo.

HowToRun

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.sh

When 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 3

Demo

Here 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 3

After all of them finished you can move to plots/ and make the animations with

python3 animation.py

This is going to be the result:

         

License

The code here presented is released under version 3 of the GNU General Public License.

Aknowledgements

About

Basic implementation of a solver for the two-dimensional time-dependent Schrödinger equation for a single particle.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published