Skip to content

pymatgen yields different spacegroup number to symbol map #83

Description

@janosh

@lan496 this should maybe be a pymatgen issue rather than a moyo issue but wanted to hear your opinion first.

after #80, i compared the maps from international number to HM short symbol you get from pymatgen and moyopy, expecting them to be identical but actually they differ for the monoclinic spacegroups. looks like pymatgen returns the full Hermann–Mauguin symbol for 3-15 and HM short else. not sure if this is by design and if so, why.

from pymatgen.symmetry.groups import SpaceGroup
from moyopy import SpaceGroupType

pmg_spg_map = {
    number: SpaceGroup.from_int_number(number).symbol for number in range(1, 230 + 1)
}
moyo_spg_map = {
    # SpaceGroupType(number).hm_short is separated by a space like "F m -3 m"
    number: SpaceGroupType(number).hm_short.replace(" ", "")
    for number in range(1, 230 + 1)
}

for k in pmg_spg_map:
    if pmg_spg_map[k] != moyo_spg_map[k]:
        print(k, pmg_spg_map[k], moyo_spg_map[k])

# this prints
3 P121 P2
4 P12_11 P2_1
5 C121 C2
6 P1m1 Pm
7 P1c1 Pc
8 C1m1 Cm
9 C1c1 Cc
10 P12/m1 P2/m
11 P12_1/m1 P2_1/m
12 C12/m1 C2/m
13 P12/c1 P2/c
14 P12_1/c1 P2_1/c
15 C12/c1 C2/c

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions