Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,24 @@

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

## Quick Start

Install TwoBody.jl from the Julia REPL or a notebook:

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

Load the package and solve the hydrogen ground state:

```julia
using TwoBody

H = Hamiltonian(Kinetic(hbar=1, m=1), Coulomb(coefficient=-1))
BS = BasisSet(SimpleGaussianBasis(13.00773), SimpleGaussianBasis(1.962079))
solve(H, BS; info=0).E[1]
```

## Documentation

- Home: https://juliafewbody.github.io/TwoBody.jl
Expand Down
11 changes: 0 additions & 11 deletions docs/src/Free-Complement.md
Original file line number Diff line number Diff line change
Expand Up @@ -153,17 +153,6 @@ for reference_energy in reference_energies
end
```

You can also generate a complement from one basis function:

```@repl fc-single
using TwoBody
H = Hamiltonian(
Kinetic(hbar = 1, m = 1),
Coulomb(coefficient = -1),
)
FC(H, PowerSlaterBasis(0, 1.5))
```

## Acknowledgments

This work was developed on the basis of the fourth lecture in Section I of the
Expand Down
7 changes: 6 additions & 1 deletion docs/src/GEM.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,12 @@ nothing # hide
Define the Gaussian basis set.

```@example gem
BS = GeometricBasisSet(GaussianBasis, 0.1, 10.0, 20)
BS = BasisSet(
GaussianBasis(13.00773),
GaussianBasis(1.962079),
GaussianBasis(0.444529),
GaussianBasis(0.1219492),
)
nothing # hide
```

Expand Down
6 changes: 5 additions & 1 deletion docs/src/Rayleigh-Ritz.md
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,8 @@ save("assets/RR_HA.svg", fig) # hide
```
![](assets/RR_HA.svg)

The numerical solution agrees well with the analytical solution even in the excited state.

## Example of Spherical Oscillator

Analytical solutions are implemented in [spherical oscillator](https://ohno.github.io/Antique.jl/stable/SphericalOscillator/).
Expand Down Expand Up @@ -254,7 +256,9 @@ save("assets/RR_SO.svg", fig) # hide
```
![](assets/RR_SO.svg)

## STO-3G
The numerical solution agrees well with the analytical solution even in the excited state.

## Example of STO-3G

This example reproduces the STO-3G calculation for hydrogen reported by [Pérez-Torres (2019)](https://doi.org/10.1021/acs.jchemed.8b00959). In the contracted calculation, the published coefficients are held fixed, and the resulting contracted function is supplied to the solver. In the uncontracted calculation, the three primitive functions are supplied separately, allowing the Rayleigh–Ritz solver to optimize their linear coefficients.

Expand Down
3 changes: 1 addition & 2 deletions docs/src/VMC.md
Original file line number Diff line number Diff line change
Expand Up @@ -100,8 +100,7 @@ Because successive Markov-chain samples are correlated, the naive `standard_erro
arXiv:1607.07892 (2016).
5. J. M. Thijssen,
[*Computational Physics*, 2nd ed.](https://doi.org/10.1017/CBO9781139171397),
Cambridge University Press (2007);
邦訳: 松田和典, 道廣嘉隆, 谷村吉隆, 高須昌子, 吉江友照 訳, 『計算物理学』, 丸善出版 (2012).
Cambridge University Press (2007).

## API reference

Expand Down
2 changes: 1 addition & 1 deletion docs/src/VNN.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ E[\psi_\theta] =
where the grid, Hamiltonian matrix ``\pmb{H}``, and radial Jacobian ``\pmb{J}``
are provided by `FiniteDifferenceMethod`.

## Standard model
## Usage

The two-argument `solve` method constructs a Lux network from `architecture`.

Expand Down
10 changes: 6 additions & 4 deletions docs/src/developer.md
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ To register a release in the [General](https://github.com/JuliaRegistries/Genera

## Architecture

`src/TwoBody.jl` defines the `TwoBody` module and includes the source files in dependency order. `Hamiltonian.jl` defines the shared problem representation. `Basis.jl` supports the Rayleigh–Ritz implementation, and `FDM.jl` supplies the discretization used by the variational neural-network method. The solver files extend `solve` for their respective method types.
`src/TwoBody.jl` defines the `TwoBody` module and includes the source files in dependency order. `Hamiltonian.jl` defines the shared problem representation. `Basis.jl` supports Rayleigh–Ritz and GEM, and `FDM.jl` supplies the discretization used by the variational neural-network method. The solver files extend `solve` for their respective method types.

```mermaid
---
Expand All @@ -111,15 +111,17 @@ flowchart TD
D["DB.jl"]
B["Basis.jl"]
R["Rayleigh-Ritz.jl"]
G["GEM.jl"]
F["FDM.jl"]
Q["QTT.jl"]
N["VNN.jl"]
V["VMC.jl"]
T["TwoBody.jl"]

H --> D
H --> R & F & Q & N & V
B --> R
H --> R & G & F & Q & N & V
B --> R & G
R --> G
F --> N
H & D & B & R & F & Q & N & V --> T
H & D & B & R & G & F & Q & N & V --> T
```
2 changes: 1 addition & 1 deletion src/Rayleigh-Ritz.jl
Original file line number Diff line number Diff line change
Expand Up @@ -568,7 +568,7 @@ This function returns the overlap matrix $\pmb{S}$. The element is written as ``
`matrix(operator::Operator, basisset::BasisSet)`

!!! note
This function is used for the expectation values and is not used in computing the Hamiltonian matrix.
This function computes expectation-value matrices, not the Hamiltonian matrix.

This function returns the matrix corresponding to the operator in the given basis set. The element is written as ``O_{ij} = \langle \phi_{i} | \hat{o} | \phi_{j} \rangle``.
""" matrix(operator::Operator, basisset::BasisSet)
Expand Down
Loading