Skip to content

Commit

Permalink
Readme with more details on usage and attach the slides for theory ex…
Browse files Browse the repository at this point in the history
…planation
  • Loading branch information
unkcpz committed Oct 15, 2024
1 parent ef8a820 commit 5dd957f
Show file tree
Hide file tree
Showing 2 changed files with 59 additions and 7 deletions.
66 changes: 59 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,29 +19,81 @@

## Usage

The [examples](https://github.com/unkcpz/PseudopotentialGenerator.jl/tree/main/examples) folder provide scripts include solving atomic Schrödinger equation and pseudolize to get pseudopotentials.
Generating a pseudopotential requires first having reference states (from real all-electrons potential) and then construct the pseudopotential that can reproduce same scattering behavior.

The [examples](https://github.com/unkcpz/PseudopotentialGenerator.jl/tree/main/examples) folder includes scripts of solving atomic Schrödinger equation and pseudizing to get pseudopotentials.

To solve the atomic Schrödinger equation under DFT framework, simply define the ionic configuration and call `self_consistent_field` function.

```julia
Z = 6
mesh = Mesh(1e-7, 50.0, 2.7e+6, 10000);
orbs = [Orbital(Z, 1, 0, 2), Orbital(Z, 2, 0, 2), Orbital(Z, 2, 1, 2)];

res = self_consistent_field(
Z,
mesh,
orbs,
mixing_beta = 0.2,
abstol = 1e-7,
maxiters_scf = 200,
perturb = true,
)

ae_info = (ε_lst = res.ε_lst, ϕs = res.ϕs, vae = res.v_tot, occs = res.occs, xc = res.xc);
```

The `ae_info` contains eigenstates and self consistent potential.

The pseudopotential is then generated to have pseudo-states that meet the restriction with respect to the all-electrons reference.
The [Troullier-Martins (TM)](https://journals.aps.org/prb/abstract/10.1103/PhysRevB.43.8861) is a one of the popular scheme to construct pseudopotential.
To generate a TM type pseudopotential, call `pseudize` function,

```julia
v_pspot, ϕ_ps = pseudize(ae_info, mesh, rc; method = :TM, kbform = false)
```

The function returns the psudopotential and all pseudo-wavefunctions.

It is essential to check whether the generated pseudopotential is good enough for solid-state DFT calculations.
One of the prevalent metric is logarithmic derivative (usually `arctan` of the derivative) of wavefunctions which reveal the discripancies between the all-electrons wavefunctions and pseudo-wavefunctions in both eigenstates and energies of scattering states.
The arctan logarithmic derivative is computed for every angular momentum by calling `compute_atanld` in the given potential,

```julia
# For all-electrons potential
compute_atanld(l, Z, mesh, ae_info.vae, rcx, window = [-10.0, 10.0], δ = 0.05)

# For pseudo-potential which is semi-local (dependent on angular momentum l)
compute_atanld(l, Z, mesh, v_pspot.v[nl], rcx, window = [-10.0, 10.0], δ = 0.05)
```

## Basic theory and package construction

You will find presentian that covers the thoretical background and the construction detials of this package.

[DFT in atom, pseudopotential generation and its Julia implementation]()

## For developers

To run tests, some functions from [DFTATOM](https://github.com/certik/dftatom) is wrappered as reference which need to compiled first.
To run tests, functions from [DFTATOM](https://github.com/certik/dftatom) are wrappered as reference which need to compiled first.

```bash
make -C deps all
```

Then can run tests by
Then run tests

```bash
julia --project=@. -e 'using Pkg; Pkg.test()'
```

## TODO
## TODOs

- [x] Solving atomic DFT in radial coordination
- [x] Migrate from self-crafted ODE solver to purely using `NonlinearSolve.jl` and `OrdinaryDiffEq.jl` as solver.
- [x] pseudolize using TM.
- [ ] pseudolize using RRKJ.
- [ ] pseudolize using BHS.
- [x] pseudize using TM.
- [ ] pseudize using RRKJ.
- [ ] pseudize using BHS.
- [x] compute logarithmic derivative plots.
- [ ] Kleinman-Bylander form and its logarithmic derivative by solving integ-ODE.
- [ ] full relativistic PP
Expand Down
Binary file added misc/PGEN_atomic_DFT_in_Julia.pdf
Binary file not shown.

0 comments on commit 5dd957f

Please sign in to comment.