version 0.0.16
This commit is contained in:
parent
4af09ef61b
commit
960e363190
@ -66,7 +66,7 @@ eigenvector = guan.calculate_eigenvector(hamiltonian)
|
|||||||
|
|
||||||
# find vector with the same gauge # Source code: https://py.guanjihuan.com/find_vector_with_the_same_gauge
|
# find vector with the same gauge # Source code: https://py.guanjihuan.com/find_vector_with_the_same_gauge
|
||||||
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_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)
|
vector = guan.find_vector_with_fixed_gauge_by_making_one_component_real(vector, precision=0.005, index=None)
|
||||||
|
|
||||||
# calculate Green functions # Source code: https://py.guanjihuan.com/calculate_green_functions
|
# calculate Green functions # Source code: https://py.guanjihuan.com/calculate_green_functions
|
||||||
green = guan.green_function(fermi_energy, hamiltonian, broadening, self_energy=0)
|
green = guan.green_function(fermi_energy, hamiltonian, broadening, self_energy=0)
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
[metadata]
|
[metadata]
|
||||||
# replace with your username:
|
# replace with your username:
|
||||||
name = guan
|
name = guan
|
||||||
version = 0.0.15
|
version = 0.0.16
|
||||||
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
|
||||||
|
@ -42,8 +42,9 @@ def find_vector_with_the_same_gauge_with_binary_search(vector_target, vector_ref
|
|||||||
print('Phase=', phase)
|
print('Phase=', phase)
|
||||||
return vector_target
|
return vector_target
|
||||||
|
|
||||||
def find_vector_with_fixed_gauge_by_making_one_component_real(vector, precision=0.005):
|
def find_vector_with_fixed_gauge_by_making_one_component_real(vector, precision=0.005, index=None):
|
||||||
index = np.argmax(np.abs(vector))
|
if index == None:
|
||||||
|
index = np.argmax(np.abs(vector))
|
||||||
sign_pre = np.sign(np.imag(vector[index]))
|
sign_pre = np.sign(np.imag(vector[index]))
|
||||||
for phase in np.arange(0, 2*pi, precision):
|
for phase in np.arange(0, 2*pi, precision):
|
||||||
sign = np.sign(np.imag(vector[index]*cmath.exp(1j*phase)))
|
sign = np.sign(np.imag(vector[index]*cmath.exp(1j*phase)))
|
||||||
|
Loading…
x
Reference in New Issue
Block a user