Skip to main content

For the calculation of one-dimensional Schroedinger equations

Project description

QuantumLine(QLine)

Quantumline (QLine) is a python package for solving one-dimensional Schroedinger equations using the variational principle and to plot the results in a comfortable way.

QLine lives on gitlab (https://gitlab.com/micwe/qline).

The documentation can be found on the corresponding gitlab pages:

https://micwe.gitlab.io/qline/

Installation

Just execute:

pip install qline

Usage

See examples directory for some examples of typical runs.

QLines can be run using Python's interpreter, or interactively with some of the interactive Python consoles.

Example: Harmonic Potential

The theoretical background can be found in the following PDF:

# import QuantumLine package
import QLine as ql
# import numpy standard package
import numpy as np

# Creating a linear Grid
grid = ql.Grid()
x = grid.create_linear_grid()
grid.show_attributes(show=True)

# Create a potential function V(x) (harmonic oscillator)
pot = ql.harmonic_potential(x)

# Configure basis set method (variational principle) 
# For solving Schroedinger equation
N = 10 # Size of basis set

# Run basis set method
# lamb = eigenvalues
# coeff = basis function coefficients (for wave functions)
# basis = basis functions
lamb, coeff, basis = ql.basis_set_method(x, pot, N=N)

print("\n\nEigenenergies:\n", lamb)
print("\n\n(Function) Coefficients:\n", np.around(coeff.real,decimals=2))

# Construct eigenfunctions (wave functions) 
# by combining coefficients and basis functions
wf = ql.wave_function_from_coeff(coeff, basis)

# Visualize wave functions within potential function
# on the associated energies
ql.plot_wfunctions_within_potential(x, pot, lamb, wf,
                                    xmin=-8, xmax=8,
                                    ymin=-0.3, ymax=10.5,
                                    savefig=False)

# Visualize energy level diagram
ql.plot_energy_levels(lamb, savefig=False)

Project details


Release history Release notifications | RSS feed

This version

1.2

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

qline-1.2.tar.gz (24.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

QLine-1.2-py3-none-any.whl (26.9 kB view details)

Uploaded Python 3

File details

Details for the file qline-1.2.tar.gz.

File metadata

  • Download URL: qline-1.2.tar.gz
  • Upload date:
  • Size: 24.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.0 CPython/3.12.3

File hashes

Hashes for qline-1.2.tar.gz
Algorithm Hash digest
SHA256 3ab3f35865ffe0ea3673ce0d1805d24b8cec1a47207e3ce24358aaefa8d942f3
MD5 2438c4906da69048168aadeb7d665e53
BLAKE2b-256 cc0620a9416dda1caa5ceb3cb0ac9ff8b3e1f2ca24094fdac00458b42e3a3016

See more details on using hashes here.

File details

Details for the file QLine-1.2-py3-none-any.whl.

File metadata

  • Download URL: QLine-1.2-py3-none-any.whl
  • Upload date:
  • Size: 26.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.0 CPython/3.12.3

File hashes

Hashes for QLine-1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 f4447fee1986fa64de02cdd1815e70a1b1804d65a6623354482d8d9d80374ab5
MD5 19c5ee52367cbc99aaf17724b3854f5e
BLAKE2b-256 9878bb86f7012cacb2dcb33f295c6c091ac1d58f70f8e1a43df3909c44baa78a

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page