Exemple #1
0
from hubbard import HubbardHamiltonian, density, sp2, plot
import sys
import numpy as np
import sisl

# Build sisl Geometry object
mol = sisl.get_sile('clar-goblet.xyz').read_geometry()
mol.sc.set_nsc([1, 1, 1])
mol = mol.move(-mol.center(what='xyz'))

# 3NN tight-binding model
Hsp2 = sp2(mol, t1=2.7, t2=0.2, t3=.18, dim=2)
H = HubbardHamiltonian(Hsp2)
H.random_density()
H.set_polarization(up=[6], dn=[28])
n_AFM = H.n

f = open('FM-AFM.dat', 'w')

mixer = sisl.mixing.PulayMixer(0.7, history=7)

for u in np.arange(5, 0, -0.25):
    # We approach the solutions for different U values
    H.U = u
    mixer.clear()

    # AFM case first
    success = H.read_density(
        'clar-goblet.nc')  # Try reading, if we already have density on file
    if not success:
        H.n = n_AFM.copy()
# Set U and kT for the whole calculation
U = 3.
kT = 0.025

# Build zigzag GNR
ZGNR = sisl.geom.zgnr(2)

# and 3NN TB Hamiltonian
H_elec = sp2(ZGNR, t1=2.7, t2=0.2, t3=0.18)

# Hubbard Hamiltonian of elecs
MFH_elec = HubbardHamiltonian(H_elec, U=U, nkpt=[102, 1, 1], kT=kT)

# Start with random densities
MFH_elec.random_density()
# Converge Electrode Hamiltonians
dn = MFH_elec.converge(density.calc_n, mixer=sisl.mixing.PulayMixer(weight=.7, history=7), tol=1e-10)

# Central region is a repetition of the electrodes without PBC
HC = H_elec.tile(3, axis=0)
HC.set_nsc([1, 1, 1])

# Map electrodes in the device region
elec_indx = [range(len(H_elec)), range(len(HC.H)-len(H_elec), len(HC.H))]

# MFH object
MFH_HC = HubbardHamiltonian(HC.H, n=np.tile(MFH_elec.n, 3), U=U, kT=kT)

# First create NEGF object
negf = NEGF(MFH_HC, [(MFH_elec, '-A'), (MFH_elec, '+A')], elec_indx)