moyopy

0.7.9 · active · verified Thu Apr 16

moyopy is a Python binding for the moyo library, a fast and robust crystal symmetry finder written in Rust. It provides functionalities for crystallographic analysis, including space group determination and primitive cell finding. The library is actively maintained, with a current version of 0.7.9, and requires Python 3.10 or newer. New releases appear with an active cadence.

Common errors

Warnings

Install

Imports

Quickstart

This quickstart demonstrates how to define a simple crystal structure and use `moyopy.get_symmetry_dataset` to obtain its symmetry properties, including the space group number, international symbol, and Hall symbol. The structure is provided as a tuple `(lattice, positions, numbers)`.

import numpy as np
from moyopy import get_symmetry_dataset

# Define crystal structure (lattice, positions, numbers)
# Example: Diamond cubic silicon
lattice = np.array([
    [0, 2.735, 2.735],
    [2.735, 0, 2.735],
    [2.735, 2.735, 0]
])
positions = np.array([
    [0.0, 0.0, 0.0],
    [0.25, 0.25, 0.25]
])
numbers = [14, 14] # Atomic numbers for Si

cell = (lattice, positions, numbers)

symprec = 1e-5 # Symmetry precision in Angstrom
angle_tolerance = 1.0 # Angle tolerance in degrees

dataset = get_symmetry_dataset(cell, symprec=symprec, angle_tolerance=angle_tolerance)

print(f"Space group number: {dataset['number']}")
print(f"International symbol: {dataset['international']}")
print(f"Hall symbol: {dataset['hall']}")
# print(f"Rotations: {dataset['rotations']}")
# print(f"Translations: {dataset['translations']}")

view raw JSON →