Skip to content

Commit

Permalink
Banduppy new updates (#27)
Browse files Browse the repository at this point in the history
*  Bug fix for PC band path Cartesian coordinate conversion
*  Improved band structures plotting
*  Implemented plotting band centers at each SCF cycles
*  Implemented save band structure data independently
*  Implemented effective mass modules
*  Added version track file
*  Added bibliography file (.bib) for referencing
*  Added tips and tricks in README
*  Documentation improved
* Bug fix in tutorial scipts
* Fix some printing mistakes

---------

Co-authored-by: Badal Mondal <[email protected]>
  • Loading branch information
bmondal94 and Badal Mondal authored Jun 27, 2024
1 parent b2d3e77 commit 18177b8
Show file tree
Hide file tree
Showing 33 changed files with 19,378 additions and 18,383 deletions.
190 changes: 125 additions & 65 deletions README.md

Large diffs are not rendered by default.

46 changes: 46 additions & 0 deletions REFERENCES.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@

```
@article{EffectsMedeirosPRB2014,
title = {Effects of extrinsic and intrinsic perturbations on the electronic structure of graphene: Retaining an effective primitive cell band structure by band unfolding},
author = {Medeiros, Paulo V. C. and Stafstr\"om, Sven and Bj\"ork, Jonas},
journal = {Phys. Rev. B},
volume = {89},
issue = {4},
pages = {041407},
numpages = {4},
year = {2014},
month = {Jan},
publisher = {American Physical Society},
doi = {10.1103/PhysRevB.89.041407},
url = {https://link.aps.org/doi/10.1103/PhysRevB.89.041407}
}
@article{UnfoldingMedeirosPRB2015,
title = {Unfolding spinor wave functions and expectation values of general operators: Introducing the unfolding-density operator},
author = {Medeiros, Paulo V. C. and Tsirkin, Stepan S. and Stafstr\"om, Sven and Bj\"ork, Jonas},
journal = {Phys. Rev. B},
volume = {91},
issue = {4},
pages = {041116},
numpages = {5},
year = {2015},
month = {Jan},
publisher = {American Physical Society},
doi = {10.1103/PhysRevB.91.041116},
url = {https://link.aps.org/doi/10.1103/PhysRevB.91.041116}
}
@article{IrRepIraolaCPC2022,
title = {IrRep: Symmetry eigenvalues and irreducible representations of ab initio band structures},
author = {Iraola, Mikel and Mañes, Juan L. and Bradlyn, Barry and Horton, Matthew K. and Neupert, Titus and Vergniory, Maia G. and Tsirkin, Stepan S.},
journal = {Comput. Phys. Commun.},
volume = {272},
pages = {108226},
year = {2022},
issn = {0010-4655},
doi = {10.1016/j.cpc.2021.108226},
url = {https://www.sciencedirect.com/science/article/pii/S0010465521003386}
}
```
35 changes: 35 additions & 0 deletions RELEASE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
__Latest release: v0.3.2__

__v0.3.2__

* Bug fix for PC band path cartesian coordinate conversion
* Improved band structures plotting
* Implemented plotting band centers at each SCF cycles
* Implemened save band structure data independently
* Implemented effective mass modules
* Added version track file
* Added bibliograpy file (.bib) for referencing
* Added tips and tricks in README
* Documentation improved

__v0.3.1__

* Package release in PyPi repository

__v0.2.1__

* Package restructuring with significant code reimplementation
* Documentation improved
* Implemented folding degree module
* Band centers determination algorithm implemented
* Unfolded band structures plotting module improved

__v0.2.0__

* Band unfolding implemented
* Plot unfolded band structures implemented





4 changes: 2 additions & 2 deletions banduppy/BasicFunctions/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from .general_functions import SaveData2File, _BasicFunctionsModule
from .general_functions import _SaveData2File, _BasicFunctionsModule


__all__ = ['SaveData2File','_BasicFunctionsModule']
__all__ = ['_SaveData2File','_BasicFunctionsModule']
24 changes: 12 additions & 12 deletions banduppy/BasicFunctions/general_functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,22 +67,22 @@ def _return_mod(input_array, round_decimals:bool=True):
return input_array%1

## ============================================================================
class SaveData2File:
class _SaveData2File:
def __init__(self):
pass

@staticmethod
def default_save_settings(save_data):
def _default_save_settings(save_data):
tmp_save = {'save2file': False, 'fdir': '.', 'fname': 'test', 'fname_suffix': ''}
for ll in tmp_save:
if ll in save_data:
tmp_save[ll] = save_data[ll]
return tmp_save

@staticmethod
def save_2_file(data=None, save_dir='.', file_name:str='', file_name_suffix:str='',
header_txt:str='', footer_txt:str='',comments_symbol='! ',
np_data_fmt='%12.8f', print_log:bool=True):
def _save_2_file(data=None, save_dir='.', file_name:str='', file_name_suffix:str='',
header_txt:str='', footer_txt:str='',comments_symbol='! ',
np_data_fmt='%12.8f', print_log:bool=True):
"""
Save the generated SC kpoints to a file.
Expand Down Expand Up @@ -129,10 +129,10 @@ def save_2_file(data=None, save_dir='.', file_name:str='', file_name_suffix:str=
return fname_save_file

@staticmethod
def save_sc_kpts_2_file(data=None, save_dir='.', file_name:str='',
file_name_suffix:str='', file_format:str='vasp',
header_txt:str='', footer_txt:str='',comments_symbol='! ',
print_log:bool=False, print_msg:str='Saving to file...'):
def _save_sc_kpts_2_file(data=None, save_dir='.', file_name:str='',
file_name_suffix:str='', file_format:str='vasp',
header_txt:str='', footer_txt:str='',comments_symbol='! ',
print_log:bool=False, print_msg:str='Saving to file...'):
"""
Save the generated SC kpoints to a file.
Expand Down Expand Up @@ -175,8 +175,8 @@ def save_sc_kpts_2_file(data=None, save_dir='.', file_name:str='',
if print_log: print(f"{'='*_draw_line_length}\n- {print_msg}.")

fname_save_file = \
SaveData2File.save_2_file(data=data, save_dir=save_dir, file_name=file_name,
file_name_suffix=file_name_suffix, header_txt=header_txt,
footer_txt=footer_txt,comments_symbol=comments_symbol)
_SaveData2File._save_2_file(data=data, save_dir=save_dir, file_name=file_name,
file_name_suffix=file_name_suffix, header_txt=header_txt,
footer_txt=footer_txt,comments_symbol=comments_symbol)
if print_log: print(f'-- Filepath: {fname_save_file}\n- Done')
return fname_save_file
12 changes: 8 additions & 4 deletions banduppy/BasicFunctions/general_plot_functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

### ===========================================================================

class GeneratePlots:
class _GeneratePlots:
def __init__(self, save_figure_dir='.'):
"""
Initialize the plotting class.
Expand Down Expand Up @@ -32,8 +32,12 @@ def __init__(self, save_figure_dir='.'):
plt.rcParams.update(params)
plt.rc('font', size=24)

def save_figure(self, fig_name, CountFig=None, fig_dpi=300):
plt.savefig(f'{self.save_figure_folder}/{fig_name}',
bbox_inches='tight', dpi=fig_dpi)
def _save_figure(self,fig_name, fig=None, CountFig=None, **kwargs_savefig):
if fig is not None:
fig.savefig(f'{self.save_figure_folder}/{fig_name}',
bbox_inches='tight', **kwargs_savefig)
else:
plt.savefig(f'{self.save_figure_folder}/{fig_name}',
bbox_inches='tight', **kwargs_savefig)
if CountFig is not None: CountFig += 1
return CountFig
Loading

0 comments on commit 18177b8

Please sign in to comment.