Skip to content

Commit

Permalink
anew
Browse files Browse the repository at this point in the history
  • Loading branch information
utksi committed Jan 16, 2025
1 parent 90e477c commit 8514ad2
Showing 1 changed file with 29 additions and 31 deletions.
60 changes: 29 additions & 31 deletions _posts/2024-12-12-wannier_elf.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,29 +42,29 @@ This ratio: $$\dfrac{ t_P(\mathbf{r}) }{ t_h(\mathbf{r}) }$$ is also sometimes c

Given $$n(\mathbf{r})$$: the electron density.

1. **von Weizsäcker Kinetic Energy Density ($t_W(\mathbf{r})$)**

$$
t_W(\mathbf{r}) = \dfrac{1}{8} \dfrac{|\nabla n(\mathbf{r})|^2}{n(\mathbf{r})}
$$
1. **von Weizsäcker Kinetic Energy Density ($t_W(\mathbf{r})$)**

2. **Pauli Kinetic Energy Density ($t_P(\mathbf{r})$)**

$$
t_P(\mathbf{r}) = t(\mathbf{r}) - t_W(\mathbf{r})
$$
$$
t_W(\mathbf{r}) = \dfrac{1}{8} \dfrac{|\nabla n(\mathbf{r})|^2}{n(\mathbf{r})}
$$

3. **Homogeneous Electron Gas Kinetic Energy Density ($t_h(\mathbf{r})$)**
$$
t_h(\mathbf{r}) = \dfrac{3}{5} (3\pi^2)^{2/3} [n(\mathbf{r})]^{5/3}
$$
2. **Pauli Kinetic Energy Density ($t_P(\mathbf{r})$)**

$$
t_P(\mathbf{r}) = t(\mathbf{r}) - t_W(\mathbf{r})
$$

### VASP/CASTEP expressions for ELF:
3. **Homogeneous Electron Gas Kinetic Energy Density ($t_h(\mathbf{r})$)**

$$
t_h(\mathbf{r}) = \dfrac{3}{5} (3\pi^2)^{2/3} [n(\mathbf{r})]^{5/3}
$$

### VASP/CASTEP expressions for ELF

If you're reading this, then it's highly likely that you already know that ELF fields can be written very easily after a obtaining charge density in VASP/CASTEP.

And,
And,
In CASTEP and VASP, the ELF is calculated using an expression involving the Laplacian of the Kohn-Sham orbitals and electron density:

$$
Expand Down Expand Up @@ -162,24 +162,23 @@ $$
- The CASTEP/VASP expression for $D(\mathbf{r})$ essentially represents twice the Pauli kinetic energy density $2 t_P(\mathbf{r})$, up to divergence terms.
- The divergence terms may cancel out or integrate to zero under appropriate boundary conditions but can be significant locally.


### Scalar fields with Wannier functions:
### Scalar fields with Wannier functions

The first step would be to recognize that we're working with *Maximally localized* wannier functions. As as result, the phase is consistent.

To that end, the solution should be simple.

Given a scalar field $$w_n(r)$$:

$$
n(\mathbf{r}) = \sum_n^{\text{occ}} |\tilde{w}_n(\mathbf{r})|^2
$$

And, calculate the kinetic energy density terms in the same way.
And, calculate the kinetic energy density terms in the same way.

Note that, at the end, we need $$D_h(r)$$ and $$D(r) = \tau - \tau_w(r)$$.

### Density and density-gradient from $$w_n(r)$$:
### Density and density-gradient from $$w_n(r)$$

In terms of implementation, the electron density and its gradient can be constructed as:

Expand Down Expand Up @@ -212,7 +211,7 @@ for i, wf in enumerate(self.wannier_data):
density *= 2.0
```

### Symmetrization of scalar fields $$F(r)$$:
### Symmetrization of scalar fields $$F(r)$$

**Strong** emphasis needs to be laid on the importance of symmetrization of the charge density and kinetic energy scalar fields derived from wannier functions.
Since the wannier functions are not **symmetry-adapted**, but **maximally-localized**, it matters quite a bit.
Expand Down Expand Up @@ -427,10 +426,9 @@ def _reciprocal_symmetrize(self, field: np.ndarray, field_name: str) -> np.ndarr
return sym_field
```


It should be made sure that the integral quantities are conserved before and after symmetrization, in addition to whether the scalar field obey ,symmetrization in different regions: `core`, `bonding`, `interstitial`, because even if the scalar field is sampled uniformly, the constituing wavefunctions/wannier-functions are most definitely not.

So,
So,

```python
# Validate symmetry with spatial analysis
Expand Down Expand Up @@ -564,7 +562,7 @@ def validate_field_properties(
)
```

### Calculating $$ELF(r)$$:
### Calculating $$ELF(r)$$

Finally, calculating ELF, which is straightforward:

Expand Down Expand Up @@ -600,7 +598,7 @@ elf[mask] = 1.0 / (1.0 + chi[mask] ** 2)

Using a `threshold`, masking values with `mask` seems to be important for stable values.

### Writing scalar fields $$F(r)$$:
### Writing scalar fields $$F(r)$$

```python
self.write_field_xsf("density.xsf", density)
Expand All @@ -609,6 +607,7 @@ self.write_field_xsf("tau_w.xsf", tau_w)
self.write_field_xsf("D_h.xsf", D_h)
self.write_field_xsf("ELF.xsf", elf)
```

We make use of ASE's write function:

```python
Expand All @@ -625,18 +624,17 @@ def write_field_xsf(self, filename: str, field: np.ndarray) -> None:
)
```

### ELF obtained from $$w_n(r)$$:
### ELF obtained from $$w_n(r)$$

A good example is $$\mathrm{CeO_2}$$ where Cerium is supposed to have +4 and not +3 formal oxidation state. So the $$ELF(r)$$ field value near Cerium across all cross sections should be minimal.

<div class="l-page">
<iframe src="{{ '/assets/plotly/elf_plot.html' | relative_url }}" frameborder='0' scrolling='no' height="50%" width="30%" style="border: 1px dashed grey;"></iframe>
<iframe src="{{'/assets/plotly/elf_plot.html' | relative_url}}" frameborder='0' scrolling='no' height="50%" width="30%" style="border: 1px dashed grey;"></iframe>
</div>


### **Conclusion**

Calculating the Electron Localization Function (ELF) using Wannier functions provides a localized perspective on electron localization, anc can potentially offer new insights into chemical bonding and electron pairing.
Calculating the Electron Localization Function (ELF) using Wannier functions provides a localized perspective on electron localization, anc can potentially offer new insights into chemical bonding and electron pairing.
Normalization, phase alignment, and inclusion of cross terms need to be carefully addressed.
.. *Ongoing* ...

Expand All @@ -649,4 +647,4 @@ Normalization, phase alignment, and inclusion of cross terms need to be carefull
5. Bader, R. F. W. (1990). *Atoms in Molecules: A Quantum Theory*. Oxford University Press.
6. Yang, W., & Parr, R. G. (1985). Hardness, softness, and the Fukui function in the electronic theory of metals and catalysis. *Proceedings of the National Academy of Sciences*, 82(20), 6723–6726.
7. Silvi, B., & Gatti, C. (2000). Electron localization function along a bond and atomic shell structure in solids. *The Journal of Physical Chemistry A*, 104(13), 2627–2635.
8. Henkelman, G., Arnaldsson, A., & Jónsson, H. (2006). A fast and robust algorithm for Bader decomposition of charge density. *Computational Materials Science*, 36(3), 354–360.
8. Henkelman, G., Arnaldsson, A., & Jónsson, H. (2006). A fast and robust algorithm for Bader decomposition of charge density. *Computational Materials Science*, 36(3), 354–360.

0 comments on commit 8514ad2

Please sign in to comment.