Esempio n. 1
0
def get_bands(h, window):
    """Compute the bandstructure of the system"""
    opname = window.getbox("bands_color")
    if opname == "None": op = None  # no operators
    elif opname == "Sx": op = h.get_operator("sx")  # off plane case
    elif opname == "Sy": op = h.get_operator("sy")  # off plane case
    elif opname == "Sz": op = h.get_operator("sz")  # off plane case
    elif opname == "Valley": op = h.get_operator("valley")
    elif opname == "IPR": op = h.get_operator("ipr")
    elif opname == "y-position": op = h.get_operator("yposition")
    elif opname == "x-position": op = h.get_operator("xposition")
    elif opname == "z-position": op = h.get_operator("zposition")
    elif opname == "Interface": op = h.get_operator("interface")
    elif opname == "Layer": op = h.get_operator("zposition")
    else: op = None
    kpath = klist.default(h.geometry, nk=int(window.get("nk_bands")))
    num_bands = int(window.get("nbands"))
    if num_bands < 1: num_bands = None  # all the eigenvalues
    check_parallel(window)  # check if use parallelization
    h.get_bands(operator=op, kpath=kpath, num_bands=num_bands)
    command = "qh-bands --dim " + str(h.dimensionality)
    if op is not None: command += " --cblabel " + opname
    if window.getbox("bands_colormap") is not None:
        command += " --cmap " + window.getbox("bands_colormap")
    execute_script(command)  # execute the command
Esempio n. 2
0
def get_berry1d(h, window):
    """Get the one dimensional Berry curvature"""
    ks = klist.default(h.geometry,
                       nk=int(window.get("topology_nk")))  # write klist
    opname = window.getbox("topology_operator")
    op = get_operator(h, opname, projector=True)  # get operator
    topology.write_berry(h, ks, operator=op)
    command = "qh-berry1d  --label True "
    if opname != "None": command += " --mode " + opname
    execute_script(command)
Esempio n. 3
0
def get_bands(h, window):
    """Compute the bandstructure of the system"""
    opname = window.getbox("bands_color")
    op = get_operator(h, opname)  # get operator
    kpath = klist.default(h.geometry, nk=int(window.get("nk_bands")))
    num_bands = int(window.get("nbands"))
    if num_bands < 1: num_bands = None  # all the eigenvalues
    check_parallel(window)  # check if use parallelization
    if op is None: h = h.reduce()  # reduce dimensionality if possible
    h.get_bands(operator=op, kpath=kpath, num_bands=num_bands)
    command = "qh-bands --dim " + str(h.dimensionality)
    if op is not None: command += " --cblabel " + opname
    execute_script(command)  # execute the command
Esempio n. 4
0
h = g.get_hamiltonian(has_spin=True)
#h.intra *= 0.0
h = h.get_multicell()
h.intra *= 1.5
#h.turn_sparse()
h.shift_fermi(0.8)
#h1 = h.copy()
#h.add_pairing(0.3,mode="swaveA")
h.add_pairing(0.4,mode="SnnAB")
h.add_pairing(0.4,mode="snn")
h.check()
#h.add_pairing(0.4,mode="snn")
#h.add_pairing(0.4,mode="swaveA")
#h.add_swave(0.4)
from pygra import klist
kpath = klist.default(g,nk=4000)
h.get_bands(kpath=kpath)
exit()
#h.turn_sparse()
from pygra import hamiltonians
#hamiltonians.print_hopping(h)
#h.check()
from pygra import superconductivity
superconductivity.superconductivity_type(h)
exit()
#exit()
#h1.add_swave(0.3)
#print(h.same_hamiltonian(h1))
from pygra import spectrum
spectrum.singlet_map(h,nsuper=1,mode="abs")
#h.get_bands()
Esempio n. 5
0
# perform the SCF calculation
#mf = scftypes.guess(h0,"ferro",fun=[1.,0.,0.]) # in-plane guess
#scf = scftypes.selfconsistency(h0,filling=0.5,nkp=20,g=10.0,
#           mf=mf,mix=0.8,maxerror=1e-6)
#hscf = scf.hamiltonian # save the selfconsistent Hamiltonian
#hscf.get_bands(operator="sz") # compute the SCF bandstructure
#########################

hscf = h0.copy() 

# Now compute energies for different rotations
# mesh of quvectors for the spin spiral
qs = np.linspace(-1,1,20) # loop over qvectors
from pygra import klist
qpath = klist.default(hscf.geometry,nk=100) # default qpath

fo = open("STIFFNESS.OUT","w") # open file
for iq in range(len(qpath)): # loop over qy
    q = qpath[iq] # q-vector
    # Compute the energy by rotating the previous ground state
    ############################
    h = hscf.copy() # copy SCF Hamiltonian
    # create the qvector of the rotation
    # get the vector in natural units (assume input is in the real BZ)
    # This is the direction around which we rotate the magnetization
    vector = [0.,0.,1.]
    # rotate the Hamiltonian

    h.generate_spin_spiral(vector=[0.,0.,1.],qspiral=q,
            fractional=True)
Esempio n. 6
0
h = g.get_hamiltonian(has_spin=True)
#h.intra *= 0.0
h = h.get_multicell()
h.intra *= 1.5
#h.turn_sparse()
h.shift_fermi(0.8)
#h1 = h.copy()
#h.add_pairing(0.3,mode="swaveA")
h.add_pairing(0.4, mode="SnnAB")
h.add_pairing(0.4, mode="snn")
h.check()
#h.add_pairing(0.4,mode="snn")
#h.add_pairing(0.4,mode="swaveA")
#h.add_swave(0.4)
from pygra import klist
kpath = klist.default(g, nk=4000)
h.get_bands(kpath=kpath)
exit()
#h.turn_sparse()
from pygra import hamiltonians
#hamiltonians.print_hopping(h)
#h.check()
from pygra import superconductivity
superconductivity.superconductivity_type(h)
exit()
#exit()
#h1.add_swave(0.3)
#print(h.same_hamiltonian(h1))
from pygra import spectrum
spectrum.singlet_map(h, nsuper=1, mode="abs")
#h.get_bands()