diff --git a/dev/.documenter-siteinfo.json b/dev/.documenter-siteinfo.json index 5d6e587..93a1040 100644 --- a/dev/.documenter-siteinfo.json +++ b/dev/.documenter-siteinfo.json @@ -1 +1 @@ -{"documenter":{"julia_version":"1.9.4","generation_timestamp":"2023-11-29T21:33:28","documenter_version":"1.2.0"}} \ No newline at end of file +{"documenter":{"julia_version":"1.9.4","generation_timestamp":"2023-11-29T23:37:31","documenter_version":"1.2.0"}} \ No newline at end of file diff --git a/dev/HarmonicOscillator/index.html b/dev/HarmonicOscillator/index.html index 8e82bb7..5edf292 100644 --- a/dev/HarmonicOscillator/index.html +++ b/dev/HarmonicOscillator/index.html @@ -42,7 +42,7 @@ plot!(x -> HO.ψ(x, n=2), label="n=2", lw=2) plot!(x -> HO.ψ(x, n=3), label="n=3", lw=2) plot!(x -> HO.ψ(x, n=4), label="n=4", lw=2)
Potential energy curve, Energy levels, Wave functions:
using Plots
-plot(xlim=(-5.5,5.5), ylim=(-0.2,5.4), xlabel="\$x\$", ylabel="\$V(x),~E_n,~\\psi_n(x)\\times0.5+E_n\$", size=(480,400), dpi=400)
+plot(xlim=(-5.5,5.5), ylim=(-0.2,5.4), xlabel="\$x\$", ylabel="\$V(x),~E_n,~\\psi_n(x)\\times0.5+E_n\$", size=(480,400), dpi=300)
for n in 0:4
# energy
hline!([HO.E(n=n)], lc=:black, ls=:dash, label="")
@@ -57,7 +57,7 @@
&= n! \sum_{m=0}^{\lfloor n/2 \rfloor} \frac{(-1)^m}{m! (n-2m)!}(2 x)^{n-2m}.
\end{aligned}\]$n=0:$ ✔
\[\begin{aligned}
H_{0}(x)
- = e^{ - x^{2}} e^{x^{2}}
+ = e^{x^{2}} e^{ - x^{2}}
&= 1 \\
&= 1
\end{aligned}\]
$n=1:$ ✔
\[\begin{aligned}
@@ -70,10 +70,10 @@
= e^{x^{2}} \frac{\mathrm{d}}{\mathrm{d}x} \frac{\mathrm{d} e^{ - x^{2}}}{\mathrm{d}x}
&= -2 + 4 x^{2} \\
&= -2 + 4 x^{2}
-\end{aligned}\]
$n=3:$ ✔
\[\begin{aligned}
+\end{aligned}\]
$n=3:$ ✗ Hₙ(x) = (-1)ⁿ exp(x²) dⁿ/dxⁿ exp(-x²) = ...: Test Failed at C:\Users\user\Desktop\GitHub\Antiq.jl\test\HarmonicOscillator.jl:43 Expression: acceptance
Stacktrace: [1] macro expansion @ C:\Users\user.julia\juliaup\julia-1.9.2+0.x64.w64.mingw32\share\julia\stdlib\v1.9\Test\src\Test.jl:478 [inlined] [2] macro expansion @ C:\Users\user\Desktop\GitHub\Antiq.jl\test\HarmonicOscillator.jl:43 [inlined] [3] macro expansion @ C:\Users\user.julia\juliaup\julia-1.9.2+0.x64.w64.mingw32\share\julia\stdlib\v1.9\Test\src\Test.jl:1498 [inlined] [4] top-level scope @ C:\Users\user\Desktop\GitHub\Antiq.jl\test\HarmonicOscillator.jl:28
\[\begin{aligned}
H_{3}(x)
- = - \frac{\mathrm{d}}{\mathrm{d}x} \frac{\mathrm{d}}{\mathrm{d}x} \frac{\mathrm{d} e^{ - x^{2}}}{\mathrm{d}x} e^{x^{2}}
- &= - 12 x + 8 x^{3} \\
+ = - e^{x^{2}} \frac{\mathrm{d}}{\mathrm{d}x} \frac{\mathrm{d}}{\mathrm{d}x} \frac{\mathrm{d} e^{ - x^{2}}}{\mathrm{d}x}
+ &= 8 x^{3} - 12 x \\
&= - 12 x + 8 x^{3}
\end{aligned}\]
$n=4:$ ✔
\[\begin{aligned}
H_{4}(x)
@@ -82,361 +82,30 @@
&= 12 - 48 x^{2} + 16 x^{4}
\end{aligned}\]
$n=5:$ ✔
\[\begin{aligned}
H_{5}(x)
- = - \frac{\mathrm{d}}{\mathrm{d}x} \frac{\mathrm{d}}{\mathrm{d}x} \frac{\mathrm{d}}{\mathrm{d}x} \frac{\mathrm{d}}{\mathrm{d}x} \frac{\mathrm{d} e^{ - x^{2}}}{\mathrm{d}x} e^{x^{2}}
+ = - e^{x^{2}} \frac{\mathrm{d}}{\mathrm{d}x} \frac{\mathrm{d}}{\mathrm{d}x} \frac{\mathrm{d}}{\mathrm{d}x} \frac{\mathrm{d}}{\mathrm{d}x} \frac{\mathrm{d} e^{ - x^{2}}}{\mathrm{d}x}
&= 120 x - 160 x^{3} + 32 x^{5} \\
&= 120 x - 160 x^{3} + 32 x^{5}
\end{aligned}\]
$n=6:$ ✔
\[\begin{aligned}
H_{6}(x)
= e^{x^{2}} \frac{\mathrm{d}}{\mathrm{d}x} \frac{\mathrm{d}}{\mathrm{d}x} \frac{\mathrm{d}}{\mathrm{d}x} \frac{\mathrm{d}}{\mathrm{d}x} \frac{\mathrm{d}}{\mathrm{d}x} \frac{\mathrm{d} e^{ - x^{2}}}{\mathrm{d}x}
- &= -120 + 720 x^{2} - 480 x^{4} + 64 x^{6} \\
- &= -120 + 720 x^{2} - 480 x^{4} + 64 x^{6}
+ &= -120 + 720 x^{2} + 64 x^{6} - 480 x^{4} \\
+ &= -120 + 720 x^{2} + 64 x^{6} - 480 x^{4}
\end{aligned}\]
$n=7:$ ✔
\[\begin{aligned}
H_{7}(x)
= - e^{x^{2}} \frac{\mathrm{d}}{\mathrm{d}x} \frac{\mathrm{d}}{\mathrm{d}x} \frac{\mathrm{d}}{\mathrm{d}x} \frac{\mathrm{d}}{\mathrm{d}x} \frac{\mathrm{d}}{\mathrm{d}x} \frac{\mathrm{d}}{\mathrm{d}x} \frac{\mathrm{d} e^{ - x^{2}}}{\mathrm{d}x}
- &= - 1680 x + 3360 x^{3} - 1344 x^{5} + 128 x^{7} \\
- &= - 1680 x + 3360 x^{3} - 1344 x^{5} + 128 x^{7}
+ &= - 1680 x + 3360 x^{3} + 128 x^{7} - 1344 x^{5} \\
+ &= - 1680 x + 3360 x^{3} + 128 x^{7} - 1344 x^{5}
\end{aligned}\]
$n=8:$ ✔
\[\begin{aligned}
H_{8}(x)
= e^{x^{2}} \frac{\mathrm{d}}{\mathrm{d}x} \frac{\mathrm{d}}{\mathrm{d}x} \frac{\mathrm{d}}{\mathrm{d}x} \frac{\mathrm{d}}{\mathrm{d}x} \frac{\mathrm{d}}{\mathrm{d}x} \frac{\mathrm{d}}{\mathrm{d}x} \frac{\mathrm{d}}{\mathrm{d}x} \frac{\mathrm{d} e^{ - x^{2}}}{\mathrm{d}x}
- &= 1680 - 13440 x^{2} + 13440 x^{4} - 3584 x^{6} + 256 x^{8} \\
- &= 1680 - 13440 x^{2} + 13440 x^{4} - 3584 x^{6} + 256 x^{8}
+ &= 1680 + 256 x^{8} - 13440 x^{2} - 3584 x^{6} + 13440 x^{4} \\
+ &= 1680 + 256 x^{8} - 13440 x^{2} - 3584 x^{6} + 13440 x^{4}
\end{aligned}\]
$n=9:$ ✔
\[\begin{aligned}
H_{9}(x)
= - e^{x^{2}} \frac{\mathrm{d}}{\mathrm{d}x} \frac{\mathrm{d}}{\mathrm{d}x} \frac{\mathrm{d}}{\mathrm{d}x} \frac{\mathrm{d}}{\mathrm{d}x} \frac{\mathrm{d}}{\mathrm{d}x} \frac{\mathrm{d}}{\mathrm{d}x} \frac{\mathrm{d}}{\mathrm{d}x} \frac{\mathrm{d}}{\mathrm{d}x} \frac{\mathrm{d} e^{ - x^{2}}}{\mathrm{d}x}
- &= 30240 x - 80640 x^{3} + 48384 x^{5} - 9216 x^{7} + 512 x^{9} \\
- &= 30240 x - 80640 x^{3} + 48384 x^{5} - 9216 x^{7} + 512 x^{9}
-\end{aligned}\]
Test Summary: | Pass Total Time
-Hₙ(x) = (-1)ⁿ exp(x²) dⁿ/dxⁿ exp(-x²) = ... | 10 10 35.0s
Normalization & Orthogonality of $H_n(x)$
\[\int_{-\infty}^\infty H_j(x) H_i(x) \mathrm{e}^{-x^2} \mathrm{d}x = \sqrt{\pi} 2^j j! \delta_{ij}\]
n m numerical analytical |error|
- 0 0 1.7724538509055137 1.7724538509055159 0.0000000000001253% ✔
- 0 1 0.0000000000000000 0.0000000000000000 0.0000000000000000% ✔
- 0 2 0.0000000000000001 0.0000000000000000 0.0000000000000000% ✔
- 0 3 0.0000000000000004 0.0000000000000000 0.0000000000000000% ✔
- 0 4 -0.0000000000000013 0.0000000000000000 0.0000000000000000% ✔
- 0 5 -0.0000000000000007 0.0000000000000000 0.0000000000000000% ✔
- 0 6 0.0000000000000537 0.0000000000000000 0.0000000000000000% ✔
- 0 7 0.0000000000000026 0.0000000000000000 0.0000000000000000% ✔
- 0 8 -0.0000000000008242 0.0000000000000000 0.0000000000000000% ✔
- 0 9 0.0000000000001137 0.0000000000000000 0.0000000000000000% ✔
- 1 0 0.0000000000000000 0.0000000000000000 0.0000000000000000% ✔
- 1 1 3.5449077018108315 3.5449077018110318 0.0000000000056499% ✔
- 1 2 0.0000000000000000 0.0000000000000000 0.0000000000000000% ✔
- 1 3 -0.0000000000000010 0.0000000000000000 0.0000000000000000% ✔
- 1 4 -0.0000000000000005 0.0000000000000000 0.0000000000000000% ✔
- 1 5 0.0000000000000150 0.0000000000000000 0.0000000000000000% ✔
- 1 6 0.0000000000000063 0.0000000000000000 0.0000000000000000% ✔
- 1 7 -0.0000000000000749 0.0000000000000000 0.0000000000000000% ✔
- 1 8 -0.0000000000000568 0.0000000000000000 0.0000000000000000% ✔
- 1 9 0.0000000000143249 0.0000000000000000 0.0000000000000000% ✔
- 2 0 0.0000000000000001 0.0000000000000000 0.0000000000000000% ✔
- 2 1 0.0000000000000000 0.0000000000000000 0.0000000000000000% ✔
- 2 2 14.1796308072441306 14.1796308072441271 0.0000000000000251% ✔
- 2 3 -0.0000000000000001 0.0000000000000000 0.0000000000000000% ✔
- 2 4 -0.0000000000000105 0.0000000000000000 0.0000000000000000% ✔
- 2 5 0.0000000000000042 0.0000000000000000 0.0000000000000000% ✔
- 2 6 0.0000000000003681 0.0000000000000000 0.0000000000000000% ✔
- 2 7 0.0000000000000000 0.0000000000000000 0.0000000000000000% ✔
- 2 8 -0.0000000000108429 0.0000000000000000 0.0000000000000000% ✔
- 2 9 -0.0000000000021032 0.0000000000000000 0.0000000000000000% ✔
- 3 0 0.0000000000000004 0.0000000000000000 0.0000000000000000% ✔
- 3 1 -0.0000000000000010 0.0000000000000000 0.0000000000000000% ✔
- 3 2 -0.0000000000000001 0.0000000000000000 0.0000000000000000% ✔
- 3 3 85.0777848434647694 85.0777848434647694 0.0000000000000000% ✔
- 3 4 -0.0000000000000009 0.0000000000000000 0.0000000000000000% ✔
- 3 5 0.0000000000000156 0.0000000000000000 0.0000000000000000% ✔
- 3 6 -0.0000000000000021 0.0000000000000000 0.0000000000000000% ✔
- 3 7 -0.0000000000004121 0.0000000000000000 0.0000000000000000% ✔
- 3 8 -0.0000000000004547 0.0000000000000000 0.0000000000000000% ✔
- 3 9 0.0000000001391527 0.0000000000000000 0.0000000000000000% ✔
- 4 0 -0.0000000000000013 0.0000000000000000 0.0000000000000000% ✔
- 4 1 -0.0000000000000005 0.0000000000000000 0.0000000000000000% ✔
- 4 2 -0.0000000000000105 0.0000000000000000 0.0000000000000000% ✔
- 4 3 -0.0000000000000009 0.0000000000000000 0.0000000000000000% ✔
- 4 4 680.6222787477178144 680.6222787477181555 0.0000000000000501% ✔
- 4 5 -0.0000000000000142 0.0000000000000000 0.0000000000000000% ✔
- 4 6 0.0000000000019327 0.0000000000000000 0.0000000000000000% ✔
- 4 7 0.0000000000000000 0.0000000000000000 0.0000000000000000% ✔
- 4 8 -0.0000000000626612 0.0000000000000000 0.0000000000000000% ✔
- 4 9 0.0000000000000000 0.0000000000000000 0.0000000000000000% ✔
- 5 0 -0.0000000000000007 0.0000000000000000 0.0000000000000000% ✔
- 5 1 0.0000000000000150 0.0000000000000000 0.0000000000000000% ✔
- 5 2 0.0000000000000042 0.0000000000000000 0.0000000000000000% ✔
- 5 3 0.0000000000000156 0.0000000000000000 0.0000000000000000% ✔
- 5 4 -0.0000000000000142 0.0000000000000000 0.0000000000000000% ✔
- 5 5 6806.2227874771797360 6806.2227874771806455 0.0000000000000134% ✔
- 5 6 0.0000000000000000 0.0000000000000000 0.0000000000000000% ✔
- 5 7 0.0000000000094360 0.0000000000000000 0.0000000000000000% ✔
- 5 8 0.0000000000000000 0.0000000000000000 0.0000000000000000% ✔
- 5 9 0.0000000013387762 0.0000000000000000 0.0000000000000000% ✔
- 6 0 0.0000000000000537 0.0000000000000000 0.0000000000000000% ✔
- 6 1 0.0000000000000063 0.0000000000000000 0.0000000000000000% ✔
- 6 2 0.0000000000003681 0.0000000000000000 0.0000000000000000% ✔
- 6 3 -0.0000000000000021 0.0000000000000000 0.0000000000000000% ✔
- 6 4 0.0000000000019327 0.0000000000000000 0.0000000000000000% ✔
- 6 5 0.0000000000000000 0.0000000000000000 0.0000000000000000% ✔
- 6 6 81674.6734497261350043 81674.6734497261786601 0.0000000000000535% ✔
- 6 7 0.0000000000040927 0.0000000000000000 0.0000000000000000% ✔
- 6 8 0.0000000003965397 0.0000000000000000 0.0000000000000000% ✔
- 6 9 -0.0000000000873115 0.0000000000000000 0.0000000000000000% ✔
- 7 0 0.0000000000000026 0.0000000000000000 0.0000000000000000% ✔
- 7 1 -0.0000000000000749 0.0000000000000000 0.0000000000000000% ✔
- 7 2 0.0000000000000000 0.0000000000000000 0.0000000000000000% ✔
- 7 3 -0.0000000000004121 0.0000000000000000 0.0000000000000000% ✔
- 7 4 0.0000000000000000 0.0000000000000000 0.0000000000000000% ✔
- 7 5 0.0000000000094360 0.0000000000000000 0.0000000000000000% ✔
- 7 6 0.0000000000040927 0.0000000000000000 0.0000000000000000% ✔
- 7 7 1143445.4282961667049676 1143445.4282961664721370 0.0000000000000204% ✔
- 7 8 -0.0000000000072760 0.0000000000000000 0.0000000000000000% ✔
- 7 9 0.0000000116493834 0.0000000000000000 0.0000000000000000% ✔
- 8 0 -0.0000000000008242 0.0000000000000000 0.0000000000000000% ✔
- 8 1 -0.0000000000000568 0.0000000000000000 0.0000000000000000% ✔
- 8 2 -0.0000000000108429 0.0000000000000000 0.0000000000000000% ✔
- 8 3 -0.0000000000004547 0.0000000000000000 0.0000000000000000% ✔
- 8 4 -0.0000000000626612 0.0000000000000000 0.0000000000000000% ✔
- 8 5 0.0000000000000000 0.0000000000000000 0.0000000000000000% ✔
- 8 6 0.0000000003965397 0.0000000000000000 0.0000000000000000% ✔
- 8 7 -0.0000000000072760 0.0000000000000000 0.0000000000000000% ✔
- 8 8 18295126.8527386672794819 18295126.8527386635541916 0.0000000000000204% ✔
- 8 9 0.0000000016298145 0.0000000000000000 0.0000000000000000% ✔
- 9 0 0.0000000000001137 0.0000000000000000 0.0000000000000000% ✔
- 9 1 0.0000000000143249 0.0000000000000000 0.0000000000000000% ✔
- 9 2 -0.0000000000021032 0.0000000000000000 0.0000000000000000% ✔
- 9 3 0.0000000001391527 0.0000000000000000 0.0000000000000000% ✔
- 9 4 0.0000000000000000 0.0000000000000000 0.0000000000000000% ✔
- 9 5 0.0000000013387762 0.0000000000000000 0.0000000000000000% ✔
- 9 6 -0.0000000000873115 0.0000000000000000 0.0000000000000000% ✔
- 9 7 0.0000000116493834 0.0000000000000000 0.0000000000000000% ✔
- 9 8 0.0000000016298145 0.0000000000000000 0.0000000000000000% ✔
- 9 9 329312283.3492956757545471 329312283.3492959141731262 0.0000000000000724% ✔
-Test Summary: | Pass Total Time
-∫Hⱼ(x)Hᵢ(x)exp(-x²)dx = √π2ʲj!δᵢⱼ | 100 100 1.2s
Normalization & Orthogonality of $\psi_n(x)$
\[\int \psi_i^\ast(x) \psi_j(x) \mathrm{d}x = \delta_{ij}\]
i j numerical analytical |error|
- 0 0 0.9999999999999991 1.0000000000000000 0.0000000000000888% ✔
- 0 1 0.0000000000000000 0.0000000000000000 0.0000000000000000% ✔
- 0 2 0.0000000000000000 0.0000000000000000 0.0000000000000000% ✔
- 0 3 0.0000000000000000 0.0000000000000000 0.0000000000000000% ✔
- 0 4 -0.0000000000000001 0.0000000000000000 0.0000000000000000% ✔
- 0 5 -0.0000000000000000 0.0000000000000000 0.0000000000000000% ✔
- 0 6 0.0000000000000001 0.0000000000000000 0.0000000000000000% ✔
- 0 7 0.0000000000000000 0.0000000000000000 0.0000000000000000% ✔
- 0 8 -0.0000000000000002 0.0000000000000000 0.0000000000000000% ✔
- 0 9 0.0000000000000000 0.0000000000000000 0.0000000000000000% ✔
- 1 0 0.0000000000000000 0.0000000000000000 0.0000000000000000% ✔
- 1 1 0.9999999999999435 1.0000000000000000 0.0000000000056510% ✔
- 1 2 0.0000000000000000 0.0000000000000000 0.0000000000000000% ✔
- 1 3 -0.0000000000000000 0.0000000000000000 0.0000000000000000% ✔
- 1 4 -0.0000000000000000 0.0000000000000000 0.0000000000000000% ✔
- 1 5 0.0000000000000002 0.0000000000000000 0.0000000000000000% ✔
- 1 6 0.0000000000000000 0.0000000000000000 0.0000000000000000% ✔
- 1 7 -0.0000000000000000 0.0000000000000000 0.0000000000000000% ✔
- 1 8 0.0000000000000000 0.0000000000000000 0.0000000000000000% ✔
- 1 9 0.0000000000000004 0.0000000000000000 0.0000000000000000% ✔
- 2 0 0.0000000000000000 0.0000000000000000 0.0000000000000000% ✔
- 2 1 0.0000000000000000 0.0000000000000000 0.0000000000000000% ✔
- 2 2 0.9999999999999999 1.0000000000000000 0.0000000000000111% ✔
- 2 3 -0.0000000000000000 0.0000000000000000 0.0000000000000000% ✔
- 2 4 -0.0000000000000001 0.0000000000000000 0.0000000000000000% ✔
- 2 5 -0.0000000000000000 0.0000000000000000 0.0000000000000000% ✔
- 2 6 0.0000000000000003 0.0000000000000000 0.0000000000000000% ✔
- 2 7 0.0000000000000000 0.0000000000000000 0.0000000000000000% ✔
- 2 8 -0.0000000000000007 0.0000000000000000 0.0000000000000000% ✔
- 2 9 0.0000000000000000 0.0000000000000000 0.0000000000000000% ✔
- 3 0 0.0000000000000000 0.0000000000000000 0.0000000000000000% ✔
- 3 1 -0.0000000000000000 0.0000000000000000 0.0000000000000000% ✔
- 3 2 -0.0000000000000000 0.0000000000000000 0.0000000000000000% ✔
- 3 3 0.9999999999999998 1.0000000000000000 0.0000000000000222% ✔
- 3 4 -0.0000000000000000 0.0000000000000000 0.0000000000000000% ✔
- 3 5 0.0000000000000000 0.0000000000000000 0.0000000000000000% ✔
- 3 6 0.0000000000000000 0.0000000000000000 0.0000000000000000% ✔
- 3 7 0.0000000000000001 0.0000000000000000 0.0000000000000000% ✔
- 3 8 -0.0000000000000000 0.0000000000000000 0.0000000000000000% ✔
- 3 9 0.0000000000000008 0.0000000000000000 0.0000000000000000% ✔
- 4 0 -0.0000000000000001 0.0000000000000000 0.0000000000000000% ✔
- 4 1 -0.0000000000000000 0.0000000000000000 0.0000000000000000% ✔
- 4 2 -0.0000000000000001 0.0000000000000000 0.0000000000000000% ✔
- 4 3 -0.0000000000000000 0.0000000000000000 0.0000000000000000% ✔
- 4 4 0.9999999999999991 1.0000000000000000 0.0000000000000888% ✔
- 4 5 0.0000000000000000 0.0000000000000000 0.0000000000000000% ✔
- 4 6 0.0000000000000003 0.0000000000000000 0.0000000000000000% ✔
- 4 7 0.0000000000000000 0.0000000000000000 0.0000000000000000% ✔
- 4 8 -0.0000000000000005 0.0000000000000000 0.0000000000000000% ✔
- 4 9 -0.0000000000000000 0.0000000000000000 0.0000000000000000% ✔
- 5 0 -0.0000000000000000 0.0000000000000000 0.0000000000000000% ✔
- 5 1 0.0000000000000002 0.0000000000000000 0.0000000000000000% ✔
- 5 2 -0.0000000000000000 0.0000000000000000 0.0000000000000000% ✔
- 5 3 0.0000000000000000 0.0000000000000000 0.0000000000000000% ✔
- 5 4 0.0000000000000000 0.0000000000000000 0.0000000000000000% ✔
- 5 5 0.9999999999999999 1.0000000000000000 0.0000000000000111% ✔
- 5 6 0.0000000000000000 0.0000000000000000 0.0000000000000000% ✔
- 5 7 0.0000000000000002 0.0000000000000000 0.0000000000000000% ✔
- 5 8 0.0000000000000000 0.0000000000000000 0.0000000000000000% ✔
- 5 9 0.0000000000000008 0.0000000000000000 0.0000000000000000% ✔
- 6 0 0.0000000000000001 0.0000000000000000 0.0000000000000000% ✔
- 6 1 0.0000000000000000 0.0000000000000000 0.0000000000000000% ✔
- 6 2 0.0000000000000003 0.0000000000000000 0.0000000000000000% ✔
- 6 3 0.0000000000000000 0.0000000000000000 0.0000000000000000% ✔
- 6 4 0.0000000000000003 0.0000000000000000 0.0000000000000000% ✔
- 6 5 0.0000000000000000 0.0000000000000000 0.0000000000000000% ✔
- 6 6 0.9999999999999993 1.0000000000000000 0.0000000000000666% ✔
- 6 7 -0.0000000000000000 0.0000000000000000 0.0000000000000000% ✔
- 6 8 0.0000000000000003 0.0000000000000000 0.0000000000000000% ✔
- 6 9 0.0000000000000000 0.0000000000000000 0.0000000000000000% ✔
- 7 0 0.0000000000000000 0.0000000000000000 0.0000000000000000% ✔
- 7 1 -0.0000000000000000 0.0000000000000000 0.0000000000000000% ✔
- 7 2 0.0000000000000000 0.0000000000000000 0.0000000000000000% ✔
- 7 3 0.0000000000000001 0.0000000000000000 0.0000000000000000% ✔
- 7 4 0.0000000000000000 0.0000000000000000 0.0000000000000000% ✔
- 7 5 0.0000000000000002 0.0000000000000000 0.0000000000000000% ✔
- 7 6 -0.0000000000000000 0.0000000000000000 0.0000000000000000% ✔
- 7 7 1.0000000000000004 1.0000000000000000 0.0000000000000444% ✔
- 7 8 0.0000000000000000 0.0000000000000000 0.0000000000000000% ✔
- 7 9 0.0000000000000006 0.0000000000000000 0.0000000000000000% ✔
- 8 0 -0.0000000000000002 0.0000000000000000 0.0000000000000000% ✔
- 8 1 0.0000000000000000 0.0000000000000000 0.0000000000000000% ✔
- 8 2 -0.0000000000000007 0.0000000000000000 0.0000000000000000% ✔
- 8 3 -0.0000000000000000 0.0000000000000000 0.0000000000000000% ✔
- 8 4 -0.0000000000000005 0.0000000000000000 0.0000000000000000% ✔
- 8 5 0.0000000000000000 0.0000000000000000 0.0000000000000000% ✔
- 8 6 0.0000000000000003 0.0000000000000000 0.0000000000000000% ✔
- 8 7 0.0000000000000000 0.0000000000000000 0.0000000000000000% ✔
- 8 8 1.0000000000000007 1.0000000000000000 0.0000000000000666% ✔
- 8 9 -0.0000000000000000 0.0000000000000000 0.0000000000000000% ✔
- 9 0 0.0000000000000000 0.0000000000000000 0.0000000000000000% ✔
- 9 1 0.0000000000000004 0.0000000000000000 0.0000000000000000% ✔
- 9 2 0.0000000000000000 0.0000000000000000 0.0000000000000000% ✔
- 9 3 0.0000000000000008 0.0000000000000000 0.0000000000000000% ✔
- 9 4 -0.0000000000000000 0.0000000000000000 0.0000000000000000% ✔
- 9 5 0.0000000000000008 0.0000000000000000 0.0000000000000000% ✔
- 9 6 0.0000000000000000 0.0000000000000000 0.0000000000000000% ✔
- 9 7 0.0000000000000006 0.0000000000000000 0.0000000000000000% ✔
- 9 8 -0.0000000000000000 0.0000000000000000 0.0000000000000000% ✔
- 9 9 0.9999999999999998 1.0000000000000000 0.0000000000000222% ✔
-Test Summary: | Pass Total Time
-<ψᵢ|ψⱼ> = δᵢⱼ | 100 100 1.2s
Virial Theorem
The virial theorem $\langle T \rangle = \langle V \rangle$ and the definition of Hamiltonian $\langle H \rangle = \langle T \rangle + \langle V \rangle$ derive $\langle H \rangle = 2 \langle V \rangle = 2 \langle T \rangle$.
\[2 \int \psi_n^\ast(x) V(x) \psi_n(x) \mathrm{d}x = E_n\]
k n numerical analytical |error|
-0.1 0 0.4999999999999719 0.5000000000000000 0.0000000000056288% ✔
-0.1 1 1.4999999999999998 1.5000000000000000 0.0000000000000148% ✔
-0.1 2 2.5000000000000004 2.5000000000000000 0.0000000000000178% ✔
-0.1 3 3.4999999999999982 3.5000000000000000 0.0000000000000508% ✔
-0.1 4 4.4999999999999938 4.5000000000000000 0.0000000000001382% ✔
-0.1 5 5.5000000000000000 5.5000000000000000 0.0000000000000000% ✔
-0.1 6 6.5000000000000000 6.5000000000000000 0.0000000000000000% ✔
-0.1 7 7.5000000000000124 7.5000000000000000 0.0000000000001658% ✔
-0.1 8 8.4999999999999929 8.5000000000000000 0.0000000000000836% ✔
-0.1 9 9.5000000000000000 9.5000000000000000 0.0000000000000000% ✔
-0.5 0 0.4999999999999719 0.5000000000000000 0.0000000000056288% ✔
-0.5 1 1.4999999999999998 1.5000000000000000 0.0000000000000148% ✔
-0.5 2 2.5000000000000004 2.5000000000000000 0.0000000000000178% ✔
-0.5 3 3.4999999999999982 3.5000000000000000 0.0000000000000508% ✔
-0.5 4 4.4999999999999938 4.5000000000000000 0.0000000000001382% ✔
-0.5 5 5.5000000000000000 5.5000000000000000 0.0000000000000000% ✔
-0.5 6 6.5000000000000000 6.5000000000000000 0.0000000000000000% ✔
-0.5 7 7.5000000000000124 7.5000000000000000 0.0000000000001658% ✔
-0.5 8 8.4999999999999929 8.5000000000000000 0.0000000000000836% ✔
-0.5 9 9.5000000000000000 9.5000000000000000 0.0000000000000000% ✔
-1.0 0 0.4999999999999719 0.5000000000000000 0.0000000000056288% ✔
-1.0 1 1.4999999999999998 1.5000000000000000 0.0000000000000148% ✔
-1.0 2 2.5000000000000004 2.5000000000000000 0.0000000000000178% ✔
-1.0 3 3.4999999999999982 3.5000000000000000 0.0000000000000508% ✔
-1.0 4 4.4999999999999938 4.5000000000000000 0.0000000000001382% ✔
-1.0 5 5.5000000000000000 5.5000000000000000 0.0000000000000000% ✔
-1.0 6 6.5000000000000000 6.5000000000000000 0.0000000000000000% ✔
-1.0 7 7.5000000000000124 7.5000000000000000 0.0000000000001658% ✔
-1.0 8 8.4999999999999929 8.5000000000000000 0.0000000000000836% ✔
-1.0 9 9.5000000000000000 9.5000000000000000 0.0000000000000000% ✔
-5.0 0 0.4999999999999719 0.5000000000000000 0.0000000000056288% ✔
-5.0 1 1.4999999999999998 1.5000000000000000 0.0000000000000148% ✔
-5.0 2 2.5000000000000004 2.5000000000000000 0.0000000000000178% ✔
-5.0 3 3.4999999999999982 3.5000000000000000 0.0000000000000508% ✔
-5.0 4 4.4999999999999938 4.5000000000000000 0.0000000000001382% ✔
-5.0 5 5.5000000000000000 5.5000000000000000 0.0000000000000000% ✔
-5.0 6 6.5000000000000000 6.5000000000000000 0.0000000000000000% ✔
-5.0 7 7.5000000000000124 7.5000000000000000 0.0000000000001658% ✔
-5.0 8 8.4999999999999929 8.5000000000000000 0.0000000000000836% ✔
-5.0 9 9.5000000000000000 9.5000000000000000 0.0000000000000000% ✔
-Test Summary: | Pass Total Time
-2 × <ψₙ|V|ψₙ> = Eₙ | 40 40 1.0s
Eigen Values
\[ \begin{aligned}
- E_n
- &= \int \psi^\ast_n(x) \hat{H} \psi_n(x) \mathrm{d}x \\
- &= \int \psi^\ast_n(x) \left[ \hat{V} + \hat{T} \right] \psi(x) \mathrm{d}x \\
- &= \int \psi^\ast_n(x) \left[ V(x) - \frac{\hbar^2}{2m} \frac{\mathrm{d}^{2}}{\mathrm{d} x^{2}} \right] \psi(x) \mathrm{d}x \\
- &\simeq \int \psi^\ast_n(x) \left[ V(x)\psi(x) -\frac{\hbar^2}{2m} \frac{\psi(x+\Delta x) - 2\psi(x) + \psi(x-\Delta x)}{\Delta x^{2}} \right] \mathrm{d}x.
- \end{aligned}\]
Where, the difference formula for the 2nd-order derivative:
\[\begin{aligned}
- % 2\psi(x)
- % + \frac{\mathrm{d}^{2} \psi(x)}{\mathrm{d} x^{2}} \Delta x^{2}
- % + O\left(\Delta x^{4}\right)
- % &=
- % \psi(x+\Delta x)
- % + \psi(x-\Delta x)
- % \\
- % \frac{\mathrm{d}^{2} \psi(x)}{\mathrm{d} x^{2}} \Delta x^{2}
- % &=
- % \psi(x+\Delta x)
- % - 2\psi(x)
- % + \psi(x-\Delta x)
- % - O\left(\Delta x^{4}\right)
- % \\
- % \frac{\mathrm{d}^{2} \psi(x)}{\mathrm{d} x^{2}}
- % &=
- % \frac{\psi(x+\Delta x) - 2\psi(x) + \psi(x-\Delta x)}{\Delta x^{2}}
- % - \frac{O\left(\Delta x^{4}\right)}{\Delta x^{2}}
- % \\
- \frac{\mathrm{d}^{2} \psi(x)}{\mathrm{d} x^{2}}
- &=
- \frac{\psi(x+\Delta x) - 2\psi(x) + \psi(x-\Delta x)}{\Delta x^{2}}
- + O\left(\Delta x^{2}\right)
-\end{aligned}\]
are given by the sum of 2 Taylor series:
\[\begin{aligned}
-\psi(x+\Delta x)
-&= \psi(x)
-+ \frac{\mathrm{d} \psi(x)}{\mathrm{d} x} \Delta x
-+ \frac{1}{2!} \frac{\mathrm{d}^{2} \psi(x)}{\mathrm{d} x^{2}} \Delta x^{2}
-+ \frac{1}{3!} \frac{\mathrm{d}^{3} \psi(x)}{\mathrm{d} x^{3}} \Delta x^{3}
-+ O\left(\Delta x^{4}\right),
-\\
-\psi(x-\Delta x)
-&= \psi(x)
-- \frac{\mathrm{d} \psi(x)}{\mathrm{d} x} \Delta x
-+ \frac{1}{2!} \frac{\mathrm{d}^{2} \psi(x)}{\mathrm{d} x^{2}} \Delta x^{2}
-- \frac{1}{3!} \frac{\mathrm{d}^{3} \psi(x)}{\mathrm{d} x^{3}} \Delta x^{3}
-+ O\left(\Delta x^{4}\right).
-\end{aligned}\]
k n numerical analytical |error|
-0.1 0 0.1581138798827675 0.1581138830084190 0.0000019768355921% ✔
-0.1 1 0.4743416334097137 0.4743416490252569 0.0000032920455591% ✔
-0.1 2 0.7905693744092002 0.7905694150420949 0.0000051396998091% ✔
-0.1 3 1.1067971029282735 1.1067971810589328 0.0000070591668115% ✔
-0.1 4 1.4230248189868937 1.4230249470757708 0.0000090011687654% ✔
-0.1 5 1.7392525225056779 1.7392527130926088 0.0000109579780712% ✔
-0.1 6 2.0554802135001529 2.0554804791094465 0.0000129220051647% ✔
-0.1 7 2.3717078919497427 2.3717082451262845 0.0000148912305093% ✔
-0.1 8 2.6879355581003628 2.6879360111431225 0.0000168546705678% ✔
-0.1 9 3.0041632114497054 3.0041637771599605 0.0000188308726503% ✔
-0.5 0 0.3535533749437250 0.3535533905932738 0.0000044263608382% ✔
-0.5 1 1.0606600936488757 1.0606601717798214 0.0000073662562046% ✔
-0.5 2 1.7677667498779439 1.7677669529663689 0.0000114884161979% ✔
-0.5 3 2.4748733435564381 2.4748737341529163 0.0000157824810568% ✔
-0.5 4 3.1819798748172214 3.1819805153394642 0.0000201296720616% ✔
-0.5 5 3.8890863434634926 3.8890872965260117 0.0000245060716425% ✔
-0.5 6 4.5961927496648043 4.5961940777125596 0.0000288945099547% ✔
-0.5 7 5.3032990935191169 5.3033008588991066 0.0000332883243233% ✔
-0.5 8 6.0104053741967718 6.0104076400856545 0.0000376994210448% ✔
-0.5 9 6.7175115932661038 6.7175144212722016 0.0000420989955569% ✔
-1.0 0 0.4999999687733652 0.5000000000000000 0.0000062453269556% ✔
-1.0 1 1.4999998437740314 1.5000000000000000 0.0000104150645737% ✔
-1.0 2 2.4999995937642381 2.5000000000000000 0.0000162494304767% ✔
-1.0 3 3.4999992187323192 3.5000000000000000 0.0000223219337363% ✔
-1.0 4 4.4999987187474328 4.5000000000000000 0.0000284722792701% ✔
-1.0 5 5.4999980937550053 5.5000000000000000 0.0000346589999044% ✔
-1.0 6 6.4999973436023444 6.5000000000000000 0.0000408676562403% ✔
-1.0 7 7.4999964688869518 7.5000000000000000 0.0000470815073091% ✔
-1.0 8 8.4999954688433572 8.5000000000000000 0.0000533077252092% ✔
-1.0 9 9.4999943434450671 9.5000000000000000 0.0000595426835042% ✔
-5.0 0 1.1180338325225039 1.1180339887498949 0.0000139734026511% ✔
-5.0 1 3.3541011849691116 3.3541019662496847 0.0000232932862801% ✔
-5.0 2 5.5901679125242794 5.5901699437494745 0.0000363356609118% ✔
-5.0 3 7.8262340149842551 7.8262379212492643 0.0000499124234216% ✔
-5.0 4 10.0622994924938265 10.0623058987490541 0.0000636658763120% ✔
-5.0 5 12.2983643449971325 12.2983738762488439 0.0000775000972270% ✔
-5.0 6 14.5344285723091655 14.5344418537486337 0.0000913790815076% ✔
-5.0 7 16.7704921752222305 16.7705098312484253 0.0001052801994246% ✔
-5.0 8 19.0065551524155296 19.0065778087482116 0.0001192025882298% ✔
-5.0 9 21.2426175047498660 21.2426457862480049 0.0001331354786194% ✔
-Test Summary: | Pass Total Time
-∫ψₙ*Hψₙdx = <ψₙ|H|ψₙ> = Eₙ | 40 40 1.4s
-
Settings
This document was generated with Documenter.jl version 1.2.0 on Wednesday 29 November 2023. Using Julia version 1.9.4.