Skip to content
Snippets Groups Projects
Commit 5c0dbc3a authored by Kostas Vilkelis's avatar Kostas Vilkelis :flamingo:
Browse files

make func_hop optional

parent 7b56e481
No related branches found
No related tags found
1 merge request!8Builder fixes
Pipeline #181727 passed
This commit is part of merge request !8. Comments created here will be created in the context of that merge request.
from itertools import product
from typing import Callable
from typing import Callable, Optional
import inspect
import numpy as np
......@@ -172,7 +172,7 @@ def build_interacting_syst(
builder: kwant.builder.Builder,
lattice: kwant.lattice.Polyatomic,
func_onsite: Callable,
func_hop: Callable,
func_hop: Optional[Callable] = None,
max_neighbor: int = 1,
) -> kwant.builder.Builder:
"""
......@@ -201,6 +201,7 @@ def build_interacting_syst(
kwant.lattice.TranslationalSymmetry(*builder.symmetry.periods)
)
int_builder[builder.sites()] = func_onsite
for neighbors in range(max_neighbor):
int_builder[lattice.neighbors(neighbors + 1)] = func_hop
if func_hop is not None:
for neighbors in range(max_neighbor):
int_builder[lattice.neighbors(neighbors + 1)] = func_hop
return int_builder
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment