From 5291bbed3b2d970377837508dd2e07cef650d5ce Mon Sep 17 00:00:00 2001 From: Shuhei Ohno Date: Tue, 5 Dec 2023 20:54:07 +0900 Subject: [PATCH] AnalyticalSolutions to Antique --- .github/workflows/CI.yml | 6 ++--- Project.toml | 2 +- README.md | 30 ++++++++++++------------- developer/logo.jl | 4 ++-- developer/pkg.jl | 2 +- developer/revice.jl | 3 ++- docs/Project.toml | 2 +- docs/jmd2md.jl | 8 +++---- docs/make.jl | 14 ++++++------ docs/src/HarmonicOscillator.md | 10 ++++----- docs/src/HydrogenAtom.md | 10 ++++----- docs/src/InfinitePotentialWell.md | 10 ++++----- docs/src/MorsePotential.md | 14 ++++++------ docs/src/index.md | 18 +++++++-------- docs/src/jmd/HarmonicOscillator.jmd | 10 ++++----- docs/src/jmd/HydrogenAtom.jmd | 10 ++++----- docs/src/jmd/InfinitePotentialWell.jmd | 10 ++++----- docs/src/jmd/MorsePotential.jmd | 14 ++++++------ src/{AnalyticalSolutions.jl => Antique} | 6 ++--- test/HarmonicOscillator.jl | 4 ++-- test/HydrogenAtom.jl | 6 ++--- test/InfinitePotentialWell.jl | 4 ++-- test/MorsePotential.jl | 4 ++-- test/runtests.jl | 4 ++-- 24 files changed, 103 insertions(+), 102 deletions(-) rename src/{AnalyticalSolutions.jl => Antique} (94%) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 61e5917..61c5c54 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -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)' diff --git a/Project.toml b/Project.toml index f41a37a..90baed1 100644 --- a/Project.toml +++ b/Project.toml @@ -1,4 +1,4 @@ -name = "AnalyticalSolutions" +name = "Antique" uuid = "be6e5d0e-34a5-4c8f-af83-e1b5389203d8" authors = ["Shuhei Ohno"] version = "0.1.0" diff --git a/README.md b/README.md index 9387fe5..da0890c 100644 --- a/README.md +++ b/README.md @@ -1,17 +1,17 @@ -# 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 @@ -19,33 +19,33 @@ using Pkg; Pkg.add(path="https://github.com/ohno/AnalyticalSolutions.jl.git") 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 @@ -53,4 +53,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. diff --git a/developer/logo.jl b/developer/logo.jl index 9db67e0..ea3a3a8 100644 --- a/developer/logo.jl +++ b/developer/logo.jl @@ -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 @@ -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 diff --git a/developer/pkg.jl b/developer/pkg.jl index 70281a1..acae940 100644 --- a/developer/pkg.jl +++ b/developer/pkg.jl @@ -27,4 +27,4 @@ t = Template(; ], ) -generate("AnalyticalSolutions.jl", t) \ No newline at end of file +generate("Antique.jl", t) \ No newline at end of file diff --git a/developer/revice.jl b/developer/revice.jl index 63e4931..81bb1be 100644 --- a/developer/revice.jl +++ b/developer/revice.jl @@ -1,6 +1,7 @@ # run `include("./developer/revice.jl")` using Pkg +Pkg.instantiate() # Pkg.add("Revise") using Revise Pkg.activate("./") -using AnalyticalSolutions \ No newline at end of file +using Antique \ No newline at end of file diff --git a/docs/Project.toml b/docs/Project.toml index e34a59e..2c8b9d3 100644 --- a/docs/Project.toml +++ b/docs/Project.toml @@ -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" diff --git a/docs/jmd2md.jl b/docs/jmd2md.jl index f611b06..fdbf3dc 100644 --- a/docs/jmd2md.jl +++ b/docs/jmd2md.jl @@ -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 @@ -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 diff --git a/docs/make.jl b/docs/make.jl index bd3f61c..6a02dca 100644 --- a/docs/make.jl +++ b/docs/make.jl @@ -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", @@ -27,6 +27,6 @@ makedocs(; ) deploydocs(; - repo="github.com/ohno/AnalyticalSolutions.jl", + repo="github.com/ohno/Antique.jl", devbranch="main", ) diff --git a/docs/src/HarmonicOscillator.md b/docs/src/HarmonicOscillator.md index e769688..02cfd17 100644 --- a/docs/src/HarmonicOscillator.md +++ b/docs/src/HarmonicOscillator.md @@ -1,5 +1,5 @@ ```@meta -CurrentModule = AnalyticalSolutions +CurrentModule = Antique ``` # Harmonic Oscillator @@ -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) ``` @@ -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)$ diff --git a/docs/src/HydrogenAtom.md b/docs/src/HydrogenAtom.md index b4a24b5..7dd1589 100644 --- a/docs/src/HydrogenAtom.md +++ b/docs/src/HydrogenAtom.md @@ -1,5 +1,5 @@ ```@meta -CurrentModule = AnalyticalSolutions +CurrentModule = Antique ``` # Hydrogen Atom @@ -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) ``` @@ -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)$ diff --git a/docs/src/InfinitePotentialWell.md b/docs/src/InfinitePotentialWell.md index 9625a36..8bda017 100644 --- a/docs/src/InfinitePotentialWell.md +++ b/docs/src/InfinitePotentialWell.md @@ -1,5 +1,5 @@ ```@meta -CurrentModule = AnalyticalSolutions +CurrentModule = Antique ``` # Infinite Potential Well (Particle in a Box) @@ -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) ``` @@ -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)$ diff --git a/docs/src/MorsePotential.md b/docs/src/MorsePotential.md index 48cecb8..b1e5f63 100644 --- a/docs/src/MorsePotential.md +++ b/docs/src/MorsePotential.md @@ -1,5 +1,5 @@ ```@meta -CurrentModule = AnalyticalSolutions +CurrentModule = Antique ``` # Morse Potential @@ -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) ``` @@ -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ₘₐₓ() @@ -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)$ diff --git a/docs/src/index.md b/docs/src/index.md index 2286fd5..0aaf157 100644 --- a/docs/src/index.md +++ b/docs/src/index.md @@ -1,17 +1,17 @@ ```@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 @@ -19,23 +19,23 @@ using Pkg; Pkg.add(path="https://github.com/ohno/AnalyticalSolutions.jl.git") 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 ``` @@ -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.~~ \ No newline at end of file +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. \ No newline at end of file diff --git a/docs/src/jmd/HarmonicOscillator.jmd b/docs/src/jmd/HarmonicOscillator.jmd index ba8ef5c..9fa2c62 100644 --- a/docs/src/jmd/HarmonicOscillator.jmd +++ b/docs/src/jmd/HarmonicOscillator.jmd @@ -1,5 +1,5 @@ ```@meta -CurrentModule = AnalyticalSolutions +CurrentModule = Antique ``` # Harmonic Oscillator @@ -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; cache = :all; results = "hidden" -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) ``` Parameters: @@ -147,7 +147,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). ```julia; line_width = 500 include("../../../test/HarmonicOscillator.jl") diff --git a/docs/src/jmd/HydrogenAtom.jmd b/docs/src/jmd/HydrogenAtom.jmd index 7827a99..2c48f4f 100644 --- a/docs/src/jmd/HydrogenAtom.jmd +++ b/docs/src/jmd/HydrogenAtom.jmd @@ -1,5 +1,5 @@ ```@meta -CurrentModule = AnalyticalSolutions +CurrentModule = Antique ``` # Hydrogen Atom @@ -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; cache = :all; results = "hidden" -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) ``` Parameters: @@ -242,7 +242,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). ```julia; line_width = 500 include("../../../test/HydrogenAtom.jl") diff --git a/docs/src/jmd/InfinitePotentialWell.jmd b/docs/src/jmd/InfinitePotentialWell.jmd index b5a53b3..7376ce8 100644 --- a/docs/src/jmd/InfinitePotentialWell.jmd +++ b/docs/src/jmd/InfinitePotentialWell.jmd @@ -1,5 +1,5 @@ ```@meta -CurrentModule = AnalyticalSolutions +CurrentModule = Antique ``` # Infinite Potential Well (Particle in a Box) @@ -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; cache = :all; results = "hidden" -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) ``` Parameters: @@ -102,7 +102,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). ```julia; line_width = 500 include("../../../test/InfinitePotentialWell.jl") diff --git a/docs/src/jmd/MorsePotential.jmd b/docs/src/jmd/MorsePotential.jmd index 047eae4..54ff4a3 100644 --- a/docs/src/jmd/MorsePotential.jmd +++ b/docs/src/jmd/MorsePotential.jmd @@ -1,5 +1,5 @@ ```@meta -CurrentModule = AnalyticalSolutions +CurrentModule = Antique ``` # Morse Potential @@ -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; cache = :all; results = "hidden" -using AnalyticalSolutions -MP = solution(:MorsePotential) +using Antique +MP = antique(:MorsePotential) ``` Parameters (for H₂⁺): @@ -127,8 +127,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ₘₐₓ() @@ -147,7 +147,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). ```julia; line_width = 500 include("../../../test/MorsePotential.jl") diff --git a/src/AnalyticalSolutions.jl b/src/Antique similarity index 94% rename from src/AnalyticalSolutions.jl rename to src/Antique index 2ee691a..283c3fe 100644 --- a/src/AnalyticalSolutions.jl +++ b/src/Antique @@ -1,6 +1,6 @@ -module AnalyticalSolutions +module Antique - export solution + export antique # Update this list when you add a model. models = [ @@ -32,7 +32,7 @@ module AnalyticalSolutions end # main functions - function solution(model; parameters...) + function antique(model; parameters...) # check existence of model if model ∉ models throw(ErrorException("\`:$(model)\` is not in the list of supported models $(models).")) diff --git a/test/HarmonicOscillator.jl b/test/HarmonicOscillator.jl index d650b22..37c2b0b 100644 --- a/test/HarmonicOscillator.jl +++ b/test/HarmonicOscillator.jl @@ -1,4 +1,4 @@ -using AnalyticalSolutions +using Antique using Test using Printf using Markdown @@ -6,7 +6,7 @@ using QuadGK using Symbolics using Latexify using LaTeXStrings -HO = solution(:HarmonicOscillator, k=1.0, m=1.0, ℏ=1.0) +HO = antique(:HarmonicOscillator, k=1.0, m=1.0, ℏ=1.0) # Hₙ(x) = (-1)ⁿ exp(x²) dⁿ/dxⁿ exp(-x²) = ... diff --git a/test/HydrogenAtom.jl b/test/HydrogenAtom.jl index 03502ea..36af7dc 100644 --- a/test/HydrogenAtom.jl +++ b/test/HydrogenAtom.jl @@ -1,4 +1,4 @@ -using AnalyticalSolutions +using Antique using Test using Printf using Markdown @@ -6,8 +6,8 @@ using QuadGK using Symbolics using Latexify using LaTeXStrings -HA = solution(:HydrogenAtom, Z=1, Eₕ=1.0, a₀=1.0, mₑ=1.0, ℏ=1.0) -MP = solution(:MorsePotential) +HA = antique(:HydrogenAtom, Z=1, Eₕ=1.0, a₀=1.0, mₑ=1.0, ℏ=1.0) +MP = antique(:MorsePotential) # Pₙᵐ(x) = √(1-x²)ᵐ dᵐ/dxᵐ Pₙ(x); Pₙ(x) = 1/(2ⁿn!) dⁿ/dxⁿ (x²-1)ⁿ diff --git a/test/InfinitePotentialWell.jl b/test/InfinitePotentialWell.jl index e00cbb4..4934240 100644 --- a/test/InfinitePotentialWell.jl +++ b/test/InfinitePotentialWell.jl @@ -1,9 +1,9 @@ -using AnalyticalSolutions +using Antique using Test using Printf using Markdown using QuadGK -IPW = solution(:InfinitePotentialWell, L=1.0, m=1.0, ℏ=1.0) +IPW = antique(:InfinitePotentialWell, L=1.0, m=1.0, ℏ=1.0) # <ψᵢ|ψⱼ> = ∫ψₙ*ψₙdx = δᵢⱼ diff --git a/test/MorsePotential.jl b/test/MorsePotential.jl index 8a1e6e2..4153f90 100644 --- a/test/MorsePotential.jl +++ b/test/MorsePotential.jl @@ -1,4 +1,4 @@ -using AnalyticalSolutions +using Antique using Test using Printf using Markdown @@ -6,7 +6,7 @@ using QuadGK using Symbolics using Latexify using LaTeXStrings -MP = solution(:MorsePotential) +MP = antique(:MorsePotential) # Lₙ⁽ᵅ⁾(x) = x⁻ᵅeˣ/n! dⁿ/dxⁿ xⁿ⁺ᵅe⁻ˣ diff --git a/test/runtests.jl b/test/runtests.jl index 5ddbb0d..5f20a69 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -1,8 +1,8 @@ -using AnalyticalSolutions +using Antique using Test using Suppressor -@testset "AnalyticalSolutions.jl" begin +@testset "Antique.jl" begin @suppress_out begin include("./InfinitePotentialWell.jl") include("./HarmonicOscillator.jl")