Skip to content

Latest commit

 

History

History
116 lines (85 loc) · 2.4 KB

DeltaPotential.md

File metadata and controls

116 lines (85 loc) · 2.4 KB
CurrentModule = Antique

Delta Potential

The Delta potential is one of the simplest models for quantum mechanical system in 1D. It always has one bound state and its wave function has a cusp at the origin.

Definitions

This model is described with the time-independent Schrödinger equation

$$\hat{H} \psi(x) = E \psi(x),$$

and the Hamiltonian

$$\hat{H} = - \frac{\hbar^2}{2m} \frac{\mathrm{d}^2}{\mathrm{d}x ^2} + V(x).$$

Parameters are specified with the following struct.

Parameters

Antique.DeltaPotential

Potential

Antique.V(::DeltaPotential, ::Any)

Eigenvalues

Antique.E(::DeltaPotential)

Eigenfunctions

Antique.ψ(::DeltaPotential, ::Any)

Usage & Examples

[Install Antique.jl](@ref Install) for the first use and run using Antique before each use. The energy E(), wavefunction ψ() and potential V() will be exported. In this system, the model is generated by DeltaPotential and several parameters α, m and are set as optional arguments.

using Antique
DP = DeltaPotential(α=1.0, m=1.0, ℏ=1.0)
; #hide

Parameters:

DP.α
DP.m
DP.ℏ

Eigenvalues:

E(DP)

Wave functions:

using CairoMakie

# setting
f = Figure()
ax = Axis(f[1,1], xlabel=L"$x$", ylabel=L"$\psi(x)$")

# plot
w = lines!(ax, -5..5, x -> ψ(DP, x))

f

Potential energy curve, Energy levels, Wave functions:

using CairoMakie

# settings
f = Figure()
ax = Axis(f[1,1], xlabel=L"$x$", ylabel=L"$V(x),~E_n,~\psi_n(x) \times 5 + E_n$", aspect=1, limits=(-5,5,-0.6,0.6))
# hidespines!(ax)
# hidedecorations!(ax)

# energy
hlines!(ax, E(DP), color=:black, linewidth=1, linestyle=:dash)

# wave function
lines!(ax, -5..5, x -> E(DP) + ψ(DP,x), linewidth=2)

#potential
lines!(ax, [-5,0,0,0,5], [0,0,-1,0,0], color=:black, linewidth=2)

f
save("assets/fig/DeltaPotential.png", f) # hide
; # hide

Testing

Unit testing and Integration testing were done using numerical integration (QuadGK.jl). The test script is here.

using Markdown
using Antique
Markdown.parse(Antique.load("../../test/result/DeltaPotential.log"))