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 forGetHKLList).
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
extensionfield 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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5b3145c481896a2729aee8cabc7f3345ad30ac474088368103484359a1c14775
|
|
| MD5 |
bd5262ba87367272d293b3c7824fae3c
|
|
| BLAKE2b-256 |
082bb8c2dec1a7e64a76749c2a01a4e5f0a41e00440ba18a8086f7313ba91ea4
|
Provenance
The following attestation bundles were made for midas_hkls-0.1.0.tar.gz:
Publisher:
python-packages.yml on marinerhemant/MIDAS
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
midas_hkls-0.1.0.tar.gz -
Subject digest:
5b3145c481896a2729aee8cabc7f3345ad30ac474088368103484359a1c14775 - Sigstore transparency entry: 1397477588
- Sigstore integration time:
-
Permalink:
marinerhemant/MIDAS@c6828f52154681a30609088c27370d7ddddc19e3 -
Branch / Tag:
refs/tags/midas-hkls-v0.1.0 - Owner: https://github.com/marinerhemant
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-packages.yml@c6828f52154681a30609088c27370d7ddddc19e3 -
Trigger Event:
release
-
Statement type:
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b286c0fe3067e47a85603f25ca6e2ac8a06eaf0208a1020f7a359046db362668
|
|
| MD5 |
ce3abb654edbdb04c2c3ab4ac43daa61
|
|
| BLAKE2b-256 |
16d543673673434edafee043ac6300068de955e90988e1fb76a259f4894a4bc7
|
Provenance
The following attestation bundles were made for midas_hkls-0.1.0-py3-none-any.whl:
Publisher:
python-packages.yml on marinerhemant/MIDAS
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
midas_hkls-0.1.0-py3-none-any.whl -
Subject digest:
b286c0fe3067e47a85603f25ca6e2ac8a06eaf0208a1020f7a359046db362668 - Sigstore transparency entry: 1397477600
- Sigstore integration time:
-
Permalink:
marinerhemant/MIDAS@c6828f52154681a30609088c27370d7ddddc19e3 -
Branch / Tag:
refs/tags/midas-hkls-v0.1.0 - Owner: https://github.com/marinerhemant
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-packages.yml@c6828f52154681a30609088c27370d7ddddc19e3 -
Trigger Event:
release
-
Statement type: