From 9e811126143e95f857e92f64464cdca4f316ed73 Mon Sep 17 00:00:00 2001 From: guanjihuan Date: Wed, 20 Jul 2022 15:03:44 +0800 Subject: [PATCH] 0.0.112 --- API_Reference.py | 4 ++++ PyPI/setup.cfg | 2 +- PyPI/src/guan/__init__.py | 28 +++++++++++++++++++++++++++- 3 files changed, 32 insertions(+), 2 deletions(-) diff --git a/API_Reference.py b/API_Reference.py index 2395d8f..4076826 100644 --- a/API_Reference.py +++ b/API_Reference.py @@ -111,6 +111,10 @@ hamiltonian = guan.hamiltonian_of_ssh_model(k, v=0.6, w=1) hamiltonian = guan.hamiltonian_of_graphene(k1, k2, M=0, t=1, a=1/math.sqrt(3)) +hamiltonian = guan.effective_hamiltonian_of_graphene(qx, qy, t=1, staggered_potential=0, valley_index=0) + +hamiltonian = guan.effective_hamiltonian_of_graphene_after_discretization(qx, qy, t=1, staggered_potential=0, valley_index=0) + hamiltonian = guan.hamiltonian_of_graphene_with_zigzag_in_quasi_one_dimension(k, N=10, M=0, t=1, period=0) hamiltonian = guan.hamiltonian_of_haldane_model(k1, k2, M=2/3, t1=1, t2=1/3, phi=math.pi/4, a=1/math.sqrt(3)) diff --git a/PyPI/setup.cfg b/PyPI/setup.cfg index b0e8575..0e6edd8 100644 --- a/PyPI/setup.cfg +++ b/PyPI/setup.cfg @@ -1,7 +1,7 @@ [metadata] # replace with your username: name = guan -version = 0.0.111 +version = 0.0.112 author = guanjihuan author_email = guanjihuan@163.com description = An open source python package diff --git a/PyPI/src/guan/__init__.py b/PyPI/src/guan/__init__.py index 9ca3cfd..41cf1fa 100644 --- a/PyPI/src/guan/__init__.py +++ b/PyPI/src/guan/__init__.py @@ -2,7 +2,7 @@ # With this package, you can calculate band structures, density of states, quantum transport and topological invariant of tight-binding models by invoking the functions you need. Other frequently used functions are also integrated in this package, such as file reading/writing, figure plotting, data processing. -# The current version is guan-0.0.111, updated on July 19, 2022. +# The current version is guan-0.0.112, updated on July 20, 2022. # Installation: pip install --upgrade guan @@ -476,6 +476,32 @@ def hamiltonian_of_graphene(k1, k2, M=0, t=1, a=1/math.sqrt(3)): hamiltonian = h0 + h1 return hamiltonian +def effective_hamiltonian_of_graphene(qx, qy, t=1, staggered_potential=0, valley_index=0): + hamiltonian = np.zeros((2, 2), dtype=complex) + hamiltonian[0, 0] = staggered_potential + hamiltonian[1, 1] = -staggered_potential + constant = -np.sqrt(3)/2 + if valley_index == 0: + hamiltonian[0, 1] = constant*t*(qx-1j*qy) + hamiltonian[1, 0] = constant*t*(qx+1j*qy) + else: + hamiltonian[0, 1] = constant*t*(-qx-1j*qy) + hamiltonian[1, 0] = constant*t*(-qx+1j*qy) + return hamiltonian + +def effective_hamiltonian_of_graphene_after_discretization(qx, qy, t=1, staggered_potential=0, valley_index=0): + hamiltonian = np.zeros((2, 2), dtype=complex) + hamiltonian[0, 0] = staggered_potential + hamiltonian[1, 1] = -staggered_potential + constant = -np.sqrt(3)/2 + if valley_index == 0: + hamiltonian[0, 1] = constant*t*(np.sin(qx)-1j*np.sin(qy)) + hamiltonian[1, 0] = constant*t*(np.sin(qx)+1j*np.sin(qy)) + else: + hamiltonian[0, 1] = constant*t*(-np.sin(qx)-1j*np.sin(qy)) + hamiltonian[1, 0] = constant*t*(-np.sin(qx)+1j*np.sin(qy)) + return hamiltonian + def hamiltonian_of_graphene_with_zigzag_in_quasi_one_dimension(k, N=10, M=0, t=1, period=0): h00 = np.zeros((4*N, 4*N), dtype=complex) # hopping in a unit cell h01 = np.zeros((4*N, 4*N), dtype=complex) # hopping between unit cells