Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Finite Square Well — bound states (analytical + numerical)

Solving the finite square potential well in one dimension: its bound-state energies and wave functions, from the analytical derivation through to the numerical roots and the plots.

This began as a take-home exercise for Quantum Physics (GEMF — Universitat Rovira i Virgili, May 2026). The repository packages three things:

  • report.pdf — the full write-up (20 problems): Schrödinger equation, Hamiltonian, continuity conditions, transcendental equations, dimensionless variables, numerical energies, normalisation and probabilities. (Original coursework.)
  • matlab/finite_square_well_roots.m — the MATLAB root-finder used in the exercise. (Original coursework; runs in MATLAB or in free GNU Octave.)
  • python/finite_square_well.py — a Python companion (numpy · scipy · matplotlib) that re-derives the whole numerical part and regenerates the figures. It reproduces every value in the report.

The problem

A particle in a well of depth V0 and width L. Inside the well the wave function oscillates; outside it (for E < V0) it decays exponentially. Imposing continuity of ψ and ψ' at the two walls, and using the symmetry of the potential (states of definite parity), reduces the problem to two transcendental equations in the dimensionless variable σ = k₁L/2 (with ρ = k₂L/2 = √(ρ₀² − σ²)):

symmetric:       σ·tan σ  =  ρ
antisymmetric:  −σ·cot σ  =  ρ

where the well strength is ρ₀² = m·L²·V0 / (2ℏ²). In the units of the exercise (L = m = ℏ = 1, V0 = 50) this gives ρ₀ = 5, which admits four bound states.

Results

The four bound states (energies in the exercise's units, compared with the infinite well of the same width):

n Parity σ ρ E (finite well) E (infinite well)
1 symmetric 1.306440 4.826304 3.413571 4.934802
2 antisymmetric 2.595739 4.273422 13.475723 19.739209
3 symmetric 3.837467 3.205284 29.452308 44.413220
4 antisymmetric 4.906295 0.963467 48.143464 78.956835

Every finite-well energy sits below V0 = 50 (so all four are bound) and below its infinite-well counterpart — in a finite well the particle leaks past the walls, so it is less confined.

  • Lowest state (symmetric): strongly trapped — only 1.17 % of the probability lies outside the well.
  • Highest state (antisymmetric): only weakly bound — about 49 % of the probability is outside.

Figures

Graphical solution — the intersections give the four values of σ:

Graphical solution of the transcendental equations

Lowest bound state — strongly trapped inside the well:

Lowest bound-state wave function

Highest bound state — leaking out of the well:

Highest bound-state wave function

Run it

Python — reproduces the roots, the energies and the three figures:

pip install -r python/requirements.txt
python python/finite_square_well.py

MATLAB / Octave — just the numerical roots:

run matlab/finite_square_well_roots.m

Notes

The analytical derivation (report.pdf) and the MATLAB script are the original coursework. python/finite_square_well.py is a computational companion added afterwards: it reproduces every number in the report — the four roots, the energies, the normalisation constants and the probabilities outside the well — and regenerates the figures with numpy/scipy/matplotlib.


En castellano

Resolución del pozo de potencial cuadrado finito en 1D: energías y funciones de onda de los estados ligados, desde la derivación analítica hasta las raíces numéricas y las gráficas. Origen: un ejercicio de Física Cuántica (GEMF — URV, mayo 2026).

Imponiendo continuidad de ψ y ψ' en las paredes y usando la paridad del potencial, el problema se reduce a dos ecuaciones trascendentales en la variable adimensional σ (con ρ = √(ρ₀² − σ²)): σ·tan σ = ρ (simétricas) y −σ·cot σ = ρ (antisimétricas), con ρ₀² = m·L²·V0 / (2ℏ²). Para L = m = ℏ = 1 y V0 = 50ρ₀ = 5 y cuatro estados ligados (E₁ = 3.41, E₂ = 13.48, E₃ = 29.45, E₄ = 48.14). El fundamental está muy atrapado (1,17 % de probabilidad fuera del pozo); el más alto, apenas ligado (≈ 49 % fuera).

Contenido: report.pdf (el trabajo completo, 20 problemas) y matlab/finite_square_well_roots.m (el buscador de raíces) son el trabajo original de la asignatura; python/finite_square_well.py es un acompañamiento computacional que reproduce todos los valores del informe y regenera las figuras.

Ejecutar: pip install -r python/requirements.txt y python python/finite_square_well.py (o run matlab/finite_square_well_roots.m en MATLAB/Octave).


Author: Àlex Martos (@Arekusumt) · Quantum Physics take-home, URV, May 2026 · Code released under the MIT License.

About

Finite square well bound states — analytical report + MATLAB roots + Python (numpy/scipy/matplotlib) reproduction

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages