I am using Atomistix ToolKit 13.8.1 [Build 809ce91].
I want to find the minimum of imaginary part of complex k for given energy and kpoints in 2D Brilluoin zone. Following script ( see at the end) for simple perovskite returns me k-point and minimum of kappa in given the energy window. However if I use the same script, with different structure for example sqrt(2)xsqrt(2)x2 orthorhombic cell, I get kpoints and [[]], because k_complex returns me extra empty [PhysicalQuantity([],1/Ang)]. Can you please help me to fix the script so that it works for all.
Thank you.
from NanoLanguage import *
import itertools, numpy
bulk_configuration = nlread('scf.nc', BulkConfiguration)[0]
# Number of k-points in each cell direction
n0,n1 = (2, 2)
ne=1
# ----------------------------------------------------------------
# Generate a uniform k-point sampling grid for the reciprocal unit cell (NOT the Brillouin zone)
k0 = numpy.linspace(-0.5,0.5,n0)
k1 = numpy.linspace(-0.5,0.5,n1)
kpoints = numpy.array(list(itertools.product(k0,k1)))
f=open("kpt_min_kappa.dat", "w")
# Evaluate the band structure in all k-i
# Select the desired bands
for kpt in range(len(kpoints)):
kpoint=kpoints[kpt]
cbs = ComplexBandstructure(
configuration=bulk_configuration,
energies=numpy.linspace(0.0,0.0,ne)*eV,
k_point = kpoint,
energy_zero_parameter=FermiLevel,
)
k_real, k_complex = cbs.evaluate()
imag_k=[]
print k_complex
for (j, energy) in enumerate(cbs.energies().inUnitsOf(eV)):
if len(k_complex[j]) > 0:
print len(k_complex[j])
for x in numpy.array(k_complex[j]):
print x
ki = x.imag
imag_k.append(ki)
minkim=min(imag_k)
f.write("{} {} \n".format(kpoint, minkim))
f.close()