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
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
# zigzag ribbon import sys sys.path.append("../../../pygra") # add pygra library import geometry import topology import numpy as np import phasediagram g = geometry.chain() # create geometry of a chain def getz2(x1,x2): # calculate the Z2 invariant for certain Zeeman and Rashba h = g.get_hamiltonian(has_spin=True) # get the Hamiltonian, spinfull h.add_rashba(0.5) # add Rashba SOC h.add_zeeman(x1+0.5) # add Zeeman field h.shift_fermi(2.0) # add Zeeman field h.add_swave(x2) # add swave pairing phi = topology.berry_phase(h) # get the berry phase return np.abs(phi/np.pi) # now write the Phase diagram in a file phasediagram.diagram2d(getz2,x=np.linspace(-1,1,20,endpoint=True),y=np.linspace(-1,2.,20,endpoint=True),nite=4)
import sys sys.path.append("../../pygra") # add pygra library import geometry # library to create crystal geometries import hamiltonians # library to work with hamiltonians import sculpt # to modify the geometry import correlator import numpy as np import matplotlib.pyplot as plt import kpm g = geometry.chain() g = g.supercell(100) g.dimensionality = 0 h = g.get_hamiltonian() h.shift_fermi(.4) h.add_zeeman([.8, .8, .8]) h.add_rashba(.8) i = 0 j = 7 (x, y, yi) = kpm.correlator0d(h.intra, npol=300, i=i, j=j) (x2, y2, yi2) = correlator.correlator0d(h.intra, i=i, j=j, delta=0.1) #print(np.trapz(y,x=x,dx=x[1]-x[0])) plt.subplot(1, 2, 1) plt.plot(x, y, marker="o", label="KPM") plt.plot(x2, y2, marker="o", label="Green")
# zigzag ribbon import sys sys.path.append("../../../pygra") # add pygra library import geometry import scftypes import numpy as np # this spin calculates the spin stiffness of an interacting 1d chain g = geometry.chain() # chain geometry h0 = g.get_hamiltonian() # create hamiltonian of the system fo = open("STIFFNESS.OUT","w") # open file for a in np.linspace(0.,.2,20): # loop over angles, in units of pi h = h0.copy() h.generate_spin_spiral(angle=a,vector=[0.,1.,0.]) scf = scftypes.hubbardscf(h,filling=0.1,nkp=1000,U=2.5,silent=True, mag=[[0.,0.,.1]],mix=0.01,maxerror=1e-4) fo.write(str(a)+" "+str(scf.energy)+"\n") # write print(a,scf.energy) fo.close()
else: # RPA calculation return rpachi(ms,U=U) if __name__=="__main__": import geometry import hamiltonians g = geometry.chain() h = g.get_hamiltonian() # h.add_antiferromagnetism(.1) h.add_antiferromagnetism(.1) energies = np.linspace(-1.,1.,100) ms = chi1d(h,energies=energies) ms = sumchi(ms) # sum all the elements import pylab as py # b = h.plot_bands() py.plot(energies,ms.imag) py.plot(energies,ms.real) py.show()
import sys sys.path.append("../../../pygra") # add pygra library import geometry import numpy as np g = geometry.chain(400) # chain g.dimensionality = 0 betas = np.linspace(0.0,4.0,30) # loop over v's def discard(w): w2 = np.abs(w)*np.abs(w) # absolute value n = len(w) if np.sum(w2[0:n//10])>0.5 or np.sum(w2[9*n//10:n])>0.5: return False else: return True fo = open("LAMBDA_VS_V.OUT","w") for beta in betas: h = g.get_hamiltonian(has_spin=False) import potentials fun = potentials.aahf1d(v=2.5,beta=beta) h.shift_fermi(fun) (es,ls) = h.get_tails(discard=discard) # return the localization length for (e,l) in zip(es,ls): fo.write(str(beta)+" ") fo.write(str(e)+" ") fo.write(str(l)+"\n") fo.flush()
import sys sys.path.append("../../../pygra") # add pygra library import geometry import topology g = geometry.chain(2) # create geometry of a zigzag ribbon h = g.get_hamiltonian(has_spin=False) # get the Hamiltonian,spinless delta = -0.1 # value of the perturbation h.intra *= (1.+delta) # modify intra-hopping h.inter *= (1.-delta) # modify inter-hopping phi = topology.berry_phase(h) # get the berry phase print(phi) hf = h.supercell(100) # do a supercell hf = hf.set_finite_system(periodic=False) # do an open finite system hf.get_bands()