1D Quantum Pontentials

The basis solution requires knowledge of the potential, defined in a potential config file.

Configure Sections

A potential is defined using the section [parameters] and [regions]:

  • [parameters] has a list of lowercas parameter names as options with default values.

  • [regions] options are region numbers, values have the form:

    start, stop | region value (or function)
    

    start and stop can be any valid python code where the variable names should be defined in [parameters]. The value or function can also refer to any variables; for functions use th lambda syntax:

    lambda x: v0*(x-shift)**2 - numpy.exp(x)
    

    Functions can use any numpy or operator modules in addition to the parameters.

API Documentation

Defines a class and methods for evaluating 1D quantum potentials.

class basis.potential.Potential(potcfg)[source]

Represnts a 1D quantum potential.

Parameters:potcfg (str) – path to the potential configuration file.
filepath

str – absolute path to the file that this potential represents.

params

dict – keys are parameter names; values are python-evaluated objects.

regions (dict): keys are a tuple (‘float’, ‘float’) that specify the
start and end the region; values are either functions or variables to define the potential’s value in that region.
parser (ConfigParser): parses the potential configuration
file.

Examples

>>> from basis.potential import Potential
>>> import numpy as np
>>> x = np.linspace(-2,2,100)
>>> pot = Potential("sho.cfg")
>>> V = pot(x)
adjust_potential(**kwargs)[source]

Adjusts the parameters of the potential.

Parameters:kwargs (dict) – parameters and values to overwrite.