Getting started
eigora is a small Python package for solving quantum systems. In a few minutes you will compute the energy levels of a harmonic oscillator and compare them with the exact answer.
You can follow along on this page without installing anything: the code cells run in your browser.
Installing it
To use the package on your own machine, you need Python 3.12 or later:
pip install git+https://github.com/Tampipo/eigoraThe package needs only NumPy and SciPy. To draw plots as in the next tutorial, install it with matplotlib instead:
pip install "eigora[plot] @ git+https://github.com/Tampipo/eigora"Units
Everything is in atomic units, with . Energies, lengths and times are plain numbers, so there are no conversion factors to carry around.
Your first spectrum
A system is a grid plus a potential. The grid is where the wavefunction gets sampled, and solve returns the lowest eigenstates of the resulting Hamiltonian.
For a harmonic oscillator, the exact energies are , so we can check the numerical result against them. Press Run, then move the slider to change :
from eigora import GridND
from eigora.qm import QuantumSystem
from eigora.qm.potentials import HarmonicWell
omega = 1.0
grid = GridND.line(-10.0, 10.0, 512)
system = QuantumSystem(grid=grid, potential=HarmonicWell(omega=omega))
solution = system.solve(n_states=5)
print(" n numerical exact")
for n, energy in enumerate(solution.energies):
print(f"{n:2d} {energy:9.5f} {(n + 0.5) * omega:9.5f}")
The two columns should agree to several decimal places. They drift apart slowly at higher energies, because those states oscillate faster and the grid resolves them less well.
The theory behind these numbers is in the harmonic oscillator module. Next, let's plot these eigenstates.