示例#1
0
def main():

    # Define the system
    parameters = gasb.params_97
    hamiltonian = gasb.hamiltonian_97_k_plus()
    Width = shapes.W_STD
    a_lattice = shapes.A_STD
    syst_inf = gasb.just_lead_builder(hamiltonian,
                                      Width,
                                      a_lattice,
                                      symmetry=1)

    # Calculate the energies at kx == 0
    min_field = 0
    max_field = 5000
    N_pts = 5001
    efield_values = np.linspace(min_field, max_field, N_pts)
    energies_conf = trans.collected_energies(syst_inf, parameters,
                                             efield_values)
    energies_free = trans.continuous_levels_eF(0, 0, hamiltonian, parameters,
                                               efield_values)

    # Save the results
    path_data = './data/band_structure/'
    name       = '97_landau_levels_' + 'eF_min_' + str(min_field) + \
                '_max_' + str(max_field) + '_N_' + str(N_pts)
    np.savez(path_data + name,
             efields=efield_values,
             Energies_conf=energies_conf,
             Energies_free=energies_free)

    # Plot the results
    "Formatação para os gráficos:"
    FONT_LABELS = 18
    FONT_TITLES = 20
    font = {'family': 'serif', 'weight': 'bold', 'size': FONT_LABELS}
    matplotlib.rc('font', **font)
    plt.rc('text', usetex=True)
    plt.rc('font', family='serif')

    "Actual plot:"
    fig, ax = plt.subplots(figsize=(7, 8))
    ax.plot(efield_values,
            energies_conf,
            color='k',
            linestyle='',
            marker=',',
            linewidth=0.7)
    ax.plot(efield_values, energies_free, color='b', linewidth=2)
    ax.set_xlabel(r'eF [meV]', fontsize=FONT_TITLES)
    ax.set_ylabel(r'$\varepsilon$ [meV]', fontsize=FONT_TITLES)
    # ax.set_ylim(410, 550)
    ax.set_xlim(min_field, max_field)
    plt.tight_layout()
    plt.show()
示例#2
0
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)
示例#3
0
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()
示例#4
0
def main():
    # Define the system
    raio_simples = 10 * shapes.A_STD
    # raio_nm  = 150
    # raio_std = raio_nm * 10/shapes.A0
    print("QD radius: ", raio_simples, " Bohr radia.")

    # lattice_const_Bohr_radia = 200
    lattice_const_Bohr_radia = shapes.A_STD

    formato = shapes.Circular(raio_simples)
    H = gasb.hamiltonian_97_k_plus()
    quantum_dot = gasb.just_system_builder(H,
                                           formato,
                                           a_lattice=lattice_const_Bohr_radia)

    # Check that the system looks as intended.
    kwant.plot(quantum_dot)

    # Define parameters
    min_field = 0
    max_field = 1000
    N_pts = 1000
    eF_values = np.linspace(min_field, max_field, N_pts)
    parametros = gasb.params_97

    # Calculate and save energy levels of the dot
    energies = calc_spectrum(quantum_dot, eF_values, parametros)
    np.savez(
        "circular_quantum_dot_energies_around_445_meV_field_0_62_and_200_eigenstates_R_150nm_a_200A0.npz",
        Ef_values=eF_values,
        Energies=energies)

    # and plot the results
    plt.figure()
    plt.plot(eF_values, energies, linestyle=' ', marker=',', color='k')
    plt.xlabel("E. field [meV]")
    plt.ylabel(r"$\varepsilon$ [meV]")
    plt.tight_layout()
    plt.show()
示例#5
0
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()
示例#6
0
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)
示例#7
0
def main():
    # Define Hamiltonians
    hamiltonian = gasb.hamiltonian_97_k_plus()

    # Define the system
    symm_dir = 1  # symmetry direction
    syst_lead_up = gasb.just_lead_builder(hamiltonian, symmetry=symm_dir)

    # Set params
    eF0 = 0
    eF1 = 20
    eF2 = 60
    parametros = gasb.params_97

    # Define momentum array
    Nkx = 200
    porcent = 0.15
    momenta = np.linspace(-1, 1, Nkx) * np.pi * porcent

    # Define bands
    parametros["eF"] = eF0
    bands_left = kwant.physics.Bands(syst_lead_up, params=parametros)
    parametros["eF"] = eF1
    bands_center = kwant.physics.Bands(syst_lead_up, params=parametros)
    parametros["eF"] = eF2
    bands_right = kwant.physics.Bands(syst_lead_up, params=parametros)

    # Calculate Bands for the stripped system
    energies_left = [bands_left(k) for k in momenta]
    energies_center = [bands_center(k) for k in momenta]
    energies_right = [bands_right(k) for k in momenta]

    # Calculate the Bands for the bulk system
    bulk_left = tools.continuous_bands_2D(momenta / shapes.A_STD,
                                          0,
                                          hamiltonian,
                                          parametros,
                                          eF_value=eF0)
    bulk_center = tools.continuous_bands_2D(momenta / shapes.A_STD,
                                            0,
                                            hamiltonian,
                                            parametros,
                                            eF_value=eF1)
    bulk_right = tools.continuous_bands_2D(momenta / shapes.A_STD,
                                           0,
                                           hamiltonian,
                                           parametros,
                                           eF_value=eF2)

    # Plot bands for strip
    E_min_plot = 420
    E_max_plot = 460
    max_kx = 0.15
    fig, ax = plt.subplots(1, 3, figsize=(14, 7))
    tools.band_with_line_gasb(ax[0],
                              momenta,
                              energies_left,
                              kx_max=max_kx,
                              E_max=E_max_plot,
                              E_min=E_min_plot)
    tools.band_with_line_gasb(ax[1],
                              momenta,
                              energies_center,
                              kx_max=max_kx,
                              E_max=E_max_plot,
                              E_min=E_min_plot)
    tools.band_with_line_gasb(ax[2],
                              momenta,
                              energies_right,
                              kx_max=max_kx,
                              E_max=E_max_plot,
                              E_min=E_min_plot)

    # Plot bands for bulk
    momenta_bulk = tools.trans_momenta(momenta)
    ax[0].plot(momenta_bulk, bulk_left, linewidth=1.5, color="red")
    ax[0].set_title("x = %.1f meV" % eF0)

    ax[1].plot(momenta_bulk, bulk_center, linewidth=1.5, color="red")
    ax[1].set_title("x = %.1f meV" % eF1)

    ax[2].plot(momenta_bulk, bulk_right, linewidth=1.5, color="red")
    ax[2].set_title("x = %.1f meV" % eF2)

    plt.tight_layout()
    plt.show()
示例#8
0
def main():
    # Define Hamiltonians
    ham_up       = gasb.hamiltonian_97_up()
    ham_dn       = gasb.hamiltonian_97_down()
    ham_total  = gasb.hamiltonian_97_k_plus()

    # Define the system
    symm_dir = 1 # symmetry direction
    syst_lead_up = gasb.just_lead_builder(ham_up, symmetry = symm_dir)
    syst_lead_dn = gasb.just_lead_builder(ham_dn, symmetry = symm_dir)
    syst_total = gasb.just_lead_builder(ham_total)

    # Set params
    eF = 60
    parametros = gasb.params_97
    parametros["eF"] = eF

    # Define momentum array
    Nkx = 200
    porcent = 0.15
    momenta = np.linspace(-1, 1, Nkx) * np.pi * porcent

    # Define bands
    bands_coupled = kwant.physics.Bands(syst_total, params = parametros)
    bands_up = kwant.physics.Bands(syst_lead_up, params = parametros)
    bands_dn = kwant.physics.Bands(syst_lead_dn, params = parametros)

    # Calculate Bands for the stripped system
    energies_up = [bands_up(k) for k in momenta]
    energies_dn = [bands_dn(k) for k in momenta]
    energies_coupled = [bands_coupled(k) for k in momenta]

    # Calculate the Bands for the bulk system
    bulk_up = tools.continuous_bands_2D(momenta/shapes.A_STD, 0, ham_up, parametros, eF_value = eF)
    bulk_dn = tools.continuous_bands_2D(momenta/shapes.A_STD, 0, ham_dn, parametros, eF_value = eF)
    bulk_total = tools.continuous_bands_2D(momenta/shapes.A_STD, 0, ham_total,parametros, eF_value = eF)

    # Plot bands for strip
    E_min_plot = 420
    E_max_plot = 460

    fig, ax = plt.subplots(1, 3, figsize=(14,7))
    tools.band_with_line_gasb(ax[0], momenta, energies_up,
                            kx_max = 0.15, E_max = E_max_plot, E_min = E_min_plot)
    tools.band_with_line_gasb(ax[1], momenta, energies_dn,
                            kx_max = 0.15, E_max = E_max_plot, E_min = E_min_plot)

    tools.band_with_line_gasb(ax[2], momenta, energies_up,
                            kx_max = 0.15, E_max = E_max_plot, E_min = E_min_plot,
                            linestyle_plot = "-", color_plot = "black",
                            label_plot = "Up")
    tools.band_with_line_gasb(ax[2], momenta, energies_dn,
                            kx_max = 0.15, E_max = E_max_plot, E_min = E_min_plot,
                            linestyle_plot = "--", color_plot = "black",
                            label_plot = "Down")
    # tools.band_with_line_gasb(ax[2], momenta, energies_coupled,
    #                         kx_max = 0.15, E_max = E_max_plot, E_min = E_min_plot,
    #                         linestyle_plot = "--", color_plot = "black",
    #                         marker_plot = None, label_plot = "Coupled")

    # Plot bands for bulk
    momenta_bulk = tools.trans_momenta(momenta)
    ax[0].plot(momenta_bulk, bulk_up, linewidth=2.5, color="red")
    # ax[1].plot([0.03733],[440],marker = "o", markersize = 7, color = "blue")
    ax[0].set_title("(a)")

    ax[1].plot(momenta_bulk, bulk_dn, linewidth=2.5, color="blue")
    # ax[0].plot([0.02784],[440], marker = "o", markersize = 7, color = "red")
    ax[1].set_title("(b)")

    ax[2].set_title("(c)")
    ax[2].plot(momenta_bulk, bulk_up, linewidth=2.5, color="red")
    ax[2].plot(momenta_bulk, bulk_dn, linewidth=2.5, color="blue")
    ax[2].legend(fontsize = 13, bbox_to_anchor = (0.64, 0.7))

    plt.tight_layout()
    plt.show()
示例#9
0
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()