0.0.156
This commit is contained in:
parent
2f8fdae7db
commit
fc4249dd74
@ -214,7 +214,7 @@ conductance_array = guan.calculate_conductance_with_fermi_energy_array(fermi_ene
|
||||
|
||||
conductance = guan.calculate_conductance_with_barrier(fermi_energy, h00, h01, length=100, barrier_length=20, barrier_potential=1)
|
||||
|
||||
conductance = guan.calculate_conductance_with_disorder(fermi_energy, h00, h01, disorder_intensity=2.0, disorder_concentration=1.0, length=100)
|
||||
conductance = guan.calculate_conductance_with_disorder(fermi_energy, h00, h01, disorder_intensity=2.0, disorder_concentration=1.0, length=100, calculation_times=1)
|
||||
|
||||
conductance = guan.calculate_conductance_with_slice_disorder(fermi_energy, h00, h01, disorder_intensity=2.0, disorder_concentration=1.0, length=100)
|
||||
|
||||
@ -317,6 +317,8 @@ guan.plot_3d_surface(x_array, y_array, matrix, xlabel='x', ylabel='y', zlabel='z
|
||||
|
||||
guan.plot_contour(x_array, y_array, matrix, xlabel='x', ylabel='y', title='', fontsize=20, labelsize=15, cmap='jet', levels=None, show=1, save=0, filename='a', file_format='.jpg', dpi=300)
|
||||
|
||||
guan.plot_pcolor(x_array, y_array, matrix, xlabel='x', ylabel='y', title='', fontsize=20, labelsize=15, cmap='jet', levels=None, show=1, save=0, filename='a', file_format='.jpg', dpi=300)
|
||||
|
||||
guan.draw_dots_and_lines(coordinate_array, draw_dots=1, draw_lines=1, max_distance=1.1, line_style='-k', linewidth=1, dot_style='ro', markersize=3, show=1, save=0, filename='a', file_format='.eps', dpi=300)
|
||||
|
||||
guan.combine_two_images(image_path_array, figsize=(16,8), show=0, save=1, filename='a', file_format='.jpg', dpi=300)
|
||||
|
@ -1,7 +1,7 @@
|
||||
[metadata]
|
||||
# replace with your username:
|
||||
name = guan
|
||||
version = 0.0.155
|
||||
version = 0.0.156
|
||||
author = guanjihuan
|
||||
author_email = guanjihuan@163.com
|
||||
description = An open source python package
|
||||
|
@ -1,6 +1,6 @@
|
||||
Metadata-Version: 2.1
|
||||
Name: guan
|
||||
Version: 0.0.155
|
||||
Version: 0.0.156
|
||||
Summary: An open source python package
|
||||
Home-page: https://py.guanjihuan.com
|
||||
Author: guanjihuan
|
||||
|
@ -2,7 +2,7 @@
|
||||
|
||||
# With this package, you can calculate band structures, density of states, quantum transport and topological invariant of tight-binding models by invoking the functions you need. Other frequently used functions are also integrated in this package, such as file reading/writing, figure plotting, data processing.
|
||||
|
||||
# The current version is guan-0.0.155, updated on November 24, 2022.
|
||||
# The current version is guan-0.0.156, updated on November 29, 2022.
|
||||
|
||||
# Installation: pip install --upgrade guan
|
||||
|
||||
@ -1175,9 +1175,11 @@ def calculate_conductance_with_barrier(fermi_energy, h00, h01, length=100, barri
|
||||
conductance = np.trace(np.dot(np.dot(np.dot(gamma_left, green_0n_n), gamma_right), green_0n_n.transpose().conj()))
|
||||
return conductance
|
||||
|
||||
def calculate_conductance_with_disorder(fermi_energy, h00, h01, disorder_intensity=2.0, disorder_concentration=1.0, length=100):
|
||||
def calculate_conductance_with_disorder(fermi_energy, h00, h01, disorder_intensity=2.0, disorder_concentration=1.0, length=100, calculation_times=1):
|
||||
right_self_energy, left_self_energy, gamma_right, gamma_left = guan.self_energy_of_lead(fermi_energy, h00, h01)
|
||||
dim = np.array(h00).shape[0]
|
||||
conductance_averaged = 0
|
||||
for times in range(calculation_times):
|
||||
for ix in range(length+2):
|
||||
disorder = np.zeros((dim, dim))
|
||||
for dim0 in range(dim):
|
||||
@ -1193,6 +1195,8 @@ def calculate_conductance_with_disorder(fermi_energy, h00, h01, disorder_intensi
|
||||
green_nn_n = guan.green_function_nn_n(fermi_energy, h00, h01, green_nn_n, broadening=0, self_energy=right_self_energy)
|
||||
green_0n_n = guan.green_function_in_n(green_0n_n, h01, green_nn_n)
|
||||
conductance = np.trace(np.dot(np.dot(np.dot(gamma_left, green_0n_n), gamma_right), green_0n_n.transpose().conj()))
|
||||
conductance_averaged += conductance
|
||||
conductance_averaged = conductance_averaged/calculation_times
|
||||
return conductance
|
||||
|
||||
def calculate_conductance_with_slice_disorder(fermi_energy, h00, h01, disorder_intensity=2.0, disorder_concentration=1.0, length=100):
|
||||
@ -2472,6 +2476,29 @@ def plot_contour(x_array, y_array, matrix, xlabel='x', ylabel='y', title='', fon
|
||||
plt.show()
|
||||
plt.close('all')
|
||||
|
||||
def plot_pcolor(x_array, y_array, matrix, xlabel='x', ylabel='y', title='', fontsize=20, labelsize=15, cmap='jet', levels=None, show=1, save=0, filename='a', file_format='.jpg', dpi=300):
|
||||
import matplotlib.pyplot as plt
|
||||
fig, ax = plt.subplots()
|
||||
plt.subplots_adjust(bottom=0.2, right=0.75, left=0.2)
|
||||
x_array, y_array = np.meshgrid(x_array, y_array)
|
||||
contour = ax.pcolor(x_array,y_array,matrix, cmap=cmap)
|
||||
ax.set_title(title, fontsize=fontsize, fontfamily='Times New Roman')
|
||||
ax.set_xlabel(xlabel, fontsize=fontsize, fontfamily='Times New Roman')
|
||||
ax.set_ylabel(ylabel, fontsize=fontsize, fontfamily='Times New Roman')
|
||||
ax.tick_params(labelsize=labelsize)
|
||||
labels = ax.get_xticklabels() + ax.get_yticklabels()
|
||||
[label.set_fontname('Times New Roman') for label in labels]
|
||||
cax = plt.axes([0.8, 0.2, 0.05, 0.68])
|
||||
cbar = fig.colorbar(contour, cax=cax)
|
||||
cbar.ax.tick_params(labelsize=labelsize)
|
||||
for l in cbar.ax.yaxis.get_ticklabels():
|
||||
l.set_family('Times New Roman')
|
||||
if save == 1:
|
||||
plt.savefig(filename+file_format, dpi=dpi)
|
||||
if show == 1:
|
||||
plt.show()
|
||||
plt.close('all')
|
||||
|
||||
def draw_dots_and_lines(coordinate_array, draw_dots=1, draw_lines=1, max_distance=1.1, line_style='-k', linewidth=1, dot_style='ro', markersize=3, show=1, save=0, filename='a', file_format='.eps', dpi=300):
|
||||
import matplotlib.pyplot as plt
|
||||
coordinate_array = np.array(coordinate_array)
|
||||
|
Loading…
x
Reference in New Issue
Block a user