Ejemplo n.º 1
0
def get_geometry():
    lattice_name = getbox("lattice")  # get the option
    n = int(get("width"))  # thickness of the system
    #  lattice_name = builder.get_object("lattice").get_active_text()
    if lattice_name == "Chain":
        g = geometry.chain()
    if lattice_name == "Honeycomb":
        g = geometry.honeycomb_lattice()
    elif lattice_name == "Square":
        g = geometry.square_lattice()
    elif lattice_name == "Kagome":
        g = geometry.kagome_lattice()
    elif lattice_name == "Lieb":
        g = geometry.lieb_lattice()
    elif lattice_name == "Triangular":
        g = geometry.triangular_lattice()
    elif lattice_name == "Honeycomb zigzag":
        g = geometry.honeycomb_zigzag_ribbon(n)
    elif lattice_name == "Honeycomb armchair":
        g = geometry.honeycomb_armchair_ribbon(n)
    ##################
    elif lattice_name == "Graphene":
        g = geometry.honeycomb_lattice()
    elif lattice_name == "Bilayer graphene AB":
        g = multilayers.get_geometry("AB")
    elif lattice_name == "Bilayer graphene AA":
        g = multilayers.get_geometry("AA")
    if g.dimensionality == 2:  # original is a 2d geometry
        import ribbon
        g = ribbon.bulk2ribbon(g, n=n, clean=False)
    nsuper = int(get("nsuper"))
    g = g.supercell(nsuper)
    return g
Ejemplo n.º 2
0
def get_geometry():
    """ Create a 0d island"""
    lattice_name = getbox("lattice")  # get the option
    n = int(get("width"))  # thickness of the system
    #  lattice_name = builder.get_object("lattice").get_active_text()
    if lattice_name == "Chain":
        g = geometry.chain()
    if lattice_name == "Honeycomb":
        g = geometry.honeycomb_lattice()
    elif lattice_name == "Square":
        g = geometry.square_lattice()
    elif lattice_name == "Kagome":
        g = geometry.kagome_lattice()
    elif lattice_name == "Lieb":
        g = geometry.lieb_lattice()
    elif lattice_name == "Triangular":
        g = geometry.triangular_lattice()
    elif lattice_name == "Honeycomb zigzag":
        g = geometry.honeycomb_zigzag_ribbon(n)
    elif lattice_name == "Honeycomb armchair":
        g = geometry.honeycomb_armchair_ribbon(n)
    if g.dimensionality == 2:  # original is a 2d geometry
        import ribbon
        g = ribbon.bulk2ribbon(g, n=n)
    nsuper = int(get("nsuper"))
    g = g.supercell(nsuper)
    return g
Ejemplo n.º 3
0
import sys
import numpy as np
import os
sys.path.append("../../pygra")

import geometry
import sculpt

g = geometry.kagome_lattice()
#g = geometry.honeycomb_lattice()
g.has_sublattice = True
g.sublattice = [-1, 1, 0]
import ribbon

g = ribbon.bulk2ribbon(g, n=20)
h = g.get_hamiltonian()
ms = []  # zeeman fields
m1 = np.array([1., 0., 0.])
m2 = np.array([-.5, np.sqrt(3.) / 2., 0.])
m3 = np.array([-.5, -np.sqrt(3.) / 2., 0.])
mm = 3.0
for (r, s) in zip(g.r, g.sublattice):
    if r[1] < 0.0:
        if s == -1: ms.append(m1 * mm)
        if s == 1: ms.append(m2 * mm)
        if s == 0: ms.append(m3 * mm)
    else: ms.append([0., 0., 0.])


# swave
def fs(r):
Ejemplo n.º 4
0
# 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
from specialhopping import twisted,twisted_matrix
import specialgeometry
g = specialgeometry.twisted_bilayer(2) # get a small unit cell
import ribbon
g = ribbon.bulk2ribbon(g,n=4) # create a ribbon geometry
h = g.get_hamiltonian(is_sparse=True,has_spin=False,
     mgenerator=twisted_matrix(ti=0.4,lambi=7.0))
g.write() # write structure
import ldos
ldos.ldos(h,mode="arpack",nk=10,delta=0.1,nrep=3) # write the LDOS
h.get_bands(num_bands=20,operator="yposition") # write the bands
Ejemplo n.º 5
0
Archivo: main.py Proyecto: zx-sdu/pygra
# zigzag ribbon
import sys

sys.path.append("../../../pygra")  # add pygra library

import geometry
import ribbon

g = geometry.honeycomb_lattice()
g = ribbon.bulk2ribbon(g, n=5, boundary=[6, 1])
h = g.get_hamiltonian(has_spin=False)
h.get_bands()
g = g.supercell(4)
g.write()
Ejemplo n.º 6
0
 def geometry_builder(n):
     g = geometry.square_lattice()
     return ribbon.bulk2ribbon(g,n=n,clean=True)
Ejemplo n.º 7
0
 def geometry_builder(n):
     g = geometry.triangular_lattice()
     return ribbon.bulk2ribbon(g,n=n,clean=True)
Ejemplo n.º 8
0
# Add the root path of the pygra library
import os ; import sys ; sys.path.append(os.environ['PYGRAROOT'])

# zigzag ribbon
from pygra importgeometry
import ribbon
g = geometry.honeycomb_lattice()
g = ribbon.bulk2ribbon(g,n=5,boundary=[6,1])
h = g.get_hamiltonian(has_spin=False)
h.get_bands()
g = g.supercell(4)
g.write()
Ejemplo n.º 9
0
 def geometry_builder(n): 
   g = geometry.kagome_lattice()
   return ribbon.bulk2ribbon(g,n=n)