def createP_sigma(lx, ly, band): C = table.C_Sigma(ly / (2 / mp.sqrt(3)), lx / (mp.sqrt(3) / 2), band) #Values tabulated on a rectangular grid, flipped and compensated for. C = [ C[0], C[1], C[2], C[3] / (3**(1 / 2)), C[4] / (3**(1 / 2)), C[5] / (3**(1 / 2)) ] #For sqrt(3) normalisation, see paper for reference. f = lambda kx, ky, kz: C[0] * fi_As(lx, ly, kx, ky, kz) + C[1] * fi_Ax( lx, ly, kx, ky, kz) + C[2] * fi_Ay(lx, ly, kx, ky, kz) + C[3] * fi_Bs( lx, ly, kx, ky, kz) + C[4] * fi_Bx(lx, ly, kx, ky, kz) + C[ 5] * fi_By(lx, ly, kx, ky, kz) nrm = 1 / mp.sqrt( mp.conj(C[0]) * C[0] + mp.conj(C[1]) * C[1] + mp.conj(C[2]) * C[2] + 3 * (mp.conj(C[3]) * C[3] + mp.conj(C[4]) * C[4] + mp.conj(C[5]) * C[5]) + 2 * mp.re((mp.conj(C[0]) * C[3] * pss + mp.conj(C[0]) * C[4] * psx + mp.conj(C[0]) * C[5] * psy + mp.conj(C[1]) * C[3] * psx + mp.conj(C[1]) * C[4] * pxx + mp.conj(C[1]) * C[5] * pxy + mp.conj(C[2]) * C[3] * psy + mp.conj(C[2]) * C[4] * pxy + mp.conj(C[2]) * C[5] * pyy) * (mp.exp(1j * mp.fdot([lx, ly, 0], R_1)) + mp.exp(1j * mp.fdot([lx, ly, 0], R_2)) + mp.exp(1j * mp.fdot([lx, ly, 0], R_3))))) return lambda kx, ky, kz: f(kx, ky, kz) * nrm
def fi_Bx(lx, ly, kx, ky, kz): return (mp.exp(1j * mp.fdot( [lx + kx / ct.hbar, ly + ky / ct.hbar, kz / ct.hbar], R_1)) + mp.exp(1j * mp.fdot( [lx + kx / ct.hbar, ly + ky / ct.hbar, kz / ct.hbar], R_2)) + mp.exp(1j * mp.fdot( [lx + kx / ct.hbar, ly + ky / ct.hbar, kz / ct.hbar], R_3)) ) * w2px(kx, ky, kz)
def createP_pi(lx, ly): fle = fl(lx, ly, 0) phi_l = -mp.atan(mp.im(fle) / mp.re(fle)) f = lambda kx, ky, kz: (1 + 1 / (3**(1 / 2)) * mp.exp(1j * phi_l) * fl( lx + kx / ct.hbar, ly + ky / ct.hbar, kz / ct.hbar)) * w2pz( kx, ky, kz) #analytical #differential vectors, not used in nearest neighbor approximation R_12 = [R_1[0] - R_2[0], R_1[1] - R_2[1], R_1[2] - R_2[2]] R_23 = [R_2[0] - R_3[0], R_2[1] - R_3[1], R_2[2] - R_3[2]] R_31 = [R_3[0] - R_1[0], R_3[1] - R_1[1], R_3[2] - R_1[2]] nrm = mp.sqrt(1 / ( 2 + 2 * s / (3**(1 / 2)) * (mp.cos(phi_l + mp.fdot([lx, ly, 0], R_1)) + mp.cos(phi_l + mp.fdot([lx, ly, 0], R_2)) + mp.cos(phi_l + mp.fdot([lx, ly, 0], R_3))) + 2 * s2 * (mp.cos(mp.fdot([lx, ly, 0], R_12)) + mp.cos(mp.fdot( [lx, ly, 0], R_23)) + mp.cos(mp.fdot([lx, ly, 0], R_31))))) return lambda kx, ky, kz: f(kx, ky, kz) * nrm
def dot_exact(x, y): mp.dps = dps # convert to list first, see # <https://github.com/fredrik-johansson/mpmath/pull/385> return mp.fdot(x.tolist(), y.tolist())
def fl(lx, ly, lz): l = [lx, ly, lz] out = mp.exp(1j * mp.fdot(l, R_1)) + mp.exp(1j * mp.fdot(l, R_2)) + mp.exp( 1j * mp.fdot(l, R_3)) return out