Skip to content

Commit

Permalink
Merge pull request #4 from eimrek/release/1.5.1
Browse files Browse the repository at this point in the history
Release/1.5.1
  • Loading branch information
eimrek authored Jul 15, 2021
2 parents d4ab5eb + 15ac027 commit d672ca4
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 2 deletions.
2 changes: 1 addition & 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.0",
version="1.5.1",
author="Kristjan Eimre",
author_email="[email protected]",
description="Package to run tight-binding mean field hubbard calculations",
Expand Down
2 changes: 1 addition & 1 deletion tb_mean_field_hubbard/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
from .mfh import MeanFieldHubbardModel

__version__ = "1.5.0"
__version__ = "1.5.1"
15 changes: 15 additions & 0 deletions tb_mean_field_hubbard/mfh.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,21 @@ def _set_up_tb_model(self):
self.model_a.set_hop(-t, i_at, n)
self.model_b.set_hop(-t, i_at, n)

def override_hoppings(self, custom_t_list=[]):
""" Override tight binding hoppings:
custom_t_list - list of (atom index 1, atom index 2, new_hop)
Note: adding the hopping in one direction automatically adds the other as well
"""
for custom_t in custom_t_list:
if len(custom_t) != 3:
print("Error: please specify (atom index 1, atom index 2, hopping)")
return
i1, i2, t = custom_t
self.model_a.set_hop(-t, i1, i2, mode='reset')
self.model_b.set_hop(-t, i1, i2, mode='reset')

def visualize_tb_model(self):
self.model_a.visualize(0, 1)
plt.show()
Expand Down

0 comments on commit d672ca4

Please sign in to comment.