version 0.0.22
This commit is contained in:
parent
9efb7b1daf
commit
ab713cdd6b
@ -89,10 +89,8 @@ k_right, k_left, velocity_right, velocity_left, f_right, f_left, u_right, u_left
|
|||||||
transmission_matrix, reflection_matrix, k_right, k_left, velocity_right, velocity_left, ind_right_active = guan.calculate_scattering_matrix(fermi_energy, h00, h01, length=100)
|
transmission_matrix, reflection_matrix, k_right, k_left, velocity_right, velocity_left, ind_right_active = guan.calculate_scattering_matrix(fermi_energy, h00, h01, length=100)
|
||||||
guan.print_or_write_scattering_matrix(fermi_energy, h00, h01, length=100, on_print=1, on_write=0)
|
guan.print_or_write_scattering_matrix(fermi_energy, h00, h01, length=100, on_print=1, on_write=0)
|
||||||
|
|
||||||
# calculate Chern number # Source code: https://py.guanjihuan.com/calculate_chern_number
|
# calculate topological invariant # Source code: https://py.guanjihuan.com/source-code/calculate_topological_invariant
|
||||||
chern_number = guan.calculate_chern_number_for_square_lattice(hamiltonian_function, precision=100)
|
chern_number = guan.calculate_chern_number_for_square_lattice(hamiltonian_function, precision=100)
|
||||||
|
|
||||||
# calculate Wilson loop # Source code: https://py.guanjihuan.com/calculate_wilson_loop
|
|
||||||
wilson_loop_array = guan.calculate_wilson_loop(hamiltonian_function, k_min=-pi, k_max=pi, precision=100)
|
wilson_loop_array = guan.calculate_wilson_loop(hamiltonian_function, k_min=-pi, k_max=pi, precision=100)
|
||||||
|
|
||||||
# read and write # Source code: https://py.guanjihuan.com/read_and_write
|
# read and write # Source code: https://py.guanjihuan.com/read_and_write
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
[metadata]
|
[metadata]
|
||||||
# replace with your username:
|
# replace with your username:
|
||||||
name = guan
|
name = guan
|
||||||
version = 0.0.21
|
version = 0.0.22
|
||||||
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
|
||||||
|
@ -11,8 +11,7 @@ from .calculate_Green_functions import *
|
|||||||
from .calculate_density_of_states import *
|
from .calculate_density_of_states import *
|
||||||
from .calculate_conductance import *
|
from .calculate_conductance import *
|
||||||
from .calculate_scattering_matrix import *
|
from .calculate_scattering_matrix import *
|
||||||
from .calculate_Chern_number import *
|
from .calculate_topological_invariant import *
|
||||||
from .calculate_Wilson_loop import *
|
|
||||||
from .read_and_write import *
|
from .read_and_write import *
|
||||||
from .plot_figures import *
|
from .plot_figures import *
|
||||||
from .others import *
|
from .others import *
|
@ -1,24 +0,0 @@
|
|||||||
# Guan is an open-source python package developed and maintained by https://www.guanjihuan.com. The primary location of this package is on website https://py.guanjihuan.com.
|
|
||||||
|
|
||||||
# calculate Wilson loop
|
|
||||||
|
|
||||||
import numpy as np
|
|
||||||
from math import *
|
|
||||||
from .calculate_wave_functions import *
|
|
||||||
|
|
||||||
def calculate_wilson_loop(hamiltonian_function, k_min=-pi, k_max=pi, precision=100):
|
|
||||||
k_array = np.linspace(k_min, k_max, precision)
|
|
||||||
dim = np.array(hamiltonian_function(0)).shape[0]
|
|
||||||
wilson_loop_array = np.ones(dim, dtype=complex)
|
|
||||||
for i in range(dim):
|
|
||||||
eigenvector_array = []
|
|
||||||
for k in k_array:
|
|
||||||
eigenvector = calculate_eigenvector(hamiltonian_function(k))
|
|
||||||
if k != k_max:
|
|
||||||
eigenvector_array.append(eigenvector[:, i])
|
|
||||||
else:
|
|
||||||
eigenvector_array.append(eigenvector_array[0])
|
|
||||||
for i0 in range(precision-1):
|
|
||||||
F = np.dot(eigenvector_array[i0+1].transpose().conj(), eigenvector_array[i0])
|
|
||||||
wilson_loop_array[i] = np.dot(F, wilson_loop_array[i])
|
|
||||||
return wilson_loop_array
|
|
@ -1,11 +1,11 @@
|
|||||||
# Guan is an open-source python package developed and maintained by https://www.guanjihuan.com. The primary location of this package is on website https://py.guanjihuan.com.
|
# Guan is an open-source python package developed and maintained by https://www.guanjihuan.com. The primary location of this package is on website https://py.guanjihuan.com.
|
||||||
|
|
||||||
# calculate Chern number
|
# calculate topological invariant
|
||||||
|
|
||||||
import numpy as np
|
import numpy as np
|
||||||
import cmath
|
import cmath
|
||||||
from math import *
|
from math import *
|
||||||
from .calculate_wave_functions import *
|
from .calculate_band_structures_and_wave_functions import *
|
||||||
|
|
||||||
def calculate_chern_number_for_square_lattice(hamiltonian_function, precision=100):
|
def calculate_chern_number_for_square_lattice(hamiltonian_function, precision=100):
|
||||||
if np.array(hamiltonian_function(0, 0)).shape==():
|
if np.array(hamiltonian_function(0, 0)).shape==():
|
||||||
@ -37,3 +37,20 @@ def calculate_chern_number_for_square_lattice(hamiltonian_function, precision=10
|
|||||||
chern_number[i] = chern_number[i] + F
|
chern_number[i] = chern_number[i] + F
|
||||||
chern_number = chern_number/(2*pi*1j)
|
chern_number = chern_number/(2*pi*1j)
|
||||||
return chern_number
|
return chern_number
|
||||||
|
|
||||||
|
def calculate_wilson_loop(hamiltonian_function, k_min=-pi, k_max=pi, precision=100):
|
||||||
|
k_array = np.linspace(k_min, k_max, precision)
|
||||||
|
dim = np.array(hamiltonian_function(0)).shape[0]
|
||||||
|
wilson_loop_array = np.ones(dim, dtype=complex)
|
||||||
|
for i in range(dim):
|
||||||
|
eigenvector_array = []
|
||||||
|
for k in k_array:
|
||||||
|
eigenvector = calculate_eigenvector(hamiltonian_function(k))
|
||||||
|
if k != k_max:
|
||||||
|
eigenvector_array.append(eigenvector[:, i])
|
||||||
|
else:
|
||||||
|
eigenvector_array.append(eigenvector_array[0])
|
||||||
|
for i0 in range(precision-1):
|
||||||
|
F = np.dot(eigenvector_array[i0+1].transpose().conj(), eigenvector_array[i0])
|
||||||
|
wilson_loop_array[i] = np.dot(F, wilson_loop_array[i])
|
||||||
|
return wilson_loop_array
|
Loading…
x
Reference in New Issue
Block a user