This commit is contained in:
guanjihuan 2021-08-09 19:36:49 +08:00
parent 5d781ae1f3
commit 315cf278a3
3 changed files with 36 additions and 26 deletions

View File

@ -1,3 +1,8 @@
"""
This code is supported by the website: https://www.guanjihuan.com
The newest version of this code is on the web page: https://www.guanjihuan.com/archives/16199
"""
import numpy as np
from math import *
import cmath

View File

@ -1,18 +1,23 @@
"""
This code is supported by the website: https://www.guanjihuan.com
The newest version of this code is on the web page: https://www.guanjihuan.com/archives/16730
"""
import numpy as np
from math import *
import guan
def hamiltonian(kx, ky): # kagome lattice
k1 = kx
k2 = kx/2+ky*sqrt(3)/2
k3 = -kx/2+ky*sqrt(3)/2
k1_dot_a1 = kx
k2_dot_a2 = kx/2+ky*sqrt(3)/2
k3_dot_a3 = -kx/2+ky*sqrt(3)/2
h = np.zeros((3, 3), dtype=complex)
h[0, 1] = cos(k1)
h[0, 2] = cos(k2)
h[1, 2] = cos(k3)
h[0, 1] = 2*cos(k1_dot_a1)
h[0, 2] = 2*cos(k2_dot_a2)
h[1, 2] = 2*cos(k3_dot_a3)
h = h + h.transpose().conj()
t = 1
h = -2*t*h
h = -t*h
return h
kx_array = np.linspace(-pi ,pi, 100)

View File

@ -10,10 +10,10 @@
NotebookFileLineBreakTest
NotebookFileLineBreakTest
NotebookDataPosition[ 158, 7]
NotebookDataLength[ 2340, 82]
NotebookOptionsPosition[ 2002, 67]
NotebookOutlinePosition[ 2387, 84]
CellTagsIndexPosition[ 2344, 81]
NotebookDataLength[ 2422, 82]
NotebookOptionsPosition[ 2082, 67]
NotebookOutlinePosition[ 2469, 84]
CellTagsIndexPosition[ 2426, 81]
WindowFrame->Normal*)
(* Beginning of Notebook Content *)
@ -21,16 +21,16 @@ Notebook[{
Cell[BoxData[{
RowBox[{"Clear", "[", "\"\<`*\>\"", "]"}], "\n",
RowBox[{
RowBox[{"k1", "=", "kx"}], ";"}], "\n",
RowBox[{"k1a1", "=", "kx"}], ";"}], "\n",
RowBox[{
RowBox[{"k2", "=",
RowBox[{"k2a2", "=",
RowBox[{
RowBox[{"kx", "/", "2"}], "+",
RowBox[{"ky", "*",
RowBox[{
RowBox[{"Sqrt", "[", "3", "]"}], "/", "2"}]}]}]}], ";"}], "\n",
RowBox[{
RowBox[{"k3", "=",
RowBox[{"k3a3", "=",
RowBox[{
RowBox[{
RowBox[{"-", "kx"}], "/", "2"}], "+",
@ -46,27 +46,27 @@ Cell[BoxData[{
RowBox[{
RowBox[{"{",
RowBox[{"0", ",",
RowBox[{"Cos", "[", "k1", "]"}], ",",
RowBox[{"Cos", "[", "k2", "]"}]}], "}"}], ",",
RowBox[{"Cos", "[", "k1a1", "]"}], ",",
RowBox[{"Cos", "[", "k2a2", "]"}]}], "}"}], ",",
RowBox[{"{",
RowBox[{
RowBox[{"Cos", "[", "k1", "]"}], ",", "0", ",",
RowBox[{"Cos", "[", "k3", "]"}]}], "}"}], ",",
RowBox[{"Cos", "[", "k1a1", "]"}], ",", "0", ",",
RowBox[{"Cos", "[", "k3a3", "]"}]}], "}"}], ",",
RowBox[{"{",
RowBox[{
RowBox[{"Cos", "[", "k2", "]"}], ",",
RowBox[{"Cos", "[", "k3", "]"}], ",", "0"}], "}"}]}], "}"}],
RowBox[{"Cos", "[", "k2a2", "]"}], ",",
RowBox[{"Cos", "[", "k3a3", "]"}], ",", "0"}], "}"}]}], "}"}],
")"}]}]}], ";"}], "\n",
RowBox[{"MatrixForm", "[", "H", "]"}], "\n",
RowBox[{"eigenvalue", "=",
RowBox[{"MatrixForm", "[",
RowBox[{"Eigenvalues", "[", "H", "]"}], "]"}]}]}], "Input",
CellChangeTimes->{{3.837485198864452*^9,
3.837485198867505*^9}},ExpressionUUID->"a7abdb4e-e7ef-4556-9d32-\
d94836d031ca"]
CellChangeTimes->{{3.837485198864452*^9, 3.837485198867505*^9}, {
3.837497369979506*^9, 3.8374974574378343`*^9}},
CellLabel->"",ExpressionUUID->"a7abdb4e-e7ef-4556-9d32-d94836d031ca"]
},
WindowSize->{1904, 997},
WindowMargins->{{-8, Automatic}, {Automatic, 0}},
WindowSize->{1147, 812},
WindowMargins->{{Automatic, 228}, {22, Automatic}},
Magnification:>1.7 Inherited,
FrontEndVersion->"12.0 for Microsoft Windows (64-bit) (2019\:5e744\:67088\
\:65e5)",
@ -83,7 +83,7 @@ CellTagsIndex->{}
*)
(*NotebookFileOutline
Notebook[{
Cell[558, 20, 1440, 45, 419, "Input",ExpressionUUID->"a7abdb4e-e7ef-4556-9d32-d94836d031ca"]
Cell[558, 20, 1520, 45, 514, "Input",ExpressionUUID->"a7abdb4e-e7ef-4556-9d32-d94836d031ca"]
}
]
*)