def honeycomb_ribbon(n=1,rtype="zigzag",stype="AB",has_spin=True, t = 0.1,efield=0.1): """Return the hamiltonian of a ribbon""" if rtype=="zigzag": g = geometry.honeycomb_zigzag_ribbon(n) elif rtype=="armchair": g = geometry.honeycomb_zigzag_ribbon(n) else: raise if rtype=="amrchair": raise # not implemented yet h = g.get_hamiltonian(has_spin=has_spin) # hamiltonian if stype=="ABC": # trilayer ABC h = build_honeycomb_trilayer(h,t,mvl=[0.,1.]) elif stype=="AB": # trilayer ABC h = build_honeycomb_bilayer(h,t,mvl=[0.,1.]) add_electric_field(h,e=efield) return h
def get_zigzag_bilayer(n=10): """Get hamiltonian of a zigzag bilayer""" import geometry g = geometry.honeycomb_zigzag_ribbon(40) drs = [np.array([0., 0., -1.]), np.array([0., 1., 1.])] g = geometry.apilate(g, drs=drs) h = g.get_hamiltonian() return h
def get_zigzag_bilayer(n=10): """Get hamiltonian of a zigzag bilayer""" import geometry g = geometry.honeycomb_zigzag_ribbon(40) drs = [np.array([0.,0.,-1.]),np.array([0.,1.,1.])] g = geometry.apilate(g,drs=drs) h = g.get_hamiltonian() return h
def graphene_zigzag_ribbon(ntetramers=1,lambda_soc=0.0): """ Creates teh hamiltonian for a graphene armchair ribbon""" g = geometry.honeycomb_zigzag_ribbon(ntetramers) # create the geometry h = hamiltonians.hamiltonian(g) # create the hamiltonian # get the intracell and intercell terms (intra,inter) = hamiltonians.kane_mele(g.x,g.y, celldis=g.celldis,lambda_soc=lambda_soc) h.intra = intra # assign intracell h.inter = inter # assign intercell return h # return hamiltonian
def generate_pentagon_island(nx,ny,pentagons=[0]): """Generate a Mullen island""" g = geometry.honeycomb_zigzag_ribbon(ny) g = g.supercell(2*nx+1) g.dimensionality = 0 minx = np.min(g.x) def finite(x,y): if x<minx+.1: return False return True g = sculpt.intersec(g,finite) g = sculpt.remove_unibonded(g) g.center() # now add the hexagon dy = max(g.y) + 1.9 ym = max(g.y) # position of zigzag atoms xz = [] # list of zigzag atoms for ir in g.r: # loop over atoms if (ir[1]-ym)<0.1: xz.append(ir[0]) # store upper zigzag atom for ip in pentagons: # loop over pentagons # generate positions r1 = np.array([-1.+dx,0.+dy,0.]) r2 = np.array([1.+dx,0.+dy,0.]) r3 = np.array([.5+dx,np.sqrt(3.0)/2.+dy,0.]) r4 = np.array([-.5+dx,np.sqrt(3.0)/2.+dy,0.]) r5 = np.array([.5+dx,-np.sqrt(3.0)/2.+dy,0.]) r6 = np.array([-.5+dx,-np.sqrt(3.0)/2.+dy,0.]) # add the extra hexagons g.r = [ri for ri in g.r] + [r1,r2,r3,r4,r5,r6] g.r = [ri for ri in g.r] + [-r1,-r2,-r3,-r4,-r5,-r6] #g.r = [r1,r2,r3,r4,r5,r6] g.r = np.array(g.r) g.r2xyz() g.write() h = g.get_hamiltonian() # initialize hamiltonian def funh(ri,rj): dr = ri-rj if .1<dr.dot(dr)<1.3: return 1.0 else: return 0.0 h = hamiltonians.generate_parametric_hopping(h,funh) return h
def generate_pentagon_island(nx, ny, pentagons=[0]): """Generate a Mullen island""" g = geometry.honeycomb_zigzag_ribbon(ny) g = g.supercell(2 * nx + 1) g.dimensionality = 0 minx = np.min(g.x) def finite(x, y): if x < minx + .1: return False return True g = sculpt.intersec(g, finite) g = sculpt.remove_unibonded(g) g.center() # now add the hexagon dy = max(g.y) + 1.9 ym = max(g.y) # position of zigzag atoms xz = [] # list of zigzag atoms for ir in g.r: # loop over atoms if (ir[1] - ym) < 0.1: xz.append(ir[0]) # store upper zigzag atom for ip in pentagons: # loop over pentagons # generate positions r1 = np.array([-1. + dx, 0. + dy, 0.]) r2 = np.array([1. + dx, 0. + dy, 0.]) r3 = np.array([.5 + dx, np.sqrt(3.0) / 2. + dy, 0.]) r4 = np.array([-.5 + dx, np.sqrt(3.0) / 2. + dy, 0.]) r5 = np.array([.5 + dx, -np.sqrt(3.0) / 2. + dy, 0.]) r6 = np.array([-.5 + dx, -np.sqrt(3.0) / 2. + dy, 0.]) # add the extra hexagons g.r = [ri for ri in g.r] + [r1, r2, r3, r4, r5, r6] g.r = [ri for ri in g.r] + [-r1, -r2, -r3, -r4, -r5, -r6] #g.r = [r1,r2,r3,r4,r5,r6] g.r = np.array(g.r) g.r2xyz() g.write() h = g.get_hamiltonian() # initialize hamiltonian def funh(ri, rj): dr = ri - rj if .1 < dr.dot(dr) < 1.3: return 1.0 else: return 0.0 h = hamiltonians.generate_parametric_hopping(h, funh) return h
def graphene_zigzag_ribbon(ntetramers=1, lambda_soc=0.0): """ Creates teh hamiltonian for a graphene armchair ribbon""" g = geometry.honeycomb_zigzag_ribbon(ntetramers) # create the geometry h = hamiltonians.hamiltonian(g) # create the hamiltonian # get the intracell and intercell terms (intra, inter) = hamiltonians.kane_mele(g.x, g.y, celldis=g.celldis, lambda_soc=lambda_soc) h.intra = intra # assign intracell h.inter = inter # assign intercell return h # return hamiltonian
def generate_mullen_island(nx,ny,pristine=False): """Generate a Mullen island""" g = geometry.honeycomb_zigzag_ribbon(ny) g = g.supercell(2*nx+1+2) g.dimensionality = 0 minx = np.min(g.x) def finite(x,y): if x<minx+.1: return False return True g = sculpt.intersec(g,finite) g = sculpt.remove_unibonded(g) g.center() # now add the hexagon dy = max(g.y) + 1.9 r1 = np.array([-1.,0.+dy,0.]) r2 = np.array([1.,0.+dy,0.]) r3 = np.array([.5,np.sqrt(3.0)/2.+dy,0.]) r4 = np.array([-.5,np.sqrt(3.0)/2.+dy,0.]) r5 = np.array([.5,-np.sqrt(3.0)/2.+dy,0.]) r6 = np.array([-.5,-np.sqrt(3.0)/2.+dy,0.]) if not pristine: g.r = [ri for ri in g.r] + [r1,r2,r3,r4,r5,r6] g.r = [ri for ri in g.r] + [-r1,-r2,-r3,-r4,-r5,-r6] #g.r = [r1,r2,r3,r4,r5,r6] g.r = np.array(g.r) g.r2xyz() g.write() h = g.get_hamiltonian() # initialize hamiltonian def funh(ri,rj): dr = ri-rj if .1<dr.dot(dr)<1.3: return 1.0 else: return 0.0 h = hamiltonians.generate_parametric_hopping(h,funh) return h
def generate_mullen_island(nx, ny, pristine=False): """Generate a Mullen island""" g = geometry.honeycomb_zigzag_ribbon(ny) g = g.supercell(2 * nx + 1 + 2) g.dimensionality = 0 minx = np.min(g.x) def finite(x, y): if x < minx + .1: return False return True g = sculpt.intersec(g, finite) g = sculpt.remove_unibonded(g) g.center() # now add the hexagon dy = max(g.y) + 1.9 r1 = np.array([-1., 0. + dy, 0.]) r2 = np.array([1., 0. + dy, 0.]) r3 = np.array([.5, np.sqrt(3.0) / 2. + dy, 0.]) r4 = np.array([-.5, np.sqrt(3.0) / 2. + dy, 0.]) r5 = np.array([.5, -np.sqrt(3.0) / 2. + dy, 0.]) r6 = np.array([-.5, -np.sqrt(3.0) / 2. + dy, 0.]) if not pristine: g.r = [ri for ri in g.r] + [r1, r2, r3, r4, r5, r6] g.r = [ri for ri in g.r] + [-r1, -r2, -r3, -r4, -r5, -r6] #g.r = [r1,r2,r3,r4,r5,r6] g.r = np.array(g.r) g.r2xyz() g.write() h = g.get_hamiltonian() # initialize hamiltonian def funh(ri, rj): dr = ri - rj if .1 < dr.dot(dr) < 1.3: return 1.0 else: return 0.0 h = hamiltonians.generate_parametric_hopping(h, funh) return h
def generate_mullen_ribbon(nx,ny,single=False): """Generate a Mullen island""" g = geometry.honeycomb_zigzag_ribbon(ny) g = g.supercell(2*nx+2) # now add the hexagon dy = max(g.y) + 1.9 dx = np.sqrt(3.)/4 +0. xx = np.array([dx,0.,0.]) g.r = [ri+xx for ri in g.r] # displace whole r1 = np.array([-1.,0.+dy,0.]) r2 = np.array([1.,0.+dy,0.]) r3 = np.array([.5,np.sqrt(3.0)/2.+dy,0.]) r4 = np.array([-.5,np.sqrt(3.0)/2.+dy,0.]) r5 = np.array([.5,-np.sqrt(3.0)/2.+dy,0.]) r6 = np.array([-.5,-np.sqrt(3.0)/2.+dy,0.]) g.r = [ri for ri in g.r] + [r1,r2,r3,r4,r5,r6] # upper if not single: g.r = [ri for ri in g.r] + [-r1,-r2,-r3,-r4,-r5,-r6] # lower #g.r = [r1,r2,r3,r4,r5,r6] g.r = np.array(g.r) g.r2xyz() g.write() h = g.get_hamiltonian() # initialize hamiltonian def funh(ri,rj): dr = ri-rj if .1<dr.dot(dr)<1.3: return 1.0 else: return 0.0 h = hamiltonians.generate_parametric_hopping(h,funh) return h
def generate_mullen_ribbon(nx, ny, single=False): """Generate a Mullen island""" g = geometry.honeycomb_zigzag_ribbon(ny) g = g.supercell(2 * nx + 2) # now add the hexagon dy = max(g.y) + 1.9 dx = np.sqrt(3.) / 4 + 0. xx = np.array([dx, 0., 0.]) g.r = [ri + xx for ri in g.r] # displace whole r1 = np.array([-1., 0. + dy, 0.]) r2 = np.array([1., 0. + dy, 0.]) r3 = np.array([.5, np.sqrt(3.0) / 2. + dy, 0.]) r4 = np.array([-.5, np.sqrt(3.0) / 2. + dy, 0.]) r5 = np.array([.5, -np.sqrt(3.0) / 2. + dy, 0.]) r6 = np.array([-.5, -np.sqrt(3.0) / 2. + dy, 0.]) g.r = [ri for ri in g.r] + [r1, r2, r3, r4, r5, r6] # upper if not single: g.r = [ri for ri in g.r] + [-r1, -r2, -r3, -r4, -r5, -r6] # lower #g.r = [r1,r2,r3,r4,r5,r6] g.r = np.array(g.r) g.r2xyz() g.write() h = g.get_hamiltonian() # initialize hamiltonian def funh(ri, rj): dr = ri - rj if .1 < dr.dot(dr) < 1.3: return 1.0 else: return 0.0 h = hamiltonians.generate_parametric_hopping(h, funh) return h
import geometry # library to create crystal geometries import hamiltonians # library to work with hamiltonians import input_tb90 as in90 import heterostructures import multilayers import os import numpy as np g = geometry.honeycomb_zigzag_ribbon(ntetramers=4) #g = geometry.square_ribbon(1) #g.supercell(2) h = hamiltonians.hamiltonian(g) #h.get_simple_tb() h.get_simple_tb(mag_field=0.1) h.add_zeeman([0.02, 0.0, 0.]) #h.add_kane_mele(0.1) if False: h.write(output_file="hamiltonian_0.in") os.system("cp tb90.in-scf tb90.in") os.system("tb90.x") #in90.tb90in().write() if False: h.read("hamiltonian.in") mag = in90.read_magnetization() # ground state magnetism h.align_magnetism(mag) h.write() os.system("cp tb90.in-bands tb90.in") os.system("tb90.x")
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()
#import pyximport; pyximport.install() import chi # library for response calculation import geometry import hamiltonians import interactions import numpy as np import pylab as py U = 1.0 # hubbard strength g = geometry.chain() g = geometry.honeycomb_zigzag_ribbon(1) h = g.get_hamiltonian() ############# SCF ab = interactions.hubbard(h,U=U) # create operators mf = interactions.antiferro_initialization(h,value=0.1) # create operators #mf = interactions.selfconsistency(h,ab_list=ab,old_mf=mf) # SCF cycle mf = interactions.tb90_scf(h,ab,mf) # SCF cycle #exit() ############## h.intra += mf # add mean field h.get_bands() #exit() #ms = chi.chi1d(h,energies=energies,q=0.1,U=U,adaptive=True,delta=delta,nk=100) #exit() #h.plot_bands()
# zigzag ribbon import sys sys.path.append("../../../pygra") # add pygra library import geometry g = geometry.honeycomb_zigzag_ribbon(10) # create geometry of a zigzag ribbon h = g.get_hamiltonian() # create hamiltonian of the system h.add_rashba(0.2) # add Rashba spin orbit coupling h.add_zeeman([0., 0., 0.2]) # add off-plane Zeeman coupling h.get_bands(nkpoints=300) # calculate band structure
import geometry # library to create crystal geometries import hamiltonians # library to work with hamiltonians import input_tb90 as in90 import heterostructures import multilayers import os g = geometry.honeycomb_zigzag_ribbon(ntetramers=1) h = hamiltonians.hamiltonian(g) h.get_simple_tb() h.add_zeeman([0.1,0.0,0.0]) #h.add_kane_mele(0.1) if False: h.write(output_file = "hamiltonian_0.in") os.system("cp tb90.in-scf tb90.in") os.system("tb90.x") #in90.tb90in().write() if False: h.read("hamiltonian.in") mag = in90.read_magnetization() # ground state magnetism h.align_magnetism(mag) h.write() os.system("cp tb90.in-bands tb90.in") os.system("tb90.x") if False:
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()