def first_neighbors2d(h): """ Gets a first neighbor hamiltonian""" x = h.geometry.x # x coordinate y = h.geometry.y # x coordinate g = h.geometry celldis = h.geometry.celldis # distance to neighboring cell # first neighbors hopping h.intra = get_hop_first_neigh(x,y,x,y,mag_field=0.0) # if h.dimensionality==2: # if one dimensional if True: # if one dimensional dx = g.a1[0] # vector to the cell dy = g.a1[1] # vector to the cell h.tx = get_hop_first_neigh(x,y,x+dx,y+dy,mag_field=0.0) dx = g.a2[0] # vector to the cell dy = g.a2[1] # vector to the cell h.ty = get_hop_first_neigh(x,y,x+dx,y+dy,mag_field=0.0) dx = g.a1[0] + g.a2[0] # vector to the cell dy = g.a1[1] + g.a2[1] # vector to the cell h.txy = get_hop_first_neigh(x,y,x+dx,y+dy,mag_field=0.0) dx = g.a1[0] - g.a2[0] # vector to the cell dy = g.a1[1] - g.a2[1] # vector to the cell h.txmy = get_hop_first_neigh(x,y,x+dx,y+dy,mag_field=0.0) from increase_hilbert import m2spin if h.has_spin: # if it has spin degree of freedom h.intra = m2spin(h.intra,h.intra) # intracell term h.tx = m2spin(h.tx,h.tx) # hopping h.ty = m2spin(h.ty,h.ty) # hopping h.txy = m2spin(h.txy,h.txy) # hopping h.txmy = m2spin(h.txmy,h.txmy) # hopping
def first_neighbors1d(h): """ Gets a first neighbor hamiltonian""" r = h.geometry.r # x coordinate a1 = np.array([h.geometry.celldis,0.,0.]) # first neighbors hopping, all the matrices h.intra = create_fn_hopping(r,r) h.inter = create_fn_hopping(r,r+a1) if h.has_spin: # if it has spin degree of freedom from increase_hilbert import m2spin h.intra = m2spin(h.intra,h.intra) # intracell term h.inter = m2spin(h.inter,h.inter) # hopping
def first_neighbors0d(h): """ Gets a first neighbor hamiltonian""" r = h.geometry.r # x coordinate h.intra = create_fn_hopping(r,r) # intracell if h.has_spin: # if it has spin degree of freedom from increase_hilbert import m2spin h.intra = m2spin(h.intra,h.intra) # intracell term
def first_neighbors2d(h): """ Gets a first neighbor hamiltonian""" r = h.geometry.r # x coordinate g = h.geometry # first neighbors hopping, all the matrices a1, a2 = g.a1, g.a2 h.intra = create_fn_hopping(r,r) h.tx = create_fn_hopping(r,r+a1) h.ty = create_fn_hopping(r,r+a2) h.txy = create_fn_hopping(r,r+a1+a2) h.txmy = create_fn_hopping(r,r+a1-a2) from increase_hilbert import m2spin if h.has_spin: # if it has spin degree of freedom h.intra = m2spin(h.intra,h.intra) # intracell term h.tx = m2spin(h.tx,h.tx) # hopping h.ty = m2spin(h.ty,h.ty) # hopping h.txy = m2spin(h.txy,h.txy) # hopping h.txmy = m2spin(h.txmy,h.txmy) # hopping
def tmp_kane_mele(x,y,first = 1.0, celldis = 3.0,lambda_soc=0.0,mag_field=0.0): """ Computes the Kane-Mele matrix, input are x and y coordinates, distance to first neighbors, distance to nearest cell, lambda_soc is SOC strength""" from increase_hilbert import m2spin from numpy import array def tmp_haldane(value,minus=False): # calculate Haldane hopping onsite_hal = get_hal_hop_sec_neigh(x,y,x,y,x,y, mag_field=mag_field,value=value) onsite_hal += get_hal_hop_sec_neigh(x,y,x,y,x+celldis, y,mag_field=mag_field,value=value) onsite_hal += get_hal_hop_sec_neigh(x,y,x,y,x-celldis, y,mag_field=mag_field,value=value) # check hermiticity if intra_hal if not is_hermitic(onsite_hal): print "onsite_hal is not hermitic" raise # hopping matrix hopping_hal = get_hal_hop_sec_neigh(x,y,x+celldis,y,x,y, mag_field=mag_field,value=value) hopping_hal += get_hal_hop_sec_neigh(x,y,x+celldis,y, x+celldis,y,mag_field=mag_field,value=value) hopping_hal += get_hal_hop_sec_neigh(x,y,x+celldis,y, x-celldis,y,mag_field=mag_field,value=value) # total hopping and onsite if not minus: intra_hal = onsite_hal inter_hal = hopping_hal if minus: intra_hal = -onsite_hal inter_hal = -hopping_hal return (intra_hal,inter_hal) # return haldane hoppings # if there is SOC if lambda_soc == 0.0: return (0.0,0.0) # don't do anything (intra_up,inter_up) = tmp_haldane(lambda_soc,minus=False) # up component (intra_dn,inter_dn) = tmp_haldane(lambda_soc,minus=True) # up component # add spin degree of freedom intra = m2spin(intra_up,intra_dn) # intracell term inter = m2spin(inter_up,inter_dn) # intercell term return (intra,inter)
def kane_mele(x1,y1,x2=None,y2=None,x3=None,y3=None,has_spin=True): """ Generate Kane Mele matrices""" xs,ys = [x2,x3],[y2,y3] for ix in xs: if ix==None: ix=x1 for iy in ys: if iy==None: iy=y1 m = get_hal_hop_sec_neigh(x1,y1,x2,y2,x3,y3) if has_spin: m = m2spin(m,m) return m
def get_simple_tb(h,mag_field=0.0): """ Computes the Kane-Mele matrix, input are x and y coordinates, distance to first neighbors, distance to nearest cell, lambda_soc is SOC strength""" x = h.geometry.x # x coordinate y = h.geometry.y # x coordinate celldis = h.geometry.celldis # distance to neighboring cell from numpy import array # first neighbors hopping intra = get_hop_first_neigh(x,y,x,y,mag_field=mag_field) if h.dimensionality==1: # if one dimensional inter = get_hop_first_neigh(x,y,x+celldis,y,mag_field=mag_field) h.inter = inter # assign interterm from increase_hilbert import m2spin if h.has_spin: # if it has spin degree of freedom intra = m2spin(intra,intra) # intracell term h.intra = intra # assign intraterm if h.dimensionality==1: # if one dimensional inter = m2spin(inter,inter) # intercell term h.inter = inter # assign interterm
def kane_mele(x1,y1,x2=None,y2=None,x3=None,y3=None,has_spin=True): """ Generate Kane Mele matrices""" xs,ys = [x2,x3],[y2,y3] for ix in xs: if ix==None: ix=x1 for iy in ys: if iy==None: iy=y1 m = get_hal_hop_sec_neigh(x1,y1,x2,y2,x3,y3) from increase_hilbert import m2spin if has_spin: m = m2spin(m,np.conjugate(m)) return m
def kane_mele(x1,y1,x2=None,y2=None,x3=None,y3=None,has_spin=True): """ Generate Kane Mele matrices""" xs,ys = [x2,x3],[y2,y3] for ix in xs: if ix is None: ix=x1 for iy in ys: if iy is None: iy=y1 m = get_hal_hop_sec_neigh(x1,y1,x2,y2,x3,y3) from increase_hilbert import m2spin if has_spin: m = m2spin(m,np.conjugate(m)) return m
def first_neighbors0d(h): """ Gets a first neighbor hamiltonian""" r = h.geometry.r # x coordinate if h.is_sparse: # for sparse matrix import neighbor pairs = neighbor.find_first_neighbor(r,r) rows,cols = pairs.T # transpose data = np.array([1. for c in cols]) n = len(r) h.intra = csc_matrix((data,(rows,cols)),shape=(n,n)) else: h.intra = create_fn_hopping(r,r) # intracell if h.has_spin: # if it has spin degree of freedom from increase_hilbert import m2spin h.intra = m2spin(h.intra,h.intra) # intracell term