update to guan project
This commit is contained in:
@@ -1,3 +1,3 @@
|
||||
import gjh
|
||||
import guan
|
||||
|
||||
gjh.test()
|
||||
guan.test()
|
@@ -1,4 +1,4 @@
|
||||
import gjh
|
||||
import guan
|
||||
import numpy as np
|
||||
import cmath
|
||||
from math import *
|
||||
@@ -14,7 +14,7 @@ def hamiltonian_function(k): # SSH model
|
||||
hamiltonian[1,0] = gamma+lambda0*cmath.exp(1j*k)
|
||||
return hamiltonian
|
||||
|
||||
wilson_loop_array = gjh.calculate_wilson_loop(hamiltonian_function)
|
||||
wilson_loop_array = guan.calculate_wilson_loop(hamiltonian_function)
|
||||
print('wilson loop =', wilson_loop_array)
|
||||
p = np.log(wilson_loop_array)/2/pi/1j
|
||||
print('p =', p, '\n')
|
@@ -1,20 +1,20 @@
|
||||
import gjh
|
||||
import guan
|
||||
import numpy as np
|
||||
|
||||
x = np.array([1, 2, 3])
|
||||
y = np.array([5, 6, 7])
|
||||
gjh.write_one_dimensional_data(x, y, filename='one_dimensional_data')
|
||||
guan.write_one_dimensional_data(x, y, filename='one_dimensional_data')
|
||||
|
||||
matrix = np.zeros((3, 3))
|
||||
matrix[0, 1] = 11
|
||||
gjh.write_two_dimensional_data(x, y, matrix, filename='two_dimensional_data')
|
||||
guan.write_two_dimensional_data(x, y, matrix, filename='two_dimensional_data')
|
||||
|
||||
|
||||
x_read, y_read = gjh.read_one_dimensional_data('one_dimensional_data')
|
||||
x_read, y_read = guan.read_one_dimensional_data('one_dimensional_data')
|
||||
print(x_read, '\n')
|
||||
print(y_read, '\n\n')
|
||||
|
||||
x_read, y_read, matrix_read = gjh.read_two_dimensional_data('two_dimensional_data')
|
||||
x_read, y_read, matrix_read = guan.read_two_dimensional_data('two_dimensional_data')
|
||||
print(x_read, '\n')
|
||||
print(y_read, '\n')
|
||||
print(matrix_read)
|
@@ -1,5 +1,5 @@
|
||||
import gjh
|
||||
import guan
|
||||
|
||||
gjh.download_with_scihub()
|
||||
# gjh.download_with_scihub('address')
|
||||
# gjh.download_with_scihub(num=3)
|
||||
guan.download_with_scihub()
|
||||
# guan.download_with_scihub('address')
|
||||
# guan.download_with_scihub(num=3)
|
@@ -1,6 +1,6 @@
|
||||
import gjh
|
||||
import guan
|
||||
|
||||
print('sigma_0:\n', gjh.sigma_0(), '\n')
|
||||
print('sigma_x:\n', gjh.sigma_x(), '\n')
|
||||
print('sigma_y:\n', gjh.sigma_y(), '\n')
|
||||
print('sigma_z:\n', gjh.sigma_z(), '\n')
|
||||
print('sigma_0:\n', guan.sigma_0(), '\n')
|
||||
print('sigma_x:\n', guan.sigma_x(), '\n')
|
||||
print('sigma_y:\n', guan.sigma_y(), '\n')
|
||||
print('sigma_z:\n', guan.sigma_z(), '\n')
|
@@ -1,5 +1,5 @@
|
||||
import gjh
|
||||
import guan
|
||||
|
||||
print(gjh.finite_size_along_one_direction(3), '\n')
|
||||
print(gjh.finite_size_along_two_directions_for_square_lattice(2, 2), '\n')
|
||||
print(gjh.finite_size_along_three_directions_for_cubic_lattice(2, 2, 2), '\n')
|
||||
print(guan.finite_size_along_one_direction(3), '\n')
|
||||
print(guan.finite_size_along_two_directions_for_square_lattice(2, 2), '\n')
|
||||
print(guan.finite_size_along_three_directions_for_cubic_lattice(2, 2, 2), '\n')
|
@@ -1,4 +1,4 @@
|
||||
import gjh
|
||||
import guan
|
||||
import numpy as np
|
||||
from math import *
|
||||
import functools
|
||||
@@ -6,14 +6,14 @@ import functools
|
||||
x = np.linspace(-pi, pi, 100)
|
||||
y = np.linspace(-pi, pi, 100)
|
||||
|
||||
hamiltonian_function = functools.partial(gjh.one_dimensional_fourier_transform, unit_cell=0, hopping=1)
|
||||
eigenvalue_array = gjh.calculate_eigenvalue_with_one_parameter(x, hamiltonian_function)
|
||||
gjh.plot(x, eigenvalue_array, xlabel='k', ylabel='E', type='-o')
|
||||
hamiltonian_function = functools.partial(guan.one_dimensional_fourier_transform, unit_cell=0, hopping=1)
|
||||
eigenvalue_array = guan.calculate_eigenvalue_with_one_parameter(x, hamiltonian_function)
|
||||
guan.plot(x, eigenvalue_array, xlabel='k', ylabel='E', type='-o')
|
||||
|
||||
hamiltonian_function = functools.partial(gjh.two_dimensional_fourier_transform_for_square_lattice, unit_cell=0, hopping_1=1, hopping_2=1)
|
||||
eigenvalue_array = gjh.calculate_eigenvalue_with_two_parameters(x, y, hamiltonian_function)
|
||||
gjh.plot_3d_surface(x, y, eigenvalue_array, xlabel='kx', ylabel='ky', zlabel='E')
|
||||
hamiltonian_function = functools.partial(guan.two_dimensional_fourier_transform_for_square_lattice, unit_cell=0, hopping_1=1, hopping_2=1)
|
||||
eigenvalue_array = guan.calculate_eigenvalue_with_two_parameters(x, y, hamiltonian_function)
|
||||
guan.plot_3d_surface(x, y, eigenvalue_array, xlabel='kx', ylabel='ky', zlabel='E')
|
||||
|
||||
hamiltonian_function = functools.partial(gjh.three_dimensional_fourier_transform_for_cubic_lattice, k3=0, unit_cell=0, hopping_1=1, hopping_2=1, hopping_3=1)
|
||||
eigenvalue_array = gjh.calculate_eigenvalue_with_two_parameters(x, y, hamiltonian_function)
|
||||
gjh.plot_3d_surface(x, y, eigenvalue_array, xlabel='kx', ylabel='ky', zlabel='E')
|
||||
hamiltonian_function = functools.partial(guan.three_dimensional_fourier_transform_for_cubic_lattice, k3=0, unit_cell=0, hopping_1=1, hopping_2=1, hopping_3=1)
|
||||
eigenvalue_array = guan.calculate_eigenvalue_with_two_parameters(x, y, hamiltonian_function)
|
||||
guan.plot_3d_surface(x, y, eigenvalue_array, xlabel='kx', ylabel='ky', zlabel='E')
|
@@ -1,12 +1,12 @@
|
||||
import gjh
|
||||
import guan
|
||||
import numpy as np
|
||||
from math import *
|
||||
import functools
|
||||
|
||||
x = np.linspace(-pi, pi, 100)
|
||||
Ny = 10
|
||||
unit_cell = gjh.finite_size_along_two_directions_for_graphene(1, Ny)
|
||||
hopping = gjh.hopping_along_zigzag_direction_for_graphene(Ny)
|
||||
hamiltonian_function = functools.partial(gjh.one_dimensional_fourier_transform, unit_cell=unit_cell, hopping=hopping)
|
||||
eigenvalue_array = gjh.calculate_eigenvalue_with_one_parameter(x, hamiltonian_function)
|
||||
gjh.plot(x, eigenvalue_array, xlabel='k', ylabel='E')
|
||||
unit_cell = guan.finite_size_along_two_directions_for_graphene(1, Ny)
|
||||
hopping = guan.hopping_along_zigzag_direction_for_graphene(Ny)
|
||||
hamiltonian_function = functools.partial(guan.one_dimensional_fourier_transform, unit_cell=unit_cell, hopping=hopping)
|
||||
eigenvalue_array = guan.calculate_eigenvalue_with_one_parameter(x, hamiltonian_function)
|
||||
guan.plot(x, eigenvalue_array, xlabel='k', ylabel='E')
|
@@ -1,7 +1,7 @@
|
||||
import gjh
|
||||
import guan
|
||||
import numpy as np
|
||||
|
||||
hamiltonian = gjh.finite_size_along_two_directions_for_square_lattice(2,2)
|
||||
hamiltonian = guan.finite_size_along_two_directions_for_square_lattice(2,2)
|
||||
fermi_energy_array = np.linspace(-4, 4, 400)
|
||||
total_dos_array = gjh.total_density_of_states_with_fermi_energy_array(fermi_energy_array, hamiltonian, broadening=0.1)
|
||||
gjh.plot(fermi_energy_array, total_dos_array, xlabel='E', ylabel='Total DOS', type='-o')
|
||||
total_dos_array = guan.total_density_of_states_with_fermi_energy_array(fermi_energy_array, hamiltonian, broadening=0.1)
|
||||
guan.plot(fermi_energy_array, total_dos_array, xlabel='E', ylabel='Total DOS', type='-o')
|
@@ -1,28 +1,28 @@
|
||||
import gjh
|
||||
import guan
|
||||
import numpy as np
|
||||
|
||||
fermi_energy = 0
|
||||
N1 = 3
|
||||
N2 = 4
|
||||
hamiltonian = gjh.finite_size_along_two_directions_for_square_lattice(N1,N2)
|
||||
LDOS = gjh.local_density_of_states_for_square_lattice(fermi_energy, hamiltonian, N1=N1, N2=N2)
|
||||
hamiltonian = guan.finite_size_along_two_directions_for_square_lattice(N1,N2)
|
||||
LDOS = guan.local_density_of_states_for_square_lattice(fermi_energy, hamiltonian, N1=N1, N2=N2)
|
||||
print('square lattice:\n', LDOS, '\n')
|
||||
|
||||
h00 = gjh.finite_size_along_one_direction(N2)
|
||||
h00 = guan.finite_size_along_one_direction(N2)
|
||||
h01 = np.identity(N2)
|
||||
LDOS = gjh.local_density_of_states_for_square_lattice_using_dyson_equation(fermi_energy, h00=h00, h01=h01, N2=N2, N1=N1)
|
||||
LDOS = guan.local_density_of_states_for_square_lattice_using_dyson_equation(fermi_energy, h00=h00, h01=h01, N2=N2, N1=N1)
|
||||
print(LDOS, '\n\n')
|
||||
gjh.plot_contour(range(N1), range(N2), LDOS)
|
||||
guan.plot_contour(range(N1), range(N2), LDOS)
|
||||
|
||||
|
||||
N1 = 3
|
||||
N2 = 4
|
||||
N3 = 5
|
||||
hamiltonian = gjh.finite_size_along_three_directions_for_cubic_lattice(N1, N2, N3)
|
||||
LDOS = gjh.local_density_of_states_for_cubic_lattice(fermi_energy, hamiltonian, N1=N1, N2=N2, N3=N3)
|
||||
hamiltonian = guan.finite_size_along_three_directions_for_cubic_lattice(N1, N2, N3)
|
||||
LDOS = guan.local_density_of_states_for_cubic_lattice(fermi_energy, hamiltonian, N1=N1, N2=N2, N3=N3)
|
||||
print('cubic lattice:\n', LDOS, '\n')
|
||||
|
||||
h00 = gjh.finite_size_along_two_directions_for_square_lattice(N2, N3)
|
||||
h00 = guan.finite_size_along_two_directions_for_square_lattice(N2, N3)
|
||||
h01 = np.identity(N2*N3)
|
||||
LDOS = gjh.local_density_of_states_for_cubic_lattice_using_dyson_equation(fermi_energy, h00, h01, N3=N3, N2=N2, N1=N1)
|
||||
LDOS = guan.local_density_of_states_for_cubic_lattice_using_dyson_equation(fermi_energy, h00, h01, N3=N3, N2=N2, N1=N1)
|
||||
print(LDOS)
|
@@ -1,8 +1,8 @@
|
||||
import gjh
|
||||
import guan
|
||||
import numpy as np
|
||||
|
||||
fermi_energy_array = np.linspace(-5, 5, 400)
|
||||
h00 = gjh.finite_size_along_one_direction(4)
|
||||
h00 = guan.finite_size_along_one_direction(4)
|
||||
h01 = np.identity(4)
|
||||
conductance_array = gjh.calculate_conductance_with_fermi_energy_array(fermi_energy_array, h00, h01)
|
||||
gjh.plot(fermi_energy_array, conductance_array, xlabel='E', ylabel='Conductance', type='-o')
|
||||
conductance_array = guan.calculate_conductance_with_fermi_energy_array(fermi_energy_array, h00, h01)
|
||||
guan.plot(fermi_energy_array, conductance_array, xlabel='E', ylabel='Conductance', type='-o')
|
@@ -1,7 +1,7 @@
|
||||
import gjh
|
||||
import guan
|
||||
import numpy as np
|
||||
|
||||
fermi_energy = 0
|
||||
h00 = gjh.finite_size_along_one_direction(4)
|
||||
h00 = guan.finite_size_along_one_direction(4)
|
||||
h01 = np.identity(4)
|
||||
gjh.print_or_write_scattering_matrix(fermi_energy, h00, h01)
|
||||
guan.print_or_write_scattering_matrix(fermi_energy, h00, h01)
|
@@ -1,4 +1,4 @@
|
||||
import gjh
|
||||
import guan
|
||||
import numpy as np
|
||||
from math import *
|
||||
|
||||
@@ -14,5 +14,5 @@ def hamiltonian_function(kx, ky): # one QAH model with chern number 2
|
||||
hamiltonian[1, 1] = -(m+2*t3*sin(kx)+2*t3*sin(ky)+2*t2*cos(kx+ky))
|
||||
return hamiltonian
|
||||
|
||||
chern_number = gjh.calculate_chern_number_for_square_lattice(hamiltonian_function, precision=100)
|
||||
chern_number = guan.calculate_chern_number_for_square_lattice(hamiltonian_function, precision=100)
|
||||
print(chern_number)
|
Reference in New Issue
Block a user