コード例 #1
0
import sys

sys.path.append(os.path.dirname(os.path.realpath(__file__)) + "/../../../src")

import numpy as np
from pygra 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 pygra.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
from pygra import ldos

ldos.ldos(h)
#h.get_ldos(e=0.0) # e is the energy
# This method automatically computes the bands
#h.get_bands(num_bands=20)
コード例 #2
0
import numpy as np
from pygra import geometry
from pygra import hamiltonians
from pygra import klist
from pygra import sculpt
from pygra import specialgeometry
from pygra import scftypes
g = specialgeometry.twisted_bilayer(8)
#g = geometry.honeycomb_lattice()
g.write()
from pygra import specialhopping
h = g.get_hamiltonian(is_sparse=True,
                      has_spin=False,
                      is_multicell=False,
                      mgenerator=specialhopping.twisted_matrix(ti=0.5,
                                                               lambi=7.0))
h.turn_dense()
#def ff(r):
#    return 0.2*r[2]

#h.shift_fermi(ff)
h.turn_spinful()
h.turn_dense()
h.add_sublattice_imbalance(0.5)
h.add_kane_mele(0.03)
#h.get_bands(num_bands=40)
#exit()
from pygra import meanfield
mf = meanfield.guess(h, "antiferro", 0.1)
g = 2.0
filling = 0.5 + 1. / h.intra.shape[0]  # plus two electrons
コード例 #3
0
# Add the root path of the pygra library
import os ; import sys 
sys.path.append(os.path.dirname(os.path.realpath(__file__))+"/../../../src")




from pygra import specialgeometry
from pygra.specialhopping import twisted_matrix
g = specialgeometry.twisted_bilayer(3)
h = g.get_hamiltonian(mgenerator=twisted_matrix(ti=0.12))
h.get_bands(nk=100)







コード例 #4
0
import os
import sys
sys.path.append(os.path.dirname(os.path.realpath(__file__)) + "/../../../src")

from pygra import geometry
from pygra import hamiltonians
import numpy as np
from pygra import specialgeometry
from pygra.specialhopping import twisted_matrix
from pygra import topology

g = specialgeometry.twisted_bilayer(9)
h = g.get_hamiltonian(is_sparse=True,
                      has_spin=False,
                      is_multicell=False,
                      mgenerator=twisted_matrix(ti=0.4, lambi=7.0))
h.turn_dense()


def ff(r):
    return r[2] * 0.05


h.shift_fermi(ff)  # interlayer bias
h.set_filling(nk=3, extrae=0.)  # set to half filling + 2 e
#h.shift_fermi(-0.08)
#h.turn_sparse()
#h.get_bands(num_bands=20)
#exit()
topology.berry_green_map(h,
                         k=[-0.333333, 0.33333, 0.0],
コード例 #5
0
ファイル: main.py プロジェクト: joselado/pygra
# Add the root path of the pygra library
import os ; import sys ; sys.path.append(os.environ['PYGRAROOT'])

import numpy as np
from pygra import geometry
from pygra import hamiltonians
from pygra import klist
from pygra import sculpt
from pygra import specialgeometry
from pygra import scftypes
g = specialgeometry.twisted_bilayer(8)
#g = geometry.honeycomb_lattice()
g.write()
from pygra import specialhopping
h = g.get_hamiltonian(is_sparse=True,has_spin=False,is_multicell=False,
     mgenerator=specialhopping.twisted_matrix(ti=0.5,lambi=7.0))
h.turn_dense()
#def ff(r):
#    return 0.2*r[2]
    
#h.shift_fermi(ff)
h.turn_spinful()
h.turn_dense()
h.add_sublattice_imbalance(0.5)
h.add_kane_mele(0.03)
#h.get_bands(num_bands=40)
#exit()
from pygra import meanfield
mf = meanfield.guess(h,"antiferro",0.1)
g = 2.0
filling = 0.5 + 1./h.intra.shape[0] # plus two electrons
コード例 #6
0
ファイル: main.py プロジェクト: joselado/pygra
# Add the root path of the pygra library
import os ; import sys ; sys.path.append(os.environ['PYGRAROOT'])

from pygra import geometry
from pygra import hamiltonians
import numpy as np
from pygra import klist
from pygra import sculpt
from pygra import specialgeometry
from pygra import parallel
parallel.cores = 7


g = specialgeometry.twisted_bilayer(7)
#g = g.supercell(3)
#g = geometry.honeycomb_lattice()
from pygra.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.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(d)
#h.turn_sparse()
from pygra import algebra
algebra.accelerate = False
h.get_bands(nk=100)