From c74438f9f9d8af0a8091bc70616062a90d54543d Mon Sep 17 00:00:00 2001 From: "Documenter.jl" Date: Sun, 10 Nov 2024 05:01:49 +0000 Subject: [PATCH] build based on 7b1a558 --- dev/.documenter-siteinfo.json | 2 +- dev/API/index.html | 20 ++++++------- dev/Hamiltonian/index.html | 4 +-- "dev/Rayleigh\342\200\223Ritz/index.html" | 36 +++++++++++------------ dev/index.html | 22 +++++++------- dev/search_index.js | 2 +- 6 files changed, 43 insertions(+), 43 deletions(-) diff --git a/dev/.documenter-siteinfo.json b/dev/.documenter-siteinfo.json index 993c05e..508809b 100644 --- a/dev/.documenter-siteinfo.json +++ b/dev/.documenter-siteinfo.json @@ -1 +1 @@ -{"documenter":{"julia_version":"1.11.1","generation_timestamp":"2024-11-09T02:03:53","documenter_version":"1.7.0"}} \ No newline at end of file +{"documenter":{"julia_version":"1.11.1","generation_timestamp":"2024-11-10T05:01:45","documenter_version":"1.7.0"}} \ No newline at end of file diff --git a/dev/API/index.html b/dev/API/index.html index 2ad4186..8c6f735 100644 --- a/dev/API/index.html +++ b/dev/API/index.html @@ -1,5 +1,5 @@ -API reference · TwoBody.jl

API reference

TwoBody.BasisSetType

BasisSet(basis1, basis2, ...)

\[\{ \phi_1, \phi_2, \phi_3, \cdots \}\]

The basis set is the input for Rayleigh–Ritz method. You can define the basis set like this:

\[\begin{aligned} +API reference · TwoBody.jl

API reference

TwoBody.BasisSetType

BasisSet(basis1, basis2, ...)

\[\{ \phi_1, \phi_2, \phi_3, \cdots \}\]

The basis set is the input for Rayleigh–Ritz method. You can define the basis set like this:

\[\begin{aligned} \phi_1(r) &= \exp(-13.00773 ~r^2), \\ \phi_2(r) &= \exp(-1.962079 ~r^2), \\ \phi_3(r) &= \exp(-0.444529 ~r^2), \\ @@ -9,12 +9,12 @@ SimpleGaussianBasis(1.962079), SimpleGaussianBasis(0.444529), SimpleGaussianBasis(0.1219492), -)

source
TwoBody.HamiltonianType

Hamiltonian(operator1, operator2, ...)

\[\hat{H} = \sum_i \hat{o}_i\]

The Hamiltonian is the input for each solver. This is an example for the non-relativistic Hamiltonian of hydrogen atom in atomic units:

\[\hat{H} = +)

source
TwoBody.HamiltonianType

Hamiltonian(operator1, operator2, ...)

\[\hat{H} = \sum_i \hat{o}_i\]

The Hamiltonian is the input for each solver. This is an example for the non-relativistic Hamiltonian of hydrogen atom in atomic units:

\[\hat{H} = - \frac{1}{2} \nabla^2 - \frac{1}{r}\]

hamiltonian = Hamiltonian(
   NonRelativisticKinetic(ℏ =1 , m = 1),
   CoulombPotential(coefficient = -1),
-)
source
TwoBody.RelativisticCorrectionType

RelativisticCorrection(c=1, m=1, n=2) The p^{2n} term of the Taylor expansion:

\[\begin{aligned} \sqrt{p^2 c^2 + m^2 c^4} =& m \times c^2 \\ &+ 1 / 2 / m \times p^2 (n=1) \\ @@ -22,7 +22,7 @@ &+ 1 / 16 / m^5 / c^4 \times p^6 (n=3) \\ &- 5 / 128 / m^7 / c^6 \times p^8 (n=4) \\ &+ \cdots -\end{aligned}\]

Use c = 137.035999177 (from 2022 CODATA) in the atomic units.

source
TwoBody.YukawaPotentialType

YukawaPotential(coefficient=1, exponent=1)

\[+ \mathrm{coeff.} \times \exp(- \mathrm{expon.} \times r) / r\]

source
TwoBody.elementMethod

element(o::CoulombPotential, SGB1::SimpleGaussianBasis, SGB2::SimpleGaussianBasis)

\[\begin{aligned} +\end{aligned}\]

Use c = 137.035999177 (from 2022 CODATA) in the atomic units.

source
TwoBody.YukawaPotentialType

YukawaPotential(coefficient=1, exponent=1)

\[+ \mathrm{coeff.} \times \exp(- \mathrm{expon.} \times r) / r\]

source
TwoBody.elementMethod

element(o::CoulombPotential, SGB1::SimpleGaussianBasis, SGB2::SimpleGaussianBasis)

\[\begin{aligned} \langle \phi_{i} | \frac{1}{r} | \phi_{j} \rangle &= \iiint \phi_{i}^*(r) @@ -36,13 +36,13 @@ &= \underline{\frac{2\pi}{\alpha_i + \alpha_j}} \end{aligned}\]

Integral Formula:

\[\begin{aligned} \int_0^{\infty} r^{2n+1} \exp \left(-a r^2\right) ~\mathrm{d}r = \frac{n!}{2 a^{n+1}} -\end{aligned}\]

source
TwoBody.elementMethod

element(o::Hamiltonian, SGB1::SimpleGaussianBasis, SGB2::SimpleGaussianBasis)

\[\begin{aligned} +\end{aligned}\]

source
TwoBody.elementMethod

element(o::Hamiltonian, SGB1::SimpleGaussianBasis, SGB2::SimpleGaussianBasis)

\[\begin{aligned} H_{ij} &= \langle \phi_{i} | \hat{H} | \phi_{j} \rangle \\ &= \langle \phi_{i} | \hat{T} + \hat{V} | \phi_{j} \rangle \\ &= \langle \phi_{i} | \hat{T} | \phi_{j} \rangle + \langle \phi_{i} | \hat{V} | \phi_{j} \rangle \\ &= T_{ij} + V_{ij} -\end{aligned}\]

source
TwoBody.elementMethod

element(o::LinearPotential, SGB1::SimpleGaussianBasis, SGB2::SimpleGaussianBasis)

\[\begin{aligned} +\end{aligned}\]

source
TwoBody.elementMethod

element(o::LinearPotential, SGB1::SimpleGaussianBasis, SGB2::SimpleGaussianBasis)

\[\begin{aligned} \langle \phi_{i} | r | \phi_{j} \rangle &= \iiint \phi_{i}^*(r) @@ -56,7 +56,7 @@ &= \underline{\frac{2\pi}{(\alpha_i + \alpha_j)^2}} \end{aligned}\]

Integral Formula:

\[\begin{aligned} \int_0^{\infty} r^{2n+1} \exp \left(-a r^2\right) ~\mathrm{d}r = \frac{n!}{2 a^{n+1}} -\end{aligned}\]

source
TwoBody.elementMethod

element(o::NonRelativisticKinetic, SGB1::SimpleGaussianBasis, SGB2::SimpleGaussianBasis)

\[\begin{aligned} +\end{aligned}\]

source
TwoBody.elementMethod

element(o::NonRelativisticKinetic, SGB1::SimpleGaussianBasis, SGB2::SimpleGaussianBasis)

\[\begin{aligned} T_{ij} = \langle \phi_{i} | \hat{T} | \phi_{j} \rangle &= \iiint \mathrm{e}^{-\alpha_i r^2} @@ -159,7 +159,7 @@ \cdot 6 \cdot \frac{\alpha_i \alpha_j \pi^{\frac{3}{2}}}{(\alpha_i + \alpha_j)^{\frac{5}{2}}} } -\end{aligned}\]

source
TwoBody.elementMethod

element(o::PowerLawPotential, SGB1::SimpleGaussianBasis, SGB2::SimpleGaussianBasis)

\[\begin{aligned} +\end{aligned}\]

source
TwoBody.elementMethod

element(o::PowerLawPotential, SGB1::SimpleGaussianBasis, SGB2::SimpleGaussianBasis)

\[\begin{aligned} \langle \phi_{i} | r^n | \phi_{j} \rangle &= \iiint \phi_{i}^*(r) @@ -171,7 +171,7 @@ \int_0^\infty r^{n+2} \mathrm{e}^{-(\alpha_i + \alpha_j) r^2} ~\mathrm{d}r \\ &= 2\pi \times 2 \times \frac{\Gamma\left( \frac{n+3}{2} \right)}{2 (\alpha_i + \alpha_j)^{\frac{n+3}{2}}} \\ &= \underline{2\pi\frac{\Gamma\left( \frac{n+3}{2} \right)}{(\alpha_i + \alpha_j)^{\frac{n+3}{2}}}} -\end{aligned}\]

Integral Formula:

\[\int_0^{\infty} r^{n} \exp \left(-a r^2\right) ~\mathrm{d}r = \frac{\Gamma\left( \frac{n+1}{2} \right)}{2 a^{\frac{n+1}{2}}}\]

source
TwoBody.elementMethod

element(SGB1::SimpleGaussianBasis, SGB2::SimpleGaussianBasis)

\[\begin{aligned} +\end{aligned}\]

Integral Formula:

\[\int_0^{\infty} r^{n} \exp \left(-a r^2\right) ~\mathrm{d}r = \frac{\Gamma\left( \frac{n+1}{2} \right)}{2 a^{\frac{n+1}{2}}}\]

source
TwoBody.elementMethod

element(SGB1::SimpleGaussianBasis, SGB2::SimpleGaussianBasis)

\[\begin{aligned} S_{ij} = \langle \phi_{i} | \phi_{j} \rangle &= \iiint @@ -183,4 +183,4 @@ \int_0^\infty r^{2} \mathrm{e}^{-(\alpha_i + \alpha_j) r^2} ~\mathrm{d}r \\ &= 2\pi \times 2 \times \frac{1!!}{2^{2}} \sqrt{\frac{\pi}{a^{3}}} \\ &= \underline{\left( \frac{\pi}{\alpha_i + \alpha_j} \right)^{3/2}} -\end{aligned}\]

Integral Formula:

\[\int_0^{\infty} r^{2n} \exp \left(-a r^2\right) ~\mathrm{d}r = \frac{(2n-1)!!}{2^{n+1}} \sqrt{\frac{\pi}{a^{2n+1}}}\]

source
TwoBody.solveMethod

solve(hamiltonian::Hamiltonian, basisset::BasisSet)

This function returns the eigenvalues $E$ and eigenvectors $\pmb{c}$ for

\[\pmb{H} \pmb{c} = E \pmb{S} \pmb{c}.\]

The Hamiltonian matrix is defined as $H_{ij} = \langle \phi_{i} | \hat{H} | \phi_{j} \rangle$. The overlap matrix is defined as $S_{ij} = \langle \phi_{i} | \phi_{j} \rangle$.

source
+\end{aligned}\]

Integral Formula:

\[\int_0^{\infty} r^{2n} \exp \left(-a r^2\right) ~\mathrm{d}r = \frac{(2n-1)!!}{2^{n+1}} \sqrt{\frac{\pi}{a^{2n+1}}}\]

source
TwoBody.solveMethod

solve(hamiltonian::Hamiltonian, basisset::BasisSet)

This function returns the eigenvalues $E$ and eigenvectors $\pmb{c}$ for

\[\pmb{H} \pmb{c} = E \pmb{S} \pmb{c}.\]

The Hamiltonian matrix is defined as $H_{ij} = \langle \phi_{i} | \hat{H} | \phi_{j} \rangle$. The overlap matrix is defined as $S_{ij} = \langle \phi_{i} | \phi_{j} \rangle$.

source
diff --git a/dev/Hamiltonian/index.html b/dev/Hamiltonian/index.html index 908fca5..53bc003 100644 --- a/dev/Hamiltonian/index.html +++ b/dev/Hamiltonian/index.html @@ -4,7 +4,7 @@ - \frac{1}{r}\]

hamiltonian = Hamiltonian(
   NonRelativisticKinetic(ℏ =1 , m = 1),
   CoulombPotential(coefficient = -1),
-)
source

Operators

TwoBody.NonRelativisticKineticType

NonRelativisticKinetic(ℏ=1, m=1)

\[-\frac{\hbar^2}{2m} \nabla^2\]

source
TwoBody.RestEnergyType

RestEnergy(c=1, m=1)

\[m c^2\]

Use c = 137.035999177 (from 2022 CODATA) in the atomic units.

source
TwoBody.RelativisticCorrectionType

RelativisticCorrection(c=1, m=1, n=2) The p^{2n} term of the Taylor expansion:

\[\begin{aligned} +)

source

Operators

TwoBody.NonRelativisticKineticType

NonRelativisticKinetic(ℏ=1, m=1)

\[-\frac{\hbar^2}{2m} \nabla^2\]

source
TwoBody.RestEnergyType

RestEnergy(c=1, m=1)

\[m c^2\]

Use c = 137.035999177 (from 2022 CODATA) in the atomic units.

source
TwoBody.RelativisticCorrectionType

RelativisticCorrection(c=1, m=1, n=2) The p^{2n} term of the Taylor expansion:

\[\begin{aligned} \sqrt{p^2 c^2 + m^2 c^4} =& m \times c^2 \\ &+ 1 / 2 / m \times p^2 (n=1) \\ @@ -12,4 +12,4 @@ &+ 1 / 16 / m^5 / c^4 \times p^6 (n=3) \\ &- 5 / 128 / m^7 / c^6 \times p^8 (n=4) \\ &+ \cdots -\end{aligned}\]

Use c = 137.035999177 (from 2022 CODATA) in the atomic units.

source
TwoBody.RelativisticKineticType

RelativisticKinetic(c=1, m=1)

\[\sqrt{p^2 c^2 + m^2 c^4} - m c^2\]

Use c = 137.035999177 (from 2022 CODATA) in the atomic units.

source
TwoBody.ConstantPotentialType

ConstantPotential(constant=1)

\[+ \mathrm{const.}\]

source
TwoBody.LinearPotentialType

LinearPotential(coefficient=1)

\[+ \mathrm{coeff.} \times r \]

source
TwoBody.CoulombPotentialType

CoulombPotential(coefficient=1)

\[+ \mathrm{coeff.} \times \frac{1}{r}\]

source
TwoBody.PowerLawPotentialType

PowerLawPotential(coefficient=1, exponent=1)

\[+ \mathrm{coeff.} \times r^\mathrm{expon.}\]

source
TwoBody.GaussianPotentialType

GaussianPotential(coefficient=1, exponent=1)

\[+ \mathrm{coeff.} \times \exp(- \mathrm{expon.} \times r^2)\]

source
TwoBody.ExponentialPotentialType

ExponentialPotential(coefficient=1, exponent=1)

\[+ \mathrm{coeff.} \times \exp(- \mathrm{expon.} \times r)\]

source
TwoBody.YukawaPotentialType

YukawaPotential(coefficient=1, exponent=1)

\[+ \mathrm{coeff.} \times \exp(- \mathrm{expon.} \times r) / r\]

source
TwoBody.DeltaPotentialType

DeltaPotential(coefficient=1)

\[+ \mathrm{coeff.} \times δ(r)\]

source
TwoBody.FunctionPotentialType

FunctionPotential(f)

\[+ f(r)\]

source
TwoBody.UniformGridPotentialType

UniformGridPotential(R, V)

source
+\end{aligned}\]

Use c = 137.035999177 (from 2022 CODATA) in the atomic units.

source
TwoBody.RelativisticKineticType

RelativisticKinetic(c=1, m=1)

\[\sqrt{p^2 c^2 + m^2 c^4} - m c^2\]

Use c = 137.035999177 (from 2022 CODATA) in the atomic units.

source
TwoBody.ConstantPotentialType

ConstantPotential(constant=1)

\[+ \mathrm{const.}\]

source
TwoBody.LinearPotentialType

LinearPotential(coefficient=1)

\[+ \mathrm{coeff.} \times r \]

source
TwoBody.CoulombPotentialType

CoulombPotential(coefficient=1)

\[+ \mathrm{coeff.} \times \frac{1}{r}\]

source
TwoBody.PowerLawPotentialType

PowerLawPotential(coefficient=1, exponent=1)

\[+ \mathrm{coeff.} \times r^\mathrm{expon.}\]

source
TwoBody.GaussianPotentialType

GaussianPotential(coefficient=1, exponent=1)

\[+ \mathrm{coeff.} \times \exp(- \mathrm{expon.} \times r^2)\]

source
TwoBody.ExponentialPotentialType

ExponentialPotential(coefficient=1, exponent=1)

\[+ \mathrm{coeff.} \times \exp(- \mathrm{expon.} \times r)\]

source
TwoBody.YukawaPotentialType

YukawaPotential(coefficient=1, exponent=1)

\[+ \mathrm{coeff.} \times \exp(- \mathrm{expon.} \times r) / r\]

source
TwoBody.DeltaPotentialType

DeltaPotential(coefficient=1)

\[+ \mathrm{coeff.} \times δ(r)\]

source
TwoBody.FunctionPotentialType

FunctionPotential(f)

\[+ f(r)\]

source
TwoBody.UniformGridPotentialType

UniformGridPotential(R, V)

source
diff --git "a/dev/Rayleigh\342\200\223Ritz/index.html" "b/dev/Rayleigh\342\200\223Ritz/index.html" index d327810..944cc4d 100644 --- "a/dev/Rayleigh\342\200\223Ritz/index.html" +++ "b/dev/Rayleigh\342\200\223Ritz/index.html" @@ -1,20 +1,20 @@ Rayleigh–Ritz method · TwoBody.jl

Rayleigh–Ritz method

The solver finds the best $c_i$ for the trial wavefunction

\[\varPsi(r) = \sum_i c_i \phi_i(r),\]

to minmize the expectation value of the energy

\[E = \frac{\langle\psi|\hat{H}|\psi\rangle}{\langle\psi|\psi\rangle}.\]

Here, the energy by trial wavefunction is the upper bound for the exact energy.

Exaples

Define the Hamiltoninan. This is an example for the non-relativistic Hamiltonian of hydrogen atom in atomic units:

\[\hat{H} = - \frac{1}{2} \nabla^2 -- \frac{1}{r}\]

julia> hamiltonian = Hamiltonian(
-         NonRelativisticKinetic(ℏ = 1 , m = 1),
-         CoulombPotential(coefficient = -1),
-       )Hamiltonian(NonRelativisticKinetic(ħ=1, m=1), CoulombPotential(coefficient=-1))

Define the basis set:

\[\begin{aligned} +- \frac{1}{r}\]

hamiltonian = Hamiltonian(
+  NonRelativisticKinetic(ℏ = 1 , m = 1),
+  CoulombPotential(coefficient = -1),
+)

Define the basis set:

\[\begin{aligned} \phi_1(r) &= \exp(-13.00773 ~r^2), \\ \phi_2(r) &= \exp(-1.962079 ~r^2), \\ \phi_3(r) &= \exp(-0.444529 ~r^2), \\ \phi_4(r) &= \exp(-0.1219492 ~r^2). -\end{aligned}\]

julia> basisset = BasisSet(
-         SimpleGaussianBasis(13.00773),
-         SimpleGaussianBasis(1.962079),
-         SimpleGaussianBasis(0.444529),
-         SimpleGaussianBasis(0.1219492),
-       )BasisSet(SimpleGaussianBasis(a=13.00773), SimpleGaussianBasis(a=1.962079), SimpleGaussianBasis(a=0.444529), SimpleGaussianBasis(a=0.1219492))

You should find

\[E_{n=1} = -0.499278~E_\mathrm{h},\]

which is amazingly good for only four basis functions according to Thijssen(2007). The exact ground-state energy is $-0.5~E_\mathrm{h}$.

julia> solve(hamiltonian, basisset)
+\end{aligned}\]

basisset = BasisSet(
+  SimpleGaussianBasis(13.00773),
+  SimpleGaussianBasis(1.962079),
+  SimpleGaussianBasis(0.444529),
+  SimpleGaussianBasis(0.1219492),
+)

You should find

\[E_{n=1} = -0.499278~E_\mathrm{h},\]

which is amazingly good for only four basis functions according to Thijssen(2007). The exact ground-state energy is $-0.5~E_\mathrm{h}$.

julia> solve(hamiltonian, basisset)
 n 	basis function φₙ
 1	SimpleGaussianBasis(a=13.00773)
 2	SimpleGaussianBasis(a=1.962079)
@@ -57,7 +57,7 @@
 3	-1.8403570367716342
 4	-5.321258450209621
 
-(hamiltonian = Hamiltonian(NonRelativisticKinetic(ħ=1, m=1), CoulombPotential(coefficient=-1)), basisset = BasisSet(SimpleGaussianBasis(a=13.00773), SimpleGaussianBasis(a=1.962079), SimpleGaussianBasis(a=0.444529), SimpleGaussianBasis(a=0.1219492)), E = [-0.4992784056674876, 0.11321392045798988, 2.592299571959808, 21.144365190122507], C = [0.09610151618612488 0.1194538057449333 -0.010362061881687392 -6.155100006789123; 0.16301716963905885 0.08132945379475047 1.7448913023470436 1.2402020851506472; 0.18558698714513683 0.49621626366832666 -0.6291955141735303 -0.22641160819529882; 0.07370076069275631 -0.20591550816511817 0.09777447415099819 0.030779842546714373], S = [0.041964064408426524 0.0961391814715395 0.11285790355607861 0.11704251263182287; 0.0961391814715395 0.7163167080668228 1.4914777365294443 1.8508423236885296; 0.11285790355607861 1.4914777365294443 6.642471010530628 13.060205391889545; 0.11704251263182287 1.8508423236885296 13.060205391889545 46.22866820431064], H = [0.5772684658780091 0.072002466903411 -0.32154049871511875 -0.43612626272313476; 0.072002466903411 0.5070499286923358 -0.9891848263978418 -2.377419924763058; -0.3215404987151187 -0.9891848263978418 -2.6380824346106566 -7.342216931051755; -0.43612626272313476 -2.3774199247630583 -7.342216931051756 -17.30516271277891])

Solver

TwoBody.solveFunction

solve(hamiltonian::Hamiltonian, basisset::BasisSet)

This function returns the eigenvalues $E$ and eigenvectors $\pmb{c}$ for

\[\pmb{H} \pmb{c} = E \pmb{S} \pmb{c}.\]

The Hamiltonian matrix is defined as $H_{ij} = \langle \phi_{i} | \hat{H} | \phi_{j} \rangle$. The overlap matrix is defined as $S_{ij} = \langle \phi_{i} | \phi_{j} \rangle$.

source

Basis Set

TwoBody.BasisSetType

BasisSet(basis1, basis2, ...)

\[\{ \phi_1, \phi_2, \phi_3, \cdots \}\]

The basis set is the input for Rayleigh–Ritz method. You can define the basis set like this:

\[\begin{aligned} +(hamiltonian = Hamiltonian(NonRelativisticKinetic(ħ=1, m=1), CoulombPotential(coefficient=-1)), basisset = BasisSet(SimpleGaussianBasis(a=13.00773), SimpleGaussianBasis(a=1.962079), SimpleGaussianBasis(a=0.444529), SimpleGaussianBasis(a=0.1219492)), E = [-0.4992784056674876, 0.11321392045798988, 2.592299571959808, 21.144365190122507], C = [0.09610151618612488 0.1194538057449333 -0.010362061881687392 -6.155100006789123; 0.16301716963905885 0.08132945379475047 1.7448913023470436 1.2402020851506472; 0.18558698714513683 0.49621626366832666 -0.6291955141735303 -0.22641160819529882; 0.07370076069275631 -0.20591550816511817 0.09777447415099819 0.030779842546714373], S = [0.041964064408426524 0.0961391814715395 0.11285790355607861 0.11704251263182287; 0.0961391814715395 0.7163167080668228 1.4914777365294443 1.8508423236885296; 0.11285790355607861 1.4914777365294443 6.642471010530628 13.060205391889545; 0.11704251263182287 1.8508423236885296 13.060205391889545 46.22866820431064], H = [0.5772684658780091 0.072002466903411 -0.32154049871511875 -0.43612626272313476; 0.072002466903411 0.5070499286923358 -0.9891848263978418 -2.377419924763058; -0.3215404987151187 -0.9891848263978418 -2.6380824346106566 -7.342216931051755; -0.43612626272313476 -2.3774199247630583 -7.342216931051756 -17.30516271277891])

Solver

TwoBody.solveFunction

solve(hamiltonian::Hamiltonian, basisset::BasisSet)

This function returns the eigenvalues $E$ and eigenvectors $\pmb{c}$ for

\[\pmb{H} \pmb{c} = E \pmb{S} \pmb{c}.\]

The Hamiltonian matrix is defined as $H_{ij} = \langle \phi_{i} | \hat{H} | \phi_{j} \rangle$. The overlap matrix is defined as $S_{ij} = \langle \phi_{i} | \phi_{j} \rangle$.

source

Basis Set

TwoBody.BasisSetType

BasisSet(basis1, basis2, ...)

\[\{ \phi_1, \phi_2, \phi_3, \cdots \}\]

The basis set is the input for Rayleigh–Ritz method. You can define the basis set like this:

\[\begin{aligned} \phi_1(r) &= \exp(-13.00773 ~r^2), \\ \phi_2(r) &= \exp(-1.962079 ~r^2), \\ \phi_3(r) &= \exp(-0.444529 ~r^2), \\ @@ -67,7 +67,7 @@ SimpleGaussianBasis(1.962079), SimpleGaussianBasis(0.444529), SimpleGaussianBasis(0.1219492), -)

source

Basis Functions

Matrix Elements

TwoBody.elementFunction

element(SGB1::SimpleGaussianBasis, SGB2::SimpleGaussianBasis)

\[\begin{aligned} +)

source

Basis Functions

Matrix Elements

TwoBody.elementFunction

element(SGB1::SimpleGaussianBasis, SGB2::SimpleGaussianBasis)

\[\begin{aligned} S_{ij} = \langle \phi_{i} | \phi_{j} \rangle &= \iiint @@ -79,7 +79,7 @@ \int_0^\infty r^{2} \mathrm{e}^{-(\alpha_i + \alpha_j) r^2} ~\mathrm{d}r \\ &= 2\pi \times 2 \times \frac{1!!}{2^{2}} \sqrt{\frac{\pi}{a^{3}}} \\ &= \underline{\left( \frac{\pi}{\alpha_i + \alpha_j} \right)^{3/2}} -\end{aligned}\]

Integral Formula:

\[\int_0^{\infty} r^{2n} \exp \left(-a r^2\right) ~\mathrm{d}r = \frac{(2n-1)!!}{2^{n+1}} \sqrt{\frac{\pi}{a^{2n+1}}}\]

source

element(o::NonRelativisticKinetic, SGB1::SimpleGaussianBasis, SGB2::SimpleGaussianBasis)

\[\begin{aligned} +\end{aligned}\]

Integral Formula:

\[\int_0^{\infty} r^{2n} \exp \left(-a r^2\right) ~\mathrm{d}r = \frac{(2n-1)!!}{2^{n+1}} \sqrt{\frac{\pi}{a^{2n+1}}}\]

source

element(o::NonRelativisticKinetic, SGB1::SimpleGaussianBasis, SGB2::SimpleGaussianBasis)

\[\begin{aligned} T_{ij} = \langle \phi_{i} | \hat{T} | \phi_{j} \rangle &= \iiint \mathrm{e}^{-\alpha_i r^2} @@ -182,7 +182,7 @@ \cdot 6 \cdot \frac{\alpha_i \alpha_j \pi^{\frac{3}{2}}}{(\alpha_i + \alpha_j)^{\frac{5}{2}}} } -\end{aligned}\]

source

element(o::LinearPotential, SGB1::SimpleGaussianBasis, SGB2::SimpleGaussianBasis)

\[\begin{aligned} +\end{aligned}\]

source

element(o::LinearPotential, SGB1::SimpleGaussianBasis, SGB2::SimpleGaussianBasis)

\[\begin{aligned} \langle \phi_{i} | r | \phi_{j} \rangle &= \iiint \phi_{i}^*(r) @@ -196,7 +196,7 @@ &= \underline{\frac{2\pi}{(\alpha_i + \alpha_j)^2}} \end{aligned}\]

Integral Formula:

\[\begin{aligned} \int_0^{\infty} r^{2n+1} \exp \left(-a r^2\right) ~\mathrm{d}r = \frac{n!}{2 a^{n+1}} -\end{aligned}\]

source

element(o::CoulombPotential, SGB1::SimpleGaussianBasis, SGB2::SimpleGaussianBasis)

\[\begin{aligned} +\end{aligned}\]

source

element(o::CoulombPotential, SGB1::SimpleGaussianBasis, SGB2::SimpleGaussianBasis)

\[\begin{aligned} \langle \phi_{i} | \frac{1}{r} | \phi_{j} \rangle &= \iiint \phi_{i}^*(r) @@ -210,7 +210,7 @@ &= \underline{\frac{2\pi}{\alpha_i + \alpha_j}} \end{aligned}\]

Integral Formula:

\[\begin{aligned} \int_0^{\infty} r^{2n+1} \exp \left(-a r^2\right) ~\mathrm{d}r = \frac{n!}{2 a^{n+1}} -\end{aligned}\]

source

element(o::PowerLawPotential, SGB1::SimpleGaussianBasis, SGB2::SimpleGaussianBasis)

\[\begin{aligned} +\end{aligned}\]

source

element(o::PowerLawPotential, SGB1::SimpleGaussianBasis, SGB2::SimpleGaussianBasis)

\[\begin{aligned} \langle \phi_{i} | r^n | \phi_{j} \rangle &= \iiint \phi_{i}^*(r) @@ -222,10 +222,10 @@ \int_0^\infty r^{n+2} \mathrm{e}^{-(\alpha_i + \alpha_j) r^2} ~\mathrm{d}r \\ &= 2\pi \times 2 \times \frac{\Gamma\left( \frac{n+3}{2} \right)}{2 (\alpha_i + \alpha_j)^{\frac{n+3}{2}}} \\ &= \underline{2\pi\frac{\Gamma\left( \frac{n+3}{2} \right)}{(\alpha_i + \alpha_j)^{\frac{n+3}{2}}}} -\end{aligned}\]

Integral Formula:

\[\int_0^{\infty} r^{n} \exp \left(-a r^2\right) ~\mathrm{d}r = \frac{\Gamma\left( \frac{n+1}{2} \right)}{2 a^{\frac{n+1}{2}}}\]

source

element(o::Hamiltonian, SGB1::SimpleGaussianBasis, SGB2::SimpleGaussianBasis)

\[\begin{aligned} +\end{aligned}\]

Integral Formula:

\[\int_0^{\infty} r^{n} \exp \left(-a r^2\right) ~\mathrm{d}r = \frac{\Gamma\left( \frac{n+1}{2} \right)}{2 a^{\frac{n+1}{2}}}\]

source

element(o::Hamiltonian, SGB1::SimpleGaussianBasis, SGB2::SimpleGaussianBasis)

\[\begin{aligned} H_{ij} &= \langle \phi_{i} | \hat{H} | \phi_{j} \rangle \\ &= \langle \phi_{i} | \hat{T} + \hat{V} | \phi_{j} \rangle \\ &= \langle \phi_{i} | \hat{T} | \phi_{j} \rangle + \langle \phi_{i} | \hat{V} | \phi_{j} \rangle \\ &= T_{ij} + V_{ij} -\end{aligned}\]

source
+\end{aligned}\]

source diff --git a/dev/index.html b/dev/index.html index ef20909..30e89aa 100644 --- a/dev/index.html +++ b/dev/index.html @@ -1,20 +1,20 @@ Home · TwoBody.jl

TwoBody.jl

Stable Dev Build Status

TwoBody.jl: a Julia package for two-body problems

Install

Run the following code on the REPL or Jupyter Notebook to install this package.

import Pkg; Pkg.add(url="https://github.com/ohno/TwoBody.jl.git")

Usage

Run the following code before each use.

using TwoBody

Define the Hamiltoninan. This is an example for the non-relativistic Hamiltonian of hydrogen atom in atomic units:

\[\hat{H} = - \frac{1}{2} \nabla^2 -- \frac{1}{r}\]

julia> hamiltonian = Hamiltonian(
-         NonRelativisticKinetic(ℏ = 1 , m = 1),
-         CoulombPotential(coefficient = -1),
-       )Hamiltonian(NonRelativisticKinetic(ħ=1, m=1), CoulombPotential(coefficient=-1))

The usage depends on the method. Define the basis set for the Rayleigh–Ritz method:

\[\begin{aligned} +- \frac{1}{r}\]

hamiltonian = Hamiltonian(
+  NonRelativisticKinetic(ℏ = 1 , m = 1),
+  CoulombPotential(coefficient = -1),
+)

The usage depends on the method. Define the basis set for the Rayleigh–Ritz method:

\[\begin{aligned} \phi_1(r) &= \exp(-13.00773 ~r^2), \\ \phi_2(r) &= \exp(-1.962079 ~r^2), \\ \phi_3(r) &= \exp(-0.444529 ~r^2), \\ \phi_4(r) &= \exp(-0.1219492 ~r^2). -\end{aligned}\]

julia> basisset = BasisSet(
-         SimpleGaussianBasis(13.00773),
-         SimpleGaussianBasis(1.962079),
-         SimpleGaussianBasis(0.444529),
-         SimpleGaussianBasis(0.1219492),
-       )BasisSet(SimpleGaussianBasis(a=13.00773), SimpleGaussianBasis(a=1.962079), SimpleGaussianBasis(a=0.444529), SimpleGaussianBasis(a=0.1219492))

You should find

\[E_{n=1} = -0.499278~E_\mathrm{h},\]

which is amazingly good for only four basis functions according to Thijssen(2007). The exact ground-state energy is $-0.5~E_\mathrm{h}$.

julia> solve(hamiltonian, basisset)
+\end{aligned}\]

basisset = BasisSet(
+  SimpleGaussianBasis(13.00773),
+  SimpleGaussianBasis(1.962079),
+  SimpleGaussianBasis(0.444529),
+  SimpleGaussianBasis(0.1219492),
+)

You should find

\[E_{n=1} = -0.499278~E_\mathrm{h},\]

which is amazingly good for only four basis functions according to Thijssen(2007). The exact ground-state energy is $-0.5~E_\mathrm{h}$.

julia> solve(hamiltonian, basisset)
 n 	basis function φₙ
 1	SimpleGaussianBasis(a=13.00773)
 2	SimpleGaussianBasis(a=1.962079)
@@ -57,4 +57,4 @@
 3	-1.8403570367716342
 4	-5.321258450209621
 
-(hamiltonian = Hamiltonian(NonRelativisticKinetic(ħ=1, m=1), CoulombPotential(coefficient=-1)), basisset = BasisSet(SimpleGaussianBasis(a=13.00773), SimpleGaussianBasis(a=1.962079), SimpleGaussianBasis(a=0.444529), SimpleGaussianBasis(a=0.1219492)), E = [-0.4992784056674876, 0.11321392045798988, 2.592299571959808, 21.144365190122507], C = [0.09610151618612488 0.1194538057449333 -0.010362061881687392 -6.155100006789123; 0.16301716963905885 0.08132945379475047 1.7448913023470436 1.2402020851506472; 0.18558698714513683 0.49621626366832666 -0.6291955141735303 -0.22641160819529882; 0.07370076069275631 -0.20591550816511817 0.09777447415099819 0.030779842546714373], S = [0.041964064408426524 0.0961391814715395 0.11285790355607861 0.11704251263182287; 0.0961391814715395 0.7163167080668228 1.4914777365294443 1.8508423236885296; 0.11285790355607861 1.4914777365294443 6.642471010530628 13.060205391889545; 0.11704251263182287 1.8508423236885296 13.060205391889545 46.22866820431064], H = [0.5772684658780091 0.072002466903411 -0.32154049871511875 -0.43612626272313476; 0.072002466903411 0.5070499286923358 -0.9891848263978418 -2.377419924763058; -0.3215404987151187 -0.9891848263978418 -2.6380824346106566 -7.342216931051755; -0.43612626272313476 -2.3774199247630583 -7.342216931051756 -17.30516271277891])

API reference

+(hamiltonian = Hamiltonian(NonRelativisticKinetic(ħ=1, m=1), CoulombPotential(coefficient=-1)), basisset = BasisSet(SimpleGaussianBasis(a=13.00773), SimpleGaussianBasis(a=1.962079), SimpleGaussianBasis(a=0.444529), SimpleGaussianBasis(a=0.1219492)), E = [-0.4992784056674876, 0.11321392045798988, 2.592299571959808, 21.144365190122507], C = [0.09610151618612488 0.1194538057449333 -0.010362061881687392 -6.155100006789123; 0.16301716963905885 0.08132945379475047 1.7448913023470436 1.2402020851506472; 0.18558698714513683 0.49621626366832666 -0.6291955141735303 -0.22641160819529882; 0.07370076069275631 -0.20591550816511817 0.09777447415099819 0.030779842546714373], S = [0.041964064408426524 0.0961391814715395 0.11285790355607861 0.11704251263182287; 0.0961391814715395 0.7163167080668228 1.4914777365294443 1.8508423236885296; 0.11285790355607861 1.4914777365294443 6.642471010530628 13.060205391889545; 0.11704251263182287 1.8508423236885296 13.060205391889545 46.22866820431064], H = [0.5772684658780091 0.072002466903411 -0.32154049871511875 -0.43612626272313476; 0.072002466903411 0.5070499286923358 -0.9891848263978418 -2.377419924763058; -0.3215404987151187 -0.9891848263978418 -2.6380824346106566 -7.342216931051755; -0.43612626272313476 -2.3774199247630583 -7.342216931051756 -17.30516271277891])

API reference

diff --git a/dev/search_index.js b/dev/search_index.js index a54a4ed..157af20 100644 --- a/dev/search_index.js +++ b/dev/search_index.js @@ -1,3 +1,3 @@ var documenterSearchIndex = {"docs": -[{"location":"Rayleigh–Ritz/","page":"Rayleigh–Ritz method","title":"Rayleigh–Ritz method","text":"CurrentModule = TwoBody","category":"page"},{"location":"Rayleigh–Ritz/#Rayleigh–Ritz-method","page":"Rayleigh–Ritz method","title":"Rayleigh–Ritz method","text":"","category":"section"},{"location":"Rayleigh–Ritz/","page":"Rayleigh–Ritz method","title":"Rayleigh–Ritz method","text":"The solver finds the best c_i for the trial wavefunction","category":"page"},{"location":"Rayleigh–Ritz/","page":"Rayleigh–Ritz method","title":"Rayleigh–Ritz method","text":"varPsi(r) = sum_i c_i phi_i(r)","category":"page"},{"location":"Rayleigh–Ritz/","page":"Rayleigh–Ritz method","title":"Rayleigh–Ritz method","text":"to minmize the expectation value of the energy","category":"page"},{"location":"Rayleigh–Ritz/","page":"Rayleigh–Ritz method","title":"Rayleigh–Ritz method","text":"E = fraclanglepsihatHpsiranglelanglepsipsirangle","category":"page"},{"location":"Rayleigh–Ritz/","page":"Rayleigh–Ritz method","title":"Rayleigh–Ritz method","text":"Here, the energy by trial wavefunction is the upper bound for the exact energy.","category":"page"},{"location":"Rayleigh–Ritz/#Exaples","page":"Rayleigh–Ritz method","title":"Exaples","text":"","category":"section"},{"location":"Rayleigh–Ritz/","page":"Rayleigh–Ritz method","title":"Rayleigh–Ritz method","text":"using TwoBody","category":"page"},{"location":"Rayleigh–Ritz/","page":"Rayleigh–Ritz method","title":"Rayleigh–Ritz method","text":"Define the Hamiltoninan. This is an example for the non-relativistic Hamiltonian of hydrogen atom in atomic units:","category":"page"},{"location":"Rayleigh–Ritz/","page":"Rayleigh–Ritz method","title":"Rayleigh–Ritz method","text":"hatH = \n- frac12 nabla^2\n- frac1r","category":"page"},{"location":"Rayleigh–Ritz/","page":"Rayleigh–Ritz method","title":"Rayleigh–Ritz method","text":"hamiltonian = Hamiltonian(\n NonRelativisticKinetic(ℏ = 1 , m = 1),\n CoulombPotential(coefficient = -1),\n)","category":"page"},{"location":"Rayleigh–Ritz/","page":"Rayleigh–Ritz method","title":"Rayleigh–Ritz method","text":"Define the basis set:","category":"page"},{"location":"Rayleigh–Ritz/","page":"Rayleigh–Ritz method","title":"Rayleigh–Ritz method","text":"beginaligned\n phi_1(r) = exp(-1300773 r^2) \n phi_2(r) = exp(-1962079 r^2) \n phi_3(r) = exp(-0444529 r^2) \n phi_4(r) = exp(-01219492 r^2)\nendaligned","category":"page"},{"location":"Rayleigh–Ritz/","page":"Rayleigh–Ritz method","title":"Rayleigh–Ritz method","text":"basisset = BasisSet(\n SimpleGaussianBasis(13.00773),\n SimpleGaussianBasis(1.962079),\n SimpleGaussianBasis(0.444529),\n SimpleGaussianBasis(0.1219492),\n)","category":"page"},{"location":"Rayleigh–Ritz/","page":"Rayleigh–Ritz method","title":"Rayleigh–Ritz method","text":"You should find","category":"page"},{"location":"Rayleigh–Ritz/","page":"Rayleigh–Ritz method","title":"Rayleigh–Ritz method","text":"E_n=1 = -0499278E_mathrmh","category":"page"},{"location":"Rayleigh–Ritz/","page":"Rayleigh–Ritz method","title":"Rayleigh–Ritz method","text":"which is amazingly good for only four basis functions according to Thijssen(2007). The exact ground-state energy is -05E_mathrmh.","category":"page"},{"location":"Rayleigh–Ritz/","page":"Rayleigh–Ritz method","title":"Rayleigh–Ritz method","text":"solve(hamiltonian, basisset)","category":"page"},{"location":"Rayleigh–Ritz/#Solver","page":"Rayleigh–Ritz method","title":"Solver","text":"","category":"section"},{"location":"Rayleigh–Ritz/","page":"Rayleigh–Ritz method","title":"Rayleigh–Ritz method","text":"TwoBody.solve","category":"page"},{"location":"Rayleigh–Ritz/#TwoBody.solve-Rayleigh–Ritz","page":"Rayleigh–Ritz method","title":"TwoBody.solve","text":"solve(hamiltonian::Hamiltonian, basisset::BasisSet)\n\nThis function returns the eigenvalues E and eigenvectors pmbc for\n\npmbH pmbc = E pmbS pmbc\n\nThe Hamiltonian matrix is defined as H_ij = langle phi_i hatH phi_j rangle. The overlap matrix is defined as S_ij = langle phi_i phi_j rangle.\n\n\n\n\n\n","category":"function"},{"location":"Rayleigh–Ritz/#Basis-Set","page":"Rayleigh–Ritz method","title":"Basis Set","text":"","category":"section"},{"location":"Rayleigh–Ritz/","page":"Rayleigh–Ritz method","title":"Rayleigh–Ritz method","text":"TwoBody.BasisSet","category":"page"},{"location":"Rayleigh–Ritz/#TwoBody.BasisSet-Rayleigh–Ritz","page":"Rayleigh–Ritz method","title":"TwoBody.BasisSet","text":"BasisSet(basis1, basis2, ...)\n\n phi_1 phi_2 phi_3 cdots \n\nThe basis set is the input for Rayleigh–Ritz method. You can define the basis set like this:\n\nbeginaligned\n phi_1(r) = exp(-1300773 r^2) \n phi_2(r) = exp(-1962079 r^2) \n phi_3(r) = exp(-0444529 r^2) \n phi_4(r) = exp(-01219492 r^2)\nendaligned\n\nbasisset = BasisSet(\n SimpleGaussianBasis(13.00773),\n SimpleGaussianBasis(1.962079),\n SimpleGaussianBasis(0.444529),\n SimpleGaussianBasis(0.1219492),\n)\n\n\n\n\n\n","category":"type"},{"location":"Rayleigh–Ritz/#Basis-Functions","page":"Rayleigh–Ritz method","title":"Basis Functions","text":"","category":"section"},{"location":"Rayleigh–Ritz/","page":"Rayleigh–Ritz method","title":"Rayleigh–Ritz method","text":"TwoBody.SimpleGaussianBasis\nTwoBody.GaussianBasis\nTwoBody.ContractedBasis","category":"page"},{"location":"Rayleigh–Ritz/#TwoBody.SimpleGaussianBasis-Rayleigh–Ritz","page":"Rayleigh–Ritz method","title":"TwoBody.SimpleGaussianBasis","text":"SimpleGaussianBasis(a=1)\n\nphi_i(r) = exp(-a_i r^2)\n\nNote: This basis is not normalized. This is only for s-wave.\n\n\n\n\n\n","category":"type"},{"location":"Rayleigh–Ritz/#TwoBody.GaussianBasis-Rayleigh–Ritz","page":"Rayleigh–Ritz method","title":"TwoBody.GaussianBasis","text":"GaussianBasis(a=1, l=0, m=0)\n\nphi_i(r θ φ) = N _il r^l exp(-a_i r^2) Y_l^m(θ φ)\n\n\n\n\n\n","category":"type"},{"location":"Rayleigh–Ritz/#TwoBody.ContractedBasis-Rayleigh–Ritz","page":"Rayleigh–Ritz method","title":"TwoBody.ContractedBasis","text":"ContractedBasis([c1, c2, ...], [basis1, basis2, ...])\n\nphi = sum_i c_i phi_i\n\n\n\n\n\n","category":"type"},{"location":"Rayleigh–Ritz/#Matrix-Elements","page":"Rayleigh–Ritz method","title":"Matrix Elements","text":"","category":"section"},{"location":"Rayleigh–Ritz/","page":"Rayleigh–Ritz method","title":"Rayleigh–Ritz method","text":"TwoBody.element","category":"page"},{"location":"Rayleigh–Ritz/#TwoBody.element-Rayleigh–Ritz","page":"Rayleigh–Ritz method","title":"TwoBody.element","text":"element(SGB1::SimpleGaussianBasis, SGB2::SimpleGaussianBasis)\n\nbeginaligned\n S_ij\n = langle phi_i phi_j rangle\n = iiint\n phi_i^*(r)\n phi_j(r)\n r^2 sintheta mathrmdr mathrmdtheta mathrmdvarphi \n = int_0^2pi mathrmdvarphi\n int_0^pi sintheta mathrmdtheta\n int_0^infty r^2 mathrme^-(alpha_i + alpha_j) r^2 mathrmdr \n = 2pi times 2 times frac12^2 sqrtfracpia^3 \n = underlineleft( fracpialpha_i + alpha_j right)^32\nendaligned\n\nIntegral Formula:\n\nint_0^infty r^2n exp left(-a r^2right) mathrmdr = frac(2n-1)2^n+1 sqrtfracpia^2n+1\n\n\n\n\n\nelement(o::NonRelativisticKinetic, SGB1::SimpleGaussianBasis, SGB2::SimpleGaussianBasis)\n\nbeginaligned\n T_ij = langle phi_i hatT phi_j rangle\n = iiint\n mathrme^-alpha_i r^2\n left -frachbar^22mu nabla^2 right\n mathrme^-alpha_j r^2\n r^2 sintheta mathrmdr mathrmdtheta mathrmdvarphi \n = -frachbar^22mu iiint\n mathrme^-alpha_i r^2\n left nabla^2 right\n mathrme^-alpha_j r^2\n r^2 sintheta mathrmdr mathrmdtheta mathrmdvarphi \n = -frachbar^22mu iiint\n mathrme^-alpha_i r^2\n left -6alpha_j + 4alpha_j^2 r^2 right\n mathrme^-alpha_j r^2\n r^2 sintheta mathrmdr mathrmdtheta mathrmdvarphi \n = -frachbar^22mu iint\n sintheta mathrmdtheta mathrmdvarphi\n int\n left -6alpha_j + 4alpha_j^2 r^2 right\n r^2 mathrme^-(alpha_i + alpha_j) r^2\n mathrmdr \n = -frachbar^22mu cdot 4pi\n left\n -6alpha_j mathrmGGI(2 alpha_i + alpha_j)\n +4alpha_j^2 mathrmGGI(4 alpha_i + alpha_j)\n right\n \n = -frachbar^22mu cdot 4pi\n left\n -6alpha_j fracGammaleft( frac32 right)2 (alpha_i + alpha_j)^frac32\n +4alpha_j^2 fracGammaleft( frac52 right)2 (alpha_i + alpha_j)^frac52\n right \n = -frachbar^22mu cdot 4pi\n left\n -6alpha_j frac sqrtpi22 (alpha_i + alpha_j)^frac32\n +4alpha_j^2 frac3sqrtpi42 (alpha_i + alpha_j)^frac52\n right \n = -frachbar^22mu cdot 4pi\n left\n fracalpha_jalpha_i + alpha_j - 1\n right\n cdot 6 alpha_j cdot fracsqrtpi22 (alpha_i + alpha_j)^frac32\n \n = -frachbar^22mu cdot 4pi\n left\n - fracalpha_ialpha_i + alpha_j\n right\n cdot 6 alpha_j cdot fracsqrtpi22 (alpha_i + alpha_j)^frac32\n \n = underline\n -frachbar^22mu\n cdot 6\n cdot fracalpha_i alpha_j pi^frac32(alpha_i + alpha_j)^frac52\n \nendaligned\n\nor\n\nbeginaligned\n T_ij = langle phi_i hatT phi_j rangle\n = iiint\n mathrme^-alpha_i r^2\n left -frachbar^22mu nabla^2 right\n mathrme^-alpha_j r^2\n r^2 sintheta mathrmdr mathrmdtheta mathrmdvarphi \n = -frachbar^22mu iiint\n mathrme^-alpha_i r^2\n nabla^2\n mathrme^-alpha_j r^2\n r^2 sintheta mathrmdr mathrmdtheta mathrmdvarphi \n = frachbar^22mu iiint\n left nabla mathrme^-alpha_i r^2 right\n left nabla mathrme^-alpha_j r^2 right\n r^2 sintheta mathrmdr mathrmdtheta mathrmdvarphi \n = frachbar^22mu iiint\n left -2 alpha_i r mathrme^-alpha_i r^2 right\n left -2 alpha_j r mathrme^-alpha_j r^2 right\n r^2 sintheta mathrmdr mathrmdtheta mathrmdvarphi \n = frachbar^22mu cdot 4 alpha_i alpha_j iiint\n left r mathrme^-alpha_i r^2 right\n left r mathrme^-alpha_j r^2 right\n r^2 sintheta mathrmdr mathrmdtheta mathrmdvarphi \n = frachbar^22mu\n cdot 4 alpha_i alpha_j\n iint sintheta mathrmdtheta mathrmdvarphi\n int r^4\n mathrme^- (alpha_i + alpha_j) r^2\n mathrmdr \n = frachbar^22mu\n cdot 4 alpha_i alpha_j\n cdot 4 pi\n cdot mathrmGGI(4 alpha_i + alpha_j) \n = frachbar^22mu\n cdot 4 alpha_i alpha_j\n cdot 4 pi\n cdot fracGammaleft( frac52 right)2 (alpha_i + alpha_j)^frac52 \n = frachbar^22mu\n cdot 4 alpha_i alpha_j\n cdot 4 pi\n cdot frac3sqrtpi42 (alpha_i + alpha_j)^frac52 \n = underline\n frachbar^22mu\n cdot 6\n cdot fracalpha_i alpha_j pi^frac32(alpha_i + alpha_j)^frac52\n \nendaligned\n\n\n\n\n\nelement(o::LinearPotential, SGB1::SimpleGaussianBasis, SGB2::SimpleGaussianBasis)\n\nbeginaligned\n langle phi_i r phi_j rangle\n = iiint\n phi_i^*(r)\n times r times\n phi_j(r)\n r^2 sintheta mathrmdr mathrmdtheta mathrmdvarphi \n = int_0^2pi mathrmdvarphi\n int_0^pi sintheta mathrmdtheta\n int_0^infty r^3 mathrme^-(alpha_i + alpha_j) r^2 mathrmdr \n = 2pi times 2 times frac12 (alpha_i + alpha_j)^2 \n = underlinefrac2pi(alpha_i + alpha_j)^2\nendaligned\n\nIntegral Formula:\n\nbeginaligned\n int_0^infty r^2n+1 exp left(-a r^2right) mathrmdr = fracn2 a^n+1\nendaligned\n\n\n\n\n\nelement(o::CoulombPotential, SGB1::SimpleGaussianBasis, SGB2::SimpleGaussianBasis)\n\nbeginaligned\n langle phi_i frac1r phi_j rangle\n = iiint\n phi_i^*(r)\n times frac1r times\n phi_j(r)\n r^2 sintheta mathrmdr mathrmdtheta mathrmdvarphi \n = int_0^2pi mathrmdvarphi\n int_0^pi sintheta mathrmdtheta\n int_0^infty r mathrme^-(alpha_i + alpha_j) r^2 mathrmdr \n = 2pi times 2 times frac02 (alpha_i + alpha_j) \n = underlinefrac2pialpha_i + alpha_j\nendaligned\n\nIntegral Formula:\n\nbeginaligned\n int_0^infty r^2n+1 exp left(-a r^2right) mathrmdr = fracn2 a^n+1\nendaligned\n\n\n\n\n\nelement(o::PowerLawPotential, SGB1::SimpleGaussianBasis, SGB2::SimpleGaussianBasis)\n\nbeginaligned\n langle phi_i r^n phi_j rangle\n = iiint\n phi_i^*(r)\n times r^n times\n phi_j(r)\n r^2 sintheta mathrmdr mathrmdtheta mathrmdvarphi \n = int_0^2pi mathrmdvarphi\n int_0^pi sintheta mathrmdtheta\n int_0^infty r^n+2 mathrme^-(alpha_i + alpha_j) r^2 mathrmdr \n = 2pi times 2 times fracGammaleft( fracn+32 right)2 (alpha_i + alpha_j)^fracn+32 \n = underline2pifracGammaleft( fracn+32 right)(alpha_i + alpha_j)^fracn+32\nendaligned\n\nIntegral Formula:\n\nint_0^infty r^n exp left(-a r^2right) mathrmdr = fracGammaleft( fracn+12 right)2 a^fracn+12\n\n\n\n\n\nelement(o::Hamiltonian, SGB1::SimpleGaussianBasis, SGB2::SimpleGaussianBasis)\n\nbeginaligned\n H_ij\n = langle phi_i hatH phi_j rangle \n = langle phi_i hatT + hatV phi_j rangle \n = langle phi_i hatT phi_j rangle + langle phi_i hatV phi_j rangle \n = T_ij + V_ij\nendaligned\n\n\n\n\n\n","category":"function"},{"location":"Hamiltonian/","page":"Hamiltonian","title":"Hamiltonian","text":"CurrentModule = TwoBody","category":"page"},{"location":"Hamiltonian/#Hamiltonian","page":"Hamiltonian","title":"Hamiltonian","text":"","category":"section"},{"location":"Hamiltonian/","page":"Hamiltonian","title":"Hamiltonian","text":"TwoBody.Hamiltonian","category":"page"},{"location":"Hamiltonian/#TwoBody.Hamiltonian-Hamiltonian","page":"Hamiltonian","title":"TwoBody.Hamiltonian","text":"Hamiltonian(operator1, operator2, ...)\n\nhatH = sum_i hato_i\n\nThe Hamiltonian is the input for each solver. This is an example for the non-relativistic Hamiltonian of hydrogen atom in atomic units:\n\nhatH = \n- frac12 nabla^2\n- frac1r\n\nhamiltonian = Hamiltonian(\n NonRelativisticKinetic(ℏ =1 , m = 1),\n CoulombPotential(coefficient = -1),\n)\n\n\n\n\n\n","category":"type"},{"location":"Hamiltonian/#Operators","page":"Hamiltonian","title":"Operators","text":"","category":"section"},{"location":"Hamiltonian/","page":"Hamiltonian","title":"Hamiltonian","text":"TwoBody.NonRelativisticKinetic\nTwoBody.RestEnergy\nTwoBody.RelativisticCorrection\nTwoBody.RelativisticKinetic\nTwoBody.ConstantPotential \nTwoBody.LinearPotential \nTwoBody.CoulombPotential \nTwoBody.PowerLawPotential \nTwoBody.GaussianPotential \nTwoBody.ExponentialPotential\nTwoBody.YukawaPotential \nTwoBody.DeltaPotential \nTwoBody.FunctionPotential \nTwoBody.UniformGridPotential","category":"page"},{"location":"Hamiltonian/#TwoBody.NonRelativisticKinetic-Hamiltonian","page":"Hamiltonian","title":"TwoBody.NonRelativisticKinetic","text":"NonRelativisticKinetic(ℏ=1, m=1)\n\n-frachbar^22m nabla^2\n\n\n\n\n\n","category":"type"},{"location":"Hamiltonian/#TwoBody.RestEnergy-Hamiltonian","page":"Hamiltonian","title":"TwoBody.RestEnergy","text":"RestEnergy(c=1, m=1)\n\nm c^2\n\nUse c = 137.035999177 (from 2022 CODATA) in the atomic units.\n\n\n\n\n\n","category":"type"},{"location":"Hamiltonian/#TwoBody.RelativisticCorrection-Hamiltonian","page":"Hamiltonian","title":"TwoBody.RelativisticCorrection","text":"RelativisticCorrection(c=1, m=1, n=2) The p^{2n} term of the Taylor expansion:\n\nbeginaligned\n sqrtp^2 c^2 + m^2 c^4\n = m times c^2 \n + 1 2 m times p^2 (n=1) \n - 1 8 m^3 c^2 times p^4 (n=2) \n + 1 16 m^5 c^4 times p^6 (n=3) \n - 5 128 m^7 c^6 times p^8 (n=4) \n + cdots\nendaligned\n\nUse c = 137.035999177 (from 2022 CODATA) in the atomic units.\n\n\n\n\n\n","category":"type"},{"location":"Hamiltonian/#TwoBody.RelativisticKinetic-Hamiltonian","page":"Hamiltonian","title":"TwoBody.RelativisticKinetic","text":"RelativisticKinetic(c=1, m=1)\n\nsqrtp^2 c^2 + m^2 c^4 - m c^2\n\nUse c = 137.035999177 (from 2022 CODATA) in the atomic units.\n\n\n\n\n\n","category":"type"},{"location":"Hamiltonian/#TwoBody.ConstantPotential-Hamiltonian","page":"Hamiltonian","title":"TwoBody.ConstantPotential","text":"ConstantPotential(constant=1)\n\n+ mathrmconst\n\n\n\n\n\n","category":"type"},{"location":"Hamiltonian/#TwoBody.LinearPotential-Hamiltonian","page":"Hamiltonian","title":"TwoBody.LinearPotential","text":"LinearPotential(coefficient=1)\n\n+ mathrmcoeff times r \n\n\n\n\n\n","category":"type"},{"location":"Hamiltonian/#TwoBody.CoulombPotential-Hamiltonian","page":"Hamiltonian","title":"TwoBody.CoulombPotential","text":"CoulombPotential(coefficient=1)\n\n+ mathrmcoeff times frac1r\n\n\n\n\n\n","category":"type"},{"location":"Hamiltonian/#TwoBody.PowerLawPotential-Hamiltonian","page":"Hamiltonian","title":"TwoBody.PowerLawPotential","text":"PowerLawPotential(coefficient=1, exponent=1)\n\n+ mathrmcoeff times r^mathrmexpon\n\n\n\n\n\n","category":"type"},{"location":"Hamiltonian/#TwoBody.GaussianPotential-Hamiltonian","page":"Hamiltonian","title":"TwoBody.GaussianPotential","text":"GaussianPotential(coefficient=1, exponent=1)\n\n+ mathrmcoeff times exp(- mathrmexpon times r^2)\n\n\n\n\n\n","category":"type"},{"location":"Hamiltonian/#TwoBody.ExponentialPotential-Hamiltonian","page":"Hamiltonian","title":"TwoBody.ExponentialPotential","text":"ExponentialPotential(coefficient=1, exponent=1)\n\n+ mathrmcoeff times exp(- mathrmexpon times r)\n\n\n\n\n\n","category":"type"},{"location":"Hamiltonian/#TwoBody.YukawaPotential-Hamiltonian","page":"Hamiltonian","title":"TwoBody.YukawaPotential","text":"YukawaPotential(coefficient=1, exponent=1)\n\n+ mathrmcoeff times exp(- mathrmexpon times r) r\n\n\n\n\n\n","category":"type"},{"location":"Hamiltonian/#TwoBody.DeltaPotential-Hamiltonian","page":"Hamiltonian","title":"TwoBody.DeltaPotential","text":"DeltaPotential(coefficient=1)\n\n+ mathrmcoeff times δ(r)\n\n\n\n\n\n","category":"type"},{"location":"Hamiltonian/#TwoBody.FunctionPotential-Hamiltonian","page":"Hamiltonian","title":"TwoBody.FunctionPotential","text":"FunctionPotential(f)\n\n+ f(r)\n\n\n\n\n\n","category":"type"},{"location":"Hamiltonian/#TwoBody.UniformGridPotential-Hamiltonian","page":"Hamiltonian","title":"TwoBody.UniformGridPotential","text":"UniformGridPotential(R, V)\n\n\n\n\n\n","category":"type"},{"location":"","page":"Home","title":"Home","text":"CurrentModule = TwoBody","category":"page"},{"location":"#TwoBody.jl","page":"Home","title":"TwoBody.jl","text":"","category":"section"},{"location":"","page":"Home","title":"Home","text":"(Image: Stable) (Image: Dev) (Image: Build Status)","category":"page"},{"location":"","page":"Home","title":"Home","text":"TwoBody.jl: a Julia package for two-body problems","category":"page"},{"location":"#Install","page":"Home","title":"Install","text":"","category":"section"},{"location":"","page":"Home","title":"Home","text":"Run the following code on the REPL or Jupyter Notebook to install this package.","category":"page"},{"location":"","page":"Home","title":"Home","text":"import Pkg; Pkg.add(url=\"https://github.com/ohno/TwoBody.jl.git\")","category":"page"},{"location":"#Usage","page":"Home","title":"Usage","text":"","category":"section"},{"location":"","page":"Home","title":"Home","text":"Run the following code before each use.","category":"page"},{"location":"","page":"Home","title":"Home","text":"using TwoBody","category":"page"},{"location":"","page":"Home","title":"Home","text":"Define the Hamiltoninan. This is an example for the non-relativistic Hamiltonian of hydrogen atom in atomic units:","category":"page"},{"location":"","page":"Home","title":"Home","text":"hatH = \n- frac12 nabla^2\n- frac1r","category":"page"},{"location":"","page":"Home","title":"Home","text":"hamiltonian = Hamiltonian(\n NonRelativisticKinetic(ℏ = 1 , m = 1),\n CoulombPotential(coefficient = -1),\n)","category":"page"},{"location":"","page":"Home","title":"Home","text":"The usage depends on the method. Define the basis set for the Rayleigh–Ritz method:","category":"page"},{"location":"","page":"Home","title":"Home","text":"beginaligned\n phi_1(r) = exp(-1300773 r^2) \n phi_2(r) = exp(-1962079 r^2) \n phi_3(r) = exp(-0444529 r^2) \n phi_4(r) = exp(-01219492 r^2)\nendaligned","category":"page"},{"location":"","page":"Home","title":"Home","text":"basisset = BasisSet(\n SimpleGaussianBasis(13.00773),\n SimpleGaussianBasis(1.962079),\n SimpleGaussianBasis(0.444529),\n SimpleGaussianBasis(0.1219492),\n)","category":"page"},{"location":"","page":"Home","title":"Home","text":"You should find","category":"page"},{"location":"","page":"Home","title":"Home","text":"E_n=1 = -0499278E_mathrmh","category":"page"},{"location":"","page":"Home","title":"Home","text":"which is amazingly good for only four basis functions according to Thijssen(2007). The exact ground-state energy is -05E_mathrmh.","category":"page"},{"location":"","page":"Home","title":"Home","text":"solve(hamiltonian, basisset)","category":"page"},{"location":"#API-reference","page":"Home","title":"API reference","text":"","category":"section"},{"location":"","page":"Home","title":"Home","text":"","category":"page"},{"location":"API/","page":"API reference","title":"API reference","text":"CurrentModule = TwoBody","category":"page"},{"location":"API/#API-reference","page":"API reference","title":"API reference","text":"","category":"section"},{"location":"API/","page":"API reference","title":"API reference","text":"","category":"page"},{"location":"API/","page":"API reference","title":"API reference","text":"Modules = [TwoBody]","category":"page"},{"location":"API/#TwoBody.Basis","page":"API reference","title":"TwoBody.Basis","text":"Basis is an abstract type.\n\n\n\n\n\n","category":"type"},{"location":"API/#TwoBody.BasisSet","page":"API reference","title":"TwoBody.BasisSet","text":"BasisSet(basis1, basis2, ...)\n\n phi_1 phi_2 phi_3 cdots \n\nThe basis set is the input for Rayleigh–Ritz method. You can define the basis set like this:\n\nbeginaligned\n phi_1(r) = exp(-1300773 r^2) \n phi_2(r) = exp(-1962079 r^2) \n phi_3(r) = exp(-0444529 r^2) \n phi_4(r) = exp(-01219492 r^2)\nendaligned\n\nbasisset = BasisSet(\n SimpleGaussianBasis(13.00773),\n SimpleGaussianBasis(1.962079),\n SimpleGaussianBasis(0.444529),\n SimpleGaussianBasis(0.1219492),\n)\n\n\n\n\n\n","category":"type"},{"location":"API/#TwoBody.ConstantPotential","page":"API reference","title":"TwoBody.ConstantPotential","text":"ConstantPotential(constant=1)\n\n+ mathrmconst\n\n\n\n\n\n","category":"type"},{"location":"API/#TwoBody.ContractedBasis","page":"API reference","title":"TwoBody.ContractedBasis","text":"ContractedBasis([c1, c2, ...], [basis1, basis2, ...])\n\nphi = sum_i c_i phi_i\n\n\n\n\n\n","category":"type"},{"location":"API/#TwoBody.CoulombPotential","page":"API reference","title":"TwoBody.CoulombPotential","text":"CoulombPotential(coefficient=1)\n\n+ mathrmcoeff times frac1r\n\n\n\n\n\n","category":"type"},{"location":"API/#TwoBody.DeltaPotential","page":"API reference","title":"TwoBody.DeltaPotential","text":"DeltaPotential(coefficient=1)\n\n+ mathrmcoeff times δ(r)\n\n\n\n\n\n","category":"type"},{"location":"API/#TwoBody.ExponentialPotential","page":"API reference","title":"TwoBody.ExponentialPotential","text":"ExponentialPotential(coefficient=1, exponent=1)\n\n+ mathrmcoeff times exp(- mathrmexpon times r)\n\n\n\n\n\n","category":"type"},{"location":"API/#TwoBody.FunctionPotential","page":"API reference","title":"TwoBody.FunctionPotential","text":"FunctionPotential(f)\n\n+ f(r)\n\n\n\n\n\n","category":"type"},{"location":"API/#TwoBody.GaussianBasis","page":"API reference","title":"TwoBody.GaussianBasis","text":"GaussianBasis(a=1, l=0, m=0)\n\nphi_i(r θ φ) = N _il r^l exp(-a_i r^2) Y_l^m(θ φ)\n\n\n\n\n\n","category":"type"},{"location":"API/#TwoBody.GaussianPotential","page":"API reference","title":"TwoBody.GaussianPotential","text":"GaussianPotential(coefficient=1, exponent=1)\n\n+ mathrmcoeff times exp(- mathrmexpon times r^2)\n\n\n\n\n\n","category":"type"},{"location":"API/#TwoBody.Hamiltonian","page":"API reference","title":"TwoBody.Hamiltonian","text":"Hamiltonian(operator1, operator2, ...)\n\nhatH = sum_i hato_i\n\nThe Hamiltonian is the input for each solver. This is an example for the non-relativistic Hamiltonian of hydrogen atom in atomic units:\n\nhatH = \n- frac12 nabla^2\n- frac1r\n\nhamiltonian = Hamiltonian(\n NonRelativisticKinetic(ℏ =1 , m = 1),\n CoulombPotential(coefficient = -1),\n)\n\n\n\n\n\n","category":"type"},{"location":"API/#TwoBody.LinearPotential","page":"API reference","title":"TwoBody.LinearPotential","text":"LinearPotential(coefficient=1)\n\n+ mathrmcoeff times r \n\n\n\n\n\n","category":"type"},{"location":"API/#TwoBody.NonRelativisticKinetic","page":"API reference","title":"TwoBody.NonRelativisticKinetic","text":"NonRelativisticKinetic(ℏ=1, m=1)\n\n-frachbar^22m nabla^2\n\n\n\n\n\n","category":"type"},{"location":"API/#TwoBody.Operator","page":"API reference","title":"TwoBody.Operator","text":"Operator is an abstract type.\n\n\n\n\n\n","category":"type"},{"location":"API/#TwoBody.PowerLawPotential","page":"API reference","title":"TwoBody.PowerLawPotential","text":"PowerLawPotential(coefficient=1, exponent=1)\n\n+ mathrmcoeff times r^mathrmexpon\n\n\n\n\n\n","category":"type"},{"location":"API/#TwoBody.RelativisticCorrection","page":"API reference","title":"TwoBody.RelativisticCorrection","text":"RelativisticCorrection(c=1, m=1, n=2) The p^{2n} term of the Taylor expansion:\n\nbeginaligned\n sqrtp^2 c^2 + m^2 c^4\n = m times c^2 \n + 1 2 m times p^2 (n=1) \n - 1 8 m^3 c^2 times p^4 (n=2) \n + 1 16 m^5 c^4 times p^6 (n=3) \n - 5 128 m^7 c^6 times p^8 (n=4) \n + cdots\nendaligned\n\nUse c = 137.035999177 (from 2022 CODATA) in the atomic units.\n\n\n\n\n\n","category":"type"},{"location":"API/#TwoBody.RelativisticKinetic","page":"API reference","title":"TwoBody.RelativisticKinetic","text":"RelativisticKinetic(c=1, m=1)\n\nsqrtp^2 c^2 + m^2 c^4 - m c^2\n\nUse c = 137.035999177 (from 2022 CODATA) in the atomic units.\n\n\n\n\n\n","category":"type"},{"location":"API/#TwoBody.RestEnergy","page":"API reference","title":"TwoBody.RestEnergy","text":"RestEnergy(c=1, m=1)\n\nm c^2\n\nUse c = 137.035999177 (from 2022 CODATA) in the atomic units.\n\n\n\n\n\n","category":"type"},{"location":"API/#TwoBody.SimpleGaussianBasis","page":"API reference","title":"TwoBody.SimpleGaussianBasis","text":"SimpleGaussianBasis(a=1)\n\nphi_i(r) = exp(-a_i r^2)\n\nNote: This basis is not normalized. This is only for s-wave.\n\n\n\n\n\n","category":"type"},{"location":"API/#TwoBody.UniformGridPotential","page":"API reference","title":"TwoBody.UniformGridPotential","text":"UniformGridPotential(R, V)\n\n\n\n\n\n","category":"type"},{"location":"API/#TwoBody.YukawaPotential","page":"API reference","title":"TwoBody.YukawaPotential","text":"YukawaPotential(coefficient=1, exponent=1)\n\n+ mathrmcoeff times exp(- mathrmexpon times r) r\n\n\n\n\n\n","category":"type"},{"location":"API/#TwoBody.element-Tuple{CoulombPotential, SimpleGaussianBasis, SimpleGaussianBasis}","page":"API reference","title":"TwoBody.element","text":"element(o::CoulombPotential, SGB1::SimpleGaussianBasis, SGB2::SimpleGaussianBasis)\n\nbeginaligned\n langle phi_i frac1r phi_j rangle\n = iiint\n phi_i^*(r)\n times frac1r times\n phi_j(r)\n r^2 sintheta mathrmdr mathrmdtheta mathrmdvarphi \n = int_0^2pi mathrmdvarphi\n int_0^pi sintheta mathrmdtheta\n int_0^infty r mathrme^-(alpha_i + alpha_j) r^2 mathrmdr \n = 2pi times 2 times frac02 (alpha_i + alpha_j) \n = underlinefrac2pialpha_i + alpha_j\nendaligned\n\nIntegral Formula:\n\nbeginaligned\n int_0^infty r^2n+1 exp left(-a r^2right) mathrmdr = fracn2 a^n+1\nendaligned\n\n\n\n\n\n","category":"method"},{"location":"API/#TwoBody.element-Tuple{Hamiltonian, SimpleGaussianBasis, SimpleGaussianBasis}","page":"API reference","title":"TwoBody.element","text":"element(o::Hamiltonian, SGB1::SimpleGaussianBasis, SGB2::SimpleGaussianBasis)\n\nbeginaligned\n H_ij\n = langle phi_i hatH phi_j rangle \n = langle phi_i hatT + hatV phi_j rangle \n = langle phi_i hatT phi_j rangle + langle phi_i hatV phi_j rangle \n = T_ij + V_ij\nendaligned\n\n\n\n\n\n","category":"method"},{"location":"API/#TwoBody.element-Tuple{LinearPotential, SimpleGaussianBasis, SimpleGaussianBasis}","page":"API reference","title":"TwoBody.element","text":"element(o::LinearPotential, SGB1::SimpleGaussianBasis, SGB2::SimpleGaussianBasis)\n\nbeginaligned\n langle phi_i r phi_j rangle\n = iiint\n phi_i^*(r)\n times r times\n phi_j(r)\n r^2 sintheta mathrmdr mathrmdtheta mathrmdvarphi \n = int_0^2pi mathrmdvarphi\n int_0^pi sintheta mathrmdtheta\n int_0^infty r^3 mathrme^-(alpha_i + alpha_j) r^2 mathrmdr \n = 2pi times 2 times frac12 (alpha_i + alpha_j)^2 \n = underlinefrac2pi(alpha_i + alpha_j)^2\nendaligned\n\nIntegral Formula:\n\nbeginaligned\n int_0^infty r^2n+1 exp left(-a r^2right) mathrmdr = fracn2 a^n+1\nendaligned\n\n\n\n\n\n","category":"method"},{"location":"API/#TwoBody.element-Tuple{NonRelativisticKinetic, SimpleGaussianBasis, SimpleGaussianBasis}","page":"API reference","title":"TwoBody.element","text":"element(o::NonRelativisticKinetic, SGB1::SimpleGaussianBasis, SGB2::SimpleGaussianBasis)\n\nbeginaligned\n T_ij = langle phi_i hatT phi_j rangle\n = iiint\n mathrme^-alpha_i r^2\n left -frachbar^22mu nabla^2 right\n mathrme^-alpha_j r^2\n r^2 sintheta mathrmdr mathrmdtheta mathrmdvarphi \n = -frachbar^22mu iiint\n mathrme^-alpha_i r^2\n left nabla^2 right\n mathrme^-alpha_j r^2\n r^2 sintheta mathrmdr mathrmdtheta mathrmdvarphi \n = -frachbar^22mu iiint\n mathrme^-alpha_i r^2\n left -6alpha_j + 4alpha_j^2 r^2 right\n mathrme^-alpha_j r^2\n r^2 sintheta mathrmdr mathrmdtheta mathrmdvarphi \n = -frachbar^22mu iint\n sintheta mathrmdtheta mathrmdvarphi\n int\n left -6alpha_j + 4alpha_j^2 r^2 right\n r^2 mathrme^-(alpha_i + alpha_j) r^2\n mathrmdr \n = -frachbar^22mu cdot 4pi\n left\n -6alpha_j mathrmGGI(2 alpha_i + alpha_j)\n +4alpha_j^2 mathrmGGI(4 alpha_i + alpha_j)\n right\n \n = -frachbar^22mu cdot 4pi\n left\n -6alpha_j fracGammaleft( frac32 right)2 (alpha_i + alpha_j)^frac32\n +4alpha_j^2 fracGammaleft( frac52 right)2 (alpha_i + alpha_j)^frac52\n right \n = -frachbar^22mu cdot 4pi\n left\n -6alpha_j frac sqrtpi22 (alpha_i + alpha_j)^frac32\n +4alpha_j^2 frac3sqrtpi42 (alpha_i + alpha_j)^frac52\n right \n = -frachbar^22mu cdot 4pi\n left\n fracalpha_jalpha_i + alpha_j - 1\n right\n cdot 6 alpha_j cdot fracsqrtpi22 (alpha_i + alpha_j)^frac32\n \n = -frachbar^22mu cdot 4pi\n left\n - fracalpha_ialpha_i + alpha_j\n right\n cdot 6 alpha_j cdot fracsqrtpi22 (alpha_i + alpha_j)^frac32\n \n = underline\n -frachbar^22mu\n cdot 6\n cdot fracalpha_i alpha_j pi^frac32(alpha_i + alpha_j)^frac52\n \nendaligned\n\nor\n\nbeginaligned\n T_ij = langle phi_i hatT phi_j rangle\n = iiint\n mathrme^-alpha_i r^2\n left -frachbar^22mu nabla^2 right\n mathrme^-alpha_j r^2\n r^2 sintheta mathrmdr mathrmdtheta mathrmdvarphi \n = -frachbar^22mu iiint\n mathrme^-alpha_i r^2\n nabla^2\n mathrme^-alpha_j r^2\n r^2 sintheta mathrmdr mathrmdtheta mathrmdvarphi \n = frachbar^22mu iiint\n left nabla mathrme^-alpha_i r^2 right\n left nabla mathrme^-alpha_j r^2 right\n r^2 sintheta mathrmdr mathrmdtheta mathrmdvarphi \n = frachbar^22mu iiint\n left -2 alpha_i r mathrme^-alpha_i r^2 right\n left -2 alpha_j r mathrme^-alpha_j r^2 right\n r^2 sintheta mathrmdr mathrmdtheta mathrmdvarphi \n = frachbar^22mu cdot 4 alpha_i alpha_j iiint\n left r mathrme^-alpha_i r^2 right\n left r mathrme^-alpha_j r^2 right\n r^2 sintheta mathrmdr mathrmdtheta mathrmdvarphi \n = frachbar^22mu\n cdot 4 alpha_i alpha_j\n iint sintheta mathrmdtheta mathrmdvarphi\n int r^4\n mathrme^- (alpha_i + alpha_j) r^2\n mathrmdr \n = frachbar^22mu\n cdot 4 alpha_i alpha_j\n cdot 4 pi\n cdot mathrmGGI(4 alpha_i + alpha_j) \n = frachbar^22mu\n cdot 4 alpha_i alpha_j\n cdot 4 pi\n cdot fracGammaleft( frac52 right)2 (alpha_i + alpha_j)^frac52 \n = frachbar^22mu\n cdot 4 alpha_i alpha_j\n cdot 4 pi\n cdot frac3sqrtpi42 (alpha_i + alpha_j)^frac52 \n = underline\n frachbar^22mu\n cdot 6\n cdot fracalpha_i alpha_j pi^frac32(alpha_i + alpha_j)^frac52\n \nendaligned\n\n\n\n\n\n","category":"method"},{"location":"API/#TwoBody.element-Tuple{PowerLawPotential, SimpleGaussianBasis, SimpleGaussianBasis}","page":"API reference","title":"TwoBody.element","text":"element(o::PowerLawPotential, SGB1::SimpleGaussianBasis, SGB2::SimpleGaussianBasis)\n\nbeginaligned\n langle phi_i r^n phi_j rangle\n = iiint\n phi_i^*(r)\n times r^n times\n phi_j(r)\n r^2 sintheta mathrmdr mathrmdtheta mathrmdvarphi \n = int_0^2pi mathrmdvarphi\n int_0^pi sintheta mathrmdtheta\n int_0^infty r^n+2 mathrme^-(alpha_i + alpha_j) r^2 mathrmdr \n = 2pi times 2 times fracGammaleft( fracn+32 right)2 (alpha_i + alpha_j)^fracn+32 \n = underline2pifracGammaleft( fracn+32 right)(alpha_i + alpha_j)^fracn+32\nendaligned\n\nIntegral Formula:\n\nint_0^infty r^n exp left(-a r^2right) mathrmdr = fracGammaleft( fracn+12 right)2 a^fracn+12\n\n\n\n\n\n","category":"method"},{"location":"API/#TwoBody.element-Tuple{SimpleGaussianBasis, SimpleGaussianBasis}","page":"API reference","title":"TwoBody.element","text":"element(SGB1::SimpleGaussianBasis, SGB2::SimpleGaussianBasis)\n\nbeginaligned\n S_ij\n = langle phi_i phi_j rangle\n = iiint\n phi_i^*(r)\n phi_j(r)\n r^2 sintheta mathrmdr mathrmdtheta mathrmdvarphi \n = int_0^2pi mathrmdvarphi\n int_0^pi sintheta mathrmdtheta\n int_0^infty r^2 mathrme^-(alpha_i + alpha_j) r^2 mathrmdr \n = 2pi times 2 times frac12^2 sqrtfracpia^3 \n = underlineleft( fracpialpha_i + alpha_j right)^32\nendaligned\n\nIntegral Formula:\n\nint_0^infty r^2n exp left(-a r^2right) mathrmdr = frac(2n-1)2^n+1 sqrtfracpia^2n+1\n\n\n\n\n\n","category":"method"},{"location":"API/#TwoBody.solve-Tuple{Hamiltonian, BasisSet}","page":"API reference","title":"TwoBody.solve","text":"solve(hamiltonian::Hamiltonian, basisset::BasisSet)\n\nThis function returns the eigenvalues E and eigenvectors pmbc for\n\npmbH pmbc = E pmbS pmbc\n\nThe Hamiltonian matrix is defined as H_ij = langle phi_i hatH phi_j rangle. The overlap matrix is defined as S_ij = langle phi_i phi_j rangle.\n\n\n\n\n\n","category":"method"}] +[{"location":"Rayleigh–Ritz/","page":"Rayleigh–Ritz method","title":"Rayleigh–Ritz method","text":"CurrentModule = TwoBody","category":"page"},{"location":"Rayleigh–Ritz/#Rayleigh–Ritz-method","page":"Rayleigh–Ritz method","title":"Rayleigh–Ritz method","text":"","category":"section"},{"location":"Rayleigh–Ritz/","page":"Rayleigh–Ritz method","title":"Rayleigh–Ritz method","text":"The solver finds the best c_i for the trial wavefunction","category":"page"},{"location":"Rayleigh–Ritz/","page":"Rayleigh–Ritz method","title":"Rayleigh–Ritz method","text":"varPsi(r) = sum_i c_i phi_i(r)","category":"page"},{"location":"Rayleigh–Ritz/","page":"Rayleigh–Ritz method","title":"Rayleigh–Ritz method","text":"to minmize the expectation value of the energy","category":"page"},{"location":"Rayleigh–Ritz/","page":"Rayleigh–Ritz method","title":"Rayleigh–Ritz method","text":"E = fraclanglepsihatHpsiranglelanglepsipsirangle","category":"page"},{"location":"Rayleigh–Ritz/","page":"Rayleigh–Ritz method","title":"Rayleigh–Ritz method","text":"Here, the energy by trial wavefunction is the upper bound for the exact energy.","category":"page"},{"location":"Rayleigh–Ritz/#Exaples","page":"Rayleigh–Ritz method","title":"Exaples","text":"","category":"section"},{"location":"Rayleigh–Ritz/","page":"Rayleigh–Ritz method","title":"Rayleigh–Ritz method","text":"using TwoBody","category":"page"},{"location":"Rayleigh–Ritz/","page":"Rayleigh–Ritz method","title":"Rayleigh–Ritz method","text":"Define the Hamiltoninan. This is an example for the non-relativistic Hamiltonian of hydrogen atom in atomic units:","category":"page"},{"location":"Rayleigh–Ritz/","page":"Rayleigh–Ritz method","title":"Rayleigh–Ritz method","text":"hatH = \n- frac12 nabla^2\n- frac1r","category":"page"},{"location":"Rayleigh–Ritz/","page":"Rayleigh–Ritz method","title":"Rayleigh–Ritz method","text":"hamiltonian = Hamiltonian(\n NonRelativisticKinetic(ℏ = 1 , m = 1),\n CoulombPotential(coefficient = -1),\n)\nnothing # hide","category":"page"},{"location":"Rayleigh–Ritz/","page":"Rayleigh–Ritz method","title":"Rayleigh–Ritz method","text":"Define the basis set:","category":"page"},{"location":"Rayleigh–Ritz/","page":"Rayleigh–Ritz method","title":"Rayleigh–Ritz method","text":"beginaligned\n phi_1(r) = exp(-1300773 r^2) \n phi_2(r) = exp(-1962079 r^2) \n phi_3(r) = exp(-0444529 r^2) \n phi_4(r) = exp(-01219492 r^2)\nendaligned","category":"page"},{"location":"Rayleigh–Ritz/","page":"Rayleigh–Ritz method","title":"Rayleigh–Ritz method","text":"basisset = BasisSet(\n SimpleGaussianBasis(13.00773),\n SimpleGaussianBasis(1.962079),\n SimpleGaussianBasis(0.444529),\n SimpleGaussianBasis(0.1219492),\n)\nnothing # hide","category":"page"},{"location":"Rayleigh–Ritz/","page":"Rayleigh–Ritz method","title":"Rayleigh–Ritz method","text":"You should find","category":"page"},{"location":"Rayleigh–Ritz/","page":"Rayleigh–Ritz method","title":"Rayleigh–Ritz method","text":"E_n=1 = -0499278E_mathrmh","category":"page"},{"location":"Rayleigh–Ritz/","page":"Rayleigh–Ritz method","title":"Rayleigh–Ritz method","text":"which is amazingly good for only four basis functions according to Thijssen(2007). The exact ground-state energy is -05E_mathrmh.","category":"page"},{"location":"Rayleigh–Ritz/","page":"Rayleigh–Ritz method","title":"Rayleigh–Ritz method","text":"solve(hamiltonian, basisset)","category":"page"},{"location":"Rayleigh–Ritz/#Solver","page":"Rayleigh–Ritz method","title":"Solver","text":"","category":"section"},{"location":"Rayleigh–Ritz/","page":"Rayleigh–Ritz method","title":"Rayleigh–Ritz method","text":"TwoBody.solve","category":"page"},{"location":"Rayleigh–Ritz/#TwoBody.solve-Rayleigh–Ritz","page":"Rayleigh–Ritz method","title":"TwoBody.solve","text":"solve(hamiltonian::Hamiltonian, basisset::BasisSet)\n\nThis function returns the eigenvalues E and eigenvectors pmbc for\n\npmbH pmbc = E pmbS pmbc\n\nThe Hamiltonian matrix is defined as H_ij = langle phi_i hatH phi_j rangle. The overlap matrix is defined as S_ij = langle phi_i phi_j rangle.\n\n\n\n\n\n","category":"function"},{"location":"Rayleigh–Ritz/#Basis-Set","page":"Rayleigh–Ritz method","title":"Basis Set","text":"","category":"section"},{"location":"Rayleigh–Ritz/","page":"Rayleigh–Ritz method","title":"Rayleigh–Ritz method","text":"TwoBody.BasisSet","category":"page"},{"location":"Rayleigh–Ritz/#TwoBody.BasisSet-Rayleigh–Ritz","page":"Rayleigh–Ritz method","title":"TwoBody.BasisSet","text":"BasisSet(basis1, basis2, ...)\n\n phi_1 phi_2 phi_3 cdots \n\nThe basis set is the input for Rayleigh–Ritz method. You can define the basis set like this:\n\nbeginaligned\n phi_1(r) = exp(-1300773 r^2) \n phi_2(r) = exp(-1962079 r^2) \n phi_3(r) = exp(-0444529 r^2) \n phi_4(r) = exp(-01219492 r^2)\nendaligned\n\nbasisset = BasisSet(\n SimpleGaussianBasis(13.00773),\n SimpleGaussianBasis(1.962079),\n SimpleGaussianBasis(0.444529),\n SimpleGaussianBasis(0.1219492),\n)\n\n\n\n\n\n","category":"type"},{"location":"Rayleigh–Ritz/#Basis-Functions","page":"Rayleigh–Ritz method","title":"Basis Functions","text":"","category":"section"},{"location":"Rayleigh–Ritz/","page":"Rayleigh–Ritz method","title":"Rayleigh–Ritz method","text":"TwoBody.SimpleGaussianBasis\nTwoBody.GaussianBasis\nTwoBody.ContractedBasis","category":"page"},{"location":"Rayleigh–Ritz/#TwoBody.SimpleGaussianBasis-Rayleigh–Ritz","page":"Rayleigh–Ritz method","title":"TwoBody.SimpleGaussianBasis","text":"SimpleGaussianBasis(a=1)\n\nphi_i(r) = exp(-a_i r^2)\n\nNote: This basis is not normalized. This is only for s-wave.\n\n\n\n\n\n","category":"type"},{"location":"Rayleigh–Ritz/#TwoBody.GaussianBasis-Rayleigh–Ritz","page":"Rayleigh–Ritz method","title":"TwoBody.GaussianBasis","text":"GaussianBasis(a=1, l=0, m=0)\n\nphi_i(r θ φ) = N _il r^l exp(-a_i r^2) Y_l^m(θ φ)\n\n\n\n\n\n","category":"type"},{"location":"Rayleigh–Ritz/#TwoBody.ContractedBasis-Rayleigh–Ritz","page":"Rayleigh–Ritz method","title":"TwoBody.ContractedBasis","text":"ContractedBasis([c1, c2, ...], [basis1, basis2, ...])\n\nphi = sum_i c_i phi_i\n\n\n\n\n\n","category":"type"},{"location":"Rayleigh–Ritz/#Matrix-Elements","page":"Rayleigh–Ritz method","title":"Matrix Elements","text":"","category":"section"},{"location":"Rayleigh–Ritz/","page":"Rayleigh–Ritz method","title":"Rayleigh–Ritz method","text":"TwoBody.element","category":"page"},{"location":"Rayleigh–Ritz/#TwoBody.element-Rayleigh–Ritz","page":"Rayleigh–Ritz method","title":"TwoBody.element","text":"element(SGB1::SimpleGaussianBasis, SGB2::SimpleGaussianBasis)\n\nbeginaligned\n S_ij\n = langle phi_i phi_j rangle\n = iiint\n phi_i^*(r)\n phi_j(r)\n r^2 sintheta mathrmdr mathrmdtheta mathrmdvarphi \n = int_0^2pi mathrmdvarphi\n int_0^pi sintheta mathrmdtheta\n int_0^infty r^2 mathrme^-(alpha_i + alpha_j) r^2 mathrmdr \n = 2pi times 2 times frac12^2 sqrtfracpia^3 \n = underlineleft( fracpialpha_i + alpha_j right)^32\nendaligned\n\nIntegral Formula:\n\nint_0^infty r^2n exp left(-a r^2right) mathrmdr = frac(2n-1)2^n+1 sqrtfracpia^2n+1\n\n\n\n\n\nelement(o::NonRelativisticKinetic, SGB1::SimpleGaussianBasis, SGB2::SimpleGaussianBasis)\n\nbeginaligned\n T_ij = langle phi_i hatT phi_j rangle\n = iiint\n mathrme^-alpha_i r^2\n left -frachbar^22mu nabla^2 right\n mathrme^-alpha_j r^2\n r^2 sintheta mathrmdr mathrmdtheta mathrmdvarphi \n = -frachbar^22mu iiint\n mathrme^-alpha_i r^2\n left nabla^2 right\n mathrme^-alpha_j r^2\n r^2 sintheta mathrmdr mathrmdtheta mathrmdvarphi \n = -frachbar^22mu iiint\n mathrme^-alpha_i r^2\n left -6alpha_j + 4alpha_j^2 r^2 right\n mathrme^-alpha_j r^2\n r^2 sintheta mathrmdr mathrmdtheta mathrmdvarphi \n = -frachbar^22mu iint\n sintheta mathrmdtheta mathrmdvarphi\n int\n left -6alpha_j + 4alpha_j^2 r^2 right\n r^2 mathrme^-(alpha_i + alpha_j) r^2\n mathrmdr \n = -frachbar^22mu cdot 4pi\n left\n -6alpha_j mathrmGGI(2 alpha_i + alpha_j)\n +4alpha_j^2 mathrmGGI(4 alpha_i + alpha_j)\n right\n \n = -frachbar^22mu cdot 4pi\n left\n -6alpha_j fracGammaleft( frac32 right)2 (alpha_i + alpha_j)^frac32\n +4alpha_j^2 fracGammaleft( frac52 right)2 (alpha_i + alpha_j)^frac52\n right \n = -frachbar^22mu cdot 4pi\n left\n -6alpha_j frac sqrtpi22 (alpha_i + alpha_j)^frac32\n +4alpha_j^2 frac3sqrtpi42 (alpha_i + alpha_j)^frac52\n right \n = -frachbar^22mu cdot 4pi\n left\n fracalpha_jalpha_i + alpha_j - 1\n right\n cdot 6 alpha_j cdot fracsqrtpi22 (alpha_i + alpha_j)^frac32\n \n = -frachbar^22mu cdot 4pi\n left\n - fracalpha_ialpha_i + alpha_j\n right\n cdot 6 alpha_j cdot fracsqrtpi22 (alpha_i + alpha_j)^frac32\n \n = underline\n -frachbar^22mu\n cdot 6\n cdot fracalpha_i alpha_j pi^frac32(alpha_i + alpha_j)^frac52\n \nendaligned\n\nor\n\nbeginaligned\n T_ij = langle phi_i hatT phi_j rangle\n = iiint\n mathrme^-alpha_i r^2\n left -frachbar^22mu nabla^2 right\n mathrme^-alpha_j r^2\n r^2 sintheta mathrmdr mathrmdtheta mathrmdvarphi \n = -frachbar^22mu iiint\n mathrme^-alpha_i r^2\n nabla^2\n mathrme^-alpha_j r^2\n r^2 sintheta mathrmdr mathrmdtheta mathrmdvarphi \n = frachbar^22mu iiint\n left nabla mathrme^-alpha_i r^2 right\n left nabla mathrme^-alpha_j r^2 right\n r^2 sintheta mathrmdr mathrmdtheta mathrmdvarphi \n = frachbar^22mu iiint\n left -2 alpha_i r mathrme^-alpha_i r^2 right\n left -2 alpha_j r mathrme^-alpha_j r^2 right\n r^2 sintheta mathrmdr mathrmdtheta mathrmdvarphi \n = frachbar^22mu cdot 4 alpha_i alpha_j iiint\n left r mathrme^-alpha_i r^2 right\n left r mathrme^-alpha_j r^2 right\n r^2 sintheta mathrmdr mathrmdtheta mathrmdvarphi \n = frachbar^22mu\n cdot 4 alpha_i alpha_j\n iint sintheta mathrmdtheta mathrmdvarphi\n int r^4\n mathrme^- (alpha_i + alpha_j) r^2\n mathrmdr \n = frachbar^22mu\n cdot 4 alpha_i alpha_j\n cdot 4 pi\n cdot mathrmGGI(4 alpha_i + alpha_j) \n = frachbar^22mu\n cdot 4 alpha_i alpha_j\n cdot 4 pi\n cdot fracGammaleft( frac52 right)2 (alpha_i + alpha_j)^frac52 \n = frachbar^22mu\n cdot 4 alpha_i alpha_j\n cdot 4 pi\n cdot frac3sqrtpi42 (alpha_i + alpha_j)^frac52 \n = underline\n frachbar^22mu\n cdot 6\n cdot fracalpha_i alpha_j pi^frac32(alpha_i + alpha_j)^frac52\n \nendaligned\n\n\n\n\n\nelement(o::LinearPotential, SGB1::SimpleGaussianBasis, SGB2::SimpleGaussianBasis)\n\nbeginaligned\n langle phi_i r phi_j rangle\n = iiint\n phi_i^*(r)\n times r times\n phi_j(r)\n r^2 sintheta mathrmdr mathrmdtheta mathrmdvarphi \n = int_0^2pi mathrmdvarphi\n int_0^pi sintheta mathrmdtheta\n int_0^infty r^3 mathrme^-(alpha_i + alpha_j) r^2 mathrmdr \n = 2pi times 2 times frac12 (alpha_i + alpha_j)^2 \n = underlinefrac2pi(alpha_i + alpha_j)^2\nendaligned\n\nIntegral Formula:\n\nbeginaligned\n int_0^infty r^2n+1 exp left(-a r^2right) mathrmdr = fracn2 a^n+1\nendaligned\n\n\n\n\n\nelement(o::CoulombPotential, SGB1::SimpleGaussianBasis, SGB2::SimpleGaussianBasis)\n\nbeginaligned\n langle phi_i frac1r phi_j rangle\n = iiint\n phi_i^*(r)\n times frac1r times\n phi_j(r)\n r^2 sintheta mathrmdr mathrmdtheta mathrmdvarphi \n = int_0^2pi mathrmdvarphi\n int_0^pi sintheta mathrmdtheta\n int_0^infty r mathrme^-(alpha_i + alpha_j) r^2 mathrmdr \n = 2pi times 2 times frac02 (alpha_i + alpha_j) \n = underlinefrac2pialpha_i + alpha_j\nendaligned\n\nIntegral Formula:\n\nbeginaligned\n int_0^infty r^2n+1 exp left(-a r^2right) mathrmdr = fracn2 a^n+1\nendaligned\n\n\n\n\n\nelement(o::PowerLawPotential, SGB1::SimpleGaussianBasis, SGB2::SimpleGaussianBasis)\n\nbeginaligned\n langle phi_i r^n phi_j rangle\n = iiint\n phi_i^*(r)\n times r^n times\n phi_j(r)\n r^2 sintheta mathrmdr mathrmdtheta mathrmdvarphi \n = int_0^2pi mathrmdvarphi\n int_0^pi sintheta mathrmdtheta\n int_0^infty r^n+2 mathrme^-(alpha_i + alpha_j) r^2 mathrmdr \n = 2pi times 2 times fracGammaleft( fracn+32 right)2 (alpha_i + alpha_j)^fracn+32 \n = underline2pifracGammaleft( fracn+32 right)(alpha_i + alpha_j)^fracn+32\nendaligned\n\nIntegral Formula:\n\nint_0^infty r^n exp left(-a r^2right) mathrmdr = fracGammaleft( fracn+12 right)2 a^fracn+12\n\n\n\n\n\nelement(o::Hamiltonian, SGB1::SimpleGaussianBasis, SGB2::SimpleGaussianBasis)\n\nbeginaligned\n H_ij\n = langle phi_i hatH phi_j rangle \n = langle phi_i hatT + hatV phi_j rangle \n = langle phi_i hatT phi_j rangle + langle phi_i hatV phi_j rangle \n = T_ij + V_ij\nendaligned\n\n\n\n\n\n","category":"function"},{"location":"Hamiltonian/","page":"Hamiltonian","title":"Hamiltonian","text":"CurrentModule = TwoBody","category":"page"},{"location":"Hamiltonian/#Hamiltonian","page":"Hamiltonian","title":"Hamiltonian","text":"","category":"section"},{"location":"Hamiltonian/","page":"Hamiltonian","title":"Hamiltonian","text":"TwoBody.Hamiltonian","category":"page"},{"location":"Hamiltonian/#TwoBody.Hamiltonian-Hamiltonian","page":"Hamiltonian","title":"TwoBody.Hamiltonian","text":"Hamiltonian(operator1, operator2, ...)\n\nhatH = sum_i hato_i\n\nThe Hamiltonian is the input for each solver. This is an example for the non-relativistic Hamiltonian of hydrogen atom in atomic units:\n\nhatH = \n- frac12 nabla^2\n- frac1r\n\nhamiltonian = Hamiltonian(\n NonRelativisticKinetic(ℏ =1 , m = 1),\n CoulombPotential(coefficient = -1),\n)\n\n\n\n\n\n","category":"type"},{"location":"Hamiltonian/#Operators","page":"Hamiltonian","title":"Operators","text":"","category":"section"},{"location":"Hamiltonian/","page":"Hamiltonian","title":"Hamiltonian","text":"TwoBody.NonRelativisticKinetic\nTwoBody.RestEnergy\nTwoBody.RelativisticCorrection\nTwoBody.RelativisticKinetic\nTwoBody.ConstantPotential \nTwoBody.LinearPotential \nTwoBody.CoulombPotential \nTwoBody.PowerLawPotential \nTwoBody.GaussianPotential \nTwoBody.ExponentialPotential\nTwoBody.YukawaPotential \nTwoBody.DeltaPotential \nTwoBody.FunctionPotential \nTwoBody.UniformGridPotential","category":"page"},{"location":"Hamiltonian/#TwoBody.NonRelativisticKinetic-Hamiltonian","page":"Hamiltonian","title":"TwoBody.NonRelativisticKinetic","text":"NonRelativisticKinetic(ℏ=1, m=1)\n\n-frachbar^22m nabla^2\n\n\n\n\n\n","category":"type"},{"location":"Hamiltonian/#TwoBody.RestEnergy-Hamiltonian","page":"Hamiltonian","title":"TwoBody.RestEnergy","text":"RestEnergy(c=1, m=1)\n\nm c^2\n\nUse c = 137.035999177 (from 2022 CODATA) in the atomic units.\n\n\n\n\n\n","category":"type"},{"location":"Hamiltonian/#TwoBody.RelativisticCorrection-Hamiltonian","page":"Hamiltonian","title":"TwoBody.RelativisticCorrection","text":"RelativisticCorrection(c=1, m=1, n=2) The p^{2n} term of the Taylor expansion:\n\nbeginaligned\n sqrtp^2 c^2 + m^2 c^4\n = m times c^2 \n + 1 2 m times p^2 (n=1) \n - 1 8 m^3 c^2 times p^4 (n=2) \n + 1 16 m^5 c^4 times p^6 (n=3) \n - 5 128 m^7 c^6 times p^8 (n=4) \n + cdots\nendaligned\n\nUse c = 137.035999177 (from 2022 CODATA) in the atomic units.\n\n\n\n\n\n","category":"type"},{"location":"Hamiltonian/#TwoBody.RelativisticKinetic-Hamiltonian","page":"Hamiltonian","title":"TwoBody.RelativisticKinetic","text":"RelativisticKinetic(c=1, m=1)\n\nsqrtp^2 c^2 + m^2 c^4 - m c^2\n\nUse c = 137.035999177 (from 2022 CODATA) in the atomic units.\n\n\n\n\n\n","category":"type"},{"location":"Hamiltonian/#TwoBody.ConstantPotential-Hamiltonian","page":"Hamiltonian","title":"TwoBody.ConstantPotential","text":"ConstantPotential(constant=1)\n\n+ mathrmconst\n\n\n\n\n\n","category":"type"},{"location":"Hamiltonian/#TwoBody.LinearPotential-Hamiltonian","page":"Hamiltonian","title":"TwoBody.LinearPotential","text":"LinearPotential(coefficient=1)\n\n+ mathrmcoeff times r \n\n\n\n\n\n","category":"type"},{"location":"Hamiltonian/#TwoBody.CoulombPotential-Hamiltonian","page":"Hamiltonian","title":"TwoBody.CoulombPotential","text":"CoulombPotential(coefficient=1)\n\n+ mathrmcoeff times frac1r\n\n\n\n\n\n","category":"type"},{"location":"Hamiltonian/#TwoBody.PowerLawPotential-Hamiltonian","page":"Hamiltonian","title":"TwoBody.PowerLawPotential","text":"PowerLawPotential(coefficient=1, exponent=1)\n\n+ mathrmcoeff times r^mathrmexpon\n\n\n\n\n\n","category":"type"},{"location":"Hamiltonian/#TwoBody.GaussianPotential-Hamiltonian","page":"Hamiltonian","title":"TwoBody.GaussianPotential","text":"GaussianPotential(coefficient=1, exponent=1)\n\n+ mathrmcoeff times exp(- mathrmexpon times r^2)\n\n\n\n\n\n","category":"type"},{"location":"Hamiltonian/#TwoBody.ExponentialPotential-Hamiltonian","page":"Hamiltonian","title":"TwoBody.ExponentialPotential","text":"ExponentialPotential(coefficient=1, exponent=1)\n\n+ mathrmcoeff times exp(- mathrmexpon times r)\n\n\n\n\n\n","category":"type"},{"location":"Hamiltonian/#TwoBody.YukawaPotential-Hamiltonian","page":"Hamiltonian","title":"TwoBody.YukawaPotential","text":"YukawaPotential(coefficient=1, exponent=1)\n\n+ mathrmcoeff times exp(- mathrmexpon times r) r\n\n\n\n\n\n","category":"type"},{"location":"Hamiltonian/#TwoBody.DeltaPotential-Hamiltonian","page":"Hamiltonian","title":"TwoBody.DeltaPotential","text":"DeltaPotential(coefficient=1)\n\n+ mathrmcoeff times δ(r)\n\n\n\n\n\n","category":"type"},{"location":"Hamiltonian/#TwoBody.FunctionPotential-Hamiltonian","page":"Hamiltonian","title":"TwoBody.FunctionPotential","text":"FunctionPotential(f)\n\n+ f(r)\n\n\n\n\n\n","category":"type"},{"location":"Hamiltonian/#TwoBody.UniformGridPotential-Hamiltonian","page":"Hamiltonian","title":"TwoBody.UniformGridPotential","text":"UniformGridPotential(R, V)\n\n\n\n\n\n","category":"type"},{"location":"","page":"Home","title":"Home","text":"CurrentModule = TwoBody","category":"page"},{"location":"#TwoBody.jl","page":"Home","title":"TwoBody.jl","text":"","category":"section"},{"location":"","page":"Home","title":"Home","text":"(Image: Stable) (Image: Dev) (Image: Build Status)","category":"page"},{"location":"","page":"Home","title":"Home","text":"TwoBody.jl: a Julia package for two-body problems","category":"page"},{"location":"#Install","page":"Home","title":"Install","text":"","category":"section"},{"location":"","page":"Home","title":"Home","text":"Run the following code on the REPL or Jupyter Notebook to install this package.","category":"page"},{"location":"","page":"Home","title":"Home","text":"import Pkg; Pkg.add(url=\"https://github.com/ohno/TwoBody.jl.git\")","category":"page"},{"location":"#Usage","page":"Home","title":"Usage","text":"","category":"section"},{"location":"","page":"Home","title":"Home","text":"Run the following code before each use.","category":"page"},{"location":"","page":"Home","title":"Home","text":"using TwoBody","category":"page"},{"location":"","page":"Home","title":"Home","text":"Define the Hamiltoninan. This is an example for the non-relativistic Hamiltonian of hydrogen atom in atomic units:","category":"page"},{"location":"","page":"Home","title":"Home","text":"hatH = \n- frac12 nabla^2\n- frac1r","category":"page"},{"location":"","page":"Home","title":"Home","text":"hamiltonian = Hamiltonian(\n NonRelativisticKinetic(ℏ = 1 , m = 1),\n CoulombPotential(coefficient = -1),\n)\nnothing # hide","category":"page"},{"location":"","page":"Home","title":"Home","text":"The usage depends on the method. Define the basis set for the Rayleigh–Ritz method:","category":"page"},{"location":"","page":"Home","title":"Home","text":"beginaligned\n phi_1(r) = exp(-1300773 r^2) \n phi_2(r) = exp(-1962079 r^2) \n phi_3(r) = exp(-0444529 r^2) \n phi_4(r) = exp(-01219492 r^2)\nendaligned","category":"page"},{"location":"","page":"Home","title":"Home","text":"basisset = BasisSet(\n SimpleGaussianBasis(13.00773),\n SimpleGaussianBasis(1.962079),\n SimpleGaussianBasis(0.444529),\n SimpleGaussianBasis(0.1219492),\n)\nnothing # hide","category":"page"},{"location":"","page":"Home","title":"Home","text":"You should find","category":"page"},{"location":"","page":"Home","title":"Home","text":"E_n=1 = -0499278E_mathrmh","category":"page"},{"location":"","page":"Home","title":"Home","text":"which is amazingly good for only four basis functions according to Thijssen(2007). The exact ground-state energy is -05E_mathrmh.","category":"page"},{"location":"","page":"Home","title":"Home","text":"solve(hamiltonian, basisset)","category":"page"},{"location":"#API-reference","page":"Home","title":"API reference","text":"","category":"section"},{"location":"","page":"Home","title":"Home","text":"","category":"page"},{"location":"API/","page":"API reference","title":"API reference","text":"CurrentModule = TwoBody","category":"page"},{"location":"API/#API-reference","page":"API reference","title":"API reference","text":"","category":"section"},{"location":"API/","page":"API reference","title":"API reference","text":"","category":"page"},{"location":"API/","page":"API reference","title":"API reference","text":"Modules = [TwoBody]","category":"page"},{"location":"API/#TwoBody.Basis","page":"API reference","title":"TwoBody.Basis","text":"Basis is an abstract type.\n\n\n\n\n\n","category":"type"},{"location":"API/#TwoBody.BasisSet","page":"API reference","title":"TwoBody.BasisSet","text":"BasisSet(basis1, basis2, ...)\n\n phi_1 phi_2 phi_3 cdots \n\nThe basis set is the input for Rayleigh–Ritz method. You can define the basis set like this:\n\nbeginaligned\n phi_1(r) = exp(-1300773 r^2) \n phi_2(r) = exp(-1962079 r^2) \n phi_3(r) = exp(-0444529 r^2) \n phi_4(r) = exp(-01219492 r^2)\nendaligned\n\nbasisset = BasisSet(\n SimpleGaussianBasis(13.00773),\n SimpleGaussianBasis(1.962079),\n SimpleGaussianBasis(0.444529),\n SimpleGaussianBasis(0.1219492),\n)\n\n\n\n\n\n","category":"type"},{"location":"API/#TwoBody.ConstantPotential","page":"API reference","title":"TwoBody.ConstantPotential","text":"ConstantPotential(constant=1)\n\n+ mathrmconst\n\n\n\n\n\n","category":"type"},{"location":"API/#TwoBody.ContractedBasis","page":"API reference","title":"TwoBody.ContractedBasis","text":"ContractedBasis([c1, c2, ...], [basis1, basis2, ...])\n\nphi = sum_i c_i phi_i\n\n\n\n\n\n","category":"type"},{"location":"API/#TwoBody.CoulombPotential","page":"API reference","title":"TwoBody.CoulombPotential","text":"CoulombPotential(coefficient=1)\n\n+ mathrmcoeff times frac1r\n\n\n\n\n\n","category":"type"},{"location":"API/#TwoBody.DeltaPotential","page":"API reference","title":"TwoBody.DeltaPotential","text":"DeltaPotential(coefficient=1)\n\n+ mathrmcoeff times δ(r)\n\n\n\n\n\n","category":"type"},{"location":"API/#TwoBody.ExponentialPotential","page":"API reference","title":"TwoBody.ExponentialPotential","text":"ExponentialPotential(coefficient=1, exponent=1)\n\n+ mathrmcoeff times exp(- mathrmexpon times r)\n\n\n\n\n\n","category":"type"},{"location":"API/#TwoBody.FunctionPotential","page":"API reference","title":"TwoBody.FunctionPotential","text":"FunctionPotential(f)\n\n+ f(r)\n\n\n\n\n\n","category":"type"},{"location":"API/#TwoBody.GaussianBasis","page":"API reference","title":"TwoBody.GaussianBasis","text":"GaussianBasis(a=1, l=0, m=0)\n\nphi_i(r θ φ) = N _il r^l exp(-a_i r^2) Y_l^m(θ φ)\n\n\n\n\n\n","category":"type"},{"location":"API/#TwoBody.GaussianPotential","page":"API reference","title":"TwoBody.GaussianPotential","text":"GaussianPotential(coefficient=1, exponent=1)\n\n+ mathrmcoeff times exp(- mathrmexpon times r^2)\n\n\n\n\n\n","category":"type"},{"location":"API/#TwoBody.Hamiltonian","page":"API reference","title":"TwoBody.Hamiltonian","text":"Hamiltonian(operator1, operator2, ...)\n\nhatH = sum_i hato_i\n\nThe Hamiltonian is the input for each solver. This is an example for the non-relativistic Hamiltonian of hydrogen atom in atomic units:\n\nhatH = \n- frac12 nabla^2\n- frac1r\n\nhamiltonian = Hamiltonian(\n NonRelativisticKinetic(ℏ =1 , m = 1),\n CoulombPotential(coefficient = -1),\n)\n\n\n\n\n\n","category":"type"},{"location":"API/#TwoBody.LinearPotential","page":"API reference","title":"TwoBody.LinearPotential","text":"LinearPotential(coefficient=1)\n\n+ mathrmcoeff times r \n\n\n\n\n\n","category":"type"},{"location":"API/#TwoBody.NonRelativisticKinetic","page":"API reference","title":"TwoBody.NonRelativisticKinetic","text":"NonRelativisticKinetic(ℏ=1, m=1)\n\n-frachbar^22m nabla^2\n\n\n\n\n\n","category":"type"},{"location":"API/#TwoBody.Operator","page":"API reference","title":"TwoBody.Operator","text":"Operator is an abstract type.\n\n\n\n\n\n","category":"type"},{"location":"API/#TwoBody.PowerLawPotential","page":"API reference","title":"TwoBody.PowerLawPotential","text":"PowerLawPotential(coefficient=1, exponent=1)\n\n+ mathrmcoeff times r^mathrmexpon\n\n\n\n\n\n","category":"type"},{"location":"API/#TwoBody.RelativisticCorrection","page":"API reference","title":"TwoBody.RelativisticCorrection","text":"RelativisticCorrection(c=1, m=1, n=2) The p^{2n} term of the Taylor expansion:\n\nbeginaligned\n sqrtp^2 c^2 + m^2 c^4\n = m times c^2 \n + 1 2 m times p^2 (n=1) \n - 1 8 m^3 c^2 times p^4 (n=2) \n + 1 16 m^5 c^4 times p^6 (n=3) \n - 5 128 m^7 c^6 times p^8 (n=4) \n + cdots\nendaligned\n\nUse c = 137.035999177 (from 2022 CODATA) in the atomic units.\n\n\n\n\n\n","category":"type"},{"location":"API/#TwoBody.RelativisticKinetic","page":"API reference","title":"TwoBody.RelativisticKinetic","text":"RelativisticKinetic(c=1, m=1)\n\nsqrtp^2 c^2 + m^2 c^4 - m c^2\n\nUse c = 137.035999177 (from 2022 CODATA) in the atomic units.\n\n\n\n\n\n","category":"type"},{"location":"API/#TwoBody.RestEnergy","page":"API reference","title":"TwoBody.RestEnergy","text":"RestEnergy(c=1, m=1)\n\nm c^2\n\nUse c = 137.035999177 (from 2022 CODATA) in the atomic units.\n\n\n\n\n\n","category":"type"},{"location":"API/#TwoBody.SimpleGaussianBasis","page":"API reference","title":"TwoBody.SimpleGaussianBasis","text":"SimpleGaussianBasis(a=1)\n\nphi_i(r) = exp(-a_i r^2)\n\nNote: This basis is not normalized. This is only for s-wave.\n\n\n\n\n\n","category":"type"},{"location":"API/#TwoBody.UniformGridPotential","page":"API reference","title":"TwoBody.UniformGridPotential","text":"UniformGridPotential(R, V)\n\n\n\n\n\n","category":"type"},{"location":"API/#TwoBody.YukawaPotential","page":"API reference","title":"TwoBody.YukawaPotential","text":"YukawaPotential(coefficient=1, exponent=1)\n\n+ mathrmcoeff times exp(- mathrmexpon times r) r\n\n\n\n\n\n","category":"type"},{"location":"API/#TwoBody.element-Tuple{CoulombPotential, SimpleGaussianBasis, SimpleGaussianBasis}","page":"API reference","title":"TwoBody.element","text":"element(o::CoulombPotential, SGB1::SimpleGaussianBasis, SGB2::SimpleGaussianBasis)\n\nbeginaligned\n langle phi_i frac1r phi_j rangle\n = iiint\n phi_i^*(r)\n times frac1r times\n phi_j(r)\n r^2 sintheta mathrmdr mathrmdtheta mathrmdvarphi \n = int_0^2pi mathrmdvarphi\n int_0^pi sintheta mathrmdtheta\n int_0^infty r mathrme^-(alpha_i + alpha_j) r^2 mathrmdr \n = 2pi times 2 times frac02 (alpha_i + alpha_j) \n = underlinefrac2pialpha_i + alpha_j\nendaligned\n\nIntegral Formula:\n\nbeginaligned\n int_0^infty r^2n+1 exp left(-a r^2right) mathrmdr = fracn2 a^n+1\nendaligned\n\n\n\n\n\n","category":"method"},{"location":"API/#TwoBody.element-Tuple{Hamiltonian, SimpleGaussianBasis, SimpleGaussianBasis}","page":"API reference","title":"TwoBody.element","text":"element(o::Hamiltonian, SGB1::SimpleGaussianBasis, SGB2::SimpleGaussianBasis)\n\nbeginaligned\n H_ij\n = langle phi_i hatH phi_j rangle \n = langle phi_i hatT + hatV phi_j rangle \n = langle phi_i hatT phi_j rangle + langle phi_i hatV phi_j rangle \n = T_ij + V_ij\nendaligned\n\n\n\n\n\n","category":"method"},{"location":"API/#TwoBody.element-Tuple{LinearPotential, SimpleGaussianBasis, SimpleGaussianBasis}","page":"API reference","title":"TwoBody.element","text":"element(o::LinearPotential, SGB1::SimpleGaussianBasis, SGB2::SimpleGaussianBasis)\n\nbeginaligned\n langle phi_i r phi_j rangle\n = iiint\n phi_i^*(r)\n times r times\n phi_j(r)\n r^2 sintheta mathrmdr mathrmdtheta mathrmdvarphi \n = int_0^2pi mathrmdvarphi\n int_0^pi sintheta mathrmdtheta\n int_0^infty r^3 mathrme^-(alpha_i + alpha_j) r^2 mathrmdr \n = 2pi times 2 times frac12 (alpha_i + alpha_j)^2 \n = underlinefrac2pi(alpha_i + alpha_j)^2\nendaligned\n\nIntegral Formula:\n\nbeginaligned\n int_0^infty r^2n+1 exp left(-a r^2right) mathrmdr = fracn2 a^n+1\nendaligned\n\n\n\n\n\n","category":"method"},{"location":"API/#TwoBody.element-Tuple{NonRelativisticKinetic, SimpleGaussianBasis, SimpleGaussianBasis}","page":"API reference","title":"TwoBody.element","text":"element(o::NonRelativisticKinetic, SGB1::SimpleGaussianBasis, SGB2::SimpleGaussianBasis)\n\nbeginaligned\n T_ij = langle phi_i hatT phi_j rangle\n = iiint\n mathrme^-alpha_i r^2\n left -frachbar^22mu nabla^2 right\n mathrme^-alpha_j r^2\n r^2 sintheta mathrmdr mathrmdtheta mathrmdvarphi \n = -frachbar^22mu iiint\n mathrme^-alpha_i r^2\n left nabla^2 right\n mathrme^-alpha_j r^2\n r^2 sintheta mathrmdr mathrmdtheta mathrmdvarphi \n = -frachbar^22mu iiint\n mathrme^-alpha_i r^2\n left -6alpha_j + 4alpha_j^2 r^2 right\n mathrme^-alpha_j r^2\n r^2 sintheta mathrmdr mathrmdtheta mathrmdvarphi \n = -frachbar^22mu iint\n sintheta mathrmdtheta mathrmdvarphi\n int\n left -6alpha_j + 4alpha_j^2 r^2 right\n r^2 mathrme^-(alpha_i + alpha_j) r^2\n mathrmdr \n = -frachbar^22mu cdot 4pi\n left\n -6alpha_j mathrmGGI(2 alpha_i + alpha_j)\n +4alpha_j^2 mathrmGGI(4 alpha_i + alpha_j)\n right\n \n = -frachbar^22mu cdot 4pi\n left\n -6alpha_j fracGammaleft( frac32 right)2 (alpha_i + alpha_j)^frac32\n +4alpha_j^2 fracGammaleft( frac52 right)2 (alpha_i + alpha_j)^frac52\n right \n = -frachbar^22mu cdot 4pi\n left\n -6alpha_j frac sqrtpi22 (alpha_i + alpha_j)^frac32\n +4alpha_j^2 frac3sqrtpi42 (alpha_i + alpha_j)^frac52\n right \n = -frachbar^22mu cdot 4pi\n left\n fracalpha_jalpha_i + alpha_j - 1\n right\n cdot 6 alpha_j cdot fracsqrtpi22 (alpha_i + alpha_j)^frac32\n \n = -frachbar^22mu cdot 4pi\n left\n - fracalpha_ialpha_i + alpha_j\n right\n cdot 6 alpha_j cdot fracsqrtpi22 (alpha_i + alpha_j)^frac32\n \n = underline\n -frachbar^22mu\n cdot 6\n cdot fracalpha_i alpha_j pi^frac32(alpha_i + alpha_j)^frac52\n \nendaligned\n\nor\n\nbeginaligned\n T_ij = langle phi_i hatT phi_j rangle\n = iiint\n mathrme^-alpha_i r^2\n left -frachbar^22mu nabla^2 right\n mathrme^-alpha_j r^2\n r^2 sintheta mathrmdr mathrmdtheta mathrmdvarphi \n = -frachbar^22mu iiint\n mathrme^-alpha_i r^2\n nabla^2\n mathrme^-alpha_j r^2\n r^2 sintheta mathrmdr mathrmdtheta mathrmdvarphi \n = frachbar^22mu iiint\n left nabla mathrme^-alpha_i r^2 right\n left nabla mathrme^-alpha_j r^2 right\n r^2 sintheta mathrmdr mathrmdtheta mathrmdvarphi \n = frachbar^22mu iiint\n left -2 alpha_i r mathrme^-alpha_i r^2 right\n left -2 alpha_j r mathrme^-alpha_j r^2 right\n r^2 sintheta mathrmdr mathrmdtheta mathrmdvarphi \n = frachbar^22mu cdot 4 alpha_i alpha_j iiint\n left r mathrme^-alpha_i r^2 right\n left r mathrme^-alpha_j r^2 right\n r^2 sintheta mathrmdr mathrmdtheta mathrmdvarphi \n = frachbar^22mu\n cdot 4 alpha_i alpha_j\n iint sintheta mathrmdtheta mathrmdvarphi\n int r^4\n mathrme^- (alpha_i + alpha_j) r^2\n mathrmdr \n = frachbar^22mu\n cdot 4 alpha_i alpha_j\n cdot 4 pi\n cdot mathrmGGI(4 alpha_i + alpha_j) \n = frachbar^22mu\n cdot 4 alpha_i alpha_j\n cdot 4 pi\n cdot fracGammaleft( frac52 right)2 (alpha_i + alpha_j)^frac52 \n = frachbar^22mu\n cdot 4 alpha_i alpha_j\n cdot 4 pi\n cdot frac3sqrtpi42 (alpha_i + alpha_j)^frac52 \n = underline\n frachbar^22mu\n cdot 6\n cdot fracalpha_i alpha_j pi^frac32(alpha_i + alpha_j)^frac52\n \nendaligned\n\n\n\n\n\n","category":"method"},{"location":"API/#TwoBody.element-Tuple{PowerLawPotential, SimpleGaussianBasis, SimpleGaussianBasis}","page":"API reference","title":"TwoBody.element","text":"element(o::PowerLawPotential, SGB1::SimpleGaussianBasis, SGB2::SimpleGaussianBasis)\n\nbeginaligned\n langle phi_i r^n phi_j rangle\n = iiint\n phi_i^*(r)\n times r^n times\n phi_j(r)\n r^2 sintheta mathrmdr mathrmdtheta mathrmdvarphi \n = int_0^2pi mathrmdvarphi\n int_0^pi sintheta mathrmdtheta\n int_0^infty r^n+2 mathrme^-(alpha_i + alpha_j) r^2 mathrmdr \n = 2pi times 2 times fracGammaleft( fracn+32 right)2 (alpha_i + alpha_j)^fracn+32 \n = underline2pifracGammaleft( fracn+32 right)(alpha_i + alpha_j)^fracn+32\nendaligned\n\nIntegral Formula:\n\nint_0^infty r^n exp left(-a r^2right) mathrmdr = fracGammaleft( fracn+12 right)2 a^fracn+12\n\n\n\n\n\n","category":"method"},{"location":"API/#TwoBody.element-Tuple{SimpleGaussianBasis, SimpleGaussianBasis}","page":"API reference","title":"TwoBody.element","text":"element(SGB1::SimpleGaussianBasis, SGB2::SimpleGaussianBasis)\n\nbeginaligned\n S_ij\n = langle phi_i phi_j rangle\n = iiint\n phi_i^*(r)\n phi_j(r)\n r^2 sintheta mathrmdr mathrmdtheta mathrmdvarphi \n = int_0^2pi mathrmdvarphi\n int_0^pi sintheta mathrmdtheta\n int_0^infty r^2 mathrme^-(alpha_i + alpha_j) r^2 mathrmdr \n = 2pi times 2 times frac12^2 sqrtfracpia^3 \n = underlineleft( fracpialpha_i + alpha_j right)^32\nendaligned\n\nIntegral Formula:\n\nint_0^infty r^2n exp left(-a r^2right) mathrmdr = frac(2n-1)2^n+1 sqrtfracpia^2n+1\n\n\n\n\n\n","category":"method"},{"location":"API/#TwoBody.solve-Tuple{Hamiltonian, BasisSet}","page":"API reference","title":"TwoBody.solve","text":"solve(hamiltonian::Hamiltonian, basisset::BasisSet)\n\nThis function returns the eigenvalues E and eigenvectors pmbc for\n\npmbH pmbc = E pmbS pmbc\n\nThe Hamiltonian matrix is defined as H_ij = langle phi_i hatH phi_j rangle. The overlap matrix is defined as S_ij = langle phi_i phi_j rangle.\n\n\n\n\n\n","category":"method"}] }