Skip to content

Fix swapped arithmetic crystal class numbers for space groups 187-190 - #398

Merged
lan496 merged 1 commit into
mainfrom
fix/arithmetic-crystal-class-187-190
Jul 13, 2026
Merged

Fix swapped arithmetic crystal class numbers for space groups 187-190#398
lan496 merged 1 commit into
mainfrom
fix/arithmetic-crystal-class-187-190

Conversation

@lan496

@lan496 lan496 commented Jul 13, 2026

Copy link
Copy Markdown
Member

Summary

Moyo has the same data bug as spglib, fixed there in spglib/spglib#632: the arithmetic crystal class (ACC) numbers 56 and 57 are swapped relative to International Tables for Crystallography, Volume C (2004), Table 1.4.2.1.

G Correct ACC Moyo before this PR
187: P-6m2 56: -6m2P 57: -6m2P
188: P-6c2 56: -6m2P 57: -6m2P
189: P-62m 57: -62mP 56: -62mP
190: P-62c 57: -62mP 56: -62mP

The swap was applied consistently across the internal tables, so symmetry identification and the reported ACC symbols were already correct; only the ACC numbers exposed via MoyoDataset / moyopy.SpaceGroupType.arithmetic_number were wrong.

Changes:

  • moyo/src/data/arithmetic_crystal_class.rs: swap the symbols so 56 = -6m2P and 57 = -62mP
  • moyo/src/data/hall_symbol_database.rs: Hall entries 481/482 (SG 187/188) now map to ACC 56, and 483/484 (SG 189/190) to ACC 57
  • moyo/src/data/point_group.rs: PointGroupRepresentative::from_arithmetic_crystal_class maps 56 -> Hall 481 and 57 -> Hall 483
  • CHANGELOG.md: Unreleased entry

Test plan

  • New regression test test_arithmetic_crystal_class_for_sg_187_to_190 asserting the ACC number and symbol for every Hall entry of SG 187-190 against Table 1.4.2.1 (fails before the fix, passes after)
  • cargo test -p moyo passes (161 unit + integration tests)
  • just prek passes

🤖 Generated with Claude Code

Per International Tables for Crystallography, Volume C (2004),
Table 1.4.2.1, arithmetic crystal class -6m2P is No. 56 and -62mP is
No. 57. Moyo had the numbers reversed, so space groups 187/188
reported arithmetic number 57 and 189/190 reported 56. The internal
number<->symbol linkage was consistent, so identification results and
the reported symbols were already correct; only the exposed numbers
change.

Same fix as spglib/spglib#632.

Co-Authored-By: Claude <noreply@anthropic.com>
@lan496
lan496 marked this pull request as ready for review July 13, 2026 11:30
@lan496
lan496 merged commit 5275f1e into main Jul 13, 2026
13 checks passed
@lan496
lan496 deleted the fix/arithmetic-crystal-class-187-190 branch July 13, 2026 11:31
@lan496 lan496 added the bug Something isn't working label Jul 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant