qmspectral
Quantum Mechanics Spectral Methods - 使用谱方法(傅里叶和切比雪夫)求解一维定态薛定谔方程。
功能
- 傅里叶谱方法: 适用于周期性边界条件
- 切比雪夫谱方法: 适用于 Dirichlet 边界条件
- 内置势函数:
- 无限深势阱 (Infinite Well)
- 简谐振子 (Harmonic Oscillator)
- 双势阱 (Double Well)
安装
pip install qmspectral
使用示例
from qmspectral import solve
# 使用切比雪夫方法求解简谐振子
energies, wavefuncs, x = solve(
method="chebyshev",
potential_name="Harmonic Oscillator",
a=-10,
b=10,
N=64,
num_states=5
)
print(f"前5个能级: {energies}")
直接使用谱方法
from qmspectral import solve_chebyshev, solve_fourier
from qmspectral.potentials import harmonic
# 切比雪夫方法
energies, wavefuncs, x = solve_chebyshev(harmonic, -10, 10, N=64, num_states=5)
# 傅里叶方法
energies, wavefuncs, x = solve_fourier(harmonic, -10, 10, N=64, num_states=5)
自定义势函数
from qmspectral import solve_chebyshev
import numpy as np
def my_potential(x):
return 0.5 * x**2 + 0.1 * x**4 # 简谐+微扰
energies, wavefuncs, x = solve_chebyshev(my_potential, -8, 8, N=128, num_states=5)
依赖
- numpy >= 1.20
- scipy >= 1.7
许可证
MIT License
Metadata
Release files for qmspectral 0.2.5
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| qmspectral-0.2.5.tar.gz | 9.8 kB | Without provenance | Details for qmspectral-0.2.5.tar.gz |
Release files / qmspectral-0.2.5.tar.gz
| Download URL | qmspectral-0.2.5.tar.gz |
|---|---|
| Size | 9.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
e939ffc152557f5d44e6c66812120c9126de34a9d8b9b194199718453044b1b2
|
|
BLAKE2b-256 checksum How to use checksums |
9069202081cc94149b28bd49d88127d0a10bd4568a6e4444a81e17dae22cd486
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.14.3
|
Security for qmspectral 0.2.5
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.