version 0.0.22
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
[metadata]
|
||||
# replace with your username:
|
||||
name = guan
|
||||
version = 0.0.21
|
||||
version = 0.0.22
|
||||
author = guanjihuan
|
||||
author_email = guanjihuan@163.com
|
||||
description = An open source python package
|
||||
|
@@ -11,8 +11,7 @@ from .calculate_Green_functions import *
|
||||
from .calculate_density_of_states import *
|
||||
from .calculate_conductance import *
|
||||
from .calculate_scattering_matrix import *
|
||||
from .calculate_Chern_number import *
|
||||
from .calculate_Wilson_loop import *
|
||||
from .calculate_topological_invariant import *
|
||||
from .read_and_write import *
|
||||
from .plot_figures 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.
|
||||
|
||||
# calculate Chern number
|
||||
# calculate topological invariant
|
||||
|
||||
import numpy as np
|
||||
import cmath
|
||||
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):
|
||||
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 = chern_number/(2*pi*1j)
|
||||
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
|
Reference in New Issue
Block a user