Skip to content

Lattice differs in output between spglib and this package #370

Description

@Bud-Macaulay

When determining the resulting cells (both primitive and conventional) the output lattice differs with respect to spglib.
Even if using the Setting.spglib() flag,

This causes downstream issues when trying to compute brilliounzone path in tools such as SeeKPath, which relies on conventional cells conforming to a specific set of rules.

One simple example is the following:

import spglib
import moyopy

from moyopy import Setting

lattice = [[3.1118027, 0 ,0], [0, 5.35005134, 0], [0,0,5.78662637]]
numbers = [1,1,2,2]

positions = [
    [0.0,0.0,0.5],
    [0.5,0.5,0.0],
    [0.0,0.0,0.0],
    [0.5,0.5,0.5]
             ]

cell = (lattice, positions, numbers)
sym_data = spglib.get_symmetry_dataset(cell, symprec=1e-4)

print(f"spglib SGN: {sym_data.number}")
print(f"Conventional Lattice:")
print(f"{sym_data.std_lattice}")

Outputs:

spglib SGN: 71
Conventional Lattice:
[[3.1118027  0.         0.        ]
 [0.         5.35005134 0.        ]
 [0.         0.         5.78662637]]

Whereas the same crystal usuing moyopy:

moyoCell = moyopy.Cell(lattice, positions,numbers)
sym_data_moyo = moyopy.MoyoDataset(moyoCell, symprec=1e-4, setting=Setting.spglib())

cell = sym_data_moyo.std_cell

print(f"moyo SGN: {sym_data_moyo.number}\n")
print("Conventional Lattice:")
for i, vec in enumerate(cell.basis):
    rounded = [round(x, 6) for x in vec]
    print(f"{rounded}")

outputs:

moyo SGN: 71
Conventional Lattice:
[5.786626, 0.0, -0.0]
[0.0, 3.111803, 0.0]
[-0.0, -0.0, 5.350051]

I will note that while this seems related to #260, I have other examples where the resulting lattice is much different to spglib.

Would be great to clear this up, perhaps its general confusion on my end.

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