diff --git a/API_reference.py b/API_reference.py index 25fbe6a..d442e8e 100644 --- a/API_reference.py +++ b/API_reference.py @@ -54,8 +54,8 @@ hamiltonian = guan.hamiltonian_of_haldane_model_in_quasi_one_dimension(k, N=10, # calculate band structures # Source code: https://py.guanjihuan.com/source-code/calculate_band_structures_and_wave_functions eigenvalue = guan.calculate_eigenvalue(hamiltonian) -eigenvalue_array = guan.calculate_eigenvalue_with_one_parameter(x_array, hamiltonian_function) -eigenvalue_array = guan.calculate_eigenvalue_with_two_parameters(x_array, y_array, hamiltonian_function) +eigenvalue_array = guan.calculate_eigenvalue_with_one_parameter(x_array, hamiltonian_function, print_show=0) +eigenvalue_array = guan.calculate_eigenvalue_with_two_parameters(x_array, y_array, hamiltonian_function, print_show=0, print_show_more=0) eigenvector = guan.calculate_eigenvector(hamiltonian) vector_target = guan.find_vector_with_the_same_gauge_with_binary_search(vector_target, vector_ref, show_error=1, show_times=0, show_phase=0, n_test=10001, precision=1e-6) vector = guan.find_vector_with_fixed_gauge_by_making_one_component_real(vector, precision=0.005, index=None) diff --git a/PyPI/setup.cfg b/PyPI/setup.cfg index d06e475..bf6e288 100644 --- a/PyPI/setup.cfg +++ b/PyPI/setup.cfg @@ -1,7 +1,7 @@ [metadata] # replace with your username: name = guan -version = 0.0.33 +version = 0.0.34 author = guanjihuan author_email = guanjihuan@163.com description = An open source python package diff --git a/PyPI/src/guan/calculate_band_structures_and_wave_functions.py b/PyPI/src/guan/calculate_band_structures_and_wave_functions.py index e99862e..1e9dc83 100644 --- a/PyPI/src/guan/calculate_band_structures_and_wave_functions.py +++ b/PyPI/src/guan/calculate_band_structures_and_wave_functions.py @@ -14,7 +14,7 @@ def calculate_eigenvalue(hamiltonian): eigenvalue, eigenvector = np.linalg.eigh(hamiltonian) return eigenvalue -def calculate_eigenvalue_with_one_parameter(x_array, hamiltonian_function): +def calculate_eigenvalue_with_one_parameter(x_array, hamiltonian_function, print_show=0): dim_x = np.array(x_array).shape[0] i0 = 0 if np.array(hamiltonian_function(0)).shape==(): @@ -27,13 +27,15 @@ def calculate_eigenvalue_with_one_parameter(x_array, hamiltonian_function): dim = np.array(hamiltonian_function(0)).shape[0] eigenvalue_array = np.zeros((dim_x, dim)) for x0 in x_array: + if print_show==1: + print(x0) hamiltonian = hamiltonian_function(x0) eigenvalue, eigenvector = np.linalg.eigh(hamiltonian) eigenvalue_array[i0, :] = eigenvalue i0 += 1 return eigenvalue_array -def calculate_eigenvalue_with_two_parameters(x_array, y_array, hamiltonian_function): +def calculate_eigenvalue_with_two_parameters(x_array, y_array, hamiltonian_function, print_show=0, print_show_more=0): dim_x = np.array(x_array).shape[0] dim_y = np.array(y_array).shape[0] if np.array(hamiltonian_function(0,0)).shape==(): @@ -52,7 +54,11 @@ def calculate_eigenvalue_with_two_parameters(x_array, y_array, hamiltonian_funct i0 = 0 for y0 in y_array: j0 = 0 + if print_show==1: + print(y0) for x0 in x_array: + if print_show_more==1: + print(x0) hamiltonian = hamiltonian_function(x0, y0) eigenvalue, eigenvector = np.linalg.eigh(hamiltonian) eigenvalue_array[i0, j0, :] = eigenvalue