Giter Site home page Giter Site logo

brooglie's Introduction

Brooglie

This software solves the time-independent Schödinger equation for the 1D, 2D and 3D cases employing a finite difference method. For example, to solve the 1D quantum harmonic oscillator one can use the following snippet:

using Brooglie

m = 1
ω = 1
a,b = -10,10 # Limits of the box

# Use atomic units!
V(x) = 0.5*m*ω^2*x^2

# Find the first 5 eigenstates
E, vv = solve(V, a=a, b=b, m=m, nev=5)

E will be in Hartree (atomic units), remember that one Hartree is equivalent to 27.21 eV. As expected, we obtain E≃ω(n+½) noticing that ℏ=1 in these units:

Analytical Numerical
0.5 0.500952
1.5 1.50275
2.5 2.50436
3.5 3.50576
4.5 4.50696

In the array vv we find 5 vectors (1 dimensional), one for each eigenstate:

alt text

Read the help of solve to see all the available options. It accepts potentials with arbitrary number of dimensions, like for example V(x,y,z,k,w), and creates the Hamiltonian accordingly (read the documentation for the methods used under the doc/ directory), reshaping the vv vectors into the correct number of dimensions. For example, if V(x,y) = x+y is used as potential the array vv will contain matrices.

If the Hamiltonian is needed for a more detailed calculation, it can be returned skipping the diagonalization with the buildH function.

TODO

  • Fix all the tests, some will need to tweak N or maxiters after the last commits.
  • Add an hydrogen atom to the tests.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.