Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Soc PROCAR handling and more #28

Merged
merged 139 commits into from
Aug 10, 2023
Merged
Show file tree
Hide file tree
Changes from 138 commits
Commits
Show all changes
139 commits
Select commit Hold shift + click to select a range
e580932
Update docs main page
kavanase Jun 26, 2023
ae49d72
Update `README.md`
kavanase Jun 26, 2023
4631ba1
Add `-h` CLI help options
kavanase Jun 26, 2023
92e3488
`yapf` formatting
kavanase Jun 26, 2023
319f358
Update `Guide` docs
kavanase Jun 26, 2023
0845cbf
Update NaBiS2 figure to have title centred
kavanase Jun 26, 2023
c64c2cc
Update atom-projected NaBiS2 figures to have titles centred
kavanase Jun 26, 2023
2d6d06e
Refactor `Guide` to `Tutorial` as this is more recognisable to people…
kavanase Jun 26, 2023
801e021
Update `publications.md`
kavanase Jun 26, 2023
dd2179c
Update `theory.md`
kavanase Jun 26, 2023
248b243
Add links to Theory page
kavanase Jun 26, 2023
6178646
Update `Installation` docs page
kavanase Jun 26, 2023
e3f36cd
Recentre Si222 images
kavanase Jun 26, 2023
c94691f
Fix typos and make output more informative
kavanase Jun 26, 2023
7bd6578
Add symlinked `README.md`s for the other examples as well as Si222
kavanase Jun 26, 2023
029dd91
Update `Si222` docs example
kavanase Jun 26, 2023
91dda31
Update `Si` CASTEP docs example
kavanase Jun 26, 2023
0e986a1
Update `MgO` docs example
kavanase Jun 26, 2023
c5c02ef
Fix `colors`/`cmap` handling and docstrings
kavanase Jun 26, 2023
e6bb9d1
Update `NaBiS2` example
kavanase Jun 26, 2023
fc76c01
Merge updates
kavanase Jun 27, 2023
3096e2e
Add .DS_Store to gitignore
kavanase Jun 27, 2023
1b19f94
Refactor `vscale` to `colour-norm` and update help message/docstrings…
kavanase Jun 27, 2023
8468498
Parse `PROCAR` in current directory by default, and update help messa…
kavanase Jun 27, 2023
056aa68
Add `--atoms` option (and corresponding functions) to just specify wh…
kavanase Jun 27, 2023
d804ba4
Remove completed TODO
kavanase Jun 27, 2023
221d077
Consolidate `colour_norm` (formerly `vscale`) and `intensity` as they…
kavanase Jun 27, 2023
152dabc
Make `ylim` consistent between CLI and plotting module
kavanase Jun 28, 2023
f582081
Add DOS plotting functionality
kavanase Jun 28, 2023
c0e0fa4
Merge main
kavanase Jun 28, 2023
59ec519
Refactor `mpl-style-file` to plot command options, as it's the only p…
kavanase Jun 28, 2023
37ca3dc
Update CLI
zhubonan Jun 28, 2023
afacfd1
Clean up the time-reversal symmetry handling
zhubonan Jun 29, 2023
f13b81a
Add docstrings
kavanase Jul 2, 2023
31b39d6
Ignore unnecessary `POTCAR` warnings
kavanase Jul 2, 2023
62f6bbc
Update help messages to be more informative
kavanase Jul 2, 2023
3a59bad
Consolidate DOS plot and projected plot colours
kavanase Jul 2, 2023
0f5dfde
Colour different orbitals for the same atom as different shades of th…
kavanase Jul 2, 2023
f29a5e7
Update `PROCAR` handling to deal with setting just `p` or just `d` fo…
kavanase Jul 3, 2023
79b200d
Update CLI help messages
kavanase Jul 3, 2023
08fc65e
Match DOS elements and orbitals with `atoms` / `orbitals` options
kavanase Jul 3, 2023
b464428
Match DOS elements/orbitals with `atoms`/`orbitals` for non-projected…
kavanase Jul 3, 2023
355bcbb
Allow non-projected plot to still specify `atoms`/`atoms_idx` and/or …
kavanase Jul 3, 2023
1ee9704
Update `unfold` docstrings to be more informative
kavanase Jul 3, 2023
164200e
Add multi-group orbital handling to `parse_atoms()`
kavanase Jul 3, 2023
13a07ac
Formatting
kavanase Jul 3, 2023
56fb766
Handle colours/line-styles for _lm_-decomposed orbital contributions,…
kavanase Jul 3, 2023
5c5f73e
Linting
kavanase Jul 3, 2023
798dce1
Ignore other `POTCAR` warnings
kavanase Jul 3, 2023
9b4de41
Update `pre-commit` requirements
kavanase Jul 3, 2023
2801142
Update `sumo` function calling for `pylint`
kavanase Jul 3, 2023
3e5b821
Add NaBiS2 directory test setup
kavanase Jul 3, 2023
65b34c9
Add help message option tests
kavanase Jul 3, 2023
e9183e4
Add NaBiS2 plotting tests, with all options
kavanase Jul 3, 2023
ec6cbe3
Formatting
kavanase Jul 3, 2023
2b28dce
Update tests
kavanase Jul 3, 2023
27aed24
Fix `sumo` version
kavanase Jul 3, 2023
68bc17d
Handle older `sumo` version requirement
kavanase Jul 4, 2023
b1b7d26
Formatting
kavanase Jul 4, 2023
142cb67
Add link to NaBiS2 customisation in Si example
kavanase Jul 4, 2023
30619fa
Fix missing file link in tutorial
kavanase Jul 5, 2023
15a349a
Update `Si222` plots (first plots potential users will see, want them…
kavanase Jul 5, 2023
85521e7
Update MgO example figures, commands, docs (show recommended `--atoms…
kavanase Jul 5, 2023
fe0c6c9
Refactor `colors` to `colours` and formatting
kavanase Jul 5, 2023
f8b73b7
Update `NaBiS2` example with new `--atoms` option, and specific appli…
kavanase Jul 5, 2023
f378628
Update `sumo` requirement
kavanase Jul 5, 2023
2ecd1b7
Add DOS plot example
kavanase Jul 5, 2023
0795152
Relax `sumo` requirements
kavanase Jul 5, 2023
965b13b
Formatting
kavanase Jul 5, 2023
50f76f3
Add atom-projected w/DOS example
kavanase Jul 5, 2023
c667767
Add notes/warnings about `sumo` requirement for DOS plots and not to …
kavanase Jul 5, 2023
0276c2a
Handle case where user sets the same atom in different projection gro…
kavanase Jul 7, 2023
de3c1f7
Add orbital projected band structure with DOS example
kavanase Jul 7, 2023
8ae3200
Add lm-decomposed orbital projected band structure with DOS example
kavanase Jul 7, 2023
77ff376
Adjust figure sizing
kavanase Jul 7, 2023
3b7a4c7
Update handling of multiple atom-orbital combos with the same atomic …
kavanase Jul 7, 2023
1380a06
Removed unused image
kavanase Jul 7, 2023
d45aeba
Refactor usages of `Easyunfold` to `easyunfold` (this is the canonica…
kavanase Jul 7, 2023
44b3649
Fix `symprec` help message
kavanase Jul 18, 2023
5980af6
Hide `--yes` help option
kavanase Jul 18, 2023
f645c48
Update tutorial to show the `scf-kpoints` option for hybrid DFT calcu…
kavanase Jul 18, 2023
432d5e4
Update tutorial to mention `--gamma` and `--ncl` options
kavanase Jul 25, 2023
b360be5
Move `add_plot_options` to just before `plot` commands (rather than b…
kavanase Jul 29, 2023
7bb0d02
Refactor `mpl_style_option` to a decorator to avoid code duplication …
kavanase Jul 29, 2023
e11f1ab
Merge remote-tracking branch 'origin/pr-cli-update' into dos-plotting
kavanase Jul 29, 2023
764ed0e
Revert `colour_norm` to `vscale`
kavanase Jul 29, 2023
0f6575e
Fix `intensity` handling from #26
kavanase Jul 29, 2023
3c93299
Replace all instances of `colour-norm`/`vscale` in docs with recommen…
kavanase Jul 29, 2023
0d33aa1
Add `poscar` option to specify `POSCAR` file as requested, and add te…
kavanase Jul 29, 2023
2a786d1
Make shell files executable
kavanase Jul 29, 2023
b08d409
Add help messages and docstrings for `--time-reversal`, and remove `T…
kavanase Jul 29, 2023
f4a92f4
Update `PROCAR` handling to work for all `LORBIT >= 11` and add test …
kavanase Jul 29, 2023
94cb1bd
Move `if dos:` block to separate function to avoid code duplication
kavanase Jul 29, 2023
d25f088
Refactor DOS plotter handling in `plotting` to separate function to a…
kavanase Jul 29, 2023
78a390d
Bump version number before next major release with backwards-compatib…
kavanase Jul 29, 2023
f821de2
`pre-commit` formatting
kavanase Jul 29, 2023
09bc5b6
Remove unused `ncl` and `gamma` CLI options from plot options (CLI pl…
kavanase Jul 31, 2023
4aec440
Overhaul `PROCAR` handling to handle and amalgamate multiple `PROCAR`…
kavanase Jul 31, 2023
2f52225
Refactor other modules to updated `PROCAR` handling
kavanase Jul 31, 2023
7459d68
Dynamically determine whether `PROCAR`s are SOC or not
kavanase Jul 31, 2023
65387a1
Make `Procar` object JSON serializable
kavanase Jul 31, 2023
3895b84
Add deprecation notice for `vscale`
kavanase Jul 31, 2023
ce80c6b
Add notes about passing multiple `--procar` options for split `PROCAR…
kavanase Jul 31, 2023
3cfaeba
Update `test_procar()` (Gamma point duplicated in k-point path so upd…
kavanase Jul 31, 2023
b328db2
Bump version number
kavanase Aug 1, 2023
41139a1
No ticks on DOS plots
kavanase Aug 1, 2023
d72c53a
Use sumo orbital colours in DOS plots (if not atom-projected plot)
kavanase Aug 1, 2023
2c73991
Pre-commit formatting
kavanase Aug 1, 2023
97e8c9b
Merge branch 'main' into SOC-procar-handling
kavanase Aug 1, 2023
a7c08c8
Merge remote-tracking branch 'origin/SOC-procar-handling' into SOC-pr…
kavanase Aug 1, 2023
f775e99
Pre-commit formatting
kavanase Aug 1, 2023
205df67
Code cleanup and efficiency
kavanase Aug 5, 2023
fabf5f3
Fix weight normalisation
kavanase Aug 5, 2023
6254fac
Add `colourspace` CLI option for `plot-projected`
kavanase Aug 5, 2023
f898dd3
Code cleanup
kavanase Aug 5, 2023
550cc84
Code cleanup
kavanase Aug 5, 2023
7e079ca
Change default colour handling ("g" in matplotlib goes to (0,0.5,0) i…
kavanase Aug 5, 2023
2bc1e16
Renormalise final interpolated colours appropriately
kavanase Aug 5, 2023
9566e4b
Change default `colorspace` to `xyz`
kavanase Aug 5, 2023
8382a64
Normalise PROCAR projections so the total orbital projection sums to …
kavanase Aug 5, 2023
55b2355
pre-commit formatting
kavanase Aug 5, 2023
ebc3ccf
Darken colour slightly if too white
kavanase Aug 6, 2023
760caee
Set default colours and colorspace to `lablch` (to be discussed)
kavanase Aug 6, 2023
d2e0fa3
Add and update tests
kavanase Aug 6, 2023
cd84230
Update test
kavanase Aug 6, 2023
c34a765
Default colourspace is `LAB` everywhere
kavanase Aug 7, 2023
062195a
Pre commit formatting
kavanase Aug 7, 2023
26915f3
Update MgO projection plots
kavanase Aug 7, 2023
547d462
Update NaBiS2 projection plots
kavanase Aug 7, 2023
9799733
Add example outputs mini section
kavanase Aug 7, 2023
70bd9ad
Pre-commit formatting
kavanase Aug 8, 2023
7599baf
Bump version number before next release
kavanase Aug 9, 2023
ae5b6cc
GitHub readme doesn't seem to work with symlinks?
kavanase Aug 9, 2023
d6a2ba3
Resize images
kavanase Aug 9, 2023
709b72e
Update README.md
kavanase Aug 9, 2023
81ebe37
Subscript formatting
kavanase Aug 9, 2023
4db50a9
Subscript formatting
kavanase Aug 9, 2023
faad55d
Merge remote-tracking branch 'origin/SOC-procar-handling' into SOC-pr…
kavanase Aug 9, 2023
ebf053e
Remove `with` from `_read` method
kavanase Aug 10, 2023
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
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -47,3 +47,5 @@ KPOINTS
PROCAR
*.json
*.DS_Store

local_tests/
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,11 @@ package.
For the methodology of supercell band unfolding, see
[here](https://link.aps.org/doi/10.1103/PhysRevB.85.085201).

### Example Outputs
Cs₂(Sn/Ti)Br₆ Vacancy-Ordered Perovskite Alloys | Symmetry-broken Si Supercell
:-------------------------:|:------------------------------------:
<img src="docs/img/CSTB_easyunfold.gif" height="400"/> | <img src="examples/Si222/unfold_tall.png" height="400"/>

## Usage

To generate an unfolded band structure, one typically needs to perform the following steps:
Expand Down
15 changes: 13 additions & 2 deletions docs/examples/example_mgo.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,15 @@ easyunfold unfold plot-projections --procar MgO_super/PROCAR --atoms="Mg,O" --co

Note that the path of the `PROCAR` is passed along with the desired atom projections (`Mg` and `O` here).

:::{tip}
If the _k_-points have been split into multiple calculations (e.g. hybrid DFT band structures), the `--procar` option
should be passed multiple times to specify the path to each split `PROCAR` file (i.e.
`--procar calc1/PROCAR --procar cal2/PROCAR ...`).
:::

:::{note}
The atomic projections are not stored in the `easyunfold.json` data file, so the `PROCAR` file should be
kept for replotting in the future.
The atomic projections are not stored in the `easyunfold.json` data file, so the `PROCAR` file(s) should be kept for
replotting in the future.
:::

The `--combined` option creates a combined plot with different colour maps for each atomic grouping.
Expand Down Expand Up @@ -97,3 +103,8 @@ easyunfold unfold plot-projections --procar MgO_super/PROCAR --atoms="Mg,O" --em

Unfolded MgO band structure with atomic projections plotted separately.
```

:::{tip}
There are _many_ customisation options available for the plotting functions in `easyunfold`. See `easyunfold plot -h` or
`easyunfold unfold plot-projections -h` for more details!
:::
20 changes: 15 additions & 5 deletions docs/examples/example_nabis2.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ When plotting the unfolded band, the `plot-projections` subcommand is used with
`--atoms` options:

```bash
easyunfold unfold plot-projections --atoms="Na,Bi,S" --intensity 2 --combined
easyunfold unfold plot-projections --atoms="Na,Bi,S" --intensity 3 --combined
```

```{figure} ../../examples/NaBiS2/NaBiS2_unfold-plot_proj.png
Expand All @@ -98,6 +98,12 @@ easyunfold unfold plot-projections --atoms="Na,Bi,S" --intensity 2 --combined
Unfolded band structure of NaBiS<sub>2</sub> with atomic contributions.
```

:::{tip}
If the _k_-points have been split into multiple calculations (e.g. hybrid DFT band structures), the `--procar` option
should be passed multiple times to specify the path to each split `PROCAR` file (i.e.
`--procar calc1/PROCAR --procar cal2/PROCAR ...`).
:::

From this plot, we can see that sulfur anions dominate the valence band, while bismuth cations dominate the conduction
band, with minimal contributions from the sodium cations as expected.

Expand Down Expand Up @@ -126,7 +132,7 @@ Unfolded band structure of NaBiS<sub>2</sub> with atomic contributions plotted s

An alternative option here is also to just plot only the contributions of `Na` and `Bi` cations, with no S projections:
```bash
easyunfold unfold plot-projections --atoms="Na,Bi" --intensity 2 --combined
easyunfold unfold plot-projections --atoms="Na,Bi" --intensity 3 --combined
```

```{figure} ../../examples/NaBiS2/NaBiS2_unfold-plot_proj_noS.png
Expand All @@ -143,7 +149,7 @@ While this plot isn't the most aesthetic, it clearly shows that Bi (green) contr
### Atom-projected Unfolded Band Structure with DOS
We can also combine the atom projections with the DOS plotting, using the `--dos` option as before:
```bash
easyunfold unfold plot-projections --atoms "Na,Bi,S" --intensity 2 --combined --dos vasprun.xml.gz --zero-line \
easyunfold unfold plot-projections --atoms "Na,Bi,S" --intensity 3 --combined --dos vasprun.xml.gz --zero-line \
--dos-label "DOS" --gaussian 0.1 --no-total --scale 2
```

Expand Down Expand Up @@ -193,7 +199,7 @@ For example, if we want to see the contributions of the Bi $s$, $p$ and S $s$ or
we can use the following command:

```bash
easyunfold unfold plot-projections --atoms "Bi,Bi,S" --orbitals="s|p|s" --intensity 2 --combined \
easyunfold unfold plot-projections --atoms "Bi,Bi,S" --orbitals="s|p|s" --intensity 3 --combined \
--dos vasprun.xml.gz --zero-line --dos-label "DOS" --gaussian 0.1 --no-total --scale 5
```

Expand All @@ -216,7 +222,7 @@ see the contributions of the Bi and S $p_x$, $p_y$ and $p_z$ orbitals to the unf
following command:

```bash
easyunfold unfold plot-projections --atoms "Na,Bi,S" --orbitals="all|px,py,pz|px,py,pz" --intensity 2 --combined \
easyunfold unfold plot-projections --atoms "Na,Bi,S" --orbitals="all|px,py,pz|px,py,pz" --intensity 3 --combined \
--dos vasprun.xml.gz --zero-line --dos-label "DOS" --gaussian 0.1 --no-total --scale 6
```

Expand All @@ -232,6 +238,10 @@ structure, due to the cubic symmetry of the NaBiS<sub>2</sub> crystal structure.
for the $d$ orbitals of transition metals in octahedral/tetrahedral environments, we would expect to see significant
differences in the contributions of different $lm$-decomposed orbitals to the electronic structure.

:::{tip}
There are _many_ customisation options available for the plotting functions in `easyunfold`. See `easyunfold plot -h` or
`easyunfold unfold plot-projections -h` for more details!
:::

[^1]: [Huang, YT., Kavanagh, S.R., Righetto, M. et al. Strong absorption and ultrafast localisation in NaBiS2 nanocrystals with slow charge-carrier recombination. Nat Commun 13, 4960 (2022)](https://www.nature.com/articles/s41467-022-32669-3)
[^2]: [Wang, Y., Kavanagh, S.R., Burgués-Ceballos, I. et al. Cation disorder engineering yields AgBiS2 nanocrystals with enhanced optical absorption for efficient ultrathin solar cells. Nat. Photon. 16, 235–241 (2022).](https://www.nature.com/articles/s41566-021-00950-4)
7 changes: 6 additions & 1 deletion docs/examples/example_si211_castep.md
Original file line number Diff line number Diff line change
Expand Up @@ -143,4 +143,9 @@ Supercell band structure of Si in a 2x1x1 supercell

which, as expected, is the same as the primitive cell if it is folded back along the midpoint between
$\Gamma$ and $X$, corresponding to the 2x expansion of the primitive cell along the $x$ direction in
generating the 2x1x1 supercell.
generating the 2x1x1 supercell.

:::{tip}
There are _many_ customisation options available for the plotting functions in `easyunfold`. See `easyunfold plot -h` or
`easyunfold unfold plot-projections -h` for more details!
:::
1 change: 0 additions & 1 deletion docs/examples/example_si222.md
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,6 @@ customising and prettifying the unfolded band structure plot. Here we have also
option to increase the spectral function intensity.
:::


Note the appearance of extra branches compared to the band structure of the primitive cell (below), due
to symmetry breaking from the displaced atom.

Expand Down
Binary file added docs/img/CSTB_easyunfold.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions docs/img/Si_222_unfold_tall.png
5 changes: 5 additions & 0 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,11 @@ package.
For the methodology of supercell band unfolding, see
[here](https://link.aps.org/doi/10.1103/PhysRevB.85.085201).

### Example Outputs
Cs₂(Sn/Ti)Br₆ Vacancy-Ordered Perovskite Alloys | Symmetry-broken Si Supercell
:-------------------------:|:------------------------------------:
<img src="../img/CSTB_easyunfold.gif" height="400"/> | <img src="../img/Si_222_unfold_tall.png" height="400"/>

## Usage

To generate an unfolded band structure, one typically needs to perform the following steps:
Expand Down
2 changes: 1 addition & 1 deletion easyunfold/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
Collection of code for band unfolding
"""

__version__ = '0.2.0'
__version__ = '0.3.0'
Loading
Loading