Skip to content

Commit

Permalink
Add plot examples
Browse files Browse the repository at this point in the history
  • Loading branch information
ohno committed Dec 11, 2024
1 parent 69a3152 commit edae822
Show file tree
Hide file tree
Showing 2 changed files with 65 additions and 0 deletions.
33 changes: 33 additions & 0 deletions docs/src/CoulombTwoBody.md
Original file line number Diff line number Diff line change
Expand Up @@ -258,6 +258,39 @@ println("µp\t", ΔE_pµ / h / 1e12, " THz\t Antique.jl + CODATA2018")
println(" \t", 0.182725*eV / h / 1e12 , " THz\t Griffiths(1982), Adamczak(2012)")
```


1S wave function of Ps:

```@example HA
import Antique
Ps = Antique.CoulombTwoBody(z₁=-1, z₂=1, m₁=1.0, m₂=1.0, mₑ=1.0, a₀=1.0, Eₕ=1.0, ℏ=1.0)
@show Antique.E(Ps)
using CairoMakie
fig = Figure(
size = (420,300),
fontsize = 11.5,
backgroundcolor = :transparent
)
ax = Axis(
fig[1,1],
xlabel = L"$r / a_0$",
ylabel = L"$\psi(r) / a_0^{-3/2}$",
ylabelsize = 16.5,
xlabelsize = 16.5,
)
lines!(ax, 0..10, r -> exp(-r/2)/sqrt(8π), label="exp(-r/2)/sqrt(8π)")
lines!(ax, 0..2, r -> (1-r/2)/sqrt(8π), label="(1-r/2)/sqrt(8π)")
lines!(ax, 0..10, r -> abs(Antique.ψ(Ps,r,0,0)), linestyle=:dash, color=:black, label="Antique.jl")
axislegend(ax, position=:rt, framevisible=false)
fig
```

## Testing

Unit testing and Integration testing were done using computer algebra system ([Symbolics.jl](https://symbolics.juliasymbolics.org/stable/)) and numerical integration ([QuadGK.jl](https://juliamath.github.io/QuadGK.jl/stable/)). The test script is [here](https://github.com/ohno/Antique.jl/blob/main/test/CoulombTwoBody.jl).
Expand Down
32 changes: 32 additions & 0 deletions docs/src/HydrogenAtom.md
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,38 @@ lines!(ax, 0.1:0.01:20, r -> V(H, r))
f
```

1S wave function:

```@example HA
import Antique
H = Antique.HydrogenAtom(Z=1, mₑ=1.0, a₀=1.0, Eₕ=1.0, ℏ=1.0)
@show Antique.E(H)
using CairoMakie
fig = Figure(
size = (420,300),
fontsize = 11.5,
backgroundcolor = :transparent
)
ax = Axis(
fig[1,1],
xlabel = L"$r / a_0$",
ylabel = L"$\psi(r) / a_0^{-3/2}$",
ylabelsize = 16.5,
xlabelsize = 16.5,
)
lines!(ax, 0..5, r -> exp(-r)/sqrt(π), label="exp(-r)/sqrt(π)")
lines!(ax, 0..1, r -> (1-r)/sqrt(π), label="(1-r)/sqrt(π)")
lines!(ax, 0..5, r -> abs(Antique.ψ(H,r,0,0)), linestyle=:dash, color=:black, label="Antique.jl")
axislegend(ax, position=:rt, framevisible=false)
fig
```

Radial functions:

```@example HA
Expand Down

0 comments on commit edae822

Please sign in to comment.