def get_geometry(modify=True): """ Create a 2d honeycomb lattice""" n = int(qtwrap.get("cell_size")) # size of the unit cell name = qtwrap.getbox("multilayer_type") if name == "Twisted bilayer": g = specialgeometry.twisted_bilayer(n) elif name == "Aligned bilayer AA": g = specialgeometry.twisted_multilayer(n, rot=[0, 0]) elif name == "Aligned bilayer AB": gb = specialgeometry.multilayer_graphene(l=[0, 1]) g = specialgeometry.twisted_multilayer(n, rot=[0], g=gb, dz=6.0) elif name == "Aligned trilayer ABC": gb = specialgeometry.multilayer_graphene(l=[0, 1, 2]) g = specialgeometry.twisted_multilayer(n, rot=[0], g=gb, dz=6.0) elif name == "Twisted trilayer 010": g = specialgeometry.twisted_multilayer(n, rot=[0, 1, 0]) elif name == "Twisted trilayer 001": g = specialgeometry.twisted_multilayer(n, rot=[0, 0, 1]) elif name == "Twisted bi-bilayer AB AB": ps = [["AB", "AB"], [0, 1]] g = specialgeometry.parse_twisted_multimultilayer(ps, n=n) elif name == "Twisted bi-bilayer AB BA": ps = [["AB", "BA"], [0, 1]] g = specialgeometry.parse_twisted_multimultilayer(ps, n=n) elif name == "Twisted bi-trilayer ABC": ps = [["ABC", "ABC"], [0, 1]] g = specialgeometry.parse_twisted_multimultilayer(ps, n=n) else: raise # g = geometry.honeycomb_lattice() # g = g.supercell(n) if modify: g = modify_geometry(g) # remove atoms if necessary return g
def show_dos(self): comp = computing() # create the computing window h = pickup_hamiltonian() # get the hamiltonian nk = int(round(np.sqrt(get("nk_dos")))) ndos = int(get("nume_dos")) npol = int(get("numpol_dos")) ndos = npol * 10 delta = get("delta_dos") scale = 10.0 # scale for KPM check_parallel() # check if there is parallelization name = qtwrap.getbox("mode_dos") # mode of the DOS if name == "KPM": dos.dos(h, use_kpm=True, nk=nk, ntries=1, scale=scale, delta=5 * delta, energies=np.linspace(-5.0, 5.0, int(20. / delta))) elif name == "Lowest": numw = int(get("numw_dos")) # number of waves energies = None dos.dos2d(h, nk=nk, delta=delta, numw=numw) else: raise execute_script("qh-dos --input DOS.OUT ") comp.kill() return
def show_ldos(): h = pickup_hamiltonian() # get the Hamiltonian ew = abs(qtwrap.get("ldos_ewindow")) energies = np.linspace(-ew, ew, 100) delta = qtwrap.get("ldos_delta") nk = int(qtwrap.get("ldos_nk")) name = qtwrap.getbox("ldos_operator") ldos.spatial_energy_profile(h, operator=h.get_operator(name), nk=nk, delta=delta, energies=energies) execute_script( 'qh-map2d --input DOSMAP.OUT --xlabel Energy --ylabel "y-position" --zlabel DOS --title "Local DOS"' )
def show_time_evolution(): h = pickup_hamiltonian() # get hamiltonian try: i = open("SELECTED_SINGLE_ATOM.INFO").read() except: i = 0 if i=="": i=0 else: i = int(i) if h.has_spin: i = i*2 if qtwrap.getbox("channel_time_evolution")=="Down": i += 1 # print(i) ; return if h.has_eh: i = i*4 tmax = qtwrap.get("tmax_time_evolution") # maximum time timeevolution.evolve_local_state(h,i=i,ts=np.linspace(0.,tmax,100), mode="green") execute_script("qh-multitimeevolution") # plot the result
def check_parallel(): """Check if there is parallelization""" if qtwrap.getbox("use_parallelization") == "Yes": parallel.cores = parallel.maxcpu else: parallel.cores = 1 # single core