From 275a12024d0f4368694e336e375d6e8a7a9c387a Mon Sep 17 00:00:00 2001 From: guanjihuan Date: Thu, 25 Jan 2024 16:05:04 +0800 Subject: [PATCH] update --- ...lation_using_Dyson_equations_in_cubic_lattice.py | 13 +------------ ...g_Dyson_equations_in_cubic_lattice_version_II.py | 13 +------------ ...ct_inverseion_of_Hamiltonian_of_cubic_lattice.py | 11 ++--------- ...ation_using_Dyson_equations_in_square_lattice.py | 13 +------------ ...t_inverseion_of_Hamiltonian_of_square_lattice.py | 11 ++--------- 5 files changed, 7 insertions(+), 54 deletions(-) diff --git a/2020.12.31_DOS_calculation_using_Dyson_equations/cubic_lattice/DOS_calculation_using_Dyson_equations_in_cubic_lattice.py b/2020.12.31_DOS_calculation_using_Dyson_equations/cubic_lattice/DOS_calculation_using_Dyson_equations_in_cubic_lattice.py index 6ea382e..ef23289 100644 --- a/2020.12.31_DOS_calculation_using_Dyson_equations/cubic_lattice/DOS_calculation_using_Dyson_equations_in_cubic_lattice.py +++ b/2020.12.31_DOS_calculation_using_Dyson_equations/cubic_lattice/DOS_calculation_using_Dyson_equations_in_cubic_lattice.py @@ -4,9 +4,6 @@ The newest version of this code is on the web page: https://www.guanjihuan.com/a """ import numpy as np -import matplotlib.pyplot as plt -from math import * - def matrix_00(width, length): h00 = np.zeros((width*length, width*length)) @@ -20,11 +17,9 @@ def matrix_00(width, length): h00[(x+1)*width+y, x*width+y] = 1 return h00 - def matrix_01(width, length): h01 = np.identity(width*length) return h01 - def main(): height = 2 # z @@ -40,8 +35,7 @@ def main(): for j0 in range(width): print(' y=', j0+1, ':') for k0 in range(length): - print(' x=', k0+1, ' ', -np.imag(G_ii_n_array[i0, k0*width+j0, k0*width+j0])/pi) # 态密度 - + print(' x=', k0+1, ' ', -np.imag(G_ii_n_array[i0, k0*width+j0, k0*width+j0])/np.pi) # 态密度 def G_ii_n_with_Dyson_equation(width, length, height, E, eta, h00, h01): dim = length*width @@ -76,27 +70,22 @@ def G_ii_n_with_Dyson_equation(width, length, height, E, eta, h00, h01): G_ii_n_array[i, :, :] = G_ii_n_minus return G_ii_n_array - def Green_nn_n(E, eta, H00, V, G_nn_n_minus): # n>=2 dim = H00.shape[0] G_nn_n = np.linalg.inv((E+eta*1j)*np.identity(dim)-H00-np.dot(np.dot(V.transpose().conj(), G_nn_n_minus), V)) return G_nn_n - def Green_in_n(G_in_n_minus, V, G_nn_n): # n>=2 G_in_n = np.dot(np.dot(G_in_n_minus, V), G_nn_n) return G_in_n - def Green_ni_n(G_nn_n, V, G_ni_n_minus): # n>=2 G_ni_n = np.dot(np.dot(G_nn_n, V.transpose().conj()), G_ni_n_minus) return G_ni_n - def Green_ii_n(G_ii_n_minus, G_in_n_minus, V, G_nn_n, G_ni_n_minus): # n>=i G_ii_n = G_ii_n_minus+np.dot(np.dot(np.dot(np.dot(G_in_n_minus, V), G_nn_n), V.transpose().conj()),G_ni_n_minus) return G_ii_n - if __name__ == '__main__': main() \ No newline at end of file diff --git a/2020.12.31_DOS_calculation_using_Dyson_equations/cubic_lattice/DOS_calculation_using_Dyson_equations_in_cubic_lattice_version_II.py b/2020.12.31_DOS_calculation_using_Dyson_equations/cubic_lattice/DOS_calculation_using_Dyson_equations_in_cubic_lattice_version_II.py index dc451ef..b401116 100644 --- a/2020.12.31_DOS_calculation_using_Dyson_equations/cubic_lattice/DOS_calculation_using_Dyson_equations_in_cubic_lattice_version_II.py +++ b/2020.12.31_DOS_calculation_using_Dyson_equations/cubic_lattice/DOS_calculation_using_Dyson_equations_in_cubic_lattice_version_II.py @@ -4,9 +4,6 @@ The newest version of this code is on the web page: https://www.guanjihuan.com/a """ import numpy as np -import matplotlib.pyplot as plt -from math import * - def matrix_00(width, length): h00 = np.zeros((width*length, width*length)) @@ -20,12 +17,10 @@ def matrix_00(width, length): h00[(x+1)*width+y, x*width+y] = 1 return h00 - def matrix_01(width, length): h01 = np.identity(width*length) return h01 - def main(): height = 2 # z width = 3 # y @@ -36,7 +31,6 @@ def main(): h01 = matrix_01(width, length) G_ii_n_with_Dyson_equation_version_II(width, length, height, E, eta, h00, h01) - def G_ii_n_with_Dyson_equation_version_II(width, length, height, E, eta, h00, h01): dim = length*width G_11_1 = np.linalg.inv((E+eta*1j)*np.identity(dim)-h00) @@ -71,29 +65,24 @@ def G_ii_n_with_Dyson_equation_version_II(width, length, height, E, eta, h00, h0 for j0 in range(width): print(' y=', j0+1, ':') for k0 in range(length): - print(' x=', k0+1, ' ', -np.imag(G_ii_n_minus[k0*width+j0, k0*width+j0])/pi) # 态密度 - + print(' x=', k0+1, ' ', -np.imag(G_ii_n_minus[k0*width+j0, k0*width+j0])/np.pi) # 态密度 def Green_nn_n(E, eta, H00, V, G_nn_n_minus): # n>=2 dim = H00.shape[0] G_nn_n = np.linalg.inv((E+eta*1j)*np.identity(dim)-H00-np.dot(np.dot(V.transpose().conj(), G_nn_n_minus), V)) return G_nn_n - def Green_in_n(G_in_n_minus, V, G_nn_n): # n>=2 G_in_n = np.dot(np.dot(G_in_n_minus, V), G_nn_n) return G_in_n - def Green_ni_n(G_nn_n, V, G_ni_n_minus): # n>=2 G_ni_n = np.dot(np.dot(G_nn_n, V.transpose().conj()), G_ni_n_minus) return G_ni_n - def Green_ii_n(G_ii_n_minus, G_in_n_minus, V, G_nn_n, G_ni_n_minus): # n>=i G_ii_n = G_ii_n_minus+np.dot(np.dot(np.dot(np.dot(G_in_n_minus, V), G_nn_n), V.transpose().conj()),G_ni_n_minus) return G_ii_n - if __name__ == '__main__': main() \ No newline at end of file diff --git a/2020.12.31_DOS_calculation_using_Dyson_equations/cubic_lattice/get_DOS_by_direct_inverseion_of_Hamiltonian_of_cubic_lattice.py b/2020.12.31_DOS_calculation_using_Dyson_equations/cubic_lattice/get_DOS_by_direct_inverseion_of_Hamiltonian_of_cubic_lattice.py index 652ee6e..4f57ea5 100644 --- a/2020.12.31_DOS_calculation_using_Dyson_equations/cubic_lattice/get_DOS_by_direct_inverseion_of_Hamiltonian_of_cubic_lattice.py +++ b/2020.12.31_DOS_calculation_using_Dyson_equations/cubic_lattice/get_DOS_by_direct_inverseion_of_Hamiltonian_of_cubic_lattice.py @@ -4,9 +4,6 @@ The newest version of this code is on the web page: https://www.guanjihuan.com/a """ import numpy as np -import matplotlib.pyplot as plt -from math import * - def hamiltonian(width, length, height): h = np.zeros((width*length*height, width*length*height)) @@ -27,7 +24,6 @@ def hamiltonian(width, length, height): h[k0*width*length+(i0+1)*width+j0, k0*width*length+i0*width+j0] = 1 return h - def main(): height = 2 # z width = 3 # y @@ -40,10 +36,7 @@ def main(): for j0 in range(width): print(' y=', j0+1, ':') for i0 in range(length): - print(' x=', i0+1, ' ', -np.imag(green[k0*width*length+i0*width+j0, k0*width*length+i0*width+j0])/pi) # 态密度 - + print(' x=', i0+1, ' ', -np.imag(green[k0*width*length+i0*width+j0, k0*width*length+i0*width+j0])/np.pi) # 态密度 if __name__ == "__main__": - main() - - \ No newline at end of file + main() \ No newline at end of file diff --git a/2020.12.31_DOS_calculation_using_Dyson_equations/square_lattice/DOS_calculation_using_Dyson_equations_in_square_lattice.py b/2020.12.31_DOS_calculation_using_Dyson_equations/square_lattice/DOS_calculation_using_Dyson_equations_in_square_lattice.py index 03dbc45..5f5c1ae 100644 --- a/2020.12.31_DOS_calculation_using_Dyson_equations/square_lattice/DOS_calculation_using_Dyson_equations_in_square_lattice.py +++ b/2020.12.31_DOS_calculation_using_Dyson_equations/square_lattice/DOS_calculation_using_Dyson_equations_in_square_lattice.py @@ -4,9 +4,6 @@ The newest version of this code is on the web page: https://www.guanjihuan.com/a """ import numpy as np -import matplotlib.pyplot as plt -from math import * - def matrix_00(width): h00 = np.zeros((width, width)) @@ -15,12 +12,10 @@ def matrix_00(width): h00[width0+1, width0] = 1 return h00 - def matrix_01(width): h01 = np.identity(width) return h01 - def main(): width = 2 length = 3 @@ -34,8 +29,7 @@ def main(): # print(G_ii_n_array[i0, :, :],'\n') print('x=', i0+1, ':') for j0 in range(width): - print(' y=', j0+1, ' ', -np.imag(G_ii_n_array[i0, j0, j0])/pi) # 态密度 - + print(' y=', j0+1, ' ', -np.imag(G_ii_n_array[i0, j0, j0])/np.pi) # 态密度 def G_ii_n_with_Dyson_equation(width, length, E, eta, h00, h01): G_ii_n_array = np.zeros((length, width, width), complex) @@ -69,27 +63,22 @@ def G_ii_n_with_Dyson_equation(width, length, E, eta, h00, h01): G_ii_n_array[i, :, :] = G_ii_n_minus return G_ii_n_array - def Green_nn_n(E, eta, H00, V, G_nn_n_minus): # n>=2 dim = H00.shape[0] G_nn_n = np.linalg.inv((E+eta*1j)*np.identity(dim)-H00-np.dot(np.dot(V.transpose().conj(), G_nn_n_minus), V)) return G_nn_n - def Green_in_n(G_in_n_minus, V, G_nn_n): # n>=2 G_in_n = np.dot(np.dot(G_in_n_minus, V), G_nn_n) return G_in_n - def Green_ni_n(G_nn_n, V, G_ni_n_minus): # n>=2 G_ni_n = np.dot(np.dot(G_nn_n, V.transpose().conj()), G_ni_n_minus) return G_ni_n - def Green_ii_n(G_ii_n_minus, G_in_n_minus, V, G_nn_n, G_ni_n_minus): # n>=i G_ii_n = G_ii_n_minus+np.dot(np.dot(np.dot(np.dot(G_in_n_minus, V), G_nn_n), V.transpose().conj()),G_ni_n_minus) return G_ii_n - if __name__ == '__main__': main() diff --git a/2020.12.31_DOS_calculation_using_Dyson_equations/square_lattice/get_DOS_by_direct_inverseion_of_Hamiltonian_of_square_lattice.py b/2020.12.31_DOS_calculation_using_Dyson_equations/square_lattice/get_DOS_by_direct_inverseion_of_Hamiltonian_of_square_lattice.py index b14e74c..b5c42b4 100644 --- a/2020.12.31_DOS_calculation_using_Dyson_equations/square_lattice/get_DOS_by_direct_inverseion_of_Hamiltonian_of_square_lattice.py +++ b/2020.12.31_DOS_calculation_using_Dyson_equations/square_lattice/get_DOS_by_direct_inverseion_of_Hamiltonian_of_square_lattice.py @@ -4,9 +4,6 @@ The newest version of this code is on the web page: https://www.guanjihuan.com/a """ import numpy as np -import matplotlib.pyplot as plt -from math import * - def hamiltonian(width, length): h = np.zeros((width*length, width*length)) @@ -20,7 +17,6 @@ def hamiltonian(width, length): h[(i0+1)*width+j0, i0*width+j0] = 1 return h - def main(): width = 2 length = 3 @@ -32,10 +28,7 @@ def main(): # print(green[i0*width+0: i0*width+width, i0*width+0: i0*width+width], '\n') print('x=', i0+1, ':') for j0 in range(width): - print(' y=', j0+1, ' ', -np.imag(green[i0*width+j0, i0*width+j0])/pi) - + print(' y=', j0+1, ' ', -np.imag(green[i0*width+j0, i0*width+j0])/np.pi) if __name__ == "__main__": - main() - - \ No newline at end of file + main() \ No newline at end of file