Skip to main content

用于量子晶格紧密结合模型的 Python 库

项目描述

概括

这是一个Python库,用于计算不同维度的量子晶格紧束缚模型。

安装

使用 pip(发行版)

pip install --upgrade pyqula

手动安装(最新版本)

克隆 Github 存储库

git clone https://github.com/joselado/pyqula

并将“pyqula/src”路径添加到您的 Python 脚本中

import sys
sys.path.append(PATH_TO_PYQULA+"/src")

功能

单粒子哈密顿量

  • 轨道的无自旋、自旋和 Nambu 基
  • 全非共线电子与南部形式主义
  • 包括磁性、自旋轨道耦合和超导性
  • 具有状态解析期望值的能带结构
  • 动量分辨谱函数
  • 局部和完全算子解析的状态密度
  • 0d、1d、2d 和 3d 紧密绑定模型
  • 超级电池中展开的电子结构

交互平均场哈密顿量

  • 具有局部/非局部相互作用的自洽平均场计算
  • 共线和非共线形式主义
  • 非共线超导体的异常平均场
  • 与非共线超导体的所有 Wick 项完全自洽
  • 有约束和无约束的平均场计算
  • 对称破缺状态有序参数的自动识别
  • Hermitian 和非 Hermitian 平均场计算

拓扑表征

  • 贝里相位、贝里曲率、陈数和 Z2 不变量
  • 算子解析陈数和贝里密度
  • 频率分辨拓扑密度
  • 空间分辨拓扑通量
  • 非晶系统的实空间陈密度
  • 威尔逊环和格林函数形式主义

光谱函数

  • 无限几何中的谱函数
  • 半无限系统的表面谱函数
  • 半无限结中的界面谱函数
  • 无限系统中的单一杂质
  • 算子分辨谱函数
  • 格林函数重整化算法

基于切比雪夫核多项式的算法

  • 局部和全谱函数
  • 非局部相关器和格林函数
  • 本地解决的期望值
  • 算子解析谱函数
  • 在单核笔记本电脑上达到高达 10000000 个原子的系统大小

量子传输

  • 金属-金属运输
  • 金属超导体传输
  • 完全非共线 Nambu 基
  • 非平衡格林函数形式主义
  • 运营商解决的运输
  • 差分衰减率
  • 隧道和接触扫描探针光谱

例子

在 pyqula/examples 中可以找到各种示例。简短的例子如下所示

Kagome晶格的能带结构

from pyqula import geometry
g = geometry.kagome_lattice() # get the geometry object
h = g.get_hamiltonian() # get the Hamiltonian object
(k,e) = h.get_bands() # compute the band structure

替代文字

蜂窝超晶格的谷分辨能带结构

from pyqula import geometry
g = geometry.honeycomb_lattice() # get the geometry object
g = g.get_supercell(7) # create a supercell
h = g.get_hamiltonian() # get the Hamiltonian object
(k,e,v) = h.get_bands(operator="valley") # compute the band structure

替代文字

相互作用驱动的自旋单线态超导

from pyqula import geometry
import numpy as np
g = geometry.triangular_lattice() # geometry of a triangular lattice
h = g.get_hamiltonian()  # get the Hamiltonian
h.setup_nambu_spinor() # setup the Nambu form of the Hamiltonian
h = h.get_mean_field_hamiltonian(U=-1.0,filling=0.15,mf="swave") # perform SCF
# electron spectral-function
h.get_kdos_bands(operator="electron",nk=400,energies=np.linspace(-1.0,1.0,100))

替代文字

相互作用驱动的非单一自旋三重态超导体

import numpy as np
from pyqula import geometry
g = geometry.triangular_lattice() # generate the geometry
h = g.get_hamiltonian() # create Hamiltonian of the system
h.add_exchange([0.,0.,1.]) # add exchange field
h.setup_nambu_spinor() # initialize the Nambu basis
# perform a superconducting non-collinear mean-field calculation
h = h.get_mean_field_hamiltonian(V1=-1.0,filling=0.3,mf="random")
# compute the non-unitarity of the spin-triplet superconducting d-vector
d = h.get_dvector_non_unitarity() # non-unitarity of spin-triplet
# electron spectral-function
h.get_kdos_bands(operator="electron",nk=400,energies=np.linspace(-2.0,2.0,400))

替代文字

锯齿形蜂窝带局部相互作用的平均场

from pyqula import geometry
g = geometry.honeycomb_zigzag_ribbon(10) # create geometry of a zigzag ribbon
h = g.get_hamiltonian() # create hamiltonian of the system
h = h.get_mean_field_hamiltonian(U=1.0,filling=0.5,mf="ferro")
(k,e,sz) = h.get_bands(operator="sz") # calculate band structure

替代文字

具有方格局部相互作用的非共线平均场

from pyqula import geometry
g = geometry.square_lattice() # geometry of a square lattice
g = g.get_supercell([2,2]) # generate a 2x2 supercell
h = g.get_hamiltonian() # create hamiltonian of the system
h.add_zeeman([0.,0.,0.1]) # add out-of-plane Zeeman field
h = h.get_mean_field_hamiltonian(U=2.0,filling=0.5,mf="random") # perform SCF
(k,e,c) = h.get_bands(operator="sz") # calculate band structure
m = h.get_magnetization() # get the magnetization

替代文字

具有自旋轨道耦合的缺陷方形晶格中相互作用引起的非共线磁性

from pyqula import geometry
g = geometry.square_lattice() # geometry of a square lattice
g = g.get_supercell([7,7]) # generate a 7x7 supercell
g = g.remove(i=g.get_central()[0]) # remove the central site
h = g.get_hamiltonian() # create hamiltonian of the system
h.add_rashba(.4) # add Rashba spin-orbit coupling
h = h.get_mean_field_hamiltonian(U=2.0,filling=0.5,mf="random") # perform SCF
(k,e,c) = h.get_bands(operator="sz") # calculate band structure
m = h.get_magnetization() # get the magnetization

替代文字

扭曲双层石墨烯的能带结构

from pyqula import specialhamiltonian # special Hamiltonians library
h = specialhamiltonian.twisted_bilayer_graphene() # TBG Hamiltonian
(k,e) = h.get_bands() # compute band structure

替代文字

单层 NbSe2 的能带结构

from pyqula import specialhamiltonian # special Hamiltonians library
h = specialhamiltonian.NbSe2(soc=0.5) # NbSe2 Hamiltonian
(k,e,c) = h.get_bands(operator="sz",kpath=["G","K","M","G"]) # compute bands

替代文字

人工陈绝缘体陈数

from pyqula import geometry
g = geometry.honeycomb_lattice()
h = g.get_hamiltonian()
h.add_rashba(0.2) # Rashba spin-orbit coupling
h.add_zeeman([0.,0.,0.6]) # Zeeman field
from pyqula import topology
(kx,ky,omega) = h.get_berry_curvature() # compute Berry curvature
c = h.get_chern() # compute the Chern number

替代文字

人工拓扑超导体中的拓扑相变

import numpy as np
from pyqula import geometry
g = geometry.chain() # create a chain
g = g.supercell(100) # create a large supercell
g.dimensionality = 0 # make it finite
for J in np.linspace(0.,0.2,50): # loop over exchange couplings
    h = g.get_hamiltonian() # create a new hamiltonian
    h.add_onsite(2.0) # shift the chemical potential
    h.add_rashba(.3) # add rashba spin-orbit coupling
    h.add_exchange([0.,0.,J]) # add exchange coupling
    h.add_swave(.1) # add s-wave superconductivity
    edge = h.get_operator("location",r=g.r[0]) # projector on the edge
    energies = np.linspace(-.2,.2,200) # set of energies
    (e0,d0) = h.get_dos(operator=edge,energies=energies,delta=2e-3) # edge DOS

替代文字

人工拓扑超导体中马约拉纳模式的空间分布

import numpy as np
from pyqula import geometry
g = geometry.chain() # create a chain
g = g.supercell(100) # create a large supercell
g.dimensionality = 0 # make it finite
h = g.get_hamiltonian() # create a new hamiltonian
h.add_onsite(2.0) # shift the chemical potential
h.add_rashba(.3) # add rashba spin-orbit coupling
h.add_exchange([0.,0.,0.15]) # add exchange coupling
h.add_swave(.1) # add s-wave superconductivity
energies = np.linspace(-.15,.15,200) # set of energies
for ri in g.r: # loop over sites
    edge = h.get_operator("location",r=ri) # projector on that site
    (e0,d0) = h.get_dos(operator=edge,energies=energies,delta=2e-3) # local DOS

替代文字

具有缺陷的超级电池的展开电子结构

from pyqula import geometry
import numpy as np
g = geometry.honeycomb_lattice() # create a honeycomb lattice
n = 3 # size of the supercell
g = g.get_supercell(n,store_primal=True) # create a supercell
h = g.get_hamiltonian() # get the Hamiltonian
fons = lambda r: (np.sum((r - g.r[0])**2)<1e-2)*100 # onsite in the impurity
h.add_onsite(fons) # add onsite energy
kpath = np.array(g.get_kpath(nk=200))*n # enlarged k-path
h.get_kdos_bands(operator="unfold",delta=1e-1,kpath=kpath) # unfolded bands

替代文字

莫尔超晶格的莫尔带结构

from pyqula import geometry
from pyqula import potentials
g = geometry.triangular_lattice() # create geometry
g = g.get_supercell([7,7]) # create a supercell
h = g.get_hamiltonian() # get the Hamiltonian
fmoire = potentials.commensurate_potential(g,n=3,minmax=[0,1]) # moire potential
h.add_onsite(fmoire) # add onsite energy following the moire
h.get_bands(operator=fmoire) # project on the moire

替代文字

莫尔上层结构的展开电子结构

from pyqula import geometry
from pyqula import potentials
import numpy as np
g0 = geometry.triangular_lattice() # create geometry
n = 5 # supercell
g = g0.get_supercell(n,store_primal=True) # create a supercell
h = g.get_hamiltonian() # get the Hamiltonian
fmoire = potentials.commensurate_potential(g,n=3,minmax=[0,1]) # moire potential
h.add_onsite(fmoire) # add onsite energy following the moire
kpath = np.array(g.get_kpath(nk=400))*n # enlarged k-path
h.get_kdos_bands(operator="unfold",delta=2e-2,kpath=kpath,
                  energies=np.linspace(-3,-1,300)) # unfolded bands

替代文字

节线半金属板的能带结构

from pyqula import geometry
from pyqula import films
g = geometry.diamond_lattice()
g = films.geometry_film(g,nz=20)
h = g.get_hamiltonian()
(k,e) = h.get_bands()

替代文字

三维拓扑绝缘体板的能带结构

from pyqula import geometry
from pyqula import films
import numpy as np
g = geometry.diamond_lattice() # create a diamond lattice
g = films.geometry_film(g,nz=60) # create a thin film
h = g.get_hamiltonian() # generate Hamiltonian
h.add_strain(lambda r: 1.+abs(r[2])*0.8,mode="directional") # add axial strain
h.add_kane_mele(0.1) # add intrinsic spin-orbit coupling
(k,e,c)= h.get_bands(operator="surface") # compute band structure

替代文字

二维量子自旋霍尔绝缘体的表面光谱函数

from pyqula import geometry
g = geometry.honeycomb_lattice() # create a honeycomb lattice
h = g.get_hamiltonian() # generate Hamiltonian
h.add_soc(0.15) # add intrinsic spin-orbit coupling
h.add_rashba(0.1) # add Rashba spin-orbit coupling
h.get_surface_kdos(delta=1e-2) # compute surface spectral function

替代文字

具有蜂窝状纳米岛原子轨道的局部态密度

from pyqula import islands
g = islands.get_geometry(name="honeycomb",n=3,nedges=3) # get an island
h = g.get_hamiltonian() # get the Hamiltonian
h.get_multildos(projection="atomic") # get the LDOS

替代文字

蜂窝纳米岛中相互作用驱动的磁性

from pyqula import islands
g = islands.get_geometry(name="honeycomb",n=3,nedges=3) # get an island
h = g.get_hamiltonian() # get the Hamiltonian
h = h.get_mean_field_hamiltonian(U=1.0,filling=0.5,mf="ferro") # perform SCF
m = h.get_magnetization() # get the magnetization in each site

替代文字

霍夫施塔特的方形格子蝴蝶

import numpy as np
from pyqula import geometry
g = geometry.square_ribbon(40) # create square ribbon geometry

for B in np.linspace(0.,1.0,300): # loop over magnetic field
    h = g.get_hamiltonian() # create a new hamiltonian
    h.add_orbital_magnetic_field(B) # add an orbital magnetic field
    # calculate DOS projected on the bulk
    (e,d) = h.get_dos(operator="bulk",energies=np.linspace(-4.5,4.5,200))

替代文字

狄拉克半金属的朗道能级

import numpy as np
from pyqula import geometry
g = geometry.honeycomb_ribbon(30) # create a honeycomb ribbon

for B in np.linspace(0.,0.02,100): # loop over magnetic field
    h = g.get_hamiltonian() # create a new hamiltonian
    h.add_orbital_magnetic_field(B) # add an orbital magnetic field
    # calculate DOS projected on the bulk
    (e,d) = h.get_dos(operator="bulk",energies=np.linspace(-1.0,1.0,200),
                       delta=1e-2)

替代文字

Chern 绝缘体的表面光谱函数

from pyqula import geometry
from pyqula import kdos
g = geometry.honeycomb_lattice() # create honeycomb lattice
h = g.get_hamiltonian() # create hamiltonian of the system
h.add_haldane(0.05) # Add Haldane coupling
kdos.surface(h) # surface spectral function

替代文字

人造二维拓扑超导体的表面态和贝里曲率

from  pyqula  import  geometry 
import