Skip to content

A simple, accurate, and fast module for solving the single particle Schrodinger equation.

License

Notifications You must be signed in to change notification settings

dhudsmith/schrod

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

56 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

schrod

A simple, accurate, and fast module for solving the single particle Schrodinger equation.

Probability distributions for V(x) = x + 0.5*x^4

Installation

  1. Make sure you have python3, numpy, and scipy. All of the these (and many more) are included with anaconda.
  2. Clone the repo:
git clone https://github.com/dhudsmith/schrod.git
  1. From inside the schrod directory execute
python setup.py install --user

Optionally you can omit --user to install for all users.

That's it. To load the package into a python shell, simply execute

import schrod

Usage

The harmonic oscillator:

import schrod, numpy

# Specify the potential
x = numpy.linspace(-5, 5, 200)
V = 1/2 * x**2

# Create and solve Schrodinger's equation
eqn = schrod.Schrod(x, V)
eqn.solve()

# Print the first five eigenvalues
print(eqn.eigs[0:5])

Output: [ 0.5 1.5 2.50000008 3.50000122 4.50001267]

For more examples, see the examples folder.

About

A simple, accurate, and fast module for solving the single particle Schrodinger equation.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages