[gpaw-users] (no subject)
DAMEGARIN SAMBIANI
sambianidamegarin at gmail.com
Tue Sep 17 19:12:17 CEST 2024
Dear gpaw user
I am reaching out to you as a user of GPAW, currently involved in quantum
transport simulations. My research project focuses on the use of
non-equilibrium Green's functions (NEGF) to study transport in
nanojunctions. In this context, I am trying to extract the real-space
Hamiltonian for use in a transport code.
I have consulted the GPAW documentation and user forums but have not found
a clear or direct method for extracting the real-space Hamiltonian from
GPAW calculations. I would like to know if GPAW provides a specific feature
for performing this extraction or if there is a recommended way to proceed.
Below, you will find my proposed method for extracting the real-space
Hamiltonian.
I look forward to your response and would be grateful for any assistance
you can provide.
Kind regards,
import math
from ase.transport.tools import subdiagonalize, cutcoupling
from gpaw.lcao.pwf2 import get_lcao_xc, get_xc2
# from diff_matrices import Diff_mat_1D, Diff_mat_2D
from scipy.sparse.linalg import spsolve
import scipy.sparse as sp
import numpy as np
import sys
from ase.transport.greenfunction import GreenFunction
from ase.transport.selfenergy import LeadSelfEnergy, BoxProbe
from numpy import linalg
from gpaw.fftw import (
check_fft_size,
create_plans,
FFTPlans,
FFTPlan,
FFTWPlan,
FFTWPlans,
NumpyFFTPlan,
NumpyFFTPlans,
)
# from gpaw.transport.greenfunction import GreenFunction
from gpaw.density import Density, RealSpaceDensity
# from gpaw.densities import Densities
import pickle
from ase.transport.calculators import TransportCalculator
import pickle as pickle
from gpaw.lcao.tools import (
remove_pbc,
get_lcao_hamiltonian,
get_lead_lcao_hamiltonian,
get_realspace_hs,
lead_kspace2realspace,
)
from gpaw.coulomb import get_vxc
from gpaw.lcao.projected_wannier import get_bfs
from gpaw.lcao.el_ph import ElectronPhononCouplingMatrix
from gpaw.lcao.tightbinding import TightBinding
from gpaw import GPAW, Mixer, FermiDirac
from ase import Atoms
from scipy.linalg import solve
import matplotlib.pyplot as plt
# Setup the Atoms for the scattering region.
a = 2.41 # Pt binding length
b = 0.90 # H2 binding length
c = 1.70 # Pt-H binding length
L = 7.00 # width of unit cell
atoms = Atoms("Pt5H2Pt5", pbc=(1, 0, 0), cell=[9 * a + b + 2 * c, L, L])
atoms.positions[:5, 0] = [i * a for i in range(5)]
atoms.positions[-5:, 0] = [i * a + b + 2 * c for i in range(4, 9)]
atoms.positions[5:7, 0] = [4 * a + c, 4 * a + c + b]
atoms.positions[:, 1:] = L / 2.0
# Attach a GPAW calculator
calc = GPAW(
h=0.3,
xc="PBE",
basis="szp(dzp)",
occupations=FermiDirac(width=0.1),
kpts=(2, 1, 1),
mode="lcao",
txt="pt_h2_lcao_scat.txt",
mixer=Mixer(0.1, 5, weight=100.0),
symmetry={"point_group": False, "time_reversal": False},
)
atoms.calc = calc
atoms.get_potential_energy() # Converge everything!
Ef = atoms.calc.get_fermi_level()
# Real-space Hamiltonian for the scattering region
S1 = TightBinding(atoms, calc)
H_NMM, S_NMM = S1.h_and_s() # (2,158,158)
H, S = H_NMM[0], S_NMM[0]
np.savetxt("H.txt", H)
np.savetxt("S.txt", S)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listserv.fysik.dtu.dk/pipermail/gpaw-users/attachments/20240917/718a010d/attachment.htm>
More information about the gpaw-users
mailing list