Skip to main content

Pure-Python crystallography & HKL list generator. sginfo-equivalent: 230 space groups via Hall-symbol parser.

Project description

midas-hkls

Pure-Python crystallography & HKL list generator. sginfo-equivalent: all 230 space groups via Hall-symbol parsing, no C dependencies at runtime.

What it provides

  • SpaceGroup — load by number, Hermann-Mauguin symbol, or Hall symbol; expose symmetry operations, systematic absences, equivalent reflections, multiplicities, Laue class, centering.
  • Lattice — direct/reciprocal metric tensors, d-spacings, Bragg 2θ, with per-crystal-system convenience constructors.
  • generate_hkls() — enumerate Laue-unique allowed reflections within a d-spacing or 2θ cutoff, sorted by d-descending, with multiplicities.
  • CLI: midas-hkls gen|info|list (drop-in for GetHKLList).

Quick start

from midas_hkls import SpaceGroup, Lattice, generate_hkls

sg  = SpaceGroup.from_number(225)              # CeO₂ / Cu / Au / NaCl  (Fm-3m)
lat = Lattice.for_system("cubic", a=5.411)     # Å
refs = generate_hkls(sg, lat, wavelength_A=0.173, two_theta_max_deg=15.0)

for r in refs:
    print(r.ring_nr, (r.h, r.k, r.l), r.d_spacing, r.two_theta_deg, r.multiplicity)

CLI

midas-hkls gen --sg 225 --lat 5.411 5.411 5.411 90 90 90 --wavelength 0.173 \
               --two-theta-max 15.0 -o ceo2.csv
midas-hkls info --sg "Fm-3m" --ops
midas-hkls list

Parity with sginfo C library

midas-hkls is parity-tested byte-for-byte against MIDAS's GetHKLList (sginfo):

  • Ring count, ring d-spacing, ring 2θ, ring multiplicity match exactly across CeO₂, LaB₆, Si, α-Fe, α-Ti, calcite, Pnma, P21/c.
  • All 230 space groups parse without error and have correct Friedel-corrected Laue-class group orders.

Run pytest to exercise the parity matrix.

Conventions

  • Lattice constants in Å; angles in degrees.
  • Wavelengths in Å.
  • Symmetry operations stored as integer Seitz matrices over translation base STBF=12 (so 1/2 → 6, 1/3 → 4, 1/4 → 3, etc.) — exact-arithmetic absence detection, no float fuzz.
  • Equivalent HKLs include Friedel pairs (centric structure factor under X-ray Laue symmetry).

Roadmap (post v0.1.0)

  • CIF reader (io/cif.py).
  • Atomic form factors (Cromer-Mann) and structure factors.
  • Anomalous scattering (Henke / Cromer tables).
  • Wyckoff positions tables (currently only general position is exposed).
  • Origin-choice and alternate-setting transformations beyond what sginfo's extension field provides.

Origin

The 530-entry Hall-symbol table is extracted verbatim from sginfo (© 1994-96 Ralf W. Grosse-Kunstleve, public domain) so that midas-hkls and MIDAS's existing C tools resolve the same standard setting for every space group.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

midas_hkls-0.1.0.tar.gz (26.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

midas_hkls-0.1.0-py3-none-any.whl (24.5 kB view details)

Uploaded Python 3

File details

Details for the file midas_hkls-0.1.0.tar.gz.

File metadata

  • Download URL: midas_hkls-0.1.0.tar.gz
  • Upload date:
  • Size: 26.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for midas_hkls-0.1.0.tar.gz
Algorithm Hash digest
SHA256 5b3145c481896a2729aee8cabc7f3345ad30ac474088368103484359a1c14775
MD5 bd5262ba87367272d293b3c7824fae3c
BLAKE2b-256 082bb8c2dec1a7e64a76749c2a01a4e5f0a41e00440ba18a8086f7313ba91ea4

See more details on using hashes here.

Provenance

The following attestation bundles were made for midas_hkls-0.1.0.tar.gz:

Publisher: python-packages.yml on marinerhemant/MIDAS

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file midas_hkls-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: midas_hkls-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 24.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for midas_hkls-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 b286c0fe3067e47a85603f25ca6e2ac8a06eaf0208a1020f7a359046db362668
MD5 ce3abb654edbdb04c2c3ab4ac43daa61
BLAKE2b-256 16d543673673434edafee043ac6300068de955e90988e1fb76a259f4894a4bc7

See more details on using hashes here.

Provenance

The following attestation bundles were made for midas_hkls-0.1.0-py3-none-any.whl:

Publisher: python-packages.yml on marinerhemant/MIDAS

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page