示例#1
0
def gutz_model_setup(u=0.0, nmesh=5000):
    '''Set up calculations for semi-circular DOS with two-ghost orbitals.
    '''
    # semi-circular energy mesh
    sc = special.semicirular()
    e_list = sc.get_e_list_of_uniform_wt(nmesh=nmesh)

    a = tb.AtomsTB("N", [(0, 0, 0)], cell=(1, 1, 1))
    a.set_orbitals_spindeg(orbitals=[("p")])
    # set up hk_list
    hk_list = [np.array([ \
            [e*1.e-0, 0, 0.j    ],\
            [0      , e, 0      ], \
            [0      , 0, e*1.e-0]]) for e in e_list]
    aTB = tb.TB(a, hk_list=hk_list)

    # dummy k-point list
    kps = e_list
    num_k = len(kps)
    kps_wt = 1.0 / num_k * np.ones((num_k))
    if aTB.Atoms.spindeg:
        kps_wt *= 2
    num_e = 0.0
    num_band_max = 3

    # GPARAMBANDS.h5

    h1e_list = [
        np.zeros((num_band_max * 2, num_band_max * 2), dtype=np.complex)
    ]
    ginput.save_gparambands(kps_wt, num_e, num_band_max, \
            ensemble=1, h1e_list=h1e_list)

    # GPARAM.h5
    # self-energy structure
    sigma = np.zeros((6, 6), dtype=int)
    sigma[0::2, 0::2] = np.arange(1, 10).reshape((3, 3))
    sigma[1::2, 1::2] = sigma[0::2, 0::2]

    # Coulomb matrix
    v2e = np.zeros((6, 6, 6, 6), dtype=np.complex)
    v2e[2, 2, 2, 2] = v2e[2, 2, 3, 3] = v2e[3, 3, 2, 2] = v2e[3, 3, 3, 3] = u
    vdc2_list = np.array([[0, 0, -u / 2, -u / 2, 0, 0]])

    ginput.save_gparam(na2_list=[6],
                       iembeddiag=-3,
                       imix=0,
                       sigma_list=[sigma],
                       v2e_list=[v2e],
                       nval_top_list=[6],
                       vdc2_list=vdc2_list)

    # BAREHAM_0.h5
    aTB.save_bareham(kps)
示例#2
0
def gutz_model_setup(u=0.0, nmesh=5000, norb=1, tiny=0.0, mu=0):
    '''Set up calculations for semi-circular DOS with two-ghost orbitals.
    '''
    # semi-circular energy mesh
    sc = special.semicirular()
    e_list = sc.get_e_list_of_uniform_wt(nmesh=nmesh)

    a = tb.AtomsTB("N", [(0, 0, 0)], cell=(1, 1, 1))
    a.set_orbitals_spindeg(orbitals=[tuple(["s" for i in range(norb)])])

    # set up hk_list
    hk_list = [get_hk1(e, tiny, norb) for e in e_list]
    aTB = tb.TB(a, hk_list=hk_list)

    # dummy k-point list
    kps = e_list
    num_k = len(kps)
    kps_wt = 1.0 / num_k * np.ones((num_k))
    if aTB.Atoms.spindeg:
        kps_wt *= 2
    num_e = 0.0
    norb2 = norb * 2

    # GPARAMBANDS.h5

    h1e_list = [np.zeros((norb2, norb2), dtype=np.complex)]
    ginput.save_gparambands(kps_wt, num_e, norb, \
            ensemble=1, h1e_list=h1e_list)

    # GPARAM.h5
    # self-energy structure
    sigma = np.zeros((norb2, norb2), dtype=int)
    sigma[0::2, 0::2] = np.arange(1,norb**2+1).reshape( \
            (norb,norb))
    sigma[1::2, 1::2] = sigma[0::2, 0::2]

    # Coulomb matrix
    v2e = np.zeros((norb2, norb2, norb2, norb2), dtype=np.complex)
    v2e[0, 0, 0, 0] = v2e[0, 0, 1, 1] = v2e[1, 1, 0, 0] = v2e[1, 1, 1, 1] = u
    vdc2_list = np.array([np.zeros((norb2))])
    vdc2_list[0, 0:2] = -u / 2 + mu

    ginput.save_gparam(na2_list=[norb2],
                       iembeddiag=-3,
                       imix=0,
                       sigma_list=[sigma],
                       v2e_list=[v2e],
                       nval_top_list=[norb2],
                       vdc2_list=vdc2_list,
                       max_iter=5000)

    # BAREHAM_0.h5
    aTB.save_bareham(kps)
示例#3
0
def gutz_model_setup(u=0.0, spindeg=True, num_e=2., iembeddiag=-1):
    '''Set up Gutzwiller calculations for 2d body-centered square lattice.

    Parameters:

    * u: real number
      Hubbard U.
    * spindeg: boolean number
      whether to keep spin degeneracy or not.
    * num_e: real number
      number of electron per unit cell
    * iembeddiag: integer
      flag for method to solve the embedding Hamiltonian.

      * -3: valence truncation ED with S=0 (spin-singlet) constraint;
      * -1: valence truncation ED;
      * 10: Hartree-Fock.

    Result:

    Create all the necessary input file of ``GPARAMBANDS.h5``, ``GPARAM.h5``,
    and ``BAREHAM_0.h5``, for *CyGutz* calculation.
    '''

    # two "H" atoms in the square unit cell, one at the corner
    # and one at the center.
    symbols = ['H', 'H']
    scaled_positions = [(0, 0, 0), (0.5, 0.5, 0)]
    cell = np.identity(3)
    a = tb.AtomsTB(symbols=symbols,
                   scaled_positions=scaled_positions,
                   cell=cell)

    # set spin degeneracy accordingly.
    a.set_orbitals_spindeg(spindeg=spindeg)

    # create a tight-binding model class given the AtomsTB.
    aTB = tb.TB(a)

    # set real space (nearest neighbour) hopping elements.
    t = -1.0
    aTB.set_hop([
        ((0, 0, 0), 0, 1, t),
        ((-1, 0, 0), 0, 1, t),
        ((0, -1, 0), 0, 1, t),
        ((-1, -1, 0), 0, 1, t),
        ((0, 0, 0), 1, 0, t),
        ((1, 0, 0), 1, 0, t),
        ((0, 1, 0), 1, 0, t),
        ((1, 1, 0), 1, 0, t),
    ])

    # set 2d k-mesh
    kps_size = (50, 50, 1)
    kps = kpoints.monkhorst_pack(kps_size)

    # set uniform k-point weight
    num_k = len(kps)
    kps_wt = 1.0 / num_k * np.ones((num_k))
    if aTB.Atoms.spindeg:
        kps_wt *= 2

    # se maximal number of bands (here we have two bands.)
    num_band_max = 2

    # set list of one-body part of the local Hamiltonian (trivial here.)
    h1e_list = [np.array([[
        0,
    ]], dtype=np.complex) for symbol in symbols]

    # create ``GPARAMBANDS.h5`` file
    ginput.save_gparambands(kps_wt, num_e, num_band_max, h1e_list=h1e_list)

    # cerate ``BAREHAM_0.h5`` file.
    aTB.save_bareham(kps)

    # for initializing CyGutz calculation
    from pyglib.gutz.batch_init import batch_initialize

    if spindeg:
        spin_polarization = 'n'
    else:
        spin_polarization = 'y'

    # the default settings are good for this model.
    batch_initialize(cell=cell,
                     scaled_positions=scaled_positions,
                     symbols=symbols,
                     idx_equivalent_atoms=[0, 1],
                     unique_u_list_ev=[u],
                     iembeddiag=iembeddiag,
                     spin_polarization=spin_polarization,
                     updn_full_list=[1, -1])

    # save the aTB
    with open('aTB.pckl', 'wb') as f:
        pickle.dump([a, aTB], f)
示例#4
0
def gutz_model_setup(u=0.0, nmesh=5000, mu=0):
    '''Set up Gutzwiller calculations for 1-band model with semi-circular DOS.

    Parameters:

    * u: real number
      Hubbard U.
    * nmesh: interger number
      number of energy mesh
    * mu: real number
      chemical potential

    Result:

    Create all the necessary input file of ``GPARAMBANDS.h5``, ``GPARAM.h5``,
    and ``BAREHAM_0.h5``, for *CyGutz* calculation.
    '''
    # get semi-circular class, predifined in pyglib.model.special
    sc = special.semicircular()

    # get semi-circular energy mesh
    e_list = sc.get_e_list_of_uniform_wt(nmesh=nmesh)

    # get atomic structure with 1 atom per unit cell.
    a = tb.AtomsTB("N", [(0, 0, 0)], cell=(1, 1, 1))

    # specify single s-orbital and orbital dimensions.
    a.set_orbitals_spindeg(orbitals=[('s')])
    norb = 1
    norb2 = norb * 2

    # get a list of one-body Hamilonian for the enrgy mesh.
    hk_list = [np.array([[e + 0.j]]) for e in e_list]

    # get the tight-binding model
    aTB = tb.TB(a, hk_list=hk_list)

    # here the energy mesh is the same as k-points.
    kps = e_list
    num_k = len(kps)

    # set uniform k-point weight.
    kps_wt = 1.0 / num_k * np.ones((num_k))

    # Include the spin degeneracy to k-point weight.
    if aTB.Atoms.spindeg:
        kps_wt *= 2

    # We will work with grand canonical model, num_e will not be used.
    num_e = 0.0

    # list of one-body part of the local Hamiltonians.
    # here the s-orbital is located at zero.
    h1e_list = [np.zeros((norb2, norb2), dtype=np.complex)]

    # generate GPARAMBANDS.h5
    # ensemble is set to 1 for grand canonical system.
    ginput.save_gparambands(kps_wt, num_e, norb, \
            ensemble=1, h1e_list=h1e_list, delta=1.e-8)

    # set self-energy structure
    sigma = np.zeros((norb2, norb2), dtype=int)
    sigma[0::2, 0::2] = np.arange(1,norb**2+1).reshape( \
            (norb,norb))
    sigma[1::2, 1::2] = sigma[0::2, 0::2]

    # set Coulomb matrix
    v2e = np.zeros((norb2, norb2, norb2, norb2), dtype=np.complex)
    v2e[0, 0, 0, 0] = v2e[0, 0, 1, 1] = v2e[1, 1, 0, 0] = v2e[1, 1, 1, 1] = u

    # set the potential shift such that the system has particle-hole
    # symmetry with recpect to zero.
    # also include chemical potential here.
    vdc2_list = np.array([np.zeros((norb2))])
    vdc2_list[0, 0:2] = -u / 2 + mu

    # generate GPARAM.h5 file.
    ginput.save_gparam(na2_list=[norb2],
                       iembeddiag=-1,
                       imix=0,
                       sigma_list=[sigma],
                       v2e_list=[v2e],
                       nval_top_list=[norb2],
                       vdc2_list=vdc2_list,
                       max_iter=500)

    # generate BAREHAM_0.h5 file.
    aTB.save_bareham(kps)
示例#5
0
文件: test_tb.py 项目: henhans/CyGutz
import numpy as np
from ase.dft import kpoints
import pyglib.gutz.ginput as ginput
import pyglib.model.tbASE as tb
import scipy.constants as s_const

# The following is a simple test for the 1-d Hubbard model.

a = tb.AtomsTB("N", [(0, 0, 0)], cell=(1, 1, 1))
a.set_orbitals_spindeg(orbitals=[("s", "p")])
aTB = tb.TB(a)
aTB.set_hop([((1, 0, 0), 0, 0, -1), ((-1, 0, 0), 0, 0, -1),
             ((1, 0, 0), 1, 1, -1), ((-1, 0, 0), 1, 1, -1),
             ((0, 0, 0), 0, 1, 0.25), ((0, 0, 0), 1, 0, 0.25)])

kps_size = (100, 1, 1)
kps = kpoints.monkhorst_pack(kps_size)

num_k = len(kps)
kps_wt = 1.0 / num_k * np.ones((num_k))
if aTB.Atoms.spindeg:
    kps_wt *= 2
num_e = 1.2
num_band_max = 2

# GPARAMBANDS.h5
h1e_list = [np.array([[0,0,0.25,0],[0,0,0,0.25],[0.25,0,0,0],[0,0.25,0,0]], \
        dtype=np.complex)]
ginput.save_gparambands(kps_wt, num_e, num_band_max, h1e_list=h1e_list)
# GPARAM.h5
sigma = np.zeros((4, 4), dtype=np.int32)