示例#1
0
def initialize():
    """ Initialize the calculation"""
    g = get_geometry2d()  # get the geometry
    from specialhopping import twisted, twisted_matrix
    has_spin = False
    h = g.get_hamiltonian(is_sparse=True,
                          has_spin=has_spin,
                          is_multicell=False,
                          mgenerator=twisted_matrix(ti=get("tinter"),
                                                    lambi=7.0))
    #  return h
    #  h.turn_dense()
    h.add_sublattice_imbalance(get("mAB"))  # sublattice imbalance
    efield = get("interlayer_bias")

    def bias(r):
        if r[2] < 0.0: return efield
        else: return -efield

    h.shift_fermi(bias)
    if h.has_spin:
        h.add_zeeman([get("Bx"), get("By"), get("Bz")])  # Zeeman fields
        h.add_rashba(get("rashba"))  # Rashba field
        h.add_antiferromagnetism(get("mAF"))  # AF order
        h.add_kane_mele(get("kanemele"))  # intrinsic SOC
    h.shift_fermi(get("fermi"))  # shift fermi energy
    if False:
        h.add_swave(get("swave"))
    if False:
        if h.has_eh:
            print("SCF not implemented with Nambu")
            raise
    if False:
        custom_scf(h)  # create the tb90.in
    else:
        h.write("hamiltonian.in")
    klist.default(g, nk=int(get("nkpoints")))  # write klist
    #  klist.tr_path(nk=int(get("nkpoints")))  # write klist
    return h
示例#2
0
文件: main.py 项目: restart668/pygra
# Add the root path of the pygra library
import os
import sys

sys.path.append(os.environ['PYGRAROOT'])

import numpy as np
import specialgeometry

n = 7  # this is a parameter that controls the size of the moire unit cell
g = specialgeometry.twisted_bilayer(n)  # get the geometry of the system
# g.r is the list with the positions in the unit cell
# g.a1 is the first lattice vector
# g.a2 is the second lattice vector
# This function will create hoppings in the structure
ti = 0.4  # this is the interlayer hopping (in terms of the intralayer)
from specialhopping import twisted_matrix

h = g.get_hamiltonian(is_sparse=True,
                      has_spin=False,
                      is_multicell=True,
                      mgenerator=twisted_matrix(ti=ti))
hk = h.get_hk_gen()  # get Bloch Hamiltonian generator
# hk is a function that given a k point, returns the Bloch Hamiltonian
# The k points are in the interval [0.,1.]
# This method automatically computes the local density of states
h.get_ldos(e=0.0)  # e is the energy
# This method automatically computes the bands
#h.get_bands(num_bands=20)
示例#3
0
文件: main.py 项目: woal777/pygra
# Add the root path of the pygra library
import os ; import sys ; sys.path.append(os.environ['PYGRAROOT'])

from pygra importgeometry
from pygra importhamiltonians
import numpy as np
import klist
import sculpt
import specialgeometry
g = specialgeometry.twisted_bilayer(5)
g.write()
from specialhopping import twisted_matrix
h = g.get_hamiltonian(is_sparse=True,has_spin=False,is_multicell=False,
     mgenerator=twisted_matrix(ti=0.4,lambi=7.0))
#h.turn_spinful()
h.add_haldane(0.05)
h.add_sublattice_imbalance(0.5)
#h.add_kane_mele(0.1)
#h.add_rashba(lambda r:  0.1*np.sign(r[2]))
h.shift_fermi(-0.3)
#h.add_sublattice_imbalance(0.1)
#h.shift_fermi(lambda r: r[2]*0.1)
import density
#h.set_filling(nk=3,extrae=1.) # set to half filling + 2 e
#d = density.density(h,window=0.1,e=0.025)
#h.shift_fermi(-0.4)
#h.turn_sparse()
#h.get_bands(num_bands=20)
#exit()
import topology
#print(h.get_gap())