def notestPropagatePlaneRealistic(self): label = join(test_folder, 'siesta') eigs, kpts, EF = readInfoForSTMSimulation(label=label) rho, variables, dh_cell = readCubeDensity(label=label) dh = np.array(map(vectorLength, dh_cell)) band = 30 kn = 4 kappa = 1.0 rho = rho.sum(axis=0) c, variables, domain = surfaceIntegrator(rho=rho, variables=variables) wf, variables1, dh_cell = readCubeWavefunction(label=label, band=band, kn=kn) kpt, wk = kpts[kn-1] eikr = phaseFactor(kpt, variables1) u1 = wf/eikr u2, variables2 = propagateWaveFunction( c=c, kpt=kpt, u=u1, variables=variables, kappa=kappa, ) grad_u = np.array(np.gradient(u2, *dh)) index = 5 grad_uz = grad_u[2, :, :, index] u2_plane = u2[:,:, index] plane_z = variables2[2,0,0, index] r_plane = variables2[:2, :,:, index] u3, variables3 = propagateWaveFunctionPlane( kpt=kpt, u=u2_plane, grad_uz=grad_uz, variables=r_plane, kappa=kappa, plane_z=plane_z, ) from matplotlib import pylab as plt fig = plt.figure(figsize=(8, 8)) ax = plt.gca() z = variables[2,0,0,:] v = abs(u1).sum(axis=(0,1)) ax.semilogy(z, v) z = variables2[2,0,0,:] v = abs(u2).sum(axis=(0,1)) ax.semilogy(z, v) z = variables3[2,0,0,:] v = abs(u3).sum(axis=(0,1)) #ax.semilogy(z, v) print abs(u2).sum(axis=(0,1)) print variables2[2,0,0,:] plt.show() eeeeee
def notestPropagatePlane(self): r = np.mgrid[0:10:1.1,1:10:0.8] u = np.ones(r.shape[1:], dtype=complex) grad_uz = np.ones(r.shape[1:], dtype=complex) u, r = propagateWaveFunctionPlane( u=u, grad_uz=grad_uz, variables=r, kappa=2, ) from matplotlib import pylab as plt plt.pcolormesh(u.real)