Exemple #1
0
def get(n):
    g = islands.get_geometry(name="triangular", n=n, nedges=20,
                             rot=0.0)  # get an island
    # maximum distance to the origin
    h = g.get_hamiltonian(has_spin=False)  # get the Hamiltonian
    h.set_filling(.5)
    m = h.project_interactions(n=4)
    return np.mean(np.abs(m))
Exemple #2
0
# Add the root path of the pygra library
import os ; import sys ; sys.path.append(os.environ['PYGRAROOT'])

from pygra import islands
from pygra import spectrum
from pygra import operators

import numpy as np
g = islands.get_geometry(name="honeycomb",n=8,nedges=6,rot=0.0) # get an island
i = g.get_central()[0]
#g = g.remove(i)

h = g.get_hamiltonian(has_spin = False)
h.add_peierls(0.05)
#h.add_sublattice_imbalance(0.1)
ops = operators.get_envelop(h,sites=range(h.intra.shape[0]),d=0.3)

fv = operators.get_valley(h,projector=True) # valley function
#fv = operators.get_valley_taux(h,projector=True) # valley function
ops = [fv()@o for o in ops] # local times valley

ys = spectrum.ev(h,operator=ops).real

np.savetxt("EV.OUT",np.array([g.x,g.y,ys]).T)



Exemple #3
0
# Add the root path of the pygra library
import os
import sys
sys.path.append(os.environ['PYGRAROOT'])

from pygra import islands
import numpy as np
g = islands.get_geometry(name="honeycomb", n=3, nedges=3,
                         rot=0.0)  # get an island
# maximum distance to the origin
h = g.get_hamiltonian(has_spin=True)  # get the Hamiltonian
from pygra import meanfield
g.write()

mf = meanfield.guess(h, mode="ferro")
scf = meanfield.Vinteraction(h,
                             filling=0.5,
                             U=3.0,
                             V1=1.0,
                             mf=mf,
                             maxerror=1e-9)
scf.hamiltonian.write_hopping(spin_imbalance=True)
scf.hamiltonian.write_magnetization()
#scf.hamiltonian.get_bands()
Exemple #4
0
# Add the root path of the pygra library
import os ; import sys ; sys.path.append(os.environ['PYGRAROOT'])

from pygra import islands
import numpy as np
g = islands.get_geometry(name="honeycomb",n=10,nedges=4,rot=0.0,clean=False) 
h = g.get_hamiltonian(has_spin=False)
h.add_haldane(.1)
from pygra import topology
#op = h.get_operator("valley",delta=1e-2)
topology.real_space_chern(h)
Exemple #5
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 islands
from pygra import interactions
from pygra import scftypes
import numpy as np
g = islands.get_geometry(name="honeycomb",
                         n=40,
                         nedges=3,
                         rot=np.pi / 3,
                         clean=False)  # get an island
g.write()
exit()
h = g.get_hamiltonian()  # get the Hamiltonian
scf = scftypes.hubbardscf(h, g=1.0, mag=[[0, 0, 1] for r in g.r])
scf.hamiltonian.get_bands()
Exemple #6
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 islands

import numpy as np
from pygra import geometry
g = islands.get_geometry(name="honeycomb", n=4, nedges=3, rot=np.pi / 3)
#g = geometry.bichain()
#g = g.supercell(10)
g.dimensionality = 0
h = g.get_hamiltonian(has_spin=True)
#h.add_rashba(0.3)
from pygra import susceptibility
from pygra import parallel
parallel.cores = 5
susceptibility.dominant_correlation(h, write=True)
Exemple #7
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 islands
import numpy as np
from pygra import kekule
# geometry of a graphene island
g = islands.get_geometry(name="honeycomb", n=6, nedges=6)
rk = kekule.kekule_positions(g.r)  # return centers of the jkekule ordering

# now plot the different positions

import matplotlib.pyplot as plt
m = np.array(g.r).T  # positions of the honeycomb lattice
mc = np.array(rk).T  # positions of the Kekule ordering
print(m.shape)
print(mc.shape)
plt.scatter(m[0], m[1], c="red", s=60, label="lattice")
plt.scatter(mc[0], mc[1], c="blue", s=200, label="Kekule center")
plt.legend()

plt.show()
Exemple #8
0
# Add the root path of the pygra library
import os ; import sys ; sys.path.append(os.environ['PYGRAROOT'])

from pygra import islands
import numpy as np
from pygra import kekule
# geometry of a graphene island
g = islands.get_geometry(name="honeycomb",n=6,nedges=6)
rk = kekule.kekule_positions(g.r) # return centers of the jkekule ordering


# now plot the different positions

import matplotlib.pyplot as plt
m = np.array(g.r).T # positions of the honeycomb lattice
mc = np.array(rk).T # positions of the Kekule ordering
print(m.shape)
print(mc.shape)
plt.scatter(m[0],m[1],c="red",s=60,label="lattice")
plt.scatter(mc[0],mc[1],c="blue",s=200,label="Kekule center")
plt.legend()

plt.show()
Exemple #9
0
# Add the root path of the pygra library
import os
import sys
sys.path.append(os.environ['PYGRAROOT'])

from pygra import islands
from pygra import densitymatrix
import numpy as np
import time
g = islands.get_geometry(name="honeycomb", n=4, clean=False)  # get an island
h = g.get_hamiltonian()  # get the Hamiltonian
h.add_rashba(.2)
h.add_zeeman([0., 0., 0.3])
g.write()
t1 = time.clock()
dm = densitymatrix.full_dm(h, use_fortran=False)
t2 = time.clock()
dmf = densitymatrix.full_dm(h, use_fortran=True)
t3 = time.clock()
print("Error = ", np.sum(np.abs(dm - dmf)))
print("Time Fortran = ", t3 - t2)
print("Time Python = ", t2 - t1)
Exemple #10
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 islands

import numpy as np
from pygra import geometry
g = islands.get_geometry(name="honeycomb",n=20,nedges=20,rot=0.) 
#g = geometry.bichain()
#g = g.supercell(100)
g.dimensionality = 0
h = g.get_hamiltonian(has_spin=False)
#h.add_haldane(1.0)
h.add_peierls(0.1)
h.shift_fermi(0.5)
#h.add_sublattice_imbalance(0.2)
#h.get_bands()
#exit()
#h.shift_fermi(0.1)
from pygra import timeevolution
from pygra import parallel
parallel.cores = 5
from pygra import chi
#chi.chargechi_reciprocal(h) ;  exit()
timeevolution.evolve_local_state(h,i=0,ts=np.linspace(0.,100,100),
        mode="green")