Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
Hertz4 authored Jul 3, 2024
1 parent 560b466 commit a865f83
Showing 1 changed file with 4 additions and 24 deletions.
28 changes: 4 additions & 24 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,22 +19,11 @@ pip install adapol


# Examples
In the `examples` directory, we provide two examples [`discrete.ipynb`](https://github.com/Hertz4/adapol/blob/main/example/discrete.ipynb) and [`semicircle.ipynb`](https://github.com/Hertz4/adapol/blob/main/example/semicircle.ipynb), showcasing how to use `adapol` for both discrete spectrum and continuous spectrum. We also demonstrate how to use our code through the triqs interface.
In the `examples` directory, we provide two examples [`discrete.ipynb`](https://github.com/Hertz4/adapol/blob/main/example/discrete.ipynb) and [`semicircle.ipynb`](https://github.com/Hertz4/adapol/blob/main/example/semicircle.ipynb), showcasing how to use `adapol` for both discrete spectrum and continuous spectrum.

In these notebooks, we also demonstrate how to use our code through the triqs interface.

Below is a quick introduction through the following toy example:
### Setup
```python
import numpy as np
beta = 20
Z = np.linspace(-25.,25.,26)*np.pi/beta #Matsubara frequencies
Delta = 1.0/(1j*Z-0.5) + 2.0/(1j*Z+0.2) + 0.5/(1j*Z+0.7) # Matsubara functions on these frequencies
```

### Hybridization Fitting
The hybridization fitting is handled by the `hybfit` function.
```python
from adapol import hybfit
```
There are two choices for doing hybridization fitting. One can either fit with desired accuracy tolerance `tol`:
```python
bath_energy, bath_hyb, final_error, func = hybfit(Delta, Z, tol=tol)
Expand All @@ -43,24 +32,15 @@ Or fit with specified number of interpolation points `Np`:
```python
bath_energy, bath_hyb, final_error, func = hybfit(Delta, Z, Np = Np)
```
Here `bath_energy` $E$ and `bath_hyb` $V$ are desired quantities of hybridization orbitals. They satisfy

```math
\Delta(\mathrm i \omega_k)_{mn} \approx \sum_l \frac{V_{lm} V_{ln}^*}{\mathrm i\omega_k - E_l}.
```
Here `bath_energy` $E$ and `bath_hyb` $V$ are desired quantities of hybridization orbitals.

In more sophisticated applications, one might need to specify other flags, such as `maxiter`, `cleanflag` and `disp`. See the documentation for details.

One can look at the final error of the hybridization fitting:

```python
print(final_error)
```
### Triqs interface

For triqs users, if the Green's function data `delta_triqs` is stored as a `triqs.gf.Gf` object or `triqs.gf.BlockGf` object, then the hybridization fitting could be done using the `hybfit_triqs` function:
```python
from adapol import hybfit_triqs
bathhyb, bathenergy, delta_fit, final_error = hybfit_triqs(delta_triqs, tol=tol, debug=True)
```
### Analytic continuation
Expand Down

0 comments on commit a865f83

Please sign in to comment.