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_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)
|
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_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.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)
|
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]
|
[metadata]
|
||||||
# replace with your username:
|
# replace with your username:
|
||||||
name = guan
|
name = guan
|
||||||
version = 0.0.155
|
version = 0.0.156
|
||||||
author = guanjihuan
|
author = guanjihuan
|
||||||
author_email = guanjihuan@163.com
|
author_email = guanjihuan@163.com
|
||||||
description = An open source python package
|
description = An open source python package
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
Metadata-Version: 2.1
|
Metadata-Version: 2.1
|
||||||
Name: guan
|
Name: guan
|
||||||
Version: 0.0.155
|
Version: 0.0.156
|
||||||
Summary: An open source python package
|
Summary: An open source python package
|
||||||
Home-page: https://py.guanjihuan.com
|
Home-page: https://py.guanjihuan.com
|
||||||
Author: guanjihuan
|
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.
|
# 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
|
# Installation: pip install --upgrade guan
|
||||||
|
|
||||||
@ -1175,24 +1175,28 @@ 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()))
|
conductance = np.trace(np.dot(np.dot(np.dot(gamma_left, green_0n_n), gamma_right), green_0n_n.transpose().conj()))
|
||||||
return conductance
|
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)
|
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]
|
dim = np.array(h00).shape[0]
|
||||||
for ix in range(length+2):
|
conductance_averaged = 0
|
||||||
disorder = np.zeros((dim, dim))
|
for times in range(calculation_times):
|
||||||
for dim0 in range(dim):
|
for ix in range(length+2):
|
||||||
if np.random.uniform(0, 1)<=disorder_concentration:
|
disorder = np.zeros((dim, dim))
|
||||||
disorder[dim0, dim0] = np.random.uniform(-disorder_intensity, disorder_intensity)
|
for dim0 in range(dim):
|
||||||
if ix == 0:
|
if np.random.uniform(0, 1)<=disorder_concentration:
|
||||||
green_nn_n = guan.green_function(fermi_energy, h00, broadening=0, self_energy=left_self_energy)
|
disorder[dim0, dim0] = np.random.uniform(-disorder_intensity, disorder_intensity)
|
||||||
green_0n_n = copy.deepcopy(green_nn_n)
|
if ix == 0:
|
||||||
elif ix != length+1:
|
green_nn_n = guan.green_function(fermi_energy, h00, broadening=0, self_energy=left_self_energy)
|
||||||
green_nn_n = guan.green_function_nn_n(fermi_energy, h00+disorder, h01, green_nn_n, broadening=0)
|
green_0n_n = copy.deepcopy(green_nn_n)
|
||||||
green_0n_n = guan.green_function_in_n(green_0n_n, h01, green_nn_n)
|
elif ix != length+1:
|
||||||
else:
|
green_nn_n = guan.green_function_nn_n(fermi_energy, h00+disorder, h01, green_nn_n, broadening=0)
|
||||||
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)
|
||||||
green_0n_n = guan.green_function_in_n(green_0n_n, h01, green_nn_n)
|
else:
|
||||||
conductance = np.trace(np.dot(np.dot(np.dot(gamma_left, green_0n_n), gamma_right), green_0n_n.transpose().conj()))
|
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
|
return conductance
|
||||||
|
|
||||||
def calculate_conductance_with_slice_disorder(fermi_energy, h00, h01, disorder_intensity=2.0, disorder_concentration=1.0, length=100):
|
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.show()
|
||||||
plt.close('all')
|
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):
|
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
|
import matplotlib.pyplot as plt
|
||||||
coordinate_array = np.array(coordinate_array)
|
coordinate_array = np.array(coordinate_array)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user