CurrentModule = Antique
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.
This model is described with the time-independent Schrödinger equation
and the Hamiltonian
Parameters are specified with the following struct.
Antique.DeltaPotential
Antique.V(::DeltaPotential, ::Any)
Antique.E(::DeltaPotential)
Antique.ψ(::DeltaPotential, ::Any)
[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
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"))