Skip to content

Commit 2b86f28

Browse files
authored
Merge pull request #197 from spglib/fix-real-rep-2
Fix real rep 2
2 parents c8e6b13 + 2330029 commit 2b86f28

File tree

19 files changed

+804
-762
lines changed

19 files changed

+804
-762
lines changed

.github/ISSUE_TEMPLATE/bug_report.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
1-
______________________________________________________________________
2-
1+
---
32
name: Bug report
43
about: Create a report to help us improve
54
title: ''
65
labels: ''
76
assignees: ''
87

9-
______________________________________________________________________
8+
---
109

1110
## Describe the bug
1211

.github/ISSUE_TEMPLATE/feature_request.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
1-
______________________________________________________________________
2-
1+
---
32
name: Feature request
43
about: Suggest an idea for this project
54
title: ''
65
labels: ''
76
assignees: ''
87

9-
______________________________________________________________________
8+
---
109

1110
## Is your feature request related to a problem? Please describe.
1211

.pre-commit-config.yaml

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,6 @@ repos:
1111
- id: check-json
1212
- id: debug-statements
1313
- id: end-of-file-fixer
14-
- repo: https://github.com/executablebooks/mdformat
15-
rev: 0.7.22
16-
hooks:
17-
- id: mdformat
18-
additional_dependencies:
19-
- mdformat-gfm
2014
- repo: https://github.com/astral-sh/ruff-pre-commit
2115
rev: v0.12.0
2216
hooks:

docs/api/api_core.md

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,11 @@
33
## Summary
44

55
Spgrep provides its core functions to enumerate irreducible representations (irreps) from given
6-
7-
- crystal structures (`(lattice, positions, numbers)`) or magnetic crystal structures (`(lattice, positions, numbers, magmoms)`),
8-
- symmetry operations of space groups (`(rotations, translations)`) or magnetic space groups (`(rotations, translations, time_reversals)`),
9-
- and symmetry operations of crystallographic point groups (`rotations`).
6+
- crystal structures (``(lattice, positions, numbers)``) or magnetic crystal structures (``(lattice, positions, numbers, magmoms)``),
7+
- symmetry operations of space groups (``(rotations, translations)``) or magnetic space groups (``(rotations, translations, time_reversals)``),
8+
- and symmetry operations of crystallographic point groups (``rotations``).
109

1110
For a given crystal structure or symmetry operations, Spgrep calculates the following representations:
12-
1311
- Linear irreps (See {ref}`space_group_irreps`)
1412
- Physically irreps (See {ref}`physically_irreps`)
1513
- Projective irreps for spinor (See {ref}`spin_representation`)
@@ -19,16 +17,16 @@ The following tables summarize core functions for a combination of representatio
1917

2018
### Functions for (magnetic) crystal structure
2119

22-
| Tasks | (Magnetic) crystal structure |
23-
| ----------------------------- | ---------------------------------------------------------- |
24-
| Linear irreps | {func}`spgrep.get_spacegroup_irreps` |
25-
| Projective irreps for spinor | {func}`spgrep.get_spacegroup_spinor_irreps` |
26-
| Projective co-reps for spinor | {func}`spgrep.get_spacegroup_spinor_irreps` with `magmoms` |
20+
| Tasks | (Magnetic) crystal structure |
21+
|-------------------------------|------------------------------------------------------------ |
22+
| Linear irreps | {func}`spgrep.get_spacegroup_irreps` |
23+
| Projective irreps for spinor | {func}`spgrep.get_spacegroup_spinor_irreps` |
24+
| Projective co-reps for spinor | {func}`spgrep.get_spacegroup_spinor_irreps` with `magmoms` |
2725

2826
### Functions for (magnetic) space-group symmetry operations
2927

3028
| Tasks | (Magnetic) space group |
31-
| ----------------------------- | ----------------------------------------------------------------------------------------- |
29+
|-------------------------------|-------------------------------------------------------------------------------------------|
3230
| Linear irreps | {func}`spgrep.get_spacegroup_irreps_from_primitive_symmetry` |
3331
| Physically irreps | {func}`spgrep.get_spacegroup_irreps_from_primitive_symmetry` with `real=True` |
3432
| Projective irreps for spinor | {func}`spgrep.get_spacegroup_spinor_irreps_from_primitive_symmetry` |
@@ -37,7 +35,7 @@ The following tables summarize core functions for a combination of representatio
3735
### Functions for (magnetic) crystallographic point-group symmetry operations
3836

3937
| Tasks | (Magnetic) point group |
40-
| ----------------------------- | ------------------------------------------------------------------------------------------------ |
38+
|-------------------------------|--------------------------------------------------------------------------------------------------|
4139
| Linear irreps | {func}`spgrep.get_crystallographic_pointgroup_irreps_from_symmetry` |
4240
| Physically irreps | {func}`spgrep.get_crystallographic_pointgroup_irreps_from_symmetry` with `real=True` |
4341
| Projective irreps for spinor | {func}`spgrep.get_crystallographic_pointgroup_spinor_irreps_from_symmetry` |

docs/changelog.md

Lines changed: 8 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -13,46 +13,40 @@
1313
- Make compatible with NumPy 2.0.0
1414

1515
## v0.3.3 (11 Jan. 2023)
16-
1716
- Improve comparison between linear subspaces [[#53]](https://github.com/spglib/spgrep/pull/53)
18-
- Use Grassmann distance to measure linear subspaces: {func}`spgrep.utils.grassmann_distance`
19-
- Drop `spgrep.utils.contain_space`
17+
- Use Grassmann distance to measure linear subspaces: {func}`spgrep.utils.grassmann_distance`
18+
- Drop `spgrep.utils.contain_space`
2019

2120
## v0.3.2 (28 Dec. 2022)
22-
2321
- Clean documents and add JOSS draft [[#50]](https://github.com/spglib/spgrep/pull/50)
2422

2523
## v0.3.1 (15 Dec. 2022)
2624

2725
- Add co-representation [[#47]](https://github.com/spglib/spgrep/pull/47)
28-
- New functions to compute co-representations for spinor
29-
- {func}`spgrep.get_spacegroup_spinor_irreps`
30-
- {func}`spgrep.get_spacegroup_spinor_irreps_from_primitive_symmetry`
31-
- {func}`spgrep.get_crystallographic_pointgroup_spinor_irreps_from_symmetry`
32-
- Require a newer spglib as dependency: `spglib>=2.0.2`
26+
- New functions to compute co-representations for spinor
27+
- {func}`spgrep.get_spacegroup_spinor_irreps`
28+
- {func}`spgrep.get_spacegroup_spinor_irreps_from_primitive_symmetry`
29+
- {func}`spgrep.get_crystallographic_pointgroup_spinor_irreps_from_symmetry`
30+
- Require a newer spglib as dependency: ``spglib>=2.0.2``
3331

34-
## v0.3.0 (17 Nov. 2022)
3532

33+
## v0.3.0 (17 Nov. 2022)
3634
- Add spinor representation [[#41]](https://github.com/spglib/spgrep/pull/41)
3735

3836
## v0.2.12
39-
4037
- Generate symmetric tensor by Erdös method {func}`spgrep.tensors.get_symmetry_adapted_tensors` and {func}`spgrep.tensors.apply_intrinsic_symmetry`
4138
- Fix induced representation
4239

4340
## v0.2.11
44-
4541
- Add physically irreducible representation of space group
4642
- Newly return Frobenius-Schur indicator from `enumerate_small_representations` and `enumerate_unitary_irreps`
4743

4844
## v0.2.9
49-
5045
- Add example notebooks
5146

5247
## v0.2.8
5348

5449
Initial release to PyPI
55-
5650
- Calculate irreducible representations (irreps) of space groups: {func}`spgrep.get_spacegroup_irreps` and {func}`spgrep.get_spacegroup_irreps_from_primitive_symmetry`
5751
- Calculate irreps of crystallographic point groups: {func}`spgrep.get_crystallographic_pointgroup_irreps_from_symmetry`
5852
- Calculate physically irreducible representations (irreps over real numbers)

docs/conf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@
6969
bibtex_bibfiles = ["references.bib"]
7070

7171
intersphinx_mapping = {
72-
"spglib": ("https://spglib.github.io/spglib/", None),
72+
"spglib": ("https://spglib.readthedocs.io/en/latest/", None),
7373
}
7474

7575
# MyST

docs/development/memo.md

Lines changed: 48 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -5,66 +5,73 @@
55

66
## Bloch sphere
77

8-
Consider a spinor $\\psi\_{\\uparrow}(\\mathbf{r})\\ket{\\uparrow} + \\psi\_{\\downarrow}(\\mathbf{r})\\ket{\\downarrow}$ with $|\\psi\_{\\uparrow}(\\mathbf{r})|^{2} + |\\psi\_{\\downarrow}(\\mathbf{r})|^{2} = 1$.
8+
Consider a spinor $\psi_{\uparrow}(\mathbf{r})\ket{\uparrow} + \psi_{\downarrow}(\mathbf{r})\ket{\downarrow}$ with $|\psi_{\uparrow}(\mathbf{r})|^{2} + |\psi_{\downarrow}(\mathbf{r})|^{2} = 1$.
99

10-
The following construction maps the spinor to a point $\\left( m\_{x}(\\mathbf{r}), m\_{y}(\\mathbf{r}), m\_{z}(\\mathbf{r}) \\right) \\in S^{2}$:
10+
The following construction maps the spinor to a point $\left( m_{x}(\mathbf{r}), m_{y}(\mathbf{r}), m_{z}(\mathbf{r}) \right) \in S^{2}$:
1111
$$
12-
m\_{x}(\\mathbf{r})
13-
&:=
14-
\\begin{pmatrix} \\psi\_{\\uparrow}(\\mathbf{r})^{\\ast} & \\psi\_{\\downarrow}(\\mathbf{r})^{\\ast} \\end{pmatrix}
15-
\\mathbf{\\sigma}_{x}
16-
\\begin{pmatrix} \\psi_{\\uparrow}(\\mathbf{r}) \\ \\psi\_{\\downarrow}(\\mathbf{r}) \\end{pmatrix} \\
17-
&=
18-
2 ,\\mathrm{Re} \\left( \\psi\_{\\uparrow}(\\mathbf{r})^{\\ast} \\psi\_{\\downarrow}(\\mathbf{r}) \\right) \\in \\mathbb{R} \\
19-
m\_{y}(\\mathbf{r})
20-
&:=
21-
\\begin{pmatrix} \\psi\_{\\uparrow}(\\mathbf{r})^{\\ast} & \\psi\_{\\downarrow}(\\mathbf{r})^{\\ast} \\end{pmatrix}
22-
\\mathbf{\\sigma}_{y}
23-
\\begin{pmatrix} \\psi_{\\uparrow}(\\mathbf{r}) \\ \\psi\_{\\downarrow}(\\mathbf{r}) \\end{pmatrix} \\
24-
&=
25-
2 ,\\mathrm{Im} \\left( \\psi\_{\\uparrow}(\\mathbf{r})^{\\ast} \\psi\_{\\downarrow}(\\mathbf{r}) \\right) \\in \\mathbb{R} \\
26-
m\_{z}(\\mathbf{r})
27-
&:=
28-
\\begin{pmatrix} \\psi\_{\\uparrow}(\\mathbf{r})^{\\ast} & \\psi\_{\\downarrow}(\\mathbf{r})^{\\ast} \\end{pmatrix}
29-
\\mathbf{\\sigma}_{z}
30-
\\begin{pmatrix} \\psi_{\\uparrow}(\\mathbf{r}) \\ \\psi\_{\\downarrow}(\\mathbf{r}) \\end{pmatrix} \\
31-
&=
32-
|\\psi\_{\\uparrow}(\\mathbf{r})|^{2} - |\\psi\_{\\downarrow}(\\mathbf{r})|^{2} \\in \\mathbb{R} \\
12+
m_{x}(\mathbf{r})
13+
&:=
14+
\begin{pmatrix} \psi_{\uparrow}(\mathbf{r})^{\ast} & \psi_{\downarrow}(\mathbf{r})^{\ast} \end{pmatrix}
15+
\mathbf{\sigma}_{x}
16+
\begin{pmatrix} \psi_{\uparrow}(\mathbf{r}) \\ \psi_{\downarrow}(\mathbf{r}) \end{pmatrix} \\
17+
&=
18+
2 \,\mathrm{Re} \left( \psi_{\uparrow}(\mathbf{r})^{\ast} \psi_{\downarrow}(\mathbf{r}) \right) \in \mathbb{R} \\
19+
m_{y}(\mathbf{r})
20+
&:=
21+
\begin{pmatrix} \psi_{\uparrow}(\mathbf{r})^{\ast} & \psi_{\downarrow}(\mathbf{r})^{\ast} \end{pmatrix}
22+
\mathbf{\sigma}_{y}
23+
\begin{pmatrix} \psi_{\uparrow}(\mathbf{r}) \\ \psi_{\downarrow}(\mathbf{r}) \end{pmatrix} \\
24+
&=
25+
2 \,\mathrm{Im} \left( \psi_{\uparrow}(\mathbf{r})^{\ast} \psi_{\downarrow}(\mathbf{r}) \right) \in \mathbb{R} \\
26+
m_{z}(\mathbf{r})
27+
&:=
28+
\begin{pmatrix} \psi_{\uparrow}(\mathbf{r})^{\ast} & \psi_{\downarrow}(\mathbf{r})^{\ast} \end{pmatrix}
29+
\mathbf{\sigma}_{z}
30+
\begin{pmatrix} \psi_{\uparrow}(\mathbf{r}) \\ \psi_{\downarrow}(\mathbf{r}) \end{pmatrix} \\
31+
&=
32+
|\psi_{\uparrow}(\mathbf{r})|^{2} - |\psi_{\downarrow}(\mathbf{r})|^{2} \in \mathbb{R} \\
3333
$$
3434

3535
$$
36-
m\_{x}(\\mathbf{r})^{2} + m\_{y}(\\mathbf{r})^{2} + m\_{z}(\\mathbf{r})^{2} = 1
36+
m_{x}(\mathbf{r})^{2} + m_{y}(\mathbf{r})^{2} + m_{z}(\mathbf{r})^{2} = 1
3737
$$
3838

3939
## Symmetry-adapted tensor with intrinsic symmetry
4040

4141
Ref. {cite}`el2008symmetry`
4242

43-
Consider vector space $V$ and its symmetry adapted basis ${ \\mathbf{f}^{\\alpha m}_{i} }$ w.r.t. group $G$.
43+
Consider vector space $V$ and its symmetry adapted basis $\{ \mathbf{f}^{\alpha m}_{i} \}$ w.r.t. group $G$.
4444
$$
45-
V &= \\bigoplus_{\\alpha} \\bigoplus\_{m=1}^{m\_{\\alpha}} V^{\\alpha m} \\
46-
V^{\\alpha m} &= \\bigoplus\_{i=1}^{d\_{\\alpha}} K \\mathbf{f}^{\\alpha m}_{i} \\
47-
g \\mathbf{f}^{\\alpha m}_{j}
48-
&= \\sum\_{i=1} ^{d\_{\\alpha}} \\mathbf{f}^{\\alpha m}_{i} \\Gamma^{\\alpha}_{ij}(g)
49-
\\quad (g \\in G, j = 1, \\dots, d\_{\\alpha}),
45+
V &= \bigoplus_{\alpha} \bigoplus_{m=1}^{m_{\alpha}} V^{\alpha m} \\
46+
V^{\alpha m} &= \bigoplus_{i=1}^{d_{\alpha}} K \mathbf{f}^{\alpha m}_{i} \\
47+
g \mathbf{f}^{\alpha m}_{j}
48+
&= \sum_{i=1} ^{d_{\alpha}} \mathbf{f}^{\alpha m}_{i} \Gamma^{\alpha}_{ij}(g)
49+
\quad (g \in G, j = 1, \dots, d_{\alpha}),
5050
$$
51-
where $K$ is $\\mathbb{C}$ or $\\mathbb{R}$, and $\\Gamma^{\\alpha}$ is irrep over $K$.
51+
where $K$ is $\mathbb{C}$ or $\mathbb{R}$, and $\Gamma^{\alpha}$ is irrep over $K$.
5252

53-
Action of $G$ on rank-$p$ tensor $\\mathsf{T}: V^{\\ast \\otimes p}$ is defined as
53+
Action of $G$ on rank-$p$ tensor $\mathsf{T}: V^{\ast \otimes p}$ is defined as
5454
$$
55-
(g \\mathsf{T})(\\mathbf{v}_{1}, \\dots, \\mathbf{v}_{p})
56-
:= \\mathsf{T}(g^{-1} \\mathbf{v}_{1}, \\dots, g^{-1} \\mathbf{v}_{p})
57-
\\quad (g \\in G).
55+
(g \mathsf{T})(\mathbf{v}_{1}, \dots, \mathbf{v}_{p})
56+
:= \mathsf{T}(g^{-1} \mathbf{v}_{1}, \dots, g^{-1} \mathbf{v}_{p})
57+
\quad (g \in G).
5858
$$
59-
We also consider intrinsic symmetry $\\Sigma$ of $\\mathsf{T}$ as [^check_action]
59+
We also consider intrinsic symmetry $\Sigma$ of $\mathsf{T}$ as [^check_action]
6060
$$
61-
(\\sigma \\mathsf{T})(\\mathbf{v}_{1}, \\dots, \\mathbf{v}_{p})
62-
:= \\mathsf{T}(\\mathbf{v}_{\\sigma^{-1}(1)}, \\dots, \\mathbf{v}_{\\sigma^{-1}(p)})
63-
\\quad (\\sigma \\in \\Sigma).
61+
(\sigma \mathsf{T})(\mathbf{v}_{1}, \dots, \mathbf{v}_{p})
62+
:= \mathsf{T}(\mathbf{v}_{\sigma^{-1}(1)}, \dots, \mathbf{v}_{\sigma^{-1}(p)})
63+
\quad (\sigma \in \Sigma).
6464
$$
6565

66-
\[^check_action\]: These definitions follow the condition of left actions:
67-
`{math} (\sigma (\sigma' \mathsf{T}))(\mathbf{v}_{1}, \dots, \mathbf{v}_{p}) &= (\sigma' \mathsf{T})(\mathbf{v}_{\sigma^{-1}(1)}, \dots, \mathbf{v}_{\sigma^{-1}(p)}) \\ &= \mathsf{T}(\mathbf{v}_{\sigma'^{-1}(\sigma^{-1}(1))}, \dots, \mathbf{v}_{\sigma'^{-1}(\sigma^{-1}(p))}) \\ &= \mathsf{T}(\mathbf{v}_{\sigma\sigma'(1)}, \dots, \mathbf{v}_{\sigma\sigma'(p)}) \\ &= ((\sigma \sigma') \mathsf{T})(\mathbf{v}_{1}, \dots, \mathbf{v}_{p}) \\ \therefore \sigma (\sigma' \mathsf{T}) &= (\sigma \sigma') \mathsf{T} `
66+
[^check_action]: These definitions follow the condition of left actions:
67+
```{math}
68+
(\sigma (\sigma' \mathsf{T}))(\mathbf{v}_{1}, \dots, \mathbf{v}_{p})
69+
&= (\sigma' \mathsf{T})(\mathbf{v}_{\sigma^{-1}(1)}, \dots, \mathbf{v}_{\sigma^{-1}(p)}) \\
70+
&= \mathsf{T}(\mathbf{v}_{\sigma'^{-1}(\sigma^{-1}(1))}, \dots, \mathbf{v}_{\sigma'^{-1}(\sigma^{-1}(p))}) \\
71+
&= \mathsf{T}(\mathbf{v}_{\sigma\sigma'(1)}, \dots, \mathbf{v}_{\sigma\sigma'(p)}) \\
72+
&= ((\sigma \sigma') \mathsf{T})(\mathbf{v}_{1}, \dots, \mathbf{v}_{p}) \\
73+
\therefore \sigma (\sigma' \mathsf{T}) &= (\sigma \sigma') \mathsf{T}
74+
```
6875
6976
## References
7077

docs/formulation/algorithm/algorithm.md

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,19 +3,15 @@
33
Irreps of crystallographic point groups or space groups are calculated in following steps:
44

55
Method-A ({func}`spgrep.irreps.enumerate_unitary_irreps_from_regular_representation`)
6-
76
1. Construct regular representation (crystallographic point group) or projective regular representation (space group).
8-
1. Construct random matrix that commutes with (projective) regular representation and obtain irreps by diagonalizing it.
7+
2. Construct random matrix that commutes with (projective) regular representation and obtain irreps by diagonalizing it.
98

109
Method-B ({func}`spgrep.irreps.enumerate_unitary_irreps_from_solvable_group_chain`)
11-
1210
1. Decompose little co-group {math}`\overline{\mathcal{G}}^{\mathbf{k}}` into series
13-
14-
```{math}
15-
1 = G_{0} \triangleleft G_{1} \triangleleft \dots \triangleleft G_{m} = \overline{\mathcal{G}}^{\mathbf{k}}.
16-
```
17-
18-
2. Construct irrep $\\Delta$ of $G\_{i}$ and use induced representation $\\Delta \\uparrow G\_{i+1}$ to obtain irreps of $G\_{i+1}$
11+
```{math}
12+
1 = G_{0} \triangleleft G_{1} \triangleleft \dots \triangleleft G_{m} = \overline{\mathcal{G}}^{\mathbf{k}}.
13+
```
14+
2. Construct irrep $\Delta$ of $G_{i}$ and use induced representation $\Delta \uparrow G_{i+1}$ to obtain irreps of $G_{i+1}$
1915

2016
## Subpages
2117

0 commit comments

Comments
 (0)