Пример #1
0
import os

qhroot = os.path.dirname(os.path.realpath(__file__)) + "/../../"
sys.path.append(qhroot + "/pysrc/")  # python libraries

from interfacetk import qtwrap  # import the library with simple wrappaers to qt4
getbox = qtwrap.getbox  # get the value of a certain variable
window = qtwrap.main()  # this is the main interface
get = window.get  # get the value of a certain variable

from interfacetk.qh_interface import *  # import all the libraries needed
from interfacetk import common  # common routines for all the geometries

common.initialize(qtwrap)  # do several common initializations

qtwrap.set_combobox("scf_initialization", meanfield.spinful_guesses)
qtwrap.set_combobox("bands_color", operators.operator_list)


def get_geometry(modify=True):
    """ Create a 0d island"""
    lattice_name = getbox("lattice")  # get the option
    if lattice_name == "Honeycomb":
        geometry_builder = geometry.honeycomb_lattice
    elif lattice_name == "Honeycomb 4 sites":
        geometry_builder = geometry.honeycomb_lattice_square_cell
    elif lattice_name == "Square":
        geometry_builder = geometry.square_lattice
    elif lattice_name == "Single square":
        geometry_builder = geometry.single_square_lattice
    elif lattice_name == "Kagome":
Пример #2
0
is_checked = qtwrap.is_checked  # get the value of a certain variable
window = qtwrap.main()  # this is the main interface

from interfacetk.qh_interface import *  # import all the libraries needed
from interfacetk import common  # common routines for all the geometries
common.initialize(qtwrap)  # do several common initializations

from pygra import parallel

from interfacetk import interfacetk
modify_geometry = lambda x: interfacetk.modify_geometry(x, qtwrap)

qtwrap.set_combobox("multilayer_type",
                    cs=[
                        "Twisted bilayer", "Aligned bilayer AA",
                        "Aligned bilayer AB", "Aligned trilayer ABC",
                        "Twisted trilayer 010", "Twisted trilayer 001",
                        "Twisted bi-bilayer AB AB", "Twisted bi-bilayer AB BA",
                        "Twisted bi-trilayer ABC"
                    ])


def get_geometry(modify=True):
    """ Create a 2d honeycomb lattice"""
    n = int(qtwrap.get("cell_size"))  # size of the unit cell
    name = qtwrap.getbox("multilayer_type")
    if name == "Twisted bilayer":
        g = specialgeometry.twisted_bilayer(n)
    elif name == "Aligned bilayer AA":
        g = specialgeometry.twisted_multilayer(n, rot=[0, 0])
    elif name == "Aligned bilayer AB":
        gb = specialgeometry.multilayer_graphene(l=[0, 1])
qhroot = os.environ["QHROOT"]  # root path
sys.path.append(qhroot + "/pysrc/")  # python libraries

from interfacetk import qtwrap  # import the library with simple wrappaers to qt4
get = qtwrap.get  # get the value of a certain variable
getbox = qtwrap.getbox  # get the value of a certain variable
window = qtwrap.main()  # this is the main interface

from interfacetk.qh_interface import *  # import all the libraries needed
from interfacetk import common
common.initialize(qtwrap)  # initilizations

# set the different possible multilayers

cs = specialgeometry.multilayer_codes(n=4)
qtwrap.set_combobox("lattice", cs=cs)


def get_geometry(modify=True):
    """ Create a 0d island"""
    lattice = getbox("lattice")  # get the option
    ns = []  # empt list
    for il in lattice:
        if il == "A": ns += [-1]
        elif il == "B": ns += [0]
        elif il == "C": ns += [1]
        else: print("Error", il)
    g = specialgeometry.multilayer_graphene(l=ns)
    nsuper = int(get("nsuper"))
    g = g.supercell(nsuper)
    if modify: g = modify_geometry(g)  # modify the geometry