def main(): """ Here we have only the calls for the actual calculations. Some remainders: * Each system width has a different Hamiltonian * Each Hamiltonian have two different formulations: - One with k_plus (k_x + 1j*k_y) at the element H_12; - Other with k_minus (k_x - 1j*k_y) at the same element; - The formulations are labeled as "plus" and "minus"; """ """ # Default values for building the systems: # # Remembering that the Hamiltonian's parameters # adopt units which lengths are mesured in units # of Bohr's radius. """ Length = shapes.L_STD Width = shapes.W_STD shapeScattering = shapes.Rect(Width, Length) # shapeScattering = shapes.ConstrictSmoothRect(Wmax = shapes.W_STD, # Wmin = 0.5 * shapes.W_STD, # beta = 1 * shapes.A_STD, # Lmax = shapes.L_STD, # Lconst = 0.5 * shapes.L_STD) # calculateForManyeFs(shapeScattering) calculateForManyFermiEnergies(shapeScattering) """
def main(): """ Here we have only the calls for the actual calculations. Some remainders: * Each system width has a different Hamiltonian * Each Hamiltonian have two different formulations: - One with k_plus (k_x + 1j*k_y) at the element H_12; - Other with k_minus (k_x - 1j*k_y) at the same element; - The formulations are labeled as "plus" and "minus"; """ """ # Default values for building the systems: # # Remembering that the Hamiltonian's parameters # adopt units which lengths are mesured in units # of Bohr's radius. """ shapeScattering = shapes.Rect(shapes.W_STD, shapes.L_STD) tipos_solicitados = ["plus"] calculateForManyeFs(tipos_solicitados, shapeScattering)
def main(): # Define the system: hamiltonian_up = gasb.hamiltonian_97_up() hamiltonian_dn = gasb.hamiltonian_97_up_y_inv() lead_ham = gasb.hamiltonian_97_up(-100) centralShape = shapes.Rect() syst_up = gasb.system_builder(hamiltonian_up, lead_ham, centralShape) syst_dn = gasb.system_builder(hamiltonian_dn, lead_ham, centralShape) # Calculate the wave_function: energia = 442 parametros = gasb.params_97 parametros['eF'] = 60 # parametros = dict(GammaLead = parametros["GammaC"], V = 100, **parametros ) wf_up = kwant.wave_function(syst_up, energy=energia, params=parametros) wf_dn = kwant.wave_function(syst_dn, energy=energia, params=parametros) modes_up = wf_up(0) # from left lead modes_dn = wf_dn(0) # from left lead # Calculate the density: rho_up = kwant.operator.Density(syst_up) rho_dn = kwant.operator.Density(syst_dn) psi_up = sum(rho_up(p) for p in modes_up) psi_dn = sum(rho_dn(p) for p in modes_dn) # Calculate dos in a line dos_in_line_up, y_values_up = density_in_line(syst_up, modes_up) dos_in_line_dn, y_values_dn = density_in_line(syst_dn, modes_dn) # Plot the results: fig, ax = plt.subplots(2, 2, figsize=(14, 6)) y_values_up = y_values_up * (shapes.A0 / 10) # conversion to nm^{-1} y_values_dn = y_values_dn * (shapes.A0 / 10) # conversion to nm^{-1} min_line, max_line = -0.7 * shapes.L_STD, 0.7 * shapes.L_STD map_density(ax[0][0], syst_up, psi_up, colormap="Reds") ax[0][0].vlines(0, min_line, max_line, linestyle="--") ax[0][0].set_title("spin up") map_density(ax[1][0], syst_dn, psi_dn, colormap="Blues") ax[1][0].vlines(0, min_line, max_line, linestyle="--") ax[1][0].set_title("spin up inv.") ax[0][1].plot(y_values_up, normalize(dos_in_line_up), marker=".", markersize=2.5, linestyle="-", color="red") ax[1][1].plot(y_values_dn, normalize(dos_in_line_dn), marker=".", markersize=2.5, linestyle="-") plt.tight_layout() plt.show()
def main(): ## Dimensions of the system: Length = shapes.W_STD Width = shapes.W_STD shapeScattering = shapes.Rect(Width, Length) params_raw = gasb.params_97 gammaLead = 36.917 V_shift = 100 params_dict = dict(GammaLead=gammaLead, V=V_shift, **params_raw) hamiltonian_syst = gasb.hamiltonian_97_k_plus() hamiltonian_lead = gasb.free_ham(norbs=6) sistema = gasb.system_builder(hamiltonian_syst, hamiltonian_lead, shapeScattering) # sistema_dn = gasb.system_builder(hamiltonian_syst_dn, hamiltonian_lead, shapeScattering) Fermi_initial, Fermi_final, N_values = 435, 440, 2001 Fermi_values = np.linspace(Fermi_initial, Fermi_final, N_values) params_dict['eF'] = 62. ## " Names for the files: " L_nm = Length * shapes.A0 * 1 / 10 path_data = "./data/transport/" name_preffixe = "data_" + str(Fermi_initial) + "_" + str( Fermi_final) + "_meV_Fermi_" name_Fermi = name_preffixe + str(N_values) + "_L_" + str(L_nm) name_transport_up = name_preffixe + "Transport_UP_" + str( N_values) + "_L_" + str(L_nm) name_transport_dn = name_preffixe + "Transport_DN_" + str( N_values) + "_L_" + str(L_nm) name_transport_total = name_preffixe + "Transport_Total_" + str( N_values) + "_L_" + str(L_nm) np.save(path_data + name_Fermi + ".npy", Fermi_values) np.savetxt(path_data + name_Fermi + ".txt", Fermi_values) ## " Transport: " transport_up, transport_dn, transport_total = calc_transp_Fermi( sistema, Fermi_values, params_dict) # Save the results in "numpy" format and "txt" # np.save(path_data + name_transport_up + ".npy", transport_up) # np.savetxt(path_data + name_transport_up + ".txt", transport_up) # # np.save(path_data + name_transport_dn + ".npy", transport_dn) # np.savetxt(path_data + name_transport_dn + ".txt", transport_dn) np.save(path_data + name_transport_total + ".npy", transport_total) np.savetxt(path_data + name_transport_total + ".txt", transport_total)
def make_system(esp="97", gammaLead=36.917, V_shift=100, width = shapes.W_STD, length = shapes.L_STD): shapeScattering = shapes.Rect(width, length) # folder_fig = esp + folder_suf params_raw = eval("gasb.params_" + esp) params_dict = dict(GammaLead = gammaLead, V = V_shift, **params_raw) hamiltonian_syst = eval("gasb.hamiltonian_" + esp + "_k_plus()") hamiltonian_lead = gasb.free_ham(norbs = 6) sistema = gasb.system_builder(hamiltonian_syst, hamiltonian_lead, shapeScattering) return sistema
def main(): parameters = gasb.params_97 hamiltonian = gasb.hamiltonian_97_k_minus() syst_shape = shapes.Rect(shapes.W_STD, shapes.L_STD) system = gasb.just_system_builder(hamiltonian, syst_shape, a_lattice=10 * shapes.A_STD) sub_matrix = system.hamiltonian_submatrix(params=parameters, sparse=True) print(type(sub_matrix)) print(sub_matrix.shape) eF_values = np.linspace(0, 200, 201) plot_spectrum(system, eF_values, parameters)
def main(): """ This code is for generate maps of current, without bands structures and with custom operators. This will allow a better exploratory process. """ # Define the system hamiltonian = gasb.hamiltonian_97_k_plus() lead_ham = gasb.free_ham(norbs = 6) centralShape = shapes.Rect(Wmax = 300, Lmax=500) syst = gasb.system_builder(hamiltonian, lead_ham, centralShape, a_lattice=20) fig, axis = plt.subplots(1,1,figsize=(10,5)) kwant.plot(syst, ax = axis, show = False) axis.axis('off') axis.set_aspect('equal') plt.show()
def main(): """ This code is for generate maps of current, without bands structures and with custom operators. This will allow a better exploratory process. """ # Define the system hamiltonian = gasb.hamiltonian_97_k_plus() lead_ham = gasb.free_ham(norbs = 6) centralShape = shapes.Rect() syst = gasb.system_builder(hamiltonian, lead_ham, centralShape) # Calculate the wave function: energia = 442 parametros = gasb.params_97 parametros['eF'] = 60 parametros['Eta2'] = 0 parametros['Eta3'] = 0 parametros = dict(GammaLead = parametros["GammaC"], V = 100, **parametros) wf = kwant.wave_function(syst, energy=energia, params=parametros) # modes = wf_dn(0) # from left lead # Define the operator σz = tinyarray.array([[1,0],[0,-1]]) Mz = np.kron(σz, np.eye(3)) # Current colormap = "Reds" J_spin = kwant.operator.Current(syst, Mz) current_spin = sum(J_spin(psi, params = parametros) for psi in wf(0)) # Plot and/or save the data fig, axis = plt.subplots(1,1, figsize=(8,8)) kwant.plotter.current(syst, current_spin, cmap = colormap, colorbar = False, show = False, ax = axis) edit_axis(axis) plt.show()
def main(): shapeScattering = shapes.Rect(shapes.W_STD, shapes.L_STD) params_raw = gasb.params_97 gammaLead = 36.917 V_shift = 100 params_dict = dict(GammaLead=gammaLead, V=V_shift, **params_raw) hamiltonian_syst = gasb.hamiltonian_97_k_plus() hamiltonian_lead = gasb.free_ham(norbs=6) sistema = gasb.system_builder(hamiltonian_syst, hamiltonian_lead, shapeScattering) eF_initial, eF_final, N_values = 62, 64, 501 eF_values = np.linspace(eF_initial, eF_final, N_values) "Transport: " energy = 440 transport = np.empty(len(eF_values)) for i in range(len(eF_values)): params_dict['eF'] = eF_values[i] # compute the scattering matrix at a given energy smatrix = kwant.smatrix(sistema, energy, params=params_dict) # compute the transmission probability from lead 0 to lead 1 transport[i] = smatrix.transmission(1, 0) path_data = "./data/transport/" name_preffixe = "data_" + str(eF_initial) + "_" + str(eF_final) + "_" name_eF = name_preffixe + "eF_" + str(N_values) name_transport = name_preffixe + "Transport_" + str(N_values) np.save(path_data + name_eF + ".npy", eF_values) np.savetxt(path_data + name_eF + ".txt", eF_values) np.save(path_data + name_transport + ".npy", transport) np.savetxt(path_data + name_transport + ".txt", transport)
def main(): # Define the system: hamiltonian = gasb.hamiltonian_97_k_plus() # hamiltonian = gasb.hamiltonian_97_down() lead_ham = gasb.free_ham(6) centralShape = shapes.Rect() syst = gasb.system_builder(hamiltonian, lead_ham, centralShape) # Calculate the wave_function: energia = 448 parametros = gasb.params_97 parametros['Eta3'] = 0 parametros['Eta2'] = 0 parametros['eF'] = 60 parametros = dict(GammaLead = parametros["GammaC"], V = 100, **parametros ) wf = kwant.wave_function(syst, energy = energia, params = parametros) modes_left = wf(0) modes_right = wf(1) # modes_total = np.vstack((wf(0), wf(1))) # Calculate the density: sigma_z = tinyarray.array([[1,0],[0,-1]]) spin_proj= np.kron(sigma_z, np.eye(3)) identity = np.eye(6) rho = kwant.operator.Density(syst, spin_proj) psi_left = sum(rho(p) for p in modes_left) psi_right = sum(rho(p) for p in modes_right) # Calculate dos in a line dos_in_line_from_left = density_in_line(syst, psi) dos_in_line_from_both = density_in_line(syst, np.vstack((wf(0),wf(1)))) plt.plot(sum(dos_in_line_from_both)) plt.show() # print(dos_in_line.shape) # print(dos_in_line) plot_dos_in_line(dos_in_line_from_left) # plot_dos_in_line(dos_in_line_from_both) print(sum(dos_in_line_from_both).shape) # Plot the results: colorRight = "seismic" colorLeft = "seismic" fig, ax = plt.subplots(2,2,figsize=(14,6)) y_values_left = y_values_left * (shapes.A0 / 10) # conversion to nm^{-1} y_values_right = y_values_right * (shapes.A0 / 10) # conversion to nm^{-1} min_line, max_line = -0.7 * shapes.L_STD, 0.7 * shapes.L_STD map_density(ax[0][0], syst, psi_left, colormap = colorRight) ax[0][0].vlines(0, min_line, max_line, linestyle = "--") ax[0][0].set_title("left lead") map_density(ax[1][0], syst, psi_right, colormap = colorLeft) ax[1][0].vlines(0, min_line, max_line, linestyle = "--") ax[1][0].set_title("right lead") ax[0][1].plot(y_values_left, normalize(dos_in_line_from_left), marker = ".", markersize = 2.5, linestyle = "-" ) ax[1][1].plot(y_values_right, normalize(dos_in_line_from_right), marker = ".", markersize = 2.5, linestyle = "-" ) plt.tight_layout() plt.show()