From 7b784f3888c5a21ab19003e98f5feb16edce7483 Mon Sep 17 00:00:00 2001 From: guanjihuan <34735497+guanjihuan@users.noreply.github.com> Date: Thu, 29 Jul 2021 00:43:58 +0800 Subject: [PATCH] Create bands_of_SSH_model_with_two_kinds_of_fourier_transform.py --- ...del_with_two_kinds_of_fourier_transform.py | 26 +++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 academic_codes/2021.07.29_bands_of_SSH_model_with_two_kinds_of_fourier_transform/bands_of_SSH_model_with_two_kinds_of_fourier_transform.py diff --git a/academic_codes/2021.07.29_bands_of_SSH_model_with_two_kinds_of_fourier_transform/bands_of_SSH_model_with_two_kinds_of_fourier_transform.py b/academic_codes/2021.07.29_bands_of_SSH_model_with_two_kinds_of_fourier_transform/bands_of_SSH_model_with_two_kinds_of_fourier_transform.py new file mode 100644 index 0000000..b1cee85 --- /dev/null +++ b/academic_codes/2021.07.29_bands_of_SSH_model_with_two_kinds_of_fourier_transform/bands_of_SSH_model_with_two_kinds_of_fourier_transform.py @@ -0,0 +1,26 @@ +import numpy as np +from math import * +import cmath +import guan + +v=0.6 +w=1 +k = np.linspace(-pi ,pi, 100) + +def hamiltonian_1(k): + matrix = np.zeros((2, 2), dtype=complex) + matrix[0,1] = v+w*cmath.exp(-1j*k) + matrix[1,0] = v+w*cmath.exp(1j*k) + return matrix + +def hamiltonian_2(k): + matrix = np.zeros((2, 2), dtype=complex) + matrix[0,1] = v*cmath.exp(1j*k/2)+w*cmath.exp(-1j*k/2) + matrix[1,0] = v*cmath.exp(-1j*k/2)+w*cmath.exp(1j*k/2) + return matrix + +E_1 = guan.calculate_eigenvalue_with_one_parameter(k, hamiltonian_1) +guan.plot(k, E_1, xlabel='k', ylabel='E_1') + +E_2 = guan.calculate_eigenvalue_with_one_parameter(k, hamiltonian_2) +guan.plot(k, E_2, xlabel='k', ylabel='E_2') \ No newline at end of file