Hi Anton, Thank you for the reply! I used your suggestion to attach two 1D leads along the z axis to a chiral 1D chain.
I inserted my code in the following and added comments to each part. I have two questions: 1- I successfully add a 1D chain to the lower part of the chiral system but when I try to add a 1D chain as the upper lead to the top of the system, it is automatically added somewhere in the middle, which is not clear to me why. 2- How can I avoid zero conductance? Thanks in advance Patrik ---------------------------------------------------------- import matplotlib.pyplot as plt from mpl_toolkits.mplot3d import Axes3D from scipy.spatial import * from matplotlib import rcParams from numpy import * from numpy.linalg import * import pickle import sys import os import string import heapq import kwant import tinyarray pb.pltutils.use_style() cl_1dl3=True if cl_1dl3: a = 0.34 t = 1.0 N = 31 class Amorphous(kwant.builder.SimpleSiteFamily): def normalize_tag(self, tag): return tinyarray.array(tag, float) def pos(self, tag): return tag atoms = Amorphous() syst = kwant.Builder() #coordinates of a chiral chain imported manually sites=atoms(0.0, 0.0, 0.0), atoms(-0.1336881039, 0.4114496766, 0.3400000000), atoms(-0.4836881039, 0.6657395614, 0.6800000000), atoms(-0.9163118961, 0.6657395614, 1.0200000000), atoms(-1.2663118961, 0.4114496766, 1.3600000000), atoms(-1.4000000000, 0.0000000000, 1.7000000000), atoms(-1.2663118961, -0.4114496766, 2.0400000000), atoms(-0.9163118961, -0.6657395614, 2.3800000000), atoms(-0.4836881039, -0.6657395614, 2.7200000000), atoms(-0.1336881039, -0.4114496766, 3.0600000000), atoms(0.0000000000, -0.0000000000, 3.4000000000), atoms(-0.1336881039, 0.4114496766, 3.7400000000), atoms(-0.4836881039, 0.6657395614, 4.0800000000), atoms(-0.9163118961, 0.6657395614, 4.4200000000), atoms(-1.2663118961, 0.4114496766, 4.7600000000), atoms(-1.4000000000, 0.0000000000, 5.1000000000), atoms(-1.2663118961, -0.4114496766, 5.4400000000), atoms(-0.9163118961, -0.6657395614, 5.7800000000), atoms(-0.4836881039, -0.6657395614, 6.1200000000), atoms(-0.1336881039, -0.4114496766, 6.4600000000), atoms(0.0000000000, -0.0000000000, 6.8000000000), atoms(-0.1336881039, 0.4114496766, 7.1400000000), atoms(-0.4836881039, 0.6657395614, 7.4800000000), atoms(-0.9163118961, 0.6657395614, 7.8200000000), atoms(-1.2663118961, 0.4114496766, 8.1600000000), atoms(-1.4000000000, 0.0000000000, 8.5000000000), atoms(-1.2663118961, -0.4114496766, 8.8400000000), atoms(-0.9163118961, -0.6657395614, 9.1800000000), atoms(-0.4836881039, -0.6657395614, 9.5200000000), atoms(-0.1336881039, -0.4114496766, 9.8600000000), atoms(0.0, 0.0, 10.2) #adding the onsite and hopping to the system for i in range(N): syst[sites[i]] = 4 * t if i > 0: syst[sites[i], sites[i-1]] = -t syst[sites[N-1], sites[0]] = -t kwant.plot(syst) # If we want to attach to vertical 1D chains to the system # we first add a slice of the down lead to the scattering region lat=kwant.lattice.cubic(a) for i in range(2): #number of atoms added to the bottom of the chiral chain syst[lat(0, 0, -(i+1)*a)] = 4 * t syst[lat.neighbors()] = -t # now we add the hopping to the chiral chain syst[sites[0], lat(0, 0, -a)] = -t kwant.plot(syst) # fWe make a regular down lead and attach it to the system dn_lead = kwant.Builder(kwant.TranslationalSymmetry((0, 0, -a))) for i in range(2): dn_lead[lat(0, 0, -(i+1)*a)] = 4 * t dn_lead[lat.neighbors()] = -t syst.attach_lead(dn_lead) kwant.plot(syst) #Here is wwhere the problem arises!!! #I want to add a similar 1D chain to the top of the chiral system #but instead it is automatically added somewhere in the middle. for i in range(N, N+2): #number of atoms added to the top syst[lat(0, 0, i*a)] = 4 * t syst[lat.neighbors()] = -t # now we add the hopping to the systeml syst[lat(0, 0, N*a), sites[N-1]] = -t kwant.plot(syst) # finally we make a regular lead and attach it to the top up_lead = kwant.Builder(kwant.TranslationalSymmetry((0, 0, a))) for i in range(N, N+2): up_lead[lat(0, 0, i*a)] = 4 * t up_lead[lat.neighbors()] = -t syst.attach_lead(up_lead) kwant.plot(syst) trans=True if trans: syst = syst.finalized() energies = [] data = [] for ie in range(0,100): energy = ie * 0.01 smatrix = kwant.smatrix(syst, energy) energies.append(energy) data.append(smatrix.transmission(1, 0)) pyplot.figure() pyplot.plot(energies, data) pyplot.xlabel("energy [t]") pyplot.ylabel("conductance [e^2/h]") pyplot.show() On 6 July 2017 at 18:13, Anton Akhmerov <anton.akhmerov...@gmail.com> wrote: > Hi Patrik, > > You can use site coordinates that don't belong to any lattice. For > that you need to define your own SiteFamily, see for example the > script below that achieves this goal. > > ------------------- > from matplotlib import pyplot > import kwant > import tinyarray > > class Amorphous(kwant.builder.SimpleSiteFamily): > def normalize_tag(self, tag): > return tinyarray.array(tag, float) > > def pos(self, tag): > return tag > > > atoms = Amorphous() > > syst = kwant.Builder() > sites = atoms(0.01, 0.05), atoms(1.01, -.5) > syst[sites[0]] = syst[sites[1]] = 2 > syst[sites[1], sites[0]] = 1 > > kwant.plot(syst) > --------------------- > > Of course it's now your responsibility to specify the Hamiltonian, > leads, attaching leads, etc. > > Best, > Anton > > On Thu, Jul 6, 2017 at 4:12 PM, Patrik Arvoy <arv...@gmail.com> wrote: > > > > Dear users and developers, > > > > I was wondering if I can import the coordinates of a scattering region > > without any particular symmetry and compute the conductance via kwant. > > If yes, how does one do that? > > Let's say the scattering region does not have any symmetry after > optimizing > > the structure via MD or ... and I have a list of coordinates of all the > > sites. > > I appreciate any help. > > > > Regards > > Patrik >