跳转到主要内容

空间群不可约表示的即时生成器

项目描述

Spgrep

testing pre-commit.ci status codecov License PyPI - Python Version PyPI version PyPI Downloads Lines of code DOI

Spgrep 是一个空间群不可约表示的即时生成器 Python 包。

功能

  • spglib 的单元和 k 点枚举空间群的以下不可约表示 (irreps)
    • 线性不可约表示
    • 物理不可约表示(实数上的不可约表示)
    • spnior 的投影不可约表示
    • 自旋子的投影不可约共表示
  • 也枚举晶体学点群的不可约表示
  • 寻找形成给定不可约表示的对称适配基
  • 最小依赖(numpy 和 spglib

用法

from spgrep import get_spacegroup_irreps
from spgrep.representation import get_character

# Rutile structure (https://materialsproject.org/materials/mp-2657/)
# P4_2/mnm (No. 136)
a = 4.603
c = 2.969
x_4f = 0.3046
lattice = [
    [a, 0, 0],
    [0, a, 0],
    [0, 0, c],
]
positions = [
    [0, 0, 0],  # Ti(2a)
    [0.5, 0.5, 0.5],  # Ti(2a)
    [x_4f, x_4f, 0],  # O(4f)
    [-x_4f, -x_4f, 0],  # O(4f)
    [-x_4f + 0.5, x_4f + 0.5, 0.5],  # O(4f)
    [x_4f + 0.5, -x_4f + 0.5, 0.5],  # O(4f)
]
numbers = [0, 0, 1, 1, 1, 1]

kpoint = [0.5, 0, 0]  # X point
irreps, rotations, translations, mapping_little_group = get_spacegroup_irreps(
    lattice, positions, numbers, kpoint
)

# Symmetry operations by spglib
assert len(rotations) == 16
assert len(translations) == 16

# At X point, the little co-group is isomorphic to mmm (order=8)
assert len(mapping_little_group) == 8
print(mapping_little_group)  # [ 0,  1,  4,  5,  8,  9, 12, 13]

# Two two-dimensional irreps
for irrep in irreps:
    print(get_character(irrep))
# [2.+0.j 0.+0.j 0.+0.j 2.+0.j 0.+0.j 0.+0.j 0.+0.j 0.+0.j]
# [2.+0.j 0.+0.j 0.+0.j -2.+0.j 0.+0.j 0.+0.j 0.+0.j 0.+0.j]

请参阅 示例页面 了解更多详细用法和 API 摘要 了解功能概述。

安装

Spgrep 与 Python3.8+ 兼容,可以通过 PyPI 安装

pip install spgrep

或本地安装

conda create -n spgrep python=3.10 pip
conda activate spgrep
git clone git@github.com:spglib/spgrep.git
cd spgrep
pip install -e .

变更日志

请参阅 变更日志 了解最新更改。

如何贡献

我们欢迎任何有助于改进功能的贡献。请打开 问题 或创建 拉取请求。查看开发页面了解如何准备环境。

许可证

Spgrep 在BSD 3条款许可下发布。

项目详情


下载文件

下载适用于您的平台的文件。如果您不确定选择哪个,请了解更多关于安装包的信息。

源代码分发

spgrep-0.3.5.tar.gz (107.3 kB 查看哈希值)

上传时间 源代码

构建分发

spgrep-0.3.5-py3-none-any.whl (35.9 kB 查看哈希值)

上传时间 Python 3

由支持