コード例 #1
0
ファイル: main.py プロジェクト: woal777/pygra
import numpy as np
from pygra import geometry
from pygra import hamiltonians
from pygra import specialgeometry
from pygra import topology
#raise # this does not work yet
g = geometry.honeycomb_lattice()
g = g.supercell(12)
h = g.get_hamiltonian(has_spin=False)
rmax = np.sqrt(g.a1.dot(g.a1))


def fm(r):
    #  dr = np.sqrt(r.dot(r)) - rmax/3.
    #  return np.tanh(dr)
    if np.sqrt(r.dot(r)) < rmax / 3: return 1.0
    else: return -1.0


h.add_sublattice_imbalance(fm)
#h.add_haldane(lambda r1,r2: fm((r1+r2)/2))
from pygra import parallel
topology.berry_green_map(h,
                         k=[0., 0., 0.0],
                         nrep=3,
                         integral=True,
                         eps=1e-4,
                         delta=1e-2,
                         operator="valley")
コード例 #2
0
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],
                         nrep=3,
                         integral=False)
#topology.berry_green_map(h,k=[0.5,0.0,0.0],nrep=3,integral=False)
#topology.berry_green_map(h,k=[0.0,-0.0,0.0],nrep=3,integral=False)
#h.get_bands()
コード例 #3
0
ファイル: main.py プロジェクト: woal777/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 specialhamiltonian

from pygra import topology
#raise # this does not work yet


h = specialhamiltonian.tbg(n=9,ti=0.5)
h.add_onsite(lambda r: 0.1*np.sign(r[2]))
h.set_filling(0.5+3./h.intra.shape[0],nk=1) # set filling
op = h.get_operator("valley",projector=True) # valley operator
#h.get_bands(num_bands=30,operator="valley")
#exit()
#exit()
topology.berry_green_map(h,k=[0.0,0.0,0.0],nrep=5,
        integral=False,operator=op,emin=-0.1)