Skip to content

Commit

Permalink
AnalyticalSolutions to Antique
Browse files Browse the repository at this point in the history
  • Loading branch information
ohno committed Dec 5, 2023
1 parent c7dc37e commit 5291bbe
Show file tree
Hide file tree
Showing 24 changed files with 103 additions and 102 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,6 @@ jobs:
- run: |
julia --project=docs -e '
using Documenter: DocMeta, doctest
using AnalyticalSolutions
DocMeta.setdocmeta!(AnalyticalSolutions, :DocTestSetup, :(using AnalyticalSolutions); recursive=true)
doctest(AnalyticalSolutions)'
using Antique
DocMeta.setdocmeta!(Antique, :DocTestSetup, :(using Antique); recursive=true)
doctest(Antique)'
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name = "AnalyticalSolutions"
name = "Antique"
uuid = "be6e5d0e-34a5-4c8f-af83-e1b5389203d8"
authors = ["Shuhei Ohno"]
version = "0.1.0"
Expand Down
30 changes: 15 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,56 +1,56 @@
# AnalyticalSolutions.jl
# Antique.jl

[![Build Status](https://github.com/ohno/AnalyticalSolutions.jl/actions/workflows/CI.yml/badge.svg?branch=main)](https://github.com/ohno/AnalyticalSolutions.jl/actions/workflows/CI.yml?query=branch%3Amain)
[![Stable](https://img.shields.io/badge/docs-stable-blue.svg)](https://ohno.github.io/AnalyticalSolutions.jl/stable/)
[![Dev](https://img.shields.io/badge/docs-dev-blue.svg)](https://ohno.github.io/AnalyticalSolutions.jl/dev/)
[![Build Status](https://github.com/ohno/Antique.jl/actions/workflows/CI.yml/badge.svg?branch=main)](https://github.com/ohno/Antique.jl/actions/workflows/CI.yml?query=branch%3Amain)
[![Stable](https://img.shields.io/badge/docs-stable-blue.svg)](https://ohno.github.io/Antique.jl/stable/)
[![Dev](https://img.shields.io/badge/docs-dev-blue.svg)](https://ohno.github.io/Antique.jl/dev/)

Self-contained, Well-Tested, Well-Documented Functions for Quantum Mechanical Models
Self-contained, Well-Tested, Well-Documented Analytical Solutions of Quantum Mechanical Equations.

## Install

To install this package, run the following code in your Jupyter Notebook:

```julia
using Pkg; Pkg.add(path="https://github.com/ohno/AnalyticalSolutions.jl.git")
using Pkg; Pkg.add(path="https://github.com/ohno/Antique.jl.git")
```

## Usage

To use this package, run the following code before each use:

```julia
using AnalyticalSolutions
using Antique
```

The function `solution(model, parameters...)` returns a module. Each module has `E()`, `ψ(x)` and some other functions.
The function `antique(model, parameters...)` returns a module. Each module has `E()`, `ψ(x)` and some other functions.

## Examples

The energy of $1S$ state in hydrogen atom:
```julia
julia> H = solution(:HydrogenAtom, Z=1)
julia> H = antique(:HydrogenAtom, Z=1)
julia> H.E(n=1)
-0.5
```

The energy of $1S$ state in helium atom:
```julia
julia> He⁺ = solution(:HydrogenAtom, Z=2)
julia> He⁺ = antique(:HydrogenAtom, Z=2)
julia> He⁺.E(n=1)
-2.0
```

## Supported Models

- [Infinite Potential Well](https://ohno.github.io/AnalyticalSolutions.jl/dev/InfinitePotentialWell/) `:InfinitePotentialWell`
- [Harmonic Oscillator](https://ohno.github.io/AnalyticalSolutions.jl/dev/HarmonicOscillator/) `:HarmonicOscillator`
- [Morse Potential](https://ohno.github.io/AnalyticalSolutions.jl/dev/MorsePotential/) `:MorsePotential`
- [Hydrogen Atom](https://ohno.github.io/AnalyticalSolutions.jl/dev/HydrogenAtom/) `:HydrogenAtom`
- [Infinite Potential Well](https://ohno.github.io/Antique.jl/dev/InfinitePotentialWell/) `:InfinitePotentialWell`
- [Harmonic Oscillator](https://ohno.github.io/Antique.jl/dev/HarmonicOscillator/) `:HarmonicOscillator`
- [Morse Potential](https://ohno.github.io/Antique.jl/dev/MorsePotential/) `:MorsePotential`
- [Hydrogen Atom](https://ohno.github.io/Antique.jl/dev/HydrogenAtom/) `:HydrogenAtom`

## Future Works

[List of quantum-mechanical systems with analytical solutions](https://en.wikipedia.org/wiki/List_of_quantum-mechanical_systems_with_analytical_solutions)

## Acknowledgment

~~This package was named by [@KB-satou](https://github.com/KB-satou) and [@ultimatile](https://github.com/ultimatile): **An**aly**ti**cal soulutions of Schrödinger e**q**uations.~~
This package was named by [@KB-satou](https://github.com/KB-satou) and [@ultimatile](https://github.com/ultimatile): **An**aly**ti**cal Solutions of **Qu**antum Mechanical **E**quations.
4 changes: 2 additions & 2 deletions developer/logo.jl
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

using Pkg
Pkg.activate("./")
using AnalyticalSolutions
using Antique

function XY2path(X,Y)
X = 252 / (maximum(X) - minimum(X)) * (X .- minimum(X)) .+ 50
Expand All @@ -17,7 +17,7 @@ function XY2path(X,Y)
return path
end

HA = solution(:HydrogenAtom, Z=1, Eₕ=1.0, a₀=1.0, mₑ=1.0, ℏ=1.0)
HA = antique(:HydrogenAtom, Z=1, Eₕ=1.0, a₀=1.0, mₑ=1.0, ℏ=1.0)
paths = Dict()
X = 0.0:0.01:8
Y1 = X .^2 .* HA.R.(X,n=1) .^2
Expand Down
2 changes: 1 addition & 1 deletion developer/pkg.jl
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,4 @@ t = Template(;
],
)

generate("AnalyticalSolutions.jl", t)
generate("Antique.jl", t)
3 changes: 2 additions & 1 deletion developer/revice.jl
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# run `include("./developer/revice.jl")`
using Pkg
Pkg.instantiate()
# Pkg.add("Revise")
using Revise
Pkg.activate("./")
using AnalyticalSolutions
using Antique
2 changes: 1 addition & 1 deletion docs/Project.toml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[deps]
AnalyticalSolutions = "be6e5d0e-34a5-4c8f-af83-e1b5389203d8"
Antique = "be6e5d0e-34a5-4c8f-af83-e1b5389203d8"
Weave = "44d3d7a6-8a23-5bf8-98c5-b353f8df5ec9"
Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4"
8 changes: 4 additions & 4 deletions docs/jmd2md.jl
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
using AnalyticalSolutions
using Antique
using Weave

for file in AnalyticalSolutions.models # [:InfinitePotentialWell]
for file in Antique.models # [:InfinitePotentialWell]
weave("./src/jmd/$file.jmd", doctype="github", out_path="./src/", fig_path="./assets/fig/")
text = AnalyticalSolutions.load("./src/$file.md")
text = Antique.load("./src/$file.md")
# remove ``` after include(...s)
for m in eachmatch(r"\n```julia\n.*?jl\"\)\n```[.\n]*?```", text)
@show m.match
Expand All @@ -16,5 +16,5 @@ for file in AnalyticalSolutions.models # [:InfinitePotentialWell]
@show m.offset
text = replace(text, m.match => "\n```\n")
end
AnalyticalSolutions.save("./src/$file.md", text)
Antique.save("./src/$file.md", text)
end
14 changes: 7 additions & 7 deletions docs/make.jl
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
using AnalyticalSolutions
using Antique
using Documenter

DocMeta.setdocmeta!(AnalyticalSolutions, :DocTestSetup, :(using AnalyticalSolutions); recursive=true)
DocMeta.setdocmeta!(Antique, :DocTestSetup, :(using Antique); recursive=true)

makedocs(;
modules=[AnalyticalSolutions],
modules=[Antique],
authors="Shuhei Ohno",
repo="https://github.com/ohno/AnalyticalSolutions.jl/blob/{commit}{path}#{line}",
sitename="AnalyticalSolutions.jl",
repo="https://github.com/ohno/Antique.jl/blob/{commit}{path}#{line}",
sitename="Antique.jl",
format=Documenter.HTML(;
prettyurls=get(ENV, "CI", "false") == "true",
canonical="https://ohno.github.io/AnalyticalSolutions.jl",
canonical="https://ohno.github.io/Antique.jl",
edit_link="main",
assets=String[
"./assets/logo.ico",
Expand All @@ -27,6 +27,6 @@ makedocs(;
)

deploydocs(;
repo="github.com/ohno/AnalyticalSolutions.jl",
repo="github.com/ohno/Antique.jl",
devbranch="main",
)
10 changes: 5 additions & 5 deletions docs/src/HarmonicOscillator.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
```@meta
CurrentModule = AnalyticalSolutions
CurrentModule = Antique
```

# Harmonic Oscillator
Expand Down Expand Up @@ -88,11 +88,11 @@ Examples:

## Usage & Examples

[Install AnalyticalSolutions.jl](@ref Install) for the first run and run `using AnalyticalSolutions` before each use. The function `solution(model, parameters...)` returns a module that has `E()`, `ψ(x)`, `V(x)` and some other functions. In this system, the model name is specified by `:HarmonicOscillator` and several parameters `k`, `m` and `` are set as optional arguments.
[Install Antique.jl](@ref Install) for the first run and run `using Antique` before each use. The function `antique(model, parameters...)` returns a module that has `E()`, `ψ(x)`, `V(x)` and some other functions. In this system, the model name is specified by `:HarmonicOscillator` and several parameters `k`, `m` and `` are set as optional arguments.

```julia
using AnalyticalSolutions
HO = solution(:HarmonicOscillator, k=1.0, m=1.0, ℏ=1.0)
using Antique
HO = antique(:HarmonicOscillator, k=1.0, m=1.0, ℏ=1.0)
```


Expand Down Expand Up @@ -174,7 +174,7 @@ plot!(x -> HO.V(x), lc=:black, lw=2, label="")

## 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/AnalyticalSolutions.jl/blob/main/test/HarmonicOscillator.jl).
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/HarmonicOscillator.jl).

#### Hermite Polynomials $H_n(x)$

Expand Down
10 changes: 5 additions & 5 deletions docs/src/HydrogenAtom.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
```@meta
CurrentModule = AnalyticalSolutions
CurrentModule = Antique
```

# Hydrogen Atom
Expand Down Expand Up @@ -151,11 +151,11 @@ Examples:

## Usage & Examples

[Install AnalyticalSolutions.jl](@ref Install) for the first run and run `using AnalyticalSolutions` before each use. The function `solution(model, parameters...)` returns a module that has `E()`, `ψ(r)`, `V(r)` and some other functions. In this system, the model name is specified by `:HydrogenAtom` and several parameters `Z`, `Eₕ`, `mₑ`, `a₀` and `` are set as optional arguments.
[Install Antique.jl](@ref Install) for the first run and run `using Antique` before each use. The function `antique(model, parameters...)` returns a module that has `E()`, `ψ(r)`, `V(r)` and some other functions. In this system, the model name is specified by `:HydrogenAtom` and several parameters `Z`, `Eₕ`, `mₑ`, `a₀` and `` are set as optional arguments.

```julia
using AnalyticalSolutions
H = solution(:HydrogenAtom, Z=1, Eₕ=1.0, a₀=1.0, mₑ=1.0, ℏ=1.0)
using Antique
H = antique(:HydrogenAtom, Z=1, Eₕ=1.0, a₀=1.0, mₑ=1.0, ℏ=1.0)
```


Expand Down Expand Up @@ -295,7 +295,7 @@ plot!()

## 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/AnalyticalSolutions.jl/blob/main/test/HydrogenAtom.jl).
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/HydrogenAtom.jl).

#### Associated Legendre Polynomials $P_n^m(x)$

Expand Down
10 changes: 5 additions & 5 deletions docs/src/InfinitePotentialWell.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
```@meta
CurrentModule = AnalyticalSolutions
CurrentModule = Antique
```

# Infinite Potential Well (Particle in a Box)
Expand Down Expand Up @@ -50,11 +50,11 @@ The infinite potential well (particle in a box) is the simplest model for quantu

## Usage & Examples

[Install AnalyticalSolutions.jl](@ref Install) for the first run and run `using AnalyticalSolutions` before each use. The function `solution(model, parameters...)` returns a module that has `E()`, `ψ(x)`, `V(x)` and some other functions. In this system, the model name is specified by `:InfinitePotentialWell` and several parameters `L`, `m` and `` are set as optional arguments.
[Install Antique.jl](@ref Install) for the first run and run `using Antique` before each use. The function `antique(model, parameters...)` returns a module that has `E()`, `ψ(x)`, `V(x)` and some other functions. In this system, the model name is specified by `:InfinitePotentialWell` and several parameters `L`, `m` and `` are set as optional arguments.

```julia
using AnalyticalSolutions
IPW = solution(:InfinitePotentialWell, L=1.0, m=1.0, ℏ=1.0)
using Antique
IPW = antique(:InfinitePotentialWell, L=1.0, m=1.0, ℏ=1.0)
```


Expand Down Expand Up @@ -125,7 +125,7 @@ plot!([0,0,L,L], [140,0,0,140], lc=:black, lw=2, label="")

## Testing

Unit testing and Integration testing were done using numerical integration ([QuadGK.jl](https://juliamath.github.io/QuadGK.jl/stable/)). The test script is [here](https://github.com/ohno/AnalyticalSolutions.jl/blob/main/test/InfinitePotentialWell.jl).
Unit testing and Integration testing were done using 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/InfinitePotentialWell.jl).

#### Normalization & Orthogonality of $\psi_n(x)$

Expand Down
14 changes: 7 additions & 7 deletions docs/src/MorsePotential.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
```@meta
CurrentModule = AnalyticalSolutions
CurrentModule = Antique
```

# Morse Potential
Expand Down Expand Up @@ -80,11 +80,11 @@ Examples:

## Usage & Examples

[Install AnalyticalSolutions.jl](@ref Install) for the first run and run `using AnalyticalSolutions` before each use. The function `solution(model, parameters...)` returns a module that has `E()`, `ψ(r)`, `V(r)` and some other functions. In this system, the model name is specified by `:MorsePotential` and several parameters `rₑ`, `Dₑ`, `k`, `µ` and `` are set as optional arguments.
[Install Antique.jl](@ref Install) for the first run and run `using Antique` before each use. The function `antique(model, parameters...)` returns a module that has `E()`, `ψ(r)`, `V(r)` and some other functions. In this system, the model name is specified by `:MorsePotential` and several parameters `rₑ`, `Dₑ`, `k`, `µ` and `` are set as optional arguments.

```julia
using AnalyticalSolutions
MP = solution(:MorsePotential)
using Antique
MP = antique(:MorsePotential)
```


Expand Down Expand Up @@ -154,8 +154,8 @@ plot!(x -> MP.ψ(x, n=5), label="n=5", lw=2)
Potential energy curve, Energy levels, Comparison with harmonic oscillator:

```julia
MP = solution(:MorsePotential)
HO = solution(:HarmonicOscillator, k=MP.k, m=MP.μ)
MP = antique(:MorsePotential)
HO = antique(:HarmonicOscillator, k=MP.k, m=MP.μ)
using Plots
plot(xlims=(0.1,9.1), ylims=(-0.11,0.01), xlabel="\$r\$", ylabel="\$V(r), E_n\$", legend=:bottomright, size=(480,400), dpi=300)
for n in 0:MP.nₘₐₓ()
Expand All @@ -178,7 +178,7 @@ where, the potential of harmonic oscillator is defined as $V(r) \simeq \frac{1}{

## 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/AnalyticalSolutions.jl/blob/main/test/MorsePotential.jl).
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/MorsePotential.jl).

#### Generalized Laguerre Polynomials $L_n^{(\alpha)}(x)$

Expand Down
18 changes: 9 additions & 9 deletions docs/src/index.md
Original file line number Diff line number Diff line change
@@ -1,41 +1,41 @@
```@meta
CurrentModule = AnalyticalSolutions
CurrentModule = Antique
```

# AnalyticalSolutions.jl
# Antique.jl

Self-contained, Well-Tested, Well-Documented Functions for Quantum Mechanical Models
Self-contained, Well-Tested, Well-Documented Analytical Solutions of Quantum Mechanical Equations.

## Install

To install this package, run the following code in your Jupyter Notebook:

```julia
using Pkg; Pkg.add(path="https://github.com/ohno/AnalyticalSolutions.jl.git")
using Pkg; Pkg.add(path="https://github.com/ohno/Antique.jl.git")
```

## Usage

To use this package, run the following code before each use:

```julia
using AnalyticalSolutions
using Antique
```

The function `solution(model, parameters...)` returns a module. Each module has `E()`, `ψ(x)` and some other functions.
The function `antique(model, parameters...)` returns a module. Each module has `E()`, `ψ(x)` and some other functions.

## Examples

The energy of $1S$ state in hydrogen atom:
```julia
julia> H = solution(:HydrogenAtom, Z=1)
julia> H = antique(:HydrogenAtom, Z=1)
julia> H.E(n=1)
-0.5
```

The energy of $1S$ state in helium atom:
```julia
julia> He⁺ = solution(:HydrogenAtom, Z=2)
julia> He⁺ = antique(:HydrogenAtom, Z=2)
julia> He⁺.E(n=1)
-2.0
```
Expand Down Expand Up @@ -77,4 +77,4 @@ julia> He⁺.E(n=1)

## Acknowledgment

~~This package was named by [@KB-satou](https://github.com/KB-satou) and [@ultimatile](https://github.com/ultimatile): **An**aly**ti**cal soulutions of Schrödinger e**q**uations.~~
This package was named by [@KB-satou](https://github.com/KB-satou) and [@ultimatile](https://github.com/ultimatile): **An**aly**ti**cal Solutions of **Qu**antum Mechanical **E**quations.
Loading

0 comments on commit 5291bbe

Please sign in to comment.