################################################################################### if __name__ == "__main__": header("BERRY CURVATURE", d.version, time.asctime()) STARTTIME = time.time() # Starts counting time if len(sys.argv) == 2: print(" Will calculate all combinations of bands from 0 up to " + str(sys.argv[1])) for gradwfc0 in range(int(sys.argv[1]) + 1): for gradwfc1 in range(int(sys.argv[1]) + 1): berry_curv(gradwfc0, gradwfc1) elif len(sys.argv) == 3: print(" Will calculate just for band " + str(sys.argv[1]) + " and " + str(sys.argv[2])) gradwfc0 = int(sys.argv[1]) gradwfc1 = int(sys.argv[2]) berry_curv(gradwfc0, gradwfc1) else: print( " ERROR in number of arguments. Has to have one or two integers." ) print(" Stoping.") print() ##################################################################################r # Finished footer(tempo(STARTTIME, time.time()))
print(" Real part of SHG saved to file sigma2r.dat") with open("sigma2i.dat", "w") as sigm: sigm.write( "# Energy (eV), sigma_xxx, sigma_yyy, sigma_xxy, sigma_xyx, sigma_xyy, \ sigma_yyx, sigma_yxy, sigma_yxx\n") for omega in np.arange(0, enermax + enerstep, enerstep): outp = "{0:.4f} {1:.4e} {2:.4e} {3:.4e} {4:.4e} {5:.4e} \ {6:.4e} {7:.4e} {8:.4e}\n" sigm.write( outp.format( omega * RY, np.imag(sigma[omega][0, 0, 0]), np.imag(sigma[omega][1, 1, 1]), np.imag(sigma[omega][0, 0, 1]), np.imag(sigma[omega][0, 1, 0]), np.imag(sigma[omega][0, 1, 1]), np.imag(sigma[omega][1, 1, 0]), np.imag(sigma[omega][1, 0, 1]), np.imag(sigma[omega][1, 0, 0]), )) sigm.close() print(" Imaginary part of SHG saved to file sigma2i.dat") # sys.exit("Stop") ################################################################################### # Finished footer(contatempo.tempo(STARTTIME, time.time()))
# # print('b'+str(banda)+'={', end = '') # for beta in range(nky): # print('{', end = '') # for alfa in range(nkx): # if alfa != nkx-1: # print(str(zarray[alfa][beta])+str(','), end = '') # else: # print(str(zarray[alfa][beta]), end = '') # if beta != nky-1: # print('},') # else: # print('}', end = '') # print('};\n') # fig = plt.figure() # ax = fig.add_subplot(111, projection='3d') # ax.plot_trisurf(xarray, yarray, zarray, linewidth=0.2, antialiased=True) plt.show() # sys.exit("Stop") # Finished endtime = time.time() footer(contatempo.tempo(starttime, endtime))