其他分享
首页 > 其他分享> > Qsymm 和 Kdotp_symmetry 对比

Qsymm 和 Kdotp_symmetry 对比

作者:互联网

Qsymm 文档: Generating \(k \cdot p\) models — Qsymm 1.4.0-dev10+gc8e0f55.dirty documentation

Kdotp_symmetry 文档:

1,Hexagonal warping

这是三维拓扑绝缘体的表面哈密顿量模型。晶格为二维表面的基矢。

Qsymm:

import numpy as np
import sympy
import qsymm

# C3 rotational symmetry - invariant under 2pi/3
C3 = qsymm.rotation(1/3, spin=1/2)
# Time reversal
TR = qsymm.time_reversal(2, spin=1/2)
# Mirror symmetry in x
Mx = qsymm.mirror([1, 0], spin=1/2)
symmetries = [C3, TR, Mx]

dim = 2  # Momenta along x and y
total_power = 3  # Maximum power of momenta
family = qsymm.continuum_hamiltonian(symmetries, dim, total_power, prettify=True)
qsymm.display_family(family)

## Output
'''
Matrix([[1, 0], [0, 1]])
Matrix([[0, I*k_x + k_y], [-I*k_x + k_y, 0]])
Matrix([[k_x**2 + k_y**2, 0], [0, k_x**2 + k_y**2]])
Matrix([[k_x**3 - 3*k_x*k_y**2, 0], [0, -k_x**3 + 3*k_x*k_y**2]])
Matrix([[0, I*k_x**3 + k_x**2*k_y + I*k_x*k_y**2 + k_y**3], [-I*k_x**3 + k_x**2*k_y - I*k_x*k_y**2 + k_y**3, 0]])
'''

对称操作矩阵为:

[
## C3 PointGroupElement( R = array([[-0.4999999999999998, -0.8660254037844387], [0.8660254037844387, -0.4999999999999998]]), conjugate = False, antisymmetry = False, U = array([[0.5-0.8660254j, 0. +0.j ], [0. +0.j , 0.5+0.8660254j]])),
## TR PointGroupElement( R = array([[1, 0], [0, 1]]), conjugate = True, antisymmetry = False, U = array([[ 0.+0.j, -1.+0.j], [ 1.+0.j, 0.+0.j]])),
## Mx PointGroupElement( R = array([[-1, 0], [0, 1]]), conjugate = False, antisymmetry = False, U = array([[0.+0.j, 0.-1.j], [0.-1.j, 0.+0.j]]))
]

Kdotp_symmetry: 

import sympy as sp
from sympy.core.numbers import I
import sympy.physics.matrices as sm
from sympy.physics.quantum import TensorProduct
import symmetry_representation as sr
import kdotp_symmetry as kp
# In this project we used the basis of tensor products of Pauli matrices
pauli_vec = [sp.eye(2), *(sm.msigma(i) for i in range(1, 4))]
basis = pauli_vec

# creating the symmetry operations
C3 = sr.SymmetryOperation(
    rotation_matrix=sp.Matrix([[-0.5, -0.8660254037844387],[0.8660254037844387, -0.5]]),
    repr_matrix=sp.Matrix([[0.5-0.8660254037844387j, 0 ],[0, 0.5+0.8660254037844387j]]),
    repr_has_cc=False,
    numeric=False
)
time_reversal = sr.SymmetryOperation(
    rotation_matrix=sp.eye(2),
    repr_matrix=sp.Matrix([[0, -1], [1, 0]]),
    repr_has_cc=True,
)
Mx = sr.SymmetryOperation(
    rotation_matrix=sp.Matrix([[-1,0],[0,1]]),
    repr_matrix=sp.Matrix([[0, -1j], [-1j, 0]]),
    repr_has_cc=False,
)

def print_result(order):
    """prints the basis for a given order of k"""
    print('Order:', order)
    for m in kp.symmetric_hamiltonian(
        C3,
        time_reversal,
        Mx,
        expr_basis=kp.monomial_basis(order),
        repr_basis=basis
        ):
        print(m)
    print()

if __name__ == '__main__':
    for i in range(2):
        print_result(order=i)

### 代码出现报错,还没解决

2. BHZ model

We reproduce the Hamiltonian for the quantum spin Hall effect derived in Science, 314, 1757 (2006).

The symmetry group is generated by spatial inversion symmetry, time-reversal symmetry and fourfold rotation symmetry.

import numpy as np
import sympy
import qsymm

# Spatial inversion
pU = np.array([
    [1.0, 0.0, 0.0, 0.0],
    [0.0, -1.0, 0.0, 0.0],
    [0.0, 0.0, 1.0, 0.0],
    [0.0, 0.0, 0.0, -1.0],
])
pS = qsymm.inversion(2, U=pU)

# Time reversal
trU = np.array([
    [0.0, 0.0, -1.0, 0.0],
    [0.0, 0.0, 0.0, -1.0],
    [1.0, 0.0, 0.0, 0.0],
    [0.0, 1.0, 0.0, 0.0],
])
trS = qsymm.time_reversal(2, U=trU)

# Rotation
phi = 2.0 * np.pi / 4.0  # Impose 4-fold rotational symmetry
rotU = np.array([
    [np.exp(-1j*phi/2), 0.0, 0.0, 0.0],
    [0.0, np.exp(-1j*3*phi/2), 0.0, 0.0],
    [0.0, 0.0, np.exp(1j*phi/2), 0.0],
    [0.0, 0.0, 0.0, np.exp(1j*3*phi/2)],
])
rotS = qsymm.rotation(1/4, U=rotU)

symmetries = [rotS, trS, pS]
# print(symmetries)
dim = 2
total_power = 2

family = qsymm.continuum_hamiltonian(symmetries, dim, total_power, prettify=True)
qsymm.display_family(family)

### Output
'''
Matrix([[1, 0, 0, 0], [0, 0, 0, 0], [0, 0, 1, 0], [0, 0, 0, 0]])
Matrix([[0, 0, 0, 0], [0, 1, 0, 0], [0, 0, 0, 0], [0, 0, 0, 1]])
Matrix([[0, k_x + I*k_y, 0, 0], [k_x - I*k_y, 0, 0, 0], [0, 0, 0, -k_x + I*k_y], [0, 0, -k_x - I*k_y, 0]])
Matrix([[0, I*k_x - k_y, 0, 0], [-I*k_x - k_y, 0, 0, 0], [0, 0, 0, I*k_x + k_y], [0, 0, -I*k_x + k_y, 0]])
Matrix([[k_x**2 + k_y**2, 0, 0, 0], [0, 0, 0, 0], [0, 0, k_x**2 + k_y**2, 0], [0, 0, 0, 0]])
Matrix([[0, 0, 0, 0], [0, k_x**2 + k_y**2, 0, 0], [0, 0, 0, 0], [0, 0, 0, k_x**2 + k_y**2]])
'''

表示矩阵

[
PointGroupElement(
R = array([[0, -1],
           [1, 0]]),
conjugate = False,
antisymmetry = False,
U = array([[ 0.70710678-0.70710678j,  0.        +0.j        ,
             0.        +0.j        ,  0.        +0.j        ],
           [ 0.        +0.j        , -0.70710678-0.70710678j,
             0.        +0.j        ,  0.        +0.j        ],
           [ 0.        +0.j        ,  0.        +0.j        ,
             0.70710678+0.70710678j,  0.        +0.j        ],
           [ 0.        +0.j        ,  0.        +0.j        ,
             0.        +0.j        , -0.70710678+0.70710678j]])), 
PointGroupElement(
R = array([[1, 0],
           [0, 1]]),
conjugate = True,
antisymmetry = False,
U = array([[ 0.,  0., -1.,  0.],
           [ 0.,  0.,  0., -1.],
           [ 1.,  0.,  0.,  0.],
           [ 0.,  1.,  0.,  0.]])), 
PointGroupElement(
R = array([[-1, 0],
           [0, -1]]),
conjugate = False,
antisymmetry = False,
U = array([[ 1.,  0.,  0.,  0.],
           [ 0., -1.,  0.,  0.],
           [ 0.,  0.,  1.,  0.],
           [ 0.,  0.,  0., -1.]]))]

 

标签:False,Matrix,symmetry,Kdotp,0.0,import,Qsymm,array
来源: https://www.cnblogs.com/ghzhan/p/16653773.html