Former-commit-id: 9f8e7ed97e3701ca1b6dc3cbe36dc35ce45fff4a
This commit is contained in:
Marek Nečada 2017-05-08 22:02:56 +03:00
parent c1db33fcf6
commit 92b33d7993
2 changed files with 9 additions and 7 deletions

View File

@ -303,7 +303,7 @@ kxmaplist = np.concatenate((np.array([0]),np.cumsum(np.linalg.norm(np.diff(klist
klist = qpms.generate_trianglepoints(kdensity, v3d=True, include_origin=True)*3*math.pi/(3*kdensity*hexside) klist = qpms.generate_trianglepoints(kdensity, v3d=True, include_origin=True)*3*math.pi/(3*kdensity*hexside)
TMatrices_om = TMatrices_interp(freq) TMatrices_om = TMatrices_interp(freq)
svdres = hexlattice_zsym_getSVD(TMatrices_om=TMatrices_om, epsilon_b=epsilon_b, hexside=hexside, maxlayer=maxlayer, svdres = qpms.hexlattice_zsym_getSVD(lMax=lMax, TMatrices_om=TMatrices_om, epsilon_b=epsilon_b, hexside=hexside, maxlayer=maxlayer,
omega=freq, klist=klist, gaussianSigma=gaussianSigma, onlyNmin=(0 if svdout else svn)) omega=freq, klist=klist, gaussianSigma=gaussianSigma, onlyNmin=(0 if svdout else svn))
if svdout: if svdout:
((svUfullTElist, svSfullTElist, svVfullTElist), (svUfullTMlist, svSfullTMlist, svVfullTMlist)) = svdres ((svUfullTElist, svSfullTElist, svVfullTElist), (svUfullTMlist, svSfullTMlist, svVfullTMlist)) = svdres

View File

@ -435,22 +435,24 @@ def hexlattice_get_AB(lMax, k_hexside, maxlayer, circular=True, return_points =
d['self_tr'] = tpdict['points'] d['self_tr'] = tpdict['points']
return d return d
from scipy.constants import c
def hexlattice_zsym_getSVD(TMatrices_om, epsilon_b, hexside, maxlayer, omega, klist, gaussianSigma=False, onlyNmin=0): def hexlattice_zsym_getSVD(lMax, TMatrices_om, epsilon_b, hexside, maxlayer, omega, klist, gaussianSigma=False, onlyNmin=0):
nelem = lMax * (lMax + 2)
n2id = np.identity(2*nelem) n2id = np.identity(2*nelem)
n2id.shape = (2,nelem,2,nelem) n2id.shape = (2,nelem,2,nelem)
nan = float('nan') nan = float('nan')
k_0 = omega * math.sqrt(epsilon_b) / c k_0 = omega * math.sqrt(epsilon_b) / c
tdic = qpms.hexlattice_get_AB(lMax,k_0*hexside,maxlayer) tdic = hexlattice_get_AB(lMax,k_0*hexside,maxlayer)
a_self = tdic['a_self'][:,:nelem,:nelem] a_self = tdic['a_self'][:,:nelem,:nelem]
b_self = tdic['b_self'][:,:nelem,:nelem] b_self = tdic['b_self'][:,:nelem,:nelem]
a_u2d = tdic['a_u2d'][:,:nelem,:nelem] a_u2d = tdic['a_u2d'][:,:nelem,:nelem]
b_u2d = tdic['b_u2d'][:,:nelem,:nelem] b_u2d = tdic['b_u2d'][:,:nelem,:nelem]
a_d2u = tdic['a_d2u'][:,:nelem,:nelem] a_d2u = tdic['a_d2u'][:,:nelem,:nelem]
b_d2u = tdic['b_d2u'][:,:nelem,:nelem] b_d2u = tdic['b_d2u'][:,:nelem,:nelem]
unitcell_translations = tdic['self_tr']*hexside*s3 unitcell_translations = tdic['self_tr']*hexside*_s3
u2d_translations = tdic['u2d_tr']*hexside*s3 u2d_translations = tdic['u2d_tr']*hexside*_s3
d2u_translations = tdic['d2u_tr']*hexside*s3 d2u_translations = tdic['d2u_tr']*hexside*_s3
if gaussianSigma: if gaussianSigma:
unitcell_envelope = np.exp(-np.sum(tdic['self_tr']**2,axis=-1)/(2*gaussianSigma**2)) unitcell_envelope = np.exp(-np.sum(tdic['self_tr']**2,axis=-1)/(2*gaussianSigma**2))