Hello Kwant Community,

I created a 3D nanowire grown along x direction with leads attached in the x 
direction  and want to plot the current density profile through a cut at a x = 
const plane.
I think this Problem was never really solved in the public community 
communication channels, and personally I think this is quiet useful, because 
people might want to show surface currents of TI's etc. 

I created a minimal example displaying two methods to calculate and display the 
current density through a plane x = const: 
see my jupyter notebook on GitHub:
https://github.com/Quaki96/KwantQuestion_2D-current-density-profile-through-3D-nanowire-cut/blob/4dde2854731c3f787c294779b9d13907002acba5/current_density_minimal_example.ipynb

There at "# current density through x=const plane  METHOD 1":
I build a 2D slice of the 3D nanowire and use  kwant.operator.Current(fsyst, 
where=cut) and specifying for which hoppings in should calculate the current 
density: 
def cut(site0,site1):    
        return site0.pos[0]==x_cut  and site1.pos[0]==x_cut+1  # calculating 
current just for this x hopping 

This yields a current density profil with only non negativ current densities 
even if I have no magnetic field, hence this somehow breaks time reversal 
symmetry. 
If I instead define 
def cut2(site0,site1):    
        return site0.pos[0]==x_cut+1  and site1.pos[0]==x_cut # calculating 
current just for this x hopping 
I get the same picture except that the sign changed completely. 


"# current density through plane x = const METHOD 2
Here I use  kwant.operator.Current(fsyst), and calculate the current density 
over all hoppings of the system. Then I use 
kwant.plotter.interpolate_current(fsyst, current_density) to interpolate
the current density vectorfield which returns it as field, box.
In a simple inefficient for loop I then create an array of y_vals and z_vals 
and their corresponding current density z (2) component values = 
values.append(field[x_cut,ny,nz,2]) at x = x_cut.

This yields a current density profile which  seems to respect time reversal 
symmetry (vanishes when B = 0) is non zero when B != 0 but because no bias is 
applied integration over the plain yields zero
total current. 
I think this might be a correct implementation. But I am really not sure 
because I don't know what I might did wrong in the first implementation.

Happy Kwanting

Felix

Reply via email to