Schrod
A simple, accurate, and fast module for solving the single particle Schrodinger equation.
Install / Use
/learn @dhudsmith/SchrodREADME
schrod
A simple, accurate, and fast module for solving the single particle Schrodinger equation.
<img src="/examples/plots/prob_dist.png" alt="Probability distributions for V(x) = x + 0.5*x^4" width="500"/>Installation
- Make sure you have
python3,numpy, andscipy. All of the these (and many more) are included with anaconda. - Clone the repo:
git clone https://github.com/dhudsmith/schrod.git
- From inside the
schroddirectory 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.
Related Skills
node-connect
347.6kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
108.4kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
347.6kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
qqbot-media
347.6kQQBot 富媒体收发能力。使用 <qqmedia> 标签,系统根据文件扩展名自动识别类型(图片/语音/视频/文件)。
