Example #1
0
def get_bar(param):
  g = geometry.square_ribbon(4) # create geometry of the system
  #g = geometry.honeycomb_zigzag_ribbon(1) # create geometry of the system
  g = geometry.chain() # create geometry of the system
  g.r = np.array([g.r[0]])
  g.a1 /= 2
  g.r2xyz()
#  g = g.supercell(4)
  h = g.get_hamiltonian() # create hamiltonian
#  h.get_bands()
#  exit()
  hr = h.copy()
  hl = h.copy()
  hc = h.copy()
  
  # fermi and pairing 
  hr.shift_fermi(1.)
  hl.shift_fermi(1.)
  hc.shift_fermi(1.)
  hr.add_swave(param)
  hc.add_swave(0.0)
  hl.add_swave(0.0)
  
  
  
                                  # of the scattering centrl part
  # create a junction object
  ht = heterostructures.create_leads_and_central(hr,hl,hc,block_diagonal=False,
                                                    num_central = 1) 
#  hlist = [hc for i in range(80)]  # create a list with the hamiltonians 
  hlist = [hc]  # create a list with the hamiltonians 
#  ht = heterostructures.create_leads_and_central_list(hr,hl,hlist)
#  ht.left_coupling *= .2
  ht.right_coupling *= .1
  return ht
Example #2
0
def bulk2ribbon(h,mag_field=0.05,n=10,sparse=True,check=True):
  """ Generate the Hamiltonian of a ribbon with magnetic field"""
  if not h.is_multicell: # dense hamiltonian
    ho = ribbonizate.hamiltonian_bulk2ribbon(h,n=n,sparse=sparse,check=check) # create hamiltonian
  else: # sparse hamiltonian
    from skeleton import build_ribbon
    import geometry
    gsk = geometry.square_ribbon(n) # skeleton geometry
    ho = build_ribbon(h,g=gsk,n=n) # build the geometry
  ho.geometry.center()
  if np.abs(mag_field)>0.0000001: ho.add_peierls(mag_field) # add peierls phase
  return ho
Example #3
0
def get_bar(param):
    g = geometry.square_ribbon(4)  # create geometry of the system
    #g = geometry.honeycomb_zigzag_ribbon(1) # create geometry of the system
    g = geometry.square_ribbon(1)  # create geometry of the system
    #g = g.supercell(10)
    h = g.get_hamiltonian()  # create hamiltonian
    #h.shift_fermi(0.5)
    hr = h.copy()
    hl = h.copy()
    hc = h.copy()

    hc.add_rashba(.6)
    hc.add_zeeman([.0, 0., 0.2])
    hc.shift_fermi(2.0)

    #hc.get_bands()
    #exit()

    #exit()
    hr.shift_fermi(1.)
    hl.shift_fermi(1.)
    hr.add_swave(0.0)
    hc.add_swave(param)
    hl.add_swave(0.0)

    hc.get_bands()

    # of the scattering centrl part
    # create a junction object
    ht = heterostructures.create_leads_and_central(hr,
                                                   hl,
                                                   hc,
                                                   block_diagonal=False,
                                                   num_central=1)
    hlist = [hc for i in range(80)]  # create a list with the hamiltonians
    ht = heterostructures.create_leads_and_central_list(hr, hl, hlist)
    ht.left_coupling *= .3
    ht.right_coupling *= .3
    return ht
Example #4
0
def bulk2ribbon(h, mag_field=0.05, n=10, sparse=True, check=True):
    """ Generate the Hamiltonian of a ribbon with magnetic field"""
    if not h.is_multicell:  # dense hamiltonian
        ho = ribbonizate.hamiltonian_bulk2ribbon(
            h, n=n, sparse=sparse, check=check)  # create hamiltonian
    else:  # sparse hamiltonian
        from skeleton import build_ribbon
        import geometry
        gsk = geometry.square_ribbon(n)  # skeleton geometry
        ho = build_ribbon(h, g=gsk, n=n)  # build the geometry
    ho.geometry.center()
    if np.abs(mag_field) > 0.0000001:
        ho.add_peierls(mag_field)  # add peierls phase
    return ho
Example #5
0
def get_bar(param):
  g = geometry.square_ribbon(4) # create geometry of the system
  #g = geometry.honeycomb_zigzag_ribbon(1) # create geometry of the system
  g = geometry.square_ribbon(1) # create geometry of the system
  #g = g.supercell(10)
  h = g.get_hamiltonian() # create hamiltonian
  #h.shift_fermi(0.5)
  hr = h.copy()
  hl = h.copy()
  hc = h.copy()
  
  hc.add_rashba(.6)
  hc.add_zeeman([.0,0.,0.2])
  hc.shift_fermi(2.0)
  
  #hc.get_bands()
  #exit()
  
  #exit()
  hr.shift_fermi(1.)
  hl.shift_fermi(1.)
  hr.add_swave(0.0)
  hc.add_swave(0.1)
  hl.add_swave(0.0)
  
  hc.get_bands()
  
  
                                  # of the scattering centrl part
  # create a junction object
  ht = heterostructures.create_leads_and_central(hr,hl,hc,block_diagonal=False,
                                                    num_central = 1) 
  hlist = [hc for i in range(param)]  # create a list with the hamiltonians 
  ht = heterostructures.create_leads_and_central_list(hr,hl,hlist)
  ht.left_coupling *= .3
  ht.right_coupling *= .3
  return ht
Example #6
0
def build_ribbon(h, g=None, n=20):
    """ Build a supercell using a certain geometry as skeleton"""
    if g is None:  # if skeleton not provided
        h.geometry.get_lattice_name()
        if h.geometry.lattice_name == "square":  # square lattice
            g = geometry.square_ribbon(n)
        else:
            raise  # not implemented
    # now build the hamiltonian
    ho = h.copy()  # generate hamiltonian
    intra = [[None for i in range(len(g.r))] for j in range(len(g.r))]
    hoppings = []  # empty list for the hoppings
    for i in range(len(g.r)):  # loop over positions
        intra[i][i] = h.intra  # intracell hopping
    for i in range(len(g.r)):  # hopping up to third cells
        for j in range(len(g.r)):  # hopping up to third cells
            rij = g.r[i] - g.r[j]  # distance between replicas
            intra[i][j] = multicell.get_tij(h, rij=rij)
    ho.intra = csc_matrix(bmat(intra))  # add the intracell matrix
    for nn in [-3, -2, -1, 1, 2, 3]:  # hopping up to third cells
        inter = [[None for i in range(len(g.r))] for j in range(len(g.r))]
        for i in range(len(g.r)):  # hopping up to third cells
            for j in range(len(g.r)):  # hopping up to third cells
                rij = g.r[i] - g.r[j]  # distance between replicas
                rij += np.array([nn, 0., 0.])  # add the displacement
                inter[i][j] = multicell.get_tij(h, rij=rij)
        hopping = multicell.Hopping()  # create object
        hopping.m = csc_matrix(bmat(inter))  # store matrix
        hopping.dir = np.array([nn, 0., 0.])  # store vector
        hoppings.append(hopping)  # store hopping
    gout = g.copy()  # copy geometry for the hamiltonian
    rs = []
    for jr in g.r:  # loop over skeleton geometry
        for ir in h.geometry.r:  # loop over basis
            rs.append(ir + jr[0] * h.geometry.a1 + jr[1] * h.geometry.a2)
    gout.r = np.array(rs)  # store
    gout.r2xyz()  # update
    gout.celldis = h.geometry.a1[0]  # this has to be well done
    ho.geometry = gout  # assign geometry
    ho.hopping = hoppings  # store the full hoppings list
    ho.dimensionality = 1  # one dimensional
    ho.is_multicell = True  # multicell Hamiltonian
    ho.is_sparse = True  # sparse Hamiltonian
    return ho  # return ribbon hamiltonian
Example #7
0
def build_ribbon(h,g=None,n=20):
  """ Build a supercell using a certain geometry as skeleton"""
  if g is None: # if skeleton not provided
    h.geometry.get_lattice_name()
    if h.geometry.lattice_name=="square": # square lattice
      g = geometry.square_ribbon(n) 
    else: raise # not implemented
  # now build the hamiltonian
  ho = h.copy() # generate hamiltonian
  intra = [[None for i in range(len(g.r))] for j in range(len(g.r))]
  hoppings = [] # empty list for the hoppings
  for i in range(len(g.r)): # loop over positions
    intra[i][i] = h.intra # intracell hopping
  for i in range(len(g.r)): # hopping up to third cells
    for j in range(len(g.r)): # hopping up to third cells
      rij = g.r[i] - g.r[j] # distance between replicas
      intra[i][j] = multicell.get_tij(h,rij=rij) 
  ho.intra = csc_matrix(bmat(intra)) # add the intracell matrix
  for nn in [-3,-2,-1,1,2,3]: # hopping up to third cells
    inter = [[None for i in range(len(g.r))] for j in range(len(g.r))]
    for i in range(len(g.r)): # hopping up to third cells
      for j in range(len(g.r)): # hopping up to third cells
        rij = g.r[i] - g.r[j] # distance between replicas
        rij += np.array([nn,0.,0.]) # add the displacement
        inter[i][j] = multicell.get_tij(h,rij=rij) 
    hopping = multicell.Hopping() # create object
    hopping.m = csc_matrix(bmat(inter)) # store matrix
    hopping.dir = np.array([nn,0.,0.]) # store vector
    hoppings.append(hopping) # store hopping
  gout = g.copy() # copy geometry for the hamiltonian
  rs = []
  for jr in g.r: # loop over skeleton geometry
    for ir in h.geometry.r: # loop over basis
      rs.append(ir + jr[0]*h.geometry.a1 + jr[1]*h.geometry.a2)
  gout.r = np.array(rs) # store
  gout.r2xyz() # update
  gout.celldis = h.geometry.a1[0] # this has to be well done
  ho.geometry = gout # assign geometry
  ho.hopping = hoppings # store the full hoppings list
  ho.dimensionality = 1 # one dimensional
  ho.is_multicell = True # multicell Hamiltonian
  ho.is_sparse = True # sparse Hamiltonian
  return ho # return ribbon hamiltonian
Example #8
0
def get_bar(delta1=0.0, delta2=0.0, phi=0.0, j=0.0, cou=1.0):
    g = geometry.square_ribbon(4)  # create geometry of the system
    #g = geometry.honeycomb_zigzag_ribbon(1) # create geometry of the system
    g = geometry.chain()  # create geometry of the system
    g.r = np.array([g.r[0]])
    g.a1 /= 2
    g.r2xyz()
    #  g = g.supercell(4)
    h = g.get_hamiltonian()  # create hamiltonian
    h.shift_fermi(1.0)
    #  h.get_bands()
    #  exit()
    hr = h.copy()
    hl = h.copy()
    hc = h.copy()
    hc.add_zeeman([0., 0., j])
    #  hc.add_rashba(0.2)
    # fermi and pairing
    #  hr.shift_fermi(1.)
    #  hl.shift_fermi(1.)
    #  hc.shift_fermi(1.)
    hr.add_swave(delta=delta2)
    hc.add_swave(delta=0.0)
    hl.add_swave(delta=delta1, phi=phi)

    # of the scattering centrl part
    # create a junction object
    ht = heterostructures.create_leads_and_central(hr,
                                                   hl,
                                                   hc,
                                                   block_diagonal=False,
                                                   num_central=1)
    #  hlist = [hc for i in range(80)]  # create a list with the hamiltonians
    hlist = [hc]  # create a list with the hamiltonians
    #  ht = heterostructures.create_leads_and_central_list(hr,hl,hlist)
    #  ht.left_coupling *= .2
    ht.right_coupling *= cou
    return ht
Example #9
0
def build_ribbon(hin,g=None,n=20):
  """ Build a supercell using a certain geometry as skeleton"""
  if g is None: # if skeleton not provided
    h.geometry.get_lattice_name()
    if h.geometry.lattice_name=="square": # square lattice
      g = geometry.square_ribbon(n) 
    else: raise # not implemented
  # now build the hamiltonian
  h = hin.copy() # generate hamiltonian
  # if the hamiltonian is not multicell, turn it so
  if not h.is_multicell: h = multicell.turn_multicell(h)
  gin = h.geometry # geometry of the hamiltonian input
# use the same axis
  gh = sculpt.rotate_a2b(h.geometry,h.geometry.a1,np.array([0.,1.,0.])) 
#  if np.abs(h.geometry.a1.dot(h.geometry.a2)) > 0.01: raise # orthogonal
#  gh = h.geometry
  def normalize(v): # normalize a vector
    return v/np.sqrt(v.dot(v))
# get reciprocal vectors
  (w1,w2,w3) = sculpt.reciprocal(normalize(gh.a1),normalize(gh.a2)) 
#  exit()
  def get_rij(r):
    """Provide a vector r, return this vector expressed in the basis cell""" 
    i = r.dot(w1) # first projection
    j = r.dot(w2) # second projection
    i,j = round(i),round(j)
    print i,j
    return [i,j,0] # return indexes
  ho = h.copy() # generate hamiltonian
  intra = [[None for i in range(len(g.r))] for j in range(len(g.r))]
  hoppings = [] # empty list for the hoppings
  for i in range(len(g.r)): # loop over positions
    intra[i][i] = h.intra # intracell hopping
  for i in range(len(g.r)): # hopping up to third cells
    for j in range(len(g.r)): # hopping up to third cells
      rij = g.r[i] - g.r[j] # distance between replicas
      intra[i][j] = multicell.get_tij(h,rij=get_rij(rij)) 
  ho.intra = csc_matrix(bmat(intra)) # add the intracell matrix
  for nn in [-3,-2,-1,1,2,3]: # hopping up to third cells
    inter = [[None for i in range(len(g.r))] for j in range(len(g.r))]
    print "Next"
    for i in range(len(g.r)): # hopping up to third cells
      for j in range(len(g.r)): # hopping up to third cells
        rij = g.r[i] - g.r[j] # distance between replicas
        rij += nn*h.geometry.a1 # add the displacement
        if i==j: # for diagonal, at least zeros
          mm = multicell.get_tij(h,rij=get_rij(rij)) 
          if mm is None: inter[i][j] = h.intra*0.0 # store zero
          else: inter[i][j] = mm # store matrix
        else: inter[i][j] = multicell.get_tij(h,rij=get_rij(rij)) 
    hopping = multicell.Hopping() # create object
    hopping.m = csc_matrix(bmat(inter)) # store matrix
    hopping.dir = np.array([nn,0.,0.]) # store vector
    hoppings.append(hopping) # store hopping
  gout = g.copy() # copy geometry for the hamiltonian
  rs = []
  for jr in g.r: # loop over skeleton geometry
    for ir in h.geometry.r: # loop over basis
      rs.append(ir + jr[0]*h.geometry.a1 + jr[1]*h.geometry.a2)
  gout.r = np.array(rs) # store
  gout.r2xyz() # update
  gout.celldis = h.geometry.a1[0] # this has to be well done
  ho.geometry = gout # assign geometry
  ho.hopping = hoppings # store the full hoppings list
  ho.dimensionality = 1 # one dimensional
  ho.is_multicell = True # multicell Hamiltonian
  ho.is_sparse = True # sparse Hamiltonian
  return ho # return ribbon hamiltonian
Example #10
0
import sys
sys.path.append("../../../pygra")  # add pygra library

import geometry
import heterostructures
import numpy as np

g = geometry.square_ribbon(3)
h = g.get_hamiltonian()

ht = heterostructures.create_leads_and_central(h, h, h)

h.get_bands()  # get bandstructure
es = np.linspace(-1., 1., 50)
ts = [ht.landauer(e) for e in es]
np.savetxt("TRANSPORT.OUT", np.matrix([es, ts]).T)
Example #11
0
import geometry  # library to create crystal geometries
import hamiltonians  # library to work with hamiltonians
import input_tb90 as in90
import heterostructures
import sys
import sculpt  # to modify the geometry
import numpy as np
import klist
import pylab as py
import green

g = geometry.square_ribbon(4) 
h = hamiltonians.hamiltonian(g) # create hamiltonian
h.first_neighbors()  # create first neighbor hopping
#h.set_finite()

#h.add_zeeman([0.,0.,-1])
h.remove_spin()

dx = -6.0
dy = 6j

ne = 100
e1 = np.linspace(dx,dx+dy,ne)
e2 = np.linspace(dx+dy,dy,ne)
e3 = np.linspace(dy,0.0,ne)
e4 = np.linspace(0.0,dx,ne)

de1 = dy/ne
de2 = -dx/ne
de3 = -de1
Example #12
0
import geometry  # library to create crystal geometries
import hamiltonians  # library to work with hamiltonians
import heterostructures
import numpy as np
import klist
import pylab as py
import green
import interactions

g = geometry.square_ribbon(4)  # create geometry of the system
g = geometry.honeycomb_zigzag_ribbon(1)  # create geometry of the system
h = g.get_hamiltonian()  # create hamiltonian
hr = h.copy()
hl = h.copy()

es = np.linspace(-3., 3., 100)  # array with the energies

hlist = [h for i in range(10)]  # create a list with the hamiltonians
# of the scattering centrl part
# create a junction object
ht = heterostructures.create_leads_and_central_list(hr, hl, hlist)
ht.block2full()
# calculate transmission
figt = ht.plot_landauer(energy=es, delta=0.00001,
                        has_eh=h.has_eh)  # figure with the transmission
figb = h.plot_bands(nkpoints=300)  # figure with the bands
py.show()
Example #13
0
import geometry  # library to create crystal geometries
import numpy as np
import heterostructures
import matplotlib.pyplot as plt

g = geometry.square_ribbon(4) # create geometry of the system
#g = geometry.honeycomb_zigzag_ribbon(1) # create geometry of the system
g = geometry.square_ribbon(1) # create geometry of the system
#g = g.supercell(10)
h = g.get_hamiltonian() # create hamiltonian
#h.shift_fermi(0.5)
hr = h.copy()
hl = h.copy()
hc = h.copy()

hc.add_rashba(.6)
hc.add_zeeman([.0,0.,0.2])
hc.shift_fermi(2.0)

#hc.get_bands()
#exit()

#exit()
#hr.shift_fermi(1.)
hr.add_swave(0.0)
hc.add_swave(0.1)
hl.add_swave(0.0)

hc.get_bands()

es = np.linspace(-.2,.2,100) # array with the energies