Dear Amrita, If you want to plot a given propagating mode, you just need to calculate your wave function and then choose your mode as follows: calculate the wave function wf=kwant.wave_function(sys, energy) choose the modes coming from a given lead (lead 0 for example): wf_0=wf(0) and then choose for example the mode number 5: my_mode=wf_0[5] you can plot it as follows: kwant.plotter.map(sys,my_mode) I hope this helps. Adel, On Tue, Mar 13, 2018 at 11:07 PM, amrita chapagain < amritachapagain@gmail.com> wrote:
Hi all,
Thank you for addressing my previous query.
I am trying to plot first few incoming transverse waveguide modes on lead 0. I am wondering whether it is possible to plot all incoming modes on Lead 0. kwant.physics.modes gives me PropagatingModes and Stabilized modes but I want to select just first few modes of incoming flux. Here is the sample code of my system
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) #----------------------------------------------------------------------
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(wv_shape,(0,0))] = E0 # To make all sites the same sys0[lat.neighbors()] = t #--------------------------------------------------------------------------------------------
# Left lead ---------------------------------------------------------------------------------- left_lead = kwant.Builder(kwant.TranslationalSymmetry([-1,0])) left_lead[(lat(0,y) for y in range(int(-W1/2+1),int(W1/2)))] = E0L left_lead[lat.neighbors()] = t sys0.attach_lead(left_lead); #-------------------------------------------------------------------------------------------- # Right lead --------------------------------------------------------------------------------- right_lead = kwant.Builder(kwant.TranslationalSymmetry([1,0])) right_lead[(lat(0,y) for y in range(int(-W1/2+1),int(W1/2)))] = E0L right_lead[lat.neighbors()] = t sys0.attach_lead(right_lead); #--------------------------------------------------------------------------------------------- sys = sys0.finalized() kwant.plot(sys);
def plot_conductance(sys, energies):
data = [] for energy in energies: smatrix = kwant.smatrix(sys, energy) data.append(smatrix.transmission(2, 0)+smatrix.transmission(1,2) ) #transmission from left 2 leads to right lead
pyplot.figure() pyplot.plot(energies, data) pyplot.xlabel("energy [t]") pyplot.ylabel("conductance [e^2/h]") pyplot.show() energies=[-3+i*0.02 for i in range(100)] plot_conductance(sys,energies)
-- Abbout Adel