https://github.com/freude/NanoNet
Raw File
Tip revision: b2b6352c2ea80217ba602409eb17dff2dcff2fc5 authored by Jackson on 02 November 2018, 06:06:41 UTC
made some changes to assist bug testing, results for bismuth bilayer are similar to literature when third-nearest neighbours are ignored. we therefore suspect there is an error in the determination of these neighbours. preliminary plotting of the nearest neighbours suggests some of the third-nearest neighbours are missing. jackson to investigate.
Tip revision: b2b6352
hamiltonian_initializer.py
from __future__ import absolute_import
import sys
import numpy as np
from .atoms import Atom
from . import diatomic_matrix_element as dme
from .hamiltonian import Hamiltonian
from .hamiltonian_sparse import HamiltonianSp


def set_tb_params(**kwargs):
    for item in kwargs:
        if item.startswith('PARAMS_'):
            setattr(dme, item, kwargs[item])


def initializer(**kwargs):

    set_tb_params(**kwargs)
    Atom.orbital_sets = kwargs.get('orbital_sets', {'Si': 'SiliconSP3D5S', 'H': 'HydrogenS'})
    sys.modules[__name__].VERBOSITY = kwargs.get('VERBOSITY', 1)

    xyz = kwargs.get('xyz', {})
    nn_distance = kwargs.get('nn_distance', 2.7)
    sparse = kwargs.get('sparse', 0)
    sigma = kwargs.get('sigma', 1.1)
    num_eigs = kwargs.get('num_eigs', 14)

    if sparse:
        h = HamiltonianSp(xyz=xyz, nn_distance=nn_distance, sigma=sigma, num_eigs=num_eigs)
    else:
        h = Hamiltonian(xyz=xyz, nn_distance=nn_distance)

    h.initialize()

    primitive_cell = kwargs.get('primitive_cell', [0, 0, 0])

    if np.sum(np.abs(np.array(primitive_cell))) > 0:
        h.set_periodic_bc(primitive_cell=primitive_cell)

    return h
back to top