Hi Amrita,

Yes, as I explained before, you can choose any mode you want.
mode_i=kwant.wave_function(sys, energy)(0)[i]
https://kwant-project.org/doc/1/tutorial/faq

I hope this helps.

On Wed, Mar 14, 2018 at 10:47 PM, amrita chapagain wrote:
Thank you for helping on previous issue. I have another curiosity here. Right now all incoming flux on lead 0 is all modes from 1 to N. The incoming flux corresponds to summation from 1 to N (i.e  ), I just want first 3 modes only.

I have attached a picture here what I want to do it. Can I achieve such condition in kwant from finding wavefunction from kwant solver?

​Here I have attached a code to find wavefunction.

import kwant
import numpy as np
from matplotlib import pyplot
from numpy import sqrt
from math import *

#======================================================================
# Define the shape -------------------
#======================================================================
def shape(pos):
x, y = pos
return (np.abs(2.0*x)<=L)&(np.abs(y)<W1/2.0)
#----------------------------------------------------------------------

#======================================================================
def wshape(pos):
x, y = pos
return (np.abs(2.0*x)<=L)&(np.abs(y)<W1/2.0)
#----------------------------------------------------------------------

a      = 1;
t      = 1;
E0L    = 0*t
L      = 10;  # Length of the
W1   = 30;  # Width on the left

# Define geometry
#--------------------------------------------------------------------------
sys0 = kwant.Builder()
lat  = kwant.lattice.square(a)
#--------------------------------------------------------------------------------------------
# Define onsite energies and couplings
#----------------------------------------------------
sys0[lat.shape(wshape,(0,0))] = E0     # To make all sites the same
sys0[lat.neighbors()]           = t
#--------------------------------------------------------------------------------------------

#----------------------------------------------------------------------------------
left_lead[(lat(0,y) for y in range(int(-W1/2+1),int(W1/2)))] = E0L
#--------------------------------------------------------------------------------------------
#---------------------------------------------------------------------------------
right_lead[(lat(0,y) for y in range(int(-W1/2+1),int(W1/2)))] = E0L
#---------------------------------------------------------------------------------------------
sys = sys0.finalized()
kwant.plot(sys);
wf = kwant.solvers.default.wave_function(sys,E,check_hermiticity=False); wf0 = wf(0); wf1 = wf(1);

def plot_conductance(sys, energies):

data = []
for energy in energies:
smatrix = kwant.smatrix(sys, energy)
data.append(smatrix.transmission(1, 0))