Ejemplo n.º 1
0
# Add the root path of the pygra library
import os ; import sys ; sys.path.append(os.environ['PYGRAROOT'])

# zigzag ribbon
import numpy as np
from pygra import geometry
from scipy.sparse import csc_matrix
from pygra import meanfield
g = geometry.honeycomb_lattice_C6()
g = geometry.honeycomb_lattice()
g = g.supercell(3)
filling = 0.5
nk = 10
h = g.get_hamiltonian(has_spin=False) # create hamiltonian of the system
#scf = scftypes.selfconsistency(h,nk=nk,filling=filling,g=g,mode="V")
mf = meanfield.guess(h,"dimerization")
scf = meanfield.Vinteraction(h,V1=4.0,mf=mf,
        V2=2.0,nk=nk,filling=filling,mix=0.3)
h = scf.hamiltonian # get the Hamiltonian
h.get_bands() # calculate band structure
from pygra import groundstate
groundstate.hopping(h,nrep=3) # write three replicas
h.write_onsite(nrep=3) # write three replicas
#spectrum.fermi_surface(h)
Ejemplo n.º 2
0
# Add the root path of the pygra library
import os ; import sys ; sys.path.append(os.environ['PYGRAROOT'])

# zigzag ribbon
import numpy as np
from pygra import geometry
from pygra import scftypes
from pygra import operators
from scipy.sparse import csc_matrix
g = geometry.chain()
g = geometry.honeycomb_lattice()
#g = geometry.kagome_lattice()
g = g.supercell(3)
h = g.get_hamiltonian() # create hamiltonian of the system
h = h.get_multicell()
h.remove_spin()
mf = np.random.random(h.intra.shape) -.5  
mf = np.matrix(mf)
mf = mf + mf.H
scf = scftypes.selfconsistency(h,nkp=1,filling=0.5,g=3.0,
              mix=0.9,mf=mf,mode="V")
h = scf.hamiltonian # get the Hamiltonian
h.get_bands() # calculate band structure
from pygra import groundstate
groundstate.hopping(h,nrep=3) # write three replicas
#spectrum.fermi_surface(h)
Ejemplo n.º 3
0
# 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 scftypes
from pygra import operators
from pygra import groundstate
from scipy.sparse import csc_matrix
g = geometry.chain()
g = g.supercell(4)
h = g.get_hamiltonian() # create hamiltonian of the system
h = h.get_multicell()
h.remove_spin()
mf = np.random.random(h.intra.shape) -.5  
mf = np.matrix(mf)
mf = mf + mf.H
scf = scftypes.selfconsistency(h,nkp=40,filling=0.5,g=3.0,
              mix=0.9,mf=mf,mode="V")
h = scf.hamiltonian # get the Hamiltonian
h.get_bands() # calculate band structure
groundstate.hopping(h)
Ejemplo n.º 4
0
Archivo: main.py Proyecto: obaica/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 groundstate
from pygra import meanfield
g = geometry.honeycomb_lattice()
h = g.get_hamiltonian(has_spin=False)  # create hamiltonian of the system
nk = 10
filling = 0.5

mf = meanfield.guess(h, "random")  # initialization
scf = meanfield.Vinteraction(h, mf=mf, V2=2.0, nk=nk, filling=filling, mix=0.1)
print(scf.identify_symmetry_breaking())
h = scf.hamiltonian  # get the Hamiltonian
print("Topological invariant", h.get_topological_invariant())
h.get_bands()  # calculate band structure
from pygra import topology
groundstate.hopping(h)
topology.write_berry(h)
Ejemplo n.º 5
0
sys.path.append(os.path.dirname(os.path.realpath(__file__)) + "/../../../src")

import numpy as np
from pygra import specialgeometry
from pygra.specialhopping import twisted_matrix
from pygra import meanfield
from pygra import groundstate
from pygra import geometry

g = specialgeometry.twisted_bilayer(4)
g = geometry.honeycomb_lattice()
g = g.supercell(3)
h = g.get_hamiltonian(is_sparse=True,
                      has_spin=False,
                      is_multicell=False,
                      mgenerator=twisted_matrix(ti=0.0, lambi=7.0))
mf = meanfield.guess(h, "dimerization")
scf = meanfield.Vinteraction(h,
                             nk=1,
                             filling=0.5,
                             V1=2.0,
                             V2=1.0,
                             mix=0.3,
                             mf=mf)
h = scf.hamiltonian  # get the Hamiltonian
groundstate.hopping(
    h, nrep=1, skip=lambda r1, r2: r1[2] * r2[2] < 0)  # write three replicas
h.get_bands()  # calculate band structure
h.write_onsite()