Skip to content
This repository has been archived by the owner on Oct 9, 2023. It is now read-only.
/ WaveNCC Public archive

An app to compute the normalization coefficients of a given set of orthogonal 1D complex wave functions.

License

Notifications You must be signed in to change notification settings

JustWhit3/WaveNCC

Repository files navigation

An app to compute the normalization coefficients of a given set of orthogonal 1D complex wave functions.

v1.0 license Python 3.8
code size repo size total lines
codeq

Table of contents

Introduction

This program computes the normalization coefficients of a given set of orthogonal 1-dimensional complex wave-functions for a given n index. Additionally, it performs orthogonality and orthonormality checks and plots the normalized wave-functions shapes. More physical and mathematical information can be found here.

The set of wave-functions is used in quantum mechanics to find a generic solution for the 1-D Schrödinger equation and in particular for the equation of the harmonic oscillator.

This program computes the coefficients only for a certain kind of wave-function, which should be:

  • Orthogonal.
  • Real or complex.
  • 1-dimensional (therefore, with only one variable).
  • Time independent.

The function may depends on an index n but this is not necessary, since the program can calculate the coefficients also if n=0.

NB: equation color is green in order to improve the readability both for light and dark GitHub themes.

An example output of the program:

The software is and will stay free, but if you want to support me with a donation it would be really appreciated!

Buy Me A Coffee

Supported operating systems

  • Linux
    • Ubuntu (tested)
  • MacOS
  • Windows

Install an run

Steps to be reproduced:

1) Download one of the releases of the repository or clone the main branch.

2) Unzip and enter the downloaded repository directory.

3) Install all the prerequisites:

pip install -r requirements.txt

Prerequisites list:

  • Python 3.8.10.
  • Doctest for Python.
  • All the required libraries with the right version.

4) Run the main program:

To run the code you can simply enter this command in the shell:

python src/main.py

Extra information about how to move inside the command line once you have ran the code can be found in the How to use section.

5) Run the tests (optional):

If you want to run the tests you have to type:

python src/functions.py

If anything is displayed it means that tests ran correctly.

Tests have been performed using the Doctest framework.

If you want a detailed tests log printed on the screen, simply enter:

python src/functions.py -v

Extra documentation

Here you can find a list of the documentation files of the repository:

  • Background explanation: contains some t theoretical explanations about the algorithm and the physics / mathematical background topics of the program.
  • Contributing: contains some information about how to contribute to this project.
  • Todo: contains a list of todo stuff which could be implemented to extend the software with new tools.

How to use

Once you ran the program and choose an option, it will be asked to insert real and imaginary part of the wave-function you want to normalize. An example is the following:

Enter the REAL part: np.cos(n*x)
Enter the IMAGINARY part: np.sin(n*x)

Then, you can insert the integration extremes, which will be used to check the orthogonality / orthonormality of the wave-function and to compute the normalization coefficients, for example:

Enter the LOWEST integration extreme: -3
Enter the HIGHEST integration extreme: 3

The next step is to insert the wave-function index n :

Enter the wave-function index "n": 3

And finally the normalization coefficient and a plot of the normalized wave-function will be displayed:

The normalization coefficient for n = 3  is:  0.4086571521491726

Credits

Project leaders


Gianluca Bianco

About

An app to compute the normalization coefficients of a given set of orthogonal 1D complex wave functions.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages