Dear Vargan,
Yes, you can do that if you use the scipy function scipy.sparse.linalg.eigsh.
You can choose the number of the returned eigenvalues and near which energy will they be picked up.
For this purpose, you have to rebuild the function giving the bands as done in the source code.
Here is an example, without all the warnings and checking done usually in the kwant source code.
I hope this helps,
Adel
##############################
import math
import scipy
params=dict(phi=0) #your parameters
sysf=make_system().finalized() # Finalized system
syst = sysf.leads[0] # The lead of the system
# Equation to solve is
# (V^\dagger e^{ik} + H + V e^{-ik}) \psi = E \psi
ham = syst.cell_hamiltonian(params=params)
hop0 = syst.inter_cell_hopping( params=params)
hop = np.empty(ham.shape, dtype=complex)
hop[:, : hop.shape[1]] = hop
hop[:, hop.shape[1]:] = 0
#The hamiltonian to diagonalize for a given momentum k
def Hamlitonian(k):
mat = hop * complex(math.cos(k), -math.sin(k))
h0 = mat + mat.conjugate().transpose() + ham
return h0
#example for k=0.3
HAM=Hamlitonian(0.3)
#be careful, in the following, k is the number of returned eigenvalues
Vals=scipy.sparse.linalg.eigsh(R,k=4,return_eigenvectors=False)