Skip to content

Commit

Permalink
Merge pull request #5 from eimrek/release/2.0.0
Browse files Browse the repository at this point in the history
Release/2.0.0
  • Loading branch information
eimrek authored Feb 15, 2022
2 parents d672ca4 + 4c7653c commit c2a434e
Show file tree
Hide file tree
Showing 8 changed files with 286 additions and 214 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@ dist/*
*.pyc
.ipynb_checkpoints
.vscode
*.itx
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ Python 3 (tested with 3.6 - 3.9) environment is required with the following libr
* Atomistic simulation environment: `ase` (3.18.1)
* Python Tight Binding: `pythtb` (1.7.2)

Note: the dependencies will be automatically installed via `pip`.

### Installation

Option 1) Install the library and dependencies hosted on PyPI:
Expand Down
53 changes: 38 additions & 15 deletions example.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
"metadata": {},
"outputs": [],
"source": [
"mfh_model.run_mfh(u = 3.0, print_iter=False, plot=False)"
"mfh_model.run_mfh(u = 3.0, print_iter=False, plot=True)"
]
},
{
Expand All @@ -69,7 +69,7 @@
},
"outputs": [],
"source": [
"mfh_model.report(num_orb=2, sts_h=10.0, sts_broad=0.05)"
"mfh_model.pp.report(num_orb=2, sts_h=8.0, sts_broad=0.05)"
]
},
{
Expand All @@ -81,13 +81,36 @@
"# Visualize one specific orbital\n",
"\n",
"spin = 0\n",
"index = 0\n",
"index = 12\n",
"print(\"Orbital index: %d, spin %d\" % (index, spin))\n",
"print(\"Energy: %.6f eV\" % mfh_model.evals[spin][index])\n",
"mfh_model.plot_mo_eigenvector(mo_index=index, spin=spin)\n",
"\n",
"# corresponding eigenvector (each element corresponds in order to atoms defined in geom/mfh_model.ase_geom)\n",
"evec = mfh_model.evecs[spin][index]"
"# corresponding eigenvector\n",
"evec = mfh_model.evecs[spin][index]\n",
"\n",
"# Visualize eigenvector\n",
"mfh_model.pp.plot_mo_eigenvector(mo_index=index, spin=spin)\n",
"\n",
"# Visualize the orbital squared\n",
"mfh_model.pp.plot_orb_squared_map(plt.gca(), evec)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# Export a map in .itx format"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"sts_map, extent = mfh_model.pp.calc_sts_map(energy=1.42, broadening=0.1, h=5.0)\n",
"\n",
"tbmfh.create_itx(data=sts_map, extent=extent, wavename=\"sts_map\", filename=\"example.itx\")"
]
},
{
Expand Down Expand Up @@ -172,7 +195,7 @@
"# \"open shell\" case, normal MFH\n",
"mfh_model = tbmfh.MeanFieldHubbardModel(geom, [2.7, 0.1, 0.4], charge=0, multiplicity=1)\n",
"mfh_model.run_mfh(u = 3.0, print_iter=False, plot=False)\n",
"mfh_model.calculate_natural_orbitals()\n",
"mfh_model.pp.calculate_natural_orbitals()\n",
"\n",
"# \"closed shell\" case (just tight-binding)\n",
"tb_model = tbmfh.MeanFieldHubbardModel(geom, [2.7, 0.1, 0.4], charge=0, multiplicity=1)\n",
Expand All @@ -193,15 +216,15 @@
" \n",
" fig, axs = plt.subplots(nrows=1, ncols=7, figsize=(7 * mfh_model.figure_size[0], mfh_model.figure_size[1]))\n",
" \n",
" mfh_model.plot_no_eigenvector(i_mo, ax=axs[0])\n",
" mfh_model.plot_orb_squared_map(axs[1], mfh_model.no_evecs[i_mo], h=h)\n",
" mfh_model.pp.plot_no_eigenvector(i_mo, ax=axs[0])\n",
" mfh_model.pp.plot_orb_squared_map(axs[1], mfh_model.pp.no_evecs[i_mo], h=h)\n",
" \n",
" mfh_model.plot_mo_eigenvector(i_mo, spin=0, ax=axs[2])\n",
" mfh_model.plot_mo_eigenvector(i_mo, spin=1, ax=axs[3])\n",
" mfh_model.plot_sts_map(axs[4], mfh_model.evals[0, i_mo], h=h)\n",
" mfh_model.pp.plot_mo_eigenvector(i_mo, spin=0, ax=axs[2])\n",
" mfh_model.pp.plot_mo_eigenvector(i_mo, spin=1, ax=axs[3])\n",
" mfh_model.pp.plot_sts_map(axs[4], mfh_model.evals[0, i_mo], h=h)\n",
" \n",
" tb_model.plot_mo_eigenvector(i_mo, spin=0, ax=axs[5])\n",
" tb_model.plot_sts_map(axs[6], tb_model.evals[0, i_mo], h=h)\n",
" tb_model.pp.plot_mo_eigenvector(i_mo, spin=0, ax=axs[5])\n",
" tb_model.pp.plot_sts_map(axs[6], tb_model.evals[0, i_mo], h=h)\n",
" \n",
" plt.subplots_adjust(wspace=0.0, hspace=0)\n",
" plt.show()"
Expand Down Expand Up @@ -231,7 +254,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.7.9"
"version": "3.8.8"
},
"toc": {
"base_numbering": 1,
Expand Down
3 changes: 2 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

setuptools.setup(
name="tb-mean-field-hubbard",
version="1.5.1",
version="2.0.0",
author="Kristjan Eimre",
author_email="[email protected]",
description="Package to run tight-binding mean field hubbard calculations",
Expand All @@ -25,5 +25,6 @@
"matplotlib",
"ase",
"pythtb",
'igor-tools @ git+https://[email protected]/nanotech-empa/igor-tools@main#egg=igor-tools',
],
)
3 changes: 2 additions & 1 deletion tb_mean_field_hubbard/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
from .mfh import MeanFieldHubbardModel
from .utils import create_itx

__version__ = "1.5.1"
__version__ = "2.0.0"
Loading

0 comments on commit c2a434e

Please sign in to comment.