0.1.63
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
import guan
|
||||
|
||||
# 计算哈密顿量的本征值
|
||||
@guan.function_decorator
|
||||
@guan.statistics_decorator
|
||||
def calculate_eigenvalue(hamiltonian):
|
||||
import numpy as np
|
||||
if np.array(hamiltonian).shape==():
|
||||
@@ -12,7 +12,7 @@ def calculate_eigenvalue(hamiltonian):
|
||||
return eigenvalue
|
||||
|
||||
# 输入哈密顿量函数(带一组参数),计算一组参数下的本征值,返回本征值向量组
|
||||
@guan.function_decorator
|
||||
@guan.statistics_decorator
|
||||
def calculate_eigenvalue_with_one_parameter(x_array, hamiltonian_function, print_show=0):
|
||||
import numpy as np
|
||||
dim_x = np.array(x_array).shape[0]
|
||||
@@ -36,7 +36,7 @@ def calculate_eigenvalue_with_one_parameter(x_array, hamiltonian_function, print
|
||||
return eigenvalue_array
|
||||
|
||||
# 输入哈密顿量函数(带两组参数),计算两组参数下的本征值,返回本征值向量组
|
||||
@guan.function_decorator
|
||||
@guan.statistics_decorator
|
||||
def calculate_eigenvalue_with_two_parameters(x_array, y_array, hamiltonian_function, print_show=0, print_show_more=0):
|
||||
import numpy as np
|
||||
dim_x = np.array(x_array).shape[0]
|
||||
@@ -70,14 +70,14 @@ def calculate_eigenvalue_with_two_parameters(x_array, y_array, hamiltonian_funct
|
||||
return eigenvalue_array
|
||||
|
||||
# 计算哈密顿量的本征矢
|
||||
@guan.function_decorator
|
||||
@guan.statistics_decorator
|
||||
def calculate_eigenvector(hamiltonian):
|
||||
import numpy as np
|
||||
eigenvalue, eigenvector = np.linalg.eigh(hamiltonian)
|
||||
return eigenvector
|
||||
|
||||
# 通过二分查找的方法获取和相邻波函数一样规范的波函数
|
||||
@guan.function_decorator
|
||||
@guan.statistics_decorator
|
||||
def find_vector_with_the_same_gauge_with_binary_search(vector_target, vector_ref, show_error=1, show_times=0, show_phase=0, n_test=1000, precision=1e-6):
|
||||
import numpy as np
|
||||
import cmath
|
||||
@@ -117,7 +117,7 @@ def find_vector_with_the_same_gauge_with_binary_search(vector_target, vector_ref
|
||||
return vector_target
|
||||
|
||||
# 通过使得波函数的一个非零分量为实数,得到固定规范的波函数
|
||||
@guan.function_decorator
|
||||
@guan.statistics_decorator
|
||||
def find_vector_with_fixed_gauge_by_making_one_component_real(vector, precision=0.005, index=None):
|
||||
import numpy as np
|
||||
import cmath
|
||||
@@ -136,7 +136,7 @@ def find_vector_with_fixed_gauge_by_making_one_component_real(vector, precision=
|
||||
return vector
|
||||
|
||||
# 通过使得波函数的一个非零分量为实数,得到固定规范的波函数(在一组波函数中选取最大的那个分量)
|
||||
@guan.function_decorator
|
||||
@guan.statistics_decorator
|
||||
def find_vector_array_with_fixed_gauge_by_making_one_component_real(vector_array, precision=0.005):
|
||||
import numpy as np
|
||||
import guan
|
||||
@@ -150,7 +150,7 @@ def find_vector_array_with_fixed_gauge_by_making_one_component_real(vector_array
|
||||
return vector_array
|
||||
|
||||
# 旋转两个简并的波函数(说明:参数比较多,算法效率不高)
|
||||
@guan.function_decorator
|
||||
@guan.statistics_decorator
|
||||
def rotation_of_degenerate_vectors(vector1, vector2, index1=None, index2=None, precision=0.01, criterion=0.01, show_theta=0):
|
||||
import numpy as np
|
||||
import math
|
||||
@@ -180,7 +180,7 @@ def rotation_of_degenerate_vectors(vector1, vector2, index1=None, index2=None, p
|
||||
return vector1, vector2
|
||||
|
||||
# 旋转两个简并的波函数向量组(说明:参数比较多,算法效率不高)
|
||||
@guan.function_decorator
|
||||
@guan.statistics_decorator
|
||||
def rotation_of_degenerate_vectors_array(vector1_array, vector2_array, precision=0.01, criterion=0.01, show_theta=0):
|
||||
import numpy as np
|
||||
import guan
|
||||
@@ -198,7 +198,7 @@ def rotation_of_degenerate_vectors_array(vector1_array, vector2_array, precision
|
||||
return vector1_array, vector2_array
|
||||
|
||||
# 在一组数据中找到数值相近的数
|
||||
@guan.function_decorator
|
||||
@guan.statistics_decorator
|
||||
def find_close_values_in_one_array(array, precision=1e-2):
|
||||
new_array = []
|
||||
i0 = 0
|
||||
@@ -212,7 +212,7 @@ def find_close_values_in_one_array(array, precision=1e-2):
|
||||
return new_array
|
||||
|
||||
# 寻找能带的简并点
|
||||
@guan.function_decorator
|
||||
@guan.statistics_decorator
|
||||
def find_degenerate_points(k_array, eigenvalue_array, precision=1e-2):
|
||||
import guan
|
||||
degenerate_k_array = []
|
||||
|
Reference in New Issue
Block a user