非平衡格林函数计算电导(附Python代码) 您所在的位置:网站首页 北方地区和南方地区的划分依据是什么呢 非平衡格林函数计算电导(附Python代码)

非平衡格林函数计算电导(附Python代码)

2023-03-14 11:13| 来源: 网络整理| 查看: 265

发布时间:2019年11月1日2023年2月25日

最近修改时间:2023年2月25日

准一维的方格子哈密顿量(以宽度3为例)为

\begin{aligned}H=&\sum_{x, \langle y, y' \rangle}|x, y \rangle \langle x, y'|+\sum_{\langle x, x' \rangle, y} |x, y \rangle \langle x', y|\\=&\sum_{x}\begin{pmatrix} |x, 0 \rangle, |x, 1 \rangle, |x, 2 \rangle \end{pmatrix}\begin{pmatrix}0 & t & 0\\t & 0 & t\\0 & t &0\\\end{pmatrix}\begin{pmatrix} \langle x,0| \\ \langle x,1| \\ \langle x,2|\end{pmatrix}\\+& \sum_{\langle x, x' \rangle}\begin{pmatrix} |x, 0 \rangle, |x, 1 \rangle, |x, 2 \rangle \end{pmatrix}\begin{pmatrix}t & 0 & 0\\0& t & 0\\0 & 0 &t\\\end{pmatrix}\begin{pmatrix} \langle x',0| \\ \langle x',1| \\ \langle x',2|\end{pmatrix}\end{aligned}

在上面最后的表达式中,第一项是H00,表示的是元胞内部的哈密顿量矩阵;第二项是H01,表示的是元胞间的跃迁矩阵。

1. 给出全部算法的代码

这里给出“用非平衡格林函数计算准一维方格子电导”的Python代码,相关公式见参考资料。其中用到戴森方程,格林函数G_{1n}公式参考这篇:利用Dyson方程迭代方法计算态密度(附Python代码)。

""" 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/948 """ import numpy as np import matplotlib.pyplot as plt import copy import time def matrix_00(width=10): # 不赋值时默认为10 h00 = np.zeros((width, width)) for width0 in range(width-1): h00[width0, width0+1] = 1 h00[width0+1, width0] = 1 return h00 def matrix_01(width=10): # 不赋值时默认为10 h01 = np.identity(width) return h01 def main(): start_time = time.time() h00 = matrix_00(width=5) h01 = matrix_01(width=5) fermi_energy_array = np.arange(-4, 4, .01) plot_conductance_energy(fermi_energy_array, h00, h01) end_time = time.time() print('运行时间=', end_time-start_time) def plot_conductance_energy(fermi_energy_array, h00, h01): # 画电导与费米能关系图 dim = fermi_energy_array.shape[0] cond = np.zeros(dim) i0 = 0 for fermi_energy0 in fermi_energy_array: cond0 = np.real(conductance(fermi_energy0 + 1e-12j, h00, h01)) cond[i0] = cond0 i0 += 1 plt.plot(fermi_energy_array, cond, '-k') plt.show() def transfer_matrix(fermi_energy, h00, h01, dim): # 转移矩阵T。dim是传递矩阵h00和h01的维度 transfer = np.zeros((2*dim, 2*dim), dtype=complex) transfer[0:dim, 0:dim] = np.dot(np.linalg.inv(h01), fermi_energy*np.identity(dim)-h00) # np.dot()等效于np.matmul() transfer[0:dim, dim:2*dim] = np.dot(-1*np.linalg.inv(h01), h01.transpose().conj()) transfer[dim:2*dim, 0:dim] = np.identity(dim) transfer[dim:2*dim, dim:2*dim] = 0 # a:b代表 a 头像 Published by guanjihuan

View all posts by guanjihuan



【本文地址】

公司简介

联系我们

今日新闻

    推荐新闻

    专题文章
      CopyRight 2018-2019 实验室设备网 版权所有