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

[feature] add the support of NRL-TB #22

Merged
merged 66 commits into from
Oct 17, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
66 commits
Select commit Hold shift + click to select a range
b014ad8
update hBN example
QG-phy Jul 27, 2023
24f2571
add the xdat.traj in hbn sparse data.
QG-phy Jul 27, 2023
c98df3e
Merge branch 'main' of https://github.com/deepmodeling/DeePTB into nr…
QG-phy Jul 27, 2023
4bcae75
doc: change and add some comments
QG-phy Jul 27, 2023
c71b5ea
refactor(onsite energy): make the onsite energy more general.
QG-phy Aug 8, 2023
38adf03
refactor(onsiteE, init model the onsite_neurons): add nout in the ons…
QG-phy Aug 8, 2023
1d08f50
test: update test_sknet.py
QG-phy Aug 8, 2023
dbdca27
[refactor] remove the onsite_db from outside. will generate it insite…
QG-phy Aug 9, 2023
0d4699d
refactor(onsiteEs): add NRL TB onsite Energy formula.
QG-phy Aug 9, 2023
dd13725
add support overlap in hamiltonian eig_sk_crt
QG-phy Aug 22, 2023
c26e305
add support overlap nrl in train and api
QG-phy Aug 22, 2023
7015494
add support NRL with overlap in formula
QG-phy Aug 22, 2023
79d3025
modify integralFunc add new input para overlap to indicate use overlap
QG-phy Aug 22, 2023
1390237
add NRL_skint_type_constants, to use atom and orbital dependent delta
QG-phy Aug 22, 2023
996fd8a
update sknet to support overlap
QG-phy Aug 22, 2023
de4eec8
update init dptb and nnsk to accept overlap for NRL mode
QG-phy Aug 22, 2023
9963c44
add duming json checkpoint for NRL mode. in plugin.py
QG-phy Aug 22, 2023
7b9a683
add new paras for overlap in argcheck
QG-phy Aug 22, 2023
d5dc58f
move overlap tag into common options.
QG-phy Aug 22, 2023
da9e9ba
add self.overlap in apihost
QG-phy Aug 22, 2023
d41d3c6
update tester for dptb and nnsk for overlap nrl cases.
QG-phy Aug 22, 2023
abec4c7
add self.overlap in train dptb and nnnsk
QG-phy Aug 22, 2023
5e55fbc
obtain overlap info from common options. previous from skfuncion opti…
QG-phy Aug 22, 2023
dba9d4a
delete else raise NotImplementedError for onsite mode. since the none…
QG-phy Aug 22, 2023
2f91b75
update test_sknet. since now hopping retures two terms, coefff and o…
QG-phy Aug 22, 2023
72e3d39
fix the bug for NN2HRK when use_orthogonal_basis
QG-phy Sep 14, 2023
e52fc2f
fix bugs for init with json model to use dptb run
QG-phy Sep 14, 2023
5e38b7b
add example silicon case of NRL TB
QG-phy Sep 14, 2023
7e62fe8
Merge branch 'deepmodeling:main' into nrl_qg
QG-phy Sep 14, 2023
e821415
Merge branch 'deepmodeling:main' into nrl_qg
QG-phy Sep 26, 2023
00d8f87
update test_processor: add test_getenv test_getbond
QG-phy Oct 6, 2023
268581f
update docstrings in processor.
QG-phy Oct 6, 2023
d300a24
add one coments in structure.py for get env smoth
QG-phy Oct 6, 2023
c10256f
update test: add test for test_next test_get_onsitenv
QG-phy Oct 6, 2023
ac75502
update hamil_eig_sk_crt.py: add comments about the onsite overlap matrix
QG-phy Oct 7, 2023
ffca168
update hamil_eig_sk_crt.py add log.info for onsiteS not None.
QG-phy Oct 7, 2023
d94443b
[test] copy test_hamil_eig_sk to test_hamil_eig_sk_skfiles, and add …
QG-phy Oct 7, 2023
2adc019
test: update test_hamil_eig_sk_crt.py
QG-phy Oct 7, 2023
07d8062
test: update test_hamil_eig_sk_crt.py
QG-phy Oct 7, 2023
edab7f8
example: updata NRL-TB example.
QG-phy Oct 7, 2023
5178f20
update apihost.py for json model read config
QG-phy Oct 7, 2023
e99d9f6
test: update test_apihost.py for nrl model
QG-phy Oct 7, 2023
7362661
test: update test_apihost.py
QG-phy Oct 7, 2023
b0c9ac7
test: create test_NN2HRK.py for non and nrl
QG-phy Oct 7, 2023
e400dbe
[fix] fix initinit_dptb.py
QG-phy Oct 8, 2023
8a6b4eb
🧪 test(test_all ): add test for train/tester_nnsk and dptb for NRL model
QG-phy Oct 8, 2023
3dfee9b
🧪 test(teat_apihost): add test for postrun of NRL TB
QG-phy Oct 8, 2023
b0b89f8
🧪 test: update test_skParam.py
QG-phy Oct 8, 2023
e03b014
🦄 refactor: update make_kpoints.py
QG-phy Oct 8, 2023
df86a35
update formula.py and test_skformula.py
QG-phy Oct 8, 2023
2b2c513
test: create test_onsite_formula.py
QG-phy Oct 9, 2023
5322713
test: update test_index_map.py add test strain mapping
QG-phy Oct 9, 2023
9df4896
test: update test_index_map.py add test_onsite_nrl_mappings
QG-phy Oct 9, 2023
84b9d5c
test: update test_index_map.py
QG-phy Oct 9, 2023
d0be5b6
test: update test_sknet.py add update test hopping onsite and soc for…
QG-phy Oct 9, 2023
0506cd6
test: update test_sknet.py
QG-phy Oct 10, 2023
01d3e84
update sknet.py and test_sknet.py add test for NRL mode in sknet
QG-phy Oct 10, 2023
b25076e
test: update test_skintTypes.py
QG-phy Oct 10, 2023
e5ab1d7
update NN2HRK.py sorted_onsite sorted_bond sorted_env input in defin…
QG-phy Oct 10, 2023
42b0e13
add test_integralFunc.py for varTang96 and powerlaw mode
QG-phy Oct 10, 2023
06d3e9f
update example/hbn/run/plotband.ipynb
QG-phy Oct 10, 2023
4e8b952
test: update test_integralFunc.py add test for NRL TB
QG-phy Oct 10, 2023
759e83f
test: update test_onsiteFunc.py add test onsite mode uniform and none
QG-phy Oct 11, 2023
8d733a8
test: update test_integralFunc.py add test for onsite for strain mode
QG-phy Oct 11, 2023
e2fd0d4
test: update test_onsiteFunc.py add test nrl
QG-phy Oct 11, 2023
a5956ed
update log.info in hamil_eig_sk_crt.py
QG-phy Oct 17, 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
34 changes: 29 additions & 5 deletions dptb/dataprocess/processor.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
from dptb.structure.abstract_stracture import AbstractStructure

class Processor(object):
# TODO: 现在strain的env 是通过get_env 获得,但是在dptb中的env是有另外的含义。是否已经考虑。
def __init__(self, structure_list: List[AbstractStructure], kpoint, eigen_list, batchsize: int, wannier_list = None, env_cutoff: float = 3.0, onsitemode=None,
onsite_cutoff=None, sorted_bond=None, sorted_onsite=None, sorted_env=None, bandinfo=None, device='cpu', dtype=torch.float32, if_shuffle=True):
super(Processor, self).__init__()
Expand Down Expand Up @@ -69,10 +68,19 @@ def shuffle(self):
self.__struct_unsampled__ = self.__struct_unsampled__[self.batchsize:]

def get_env(self, cutoff=None, sorted=None):
# TODO: the sorted mode should be explained here, in which case, we should use.
'''It takes the environment of each structure in the workspace and concatenates them into one big
environment

Parameters
----------
cutoff float : the cutoff radius for the onsite environment.
sorted str : the sorted mode for the onsite environment.
None: not sorted, return torch tensors.
'st': sorted by structure, return a dictionary of tensors. eg. {0: tensor, 1: tensor, ...}
'itype-jtype': sorted by itype and jtype, return a dictionary of tensors. eg. {'C-B': tensor, ...}

for env sorted="st".

Returns
-------
A dictionary of the environment for ent type for all the strucutes in the works sapce.
Expand Down Expand Up @@ -125,10 +133,18 @@ def get_env(self, cutoff=None, sorted=None):
return batch_env # {env_type: (f, itype, i, jtype, j, jtype, Rx, Ry, Rz, s(r), rx, ry, rz)} or [(f, itype, i, jtype, j, jtype, Rx, Ry, Rz, s(r), rx, ry, rz)]

def get_onsitenv(self, cutoff=None, sorted=None):
# TODO: the sorted mode should be explained here, in which case, we should use.
'''It takes the environment of each structure in the workspace and concatenates them into one big
environment

Parameters
----------
cutoff float : the cutoff radius for the onsite environment.
sorted str : the sorted mode for the onsite environment.
None: not sorted, return torch tensors.
'st': sorted by structure, return a dictionary of tensors. eg. {0: tensor, 1: tensor, ...}
'itype-jtype': sorted by itype and jtype, return a dictionary of tensors. eg. {'C-B': tensor, ...}

for onsiteenv sorted_env="itype-jtype".
Returns
-------
A dictionary of the environment for ent type for all the strucutes in the works sapce.
Expand All @@ -141,7 +157,7 @@ def get_onsitenv(self, cutoff=None, sorted=None):
if cutoff is None:
cutoff = self.onsite_cutoff
else:
assert isinstance(cutoff, float)
assert isinstance(cutoff, float), "The cutoff should be a float number."

if sorted is None:
batch_env = []
Expand Down Expand Up @@ -183,6 +199,14 @@ def get_onsitenv(self, cutoff=None, sorted=None):
def get_bond(self, sorted=None):
'''It takes the bonds of each structure in the workspace and concatenates them into one big dictionary.

Parameters
----------
sorted str : the sorted mode for the onsite environment.
None: not sorted, return torch tensors.
'st': sorted by structure, return a dictionary of tensors. eg. {0: tensor, 1: tensor, ...}

For bond sorted="st".

Returns
-------
A Tensor of the bonds lists for bond type for all the strucutes in the works space.
Expand Down Expand Up @@ -267,7 +291,7 @@ def __next__(self):
self.shuffle()
bond, bond_onsite = self.get_bond(self.sorted_bond)

if not self.onsitemode == 'strain':
if not self.onsitemode in ['strain','NRL']: # for NRL - TB we also need the onsite env.
data = (bond, bond_onsite, self.get_env(sorted=self.sorted_env), None, self.__struct_workspace__,
self.kpoint, self.eigen_list[self.__struct_idx_workspace__].astype(float), self.wannier_list[self.__struct_idx_workspace__])
else:
Expand Down
14 changes: 11 additions & 3 deletions dptb/hamiltonian/hamil_eig_sk_crt.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,10 @@ def update_hs_list(self, struct, hoppings, onsiteEs, onsiteVs=None, overlaps=Non
self.onsiteSs = onsiteSs
self.use_orthogonal_basis = False

if onsiteSs is not None:
log.info(msg='The onsiteSs is not None, But even for non-orthogonal basis, the onsite S matrix part is still identity.')
log.info(msg='Therefore the onsiteSs will not be used !!')

if soc_lambdas is None:
self.soc = False
else:
Expand Down Expand Up @@ -149,7 +153,10 @@ def get_hs_onsite(self, bonds_onsite = None, onsite_envs=None):

sub_hamil_block = th.zeros([self.__struct__.proj_atomtype_norbs[iatype], self.__struct__.proj_atomtype_norbs[jatype]], dtype=self.dtype, device=self.device)
if not self.use_orthogonal_basis:
sub_over_block = th.zeros([self.__struct__.proj_atomtype_norbs[iatype], self.__struct__.proj_atomtype_norbs[jatype]], dtype=self.dtype, device=self.device)
# For non - orthogonal basis, the overlap matrix is needed.
# but for the onsite, the overlap matrix is identity.
sub_over_block = th.eye(self.__struct__.proj_atomtype_norbs[iatype], dtype=self.dtype, device=self.device)


ist = 0
for ish in self.__struct__.proj_atom_anglr_m[iatype]: # ['s','p',..]
Expand All @@ -159,8 +166,9 @@ def get_hs_onsite(self, bonds_onsite = None, onsite_envs=None):

indx = self.__struct__.onsite_index_map[iatype][ish] # change onsite index map from {N:{s:}} to {N:{ss:, sp:}}
sub_hamil_block[ist:ist+norbi, ist:ist+norbi] = th.eye(norbi, dtype=self.dtype, device=self.device) * self.onsiteEs[ib][indx]
if not self.use_orthogonal_basis:
sub_over_block[ist:ist+norbi, ist:ist+norbi] = th.eye(norbi, dtype=self.dtype, device=self.device) * self.onsiteSs[ib][indx]
# For non - orthogonal basis, the onsite overlap is identity, we don't need to calculate it.
#if not self.use_orthogonal_basis:
# sub_over_block[ist:ist+norbi, ist:ist+norbi] = th.eye(norbi, dtype=self.dtype, device=self.device) * self.onsiteSs[ib][indx]
ist = ist + norbi

onsiteH_blocks.append(sub_hamil_block)
Expand Down
62 changes: 47 additions & 15 deletions dptb/nnops/NN2HRK.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,33 +86,47 @@ def _get_nnsk_HR(self):
assert self.structure.onsitemode == self.apihost.model_config['onsitemode']
# TODO: 注意检查 processor 关于 env_cutoff 和 onsite_cutoff.
predict_process = Processor(structure_list=self.structure, batchsize=1, kpoint=None, eigen_list=None, device=self.device, dtype=self.dtype,
env_cutoff=self.apihost.model_config['env_cutoff'], onsitemode=self.apihost.model_config['onsitemode'], onsite_cutoff=self.apihost.model_config['onsite_cutoff'], sorted_onsite="st", sorted_bond="st", sorted_env="st")
env_cutoff=self.apihost.model_config['env_cutoff'], onsitemode=self.apihost.model_config['onsitemode'], onsite_cutoff=self.apihost.model_config['onsite_cutoff'], sorted_onsite=self.sorted_onsite, sorted_bond=self.sorted_bond, sorted_env=self.sorted_env)

batch_bonds, batch_bond_onsites = predict_process.get_bond(sorted=self.sorted_bond)
coeffdict = self.apihost.model(mode='hopping')
coeffdict, overlap_coeffdict = self.apihost.model(mode='hopping')
batch_hoppings = self.apihost.hops_fun.get_skhops(batch_bonds=batch_bonds, coeff_paras=coeffdict, rcut=self.apihost.model_config['skfunction']['sk_cutoff'], w=self.apihost.model_config['skfunction']['sk_decay_w'])
nn_onsiteE, onsite_coeffdict = self.apihost.model(mode='onsite')
batch_onsiteEs = self.apihost.onsite_fun(batch_bonds_onsite=batch_bond_onsites, onsite_db=self.apihost.onsite_db, nn_onsiteE=nn_onsiteE)
if self.apihost.overlap:
assert overlap_coeffdict is not None, "The overlap_coeffdict should be provided if overlap is True."
batch_overlaps = self.apihost.overlap_fun.get_skoverlaps(batch_bonds=batch_bonds, coeff_paras=overlap_coeffdict, rcut=self.apihost.model_config['skfunction']['sk_cutoff'], w=self.apihost.model_config['skfunction']['sk_decay_w'])


if self.apihost.model_config['onsitemode'] in ['strain','NRL']:
batch_onsite_envs = predict_process.get_onsitenv(cutoff=self.apihost.model_config['onsite_cutoff'], sorted=self.sorted_onsite)
else:
batch_onsite_envs = None

batch_onsiteEs = self.apihost.onsite_fun.get_onsiteEs(batch_bonds_onsite=batch_bond_onsites, onsite_env=batch_onsite_envs, nn_onsite_paras=nn_onsiteE)

if self.apihost.model_config['soc']:
nn_soc_lambdas, _ = self.apihost.model(mode='soc')
batch_soc_lambdas = self.apihost.soc_fun(batch_bonds_onsite=batch_bond_onsites, soc_db=self.apihost.soc_db, nn_soc=nn_soc_lambdas)

if self.apihost.model_config['onsitemode'] == 'strain':
batch_onsite_envs = predict_process.get_onsitenv(cutoff=self.apihost.model_config['onsite_cutoff'], sorted=self.sorted_onsite)
batch_onsiteVs = self.apihost.onsitestrain_fun.get_skhops(batch_bonds=batch_onsite_envs, coeff_paras=onsite_coeffdict)
onsiteEs, hoppings, onsiteVs = batch_onsiteEs[0], batch_hoppings[0], batch_onsiteVs[0]
onsitenvs = batch_onsite_envs[0][:,1:]
else:
onsiteEs, hoppings, onsiteVs = batch_onsiteEs[0], batch_hoppings[0], None
onsitenvs = None

if self.apihost.overlap:
overlaps = batch_overlaps[0]
else:
overlaps = None

if self.apihost.model_config["soc"]:
soc_lambdas = batch_soc_lambdas[0]
else:
soc_lambdas = None

self.hamileig.update_hs_list(struct=self.structure, hoppings=hoppings, onsiteEs=onsiteEs, onsiteVs=onsiteVs, soc_lambdas=soc_lambdas)
self.hamileig.update_hs_list(struct=self.structure, hoppings=hoppings, onsiteEs=onsiteEs, onsiteVs=onsiteVs, overlaps=overlaps, soc_lambdas=soc_lambdas)
self.hamileig.get_hs_blocks(bonds_onsite=batch_bond_onsites[0][:,1:], bonds_hoppings=batch_bonds[0][:,1:],
onsite_envs=onsitenvs)

Expand All @@ -122,37 +136,54 @@ def _get_nnsk_HR(self):
self.use_orthogonal_basis = self.hamileig.use_orthogonal_basis
self.allbonds, self.hamil_blocks = self.hamileig.all_bonds, self.hamileig.hamil_blocks

if not self.hamileig.use_orthogonal_basis:
if self.hamileig.use_orthogonal_basis:
self.overlap_blocks = None
else:
self.overlap_blocks = self.hamileig.overlap_blocks

def _get_dptb_HR(self):
predict_process = Processor(structure_list=self.structure, batchsize=1, kpoint=None, eigen_list=None, device=self.device, dtype=self.dtype,
env_cutoff=self.apihost.model_config['env_cutoff'], onsitemode=self.apihost.model_config['onsitemode'], onsite_cutoff=self.apihost.model_config['onsite_cutoff'], sorted_onsite="st", sorted_bond="st", sorted_env="st")
env_cutoff=self.apihost.model_config['env_cutoff'], onsitemode=self.apihost.model_config['onsitemode'], onsite_cutoff=self.apihost.model_config['onsite_cutoff'], sorted_onsite=self.sorted_onsite, sorted_bond=self.sorted_bond, sorted_env=self.sorted_env)

batch_bonds, batch_bond_onsites = predict_process.get_bond(sorted=self.sorted_bond)
batch_env = predict_process.get_env(cutoff=self.apihost.model_config['env_cutoff'], sorted=self.sorted_env)
batch_bond_hoppings, batch_hoppings, batch_bond_onsites, batch_onsiteEs, batch_soc_lambdas = self.apihost.nntb.calc(batch_bonds, batch_env)

if self.apihost.model_config['use_correction']:
coeffdict = self.apihost.sknet(mode='hopping')
coeffdict, overlap_coeffdict = self.apihost.sknet(mode='hopping')
batch_nnsk_hoppings = self.apihost.hops_fun.get_skhops( batch_bond_hoppings, coeffdict,
rcut=self.apihost.model_config["skfunction"]["sk_cutoff"], w=self.apihost.model_config["skfunction"]["sk_decay_w"])
nnsk_onsiteE, onsite_coeffdict = self.apihost.sknet(mode='onsite')
batch_nnsk_onsiteEs = self.apihost.onsite_fun(batch_bonds_onsite=batch_bond_onsites, onsite_db=self.apihost.onsite_db, nn_onsiteE=nnsk_onsiteE)

if self.apihost.overlap:
assert overlap_coeffdict is not None, "The overlap_coeffdict should be provided if overlap is True."
batch_nnsk_overlaps = self.apihost.overlap_fun.get_skoverlaps(batch_bonds=batch_bonds, coeff_paras=overlap_coeffdict,
rcut=self.apihost.model_config['skfunction']['sk_cutoff'], w=self.apihost.model_config['skfunction']['sk_decay_w'])



if self.apihost.model_config['onsitemode'] in ['strain','NRL']:
batch_onsite_envs = predict_process.get_onsitenv(cutoff=self.apihost.model_config['onsite_cutoff'], sorted=self.sorted_onsite)
else:
batch_onsite_envs = None

batch_nnsk_onsiteEs = self.apihost.onsite_fun.get_onsiteEs(batch_bonds_onsite=batch_bond_onsites, onsite_env=batch_onsite_envs, nn_onsite_paras=nnsk_onsiteE)

if self.apihost.model_config["soc"]:
nnsk_soc_lambdas, _ = self.apihost.sknet(mode="soc")
batch_nnsk_soc_lambdas = self.apihost.soc_fun(batch_bonds_onsite=batch_bond_onsites, soc_db=self.apihost.soc_db, nn_soc=nnsk_soc_lambdas)

if self.apihost.model_config['onsitemode'] == "strain":
batch_onsite_envs = predict_process.get_onsitenv(cutoff=self.apihost.model_config['onsite_cutoff'], sorted=self.sorted_onsite)
batch_nnsk_onsiteVs = self.apihost.onsitestrain_fun.get_skhops(batch_bonds=batch_onsite_envs, coeff_paras=onsite_coeffdict)
onsiteVs = batch_nnsk_onsiteVs[0]
onsitenvs = batch_onsite_envs[0][:,1:]
else:
onsiteVs = None
onsitenvs = None
if self.apihost.overlap:
nnsk_overlaps = batch_nnsk_overlaps[0]
else:
nnsk_overlaps = None

if self.apihost.model_config["soc"] and self.apihost.model_config["dptb"]["soc_env"]:
nn_soc_lambdas = batch_soc_lambdas[0]
Expand All @@ -165,14 +196,15 @@ def _get_dptb_HR(self):
sk_soc_lambdas = None


onsiteEs, hoppings, _, _, soc_lambdas = nnsk_correction(nn_onsiteEs=batch_onsiteEs[0], nn_hoppings=batch_hoppings[0],
onsiteEs, hoppings, onsiteSs, overlaps, soc_lambdas = nnsk_correction(nn_onsiteEs=batch_onsiteEs[0], nn_hoppings=batch_hoppings[0],
sk_onsiteEs=batch_nnsk_onsiteEs[0], sk_hoppings=batch_nnsk_hoppings[0],
sk_onsiteSs=None, sk_overlaps=None, nn_soc_lambdas=nn_soc_lambdas, sk_soc_lambdas=sk_soc_lambdas)
sk_onsiteSs=None, sk_overlaps=nnsk_overlaps, nn_soc_lambdas=nn_soc_lambdas, sk_soc_lambdas=sk_soc_lambdas)
else:
onsiteEs, hoppings, soc_lambdas, onsiteVs, onsitenvs = batch_onsiteEs[0], batch_hoppings[0], None, None, None
assert not self.apihost.overlap, "The overlap should be False if use_correction is False."
onsiteEs, hoppings, soc_lambdas, onsiteVs, onsitenvs, onsiteSs, overlaps = batch_onsiteEs[0], batch_hoppings[0], None, None, None, None, None


self.hamileig.update_hs_list(struct=self.structure, hoppings=hoppings, onsiteEs=onsiteEs, onsiteVs=onsiteVs, soc_lambdas=soc_lambdas)
self.hamileig.update_hs_list(struct=self.structure, hoppings=hoppings, onsiteEs=onsiteEs, onsiteVs=onsiteVs,overlaps=overlaps, soc_lambdas=soc_lambdas)
self.hamileig.get_hs_blocks(bonds_onsite=batch_bond_onsites[0][:,1:], bonds_hoppings=batch_bond_hoppings[0][:,1:],
onsite_envs=onsitenvs)

Expand All @@ -182,7 +214,7 @@ def _get_dptb_HR(self):
self.use_orthogonal_basis = self.hamileig.use_orthogonal_basis
self.allbonds, self.hamil_blocks = self.hamileig.all_bonds, self.hamileig.hamil_blocks

if not self.hamileig.use_orthogonal_basis:
if self.hamileig.use_orthogonal_basis:
self.overlap_blocks = None
else:
self.overlap_blocks = self.hamileig.overlap_blocks
Loading