def get_geometry(name,dz=2.0): """Return the geometry for multilayer graphene""" g = geometry.honeycomb_lattice() # honeycomb lattice if name=="AA": g = bilayer_geometry(g,mvl=[0.,0.],dz=dz) elif name=="AB": g = bilayer_geometry(g,mvl=None,dz=dz) else: raise return g
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 ns = np.arange(1, 7, 1) t1s = [] t2s = [] for ncell in ns: g = geometry.honeycomb_lattice() # create a honeycomb lattice h2 = g.get_hamiltonian() # create hamiltonian # h2.add_rashba(0.1) # h2.remove_spin() ncell = int(ncell) # ncell = 8 g = g.supercell(ncell) h1 = g.get_hamiltonian() # create hamiltonian # h1.add_rashba(0.1) # h1.remove_spin() import green delta = 0.02
import sys sys.path.append("../../../pygra") # add pygra library import geometry import topology import klist g = geometry.honeycomb_lattice() h = g.get_hamiltonian(has_spin=False) h.add_haldane(0.1) import dos import topology topology.berry_density(h) #h.get_bands() #dos.dos(h,nk=100,use_kpm=True)
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.honeycomb_lattice() # create a honeycomb lattice #g = geometry.square_ribbon(1) g = geometry.supercell2d(g,n1=4,n2=4) h = hamiltonians.hamiltonian(g) # create hamiltonian h.first_neighbors() # create first neighbor hopping #h.add_sublattice_imbalance(.1) #h.remove_spin() h.add_kane_mele(0.04) h.remove_spin() #h.add_rashba(.2) #h.add_zeeman([0.,0.,.2]) es = np.linspace(-1.,1.,80) #es = np.linspace(-.3,.3,80) dos = [] dosv = [] vintra = h.intra.copy() vintra[len(vintra)/2,len(vintra)/2] = 10000.
import geometry import hamiltonians g = geometry.honeycomb_lattice() g = g.supercell(20) g.dimensionality = 0 h = g.get_hamiltonian() h.remove_spin() import neighbor pairs = neighbor.find_first_neighbor(g.r,g.r) print pairs h.write()
# zigzag ribbon import sys sys.path.append("../../../pygra") # add pygra library import geometry import numpy as np import embedding # Here we will use the embedding method to calculate the # density of states of a single vacancy in infinite graphene # The embedding technique is a quite expensive algorithm, if you use # large cells it will take a lot of time g = geometry.honeycomb_lattice() # create geometry of a chain h = g.get_hamiltonian(has_spin=False) # get the Hamiltonian,spinless # create a new intraterm, vacancy is modeled as a large onsite potential vintra = h.intra.copy() vintra[0, 0] = 1000.0 energies = np.linspace(-3.5, 3.5, 200) delta = 0.01 # smearing embedding.dos_impurity(h, vc=vintra, silent=False, energies=energies, delta=delta, use_generator=False)
def twisted_bilayer(m0=3, rotate=True, shift=[0., 0.], center="AB/BA", sublattice=True, r=1): """Return the geometry for twisted bilayer graphene""" g = geometry.honeycomb_lattice() g.has_sublattice = False if sublattice: # trace the sublattice using a dirty trick g.z[0] += 0.001 g.z[1] -= 0.001 g.xyz2r() else: pass g = geometry.non_orthogonal_supercell(g, m=[[-1, 0, 0], [0, 1, 0], [0, 0, 1]]) # m0 = 3 # r = 1 theta = np.arccos((3. * m0**2 + 3 * m0 * r + r**2 / 2.) / (3. * m0**2 + 3 * m0 * r + r**2)) print("Theta", theta * 180.0 / np.pi) nsuper = [[m0, m0 + r, 0], [-m0 - r, 2 * m0 + r, 0], [0, 0, 1]] g = geometry.non_orthogonal_supercell(g, m=nsuper, reducef=lambda x: 3 * np.sqrt(x)) g1 = g.copy() g1.shift([1., 0., 0.]) g.z -= 1.5 g.xyz2r() # update if rotate: # rotate one of the layers g1 = g1.rotate(theta * 180 / np.pi) g1s = g1.supercell(2) # supercell g1s.z += 1.5 g1s.x += shift[0] # shift upper layer g1s.y += shift[1] # shift upper layer g1s.xyz2r() # update g1.a1 = g.a1 g1.a2 = g.a2 rs = sculpt.retain_unit_cell(g1s.r, g.a1, g.a2, g.a3, dim=2) # get positions else: # do not rotate rs = np.array(g1.r) # same coordinates rs[:, 2] = 1.0 # set as one g1.r = np.concatenate([rs, g.r]) g1.r2xyz() # update g1.real2fractional() # update fractional coordinates if center == "AB/BA": pass # do nothing elif center == "AA": g1.frac_x = (g1.frac_x) % 1 # to the unit cell g1.fractional2real() elif center == "AB": g1.frac_x = (g1.frac_x) % 1 # to the unit cell g1.frac_y = (g1.frac_y) % 1 # to the unit cell g1.frac_y += 0.5 # to the unit cell g1.frac_x = (g1.frac_x) % 1 # to the unit cell g1.frac_y = (g1.frac_y) % 1 # to the unit cell g1.frac_x -= 1. / 3. g1.frac_y -= 1. / 3. g1.frac_x = (g1.frac_x) % 1 # to the unit cell g1.frac_y = (g1.frac_y) % 1 # to the unit cell g1.fractional2real() else: raise if sublattice: # recover the sublattice g1.has_sublattice = True # say that it has sl = [] for r in g1.r: # loop over positions if np.abs(r[2] - 1.5) < 0.01: # upper layer if r[2] - 1.5 > 0.0: sl.append(-1.) # A sublattice else: sl.append(1.) # B sublattice elif np.abs(r[2] + 1.5) < 0.01: # lower layer if r[2] + 1.5 > 0.0: sl.append(-1.) # A sublattice else: sl.append(1.) # B sublattice g1.z = np.round(g1.z, 2) # delete the small shift g1.xyz2r() # update coordinates g1.sublattice = np.array(sl) # store sublattice g1.get_fractional() # get fractional coordinates return g1