栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 软件开发 > 后端开发 > Python

pybinding周期性边缘态可视化

Python 更新时间: 发布时间: IT归档 最新发布 模块sitemap 名妆网 法律咨询 聚返吧 英语巴士网 伯小乐 网商动力

pybinding周期性边缘态可视化

可惜图不是很好看

import pybinding as pb
import numpy as np
import matplotlib.pyplot as plt
from math import sqrt, pi
pb.pltutils.use_style()

def SU4():
    t = 1      # [eV] nearest neighbour hopping
 
    lat = pb.Lattice(a1=[2*sqrt(3), 0],
                     a2=[sqrt(3)/2, -1.5])
            
                     
    lat.add_sublattices(('A', [0, 0]),
                        ('B', [sqrt(3)/2, -0.5]),
                        ('C', [sqrt(3), 0]),
                        ('D', [sqrt(3)*3/2, -0.5]))
    
    lat.add_hoppings(
        # inside the main cell
        ([0,  0], 'A', 'B', t),
        ([0,  0], 'B', 'C', t),
        ([0,  0], 'C', 'D', t),
        # between neighboring cells
        ([0, -1], 'A', 'B', t),
        ([0, -1], 'C', 'D', -t),
        ([-1, 0], 'A', 'D', t),
    )
    return lat

lat = SU4()

def vacancy(position, radius):
    @pb.site_state_modifier
    def modifier(state, x, y):
        x0, y0 = position
        state[(x-x0)**2 + (y-y0)**2 < radius**2] = False
        return state
    return modifier

model = pb.Model(
    lat,
    pb.rectangle(x=20, y=10),
    vacancy(position=[-0.83 + 2*sqrt(3),  4.64], radius=0.5),
    vacancy(position=[-0.83,  4.64], radius=0.5),
    vacancy(position=[-0.83-2*sqrt(3),  4.64], radius=0.5),
    pb.translational_symmetry(a1=6*sqrt(3), a2=False),
)
model.plot()
plt.show()
solver = pb.solver.lapack(model)
solver.set_wave_vector(k=pi)
ldos = solver.calc_spatial_ldos(energy=sqrt(3), broadening=0.1)  
plt.ylim(0, 5)
ldos.plot(site_radius=(0.01, 0.2))
pb.pltutils.colorbar()
plt.show()

转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/715074.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号