Git Product home page Git Product logo

variational_principle's Introduction

The Variational Principle in Quantum Mechanics:

Quality Gate Status

The Variational Principle in Quantum Mechanics states that:

equation


This implementation utilises NumPy and Matplotlib to numerically calculate the energy eigenstates and energy eigenvalues of the given bounded potential system.

The code is capable of calculating the bound energies and states of any number of energy eigenstates, with decreasing accuracy with each new state.

The code can handle systems of any number of dimensions, but can only plot the energy eigenstates of a system up to and including 3D.


For full details read the report

Setup:

First, setup a virtualenvironment and install the requirements:

$ python -m virtualenv venv
$ source venv/bin/activate
$ pip install -r requirements.txt

Running:

Ensure the setup steps above are run.

From the top level directory:

$ python -m variational_principle.main

Should result in a help message like the following:

main.py - A tool to calculate the n energy eigenstates for a given bound potential
USAGE:
main.py [FLAGS] <start> <stop> <N>
FLAGS:
-i/--include-potential       Whether or not to plot the calculated graphs with the given potential superimposed
                             (default = False)
-v/--v-scale                 Scaling factor used on the potential when --include-potential is True (default = 10)
-d/--dimensions              The number of dimensions to calculate on, options are 1, 2 or 3 (default = 1)
-n/--num-states              Number of energy eigenstates to calculate (default = 1)
-n/--num-iterations          The number of iterations to calculate (default = 10^5)
-h/--help                    Show this message
ARGUMENTS:
<start>                      The initial coordinate for the grid
<stop>                       The end coordinate for the grid
<N>                          The number of subdivisions of the grid

To verify the code will run correctly, the easiest input is:

$ python -m variational_principle.main -1 1 1

If no errors occur, a GUI should appear with an empty plot.

After that, happy plotting!

Installing:

Using pyinstaller an executable binary can be compiled:

$ pyinstaller --onefile binary.spec

Will compile an executable binary at dist/variational_principle. Run the binary as usual with

$ ./dist/variational_principle [...input]

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.