httk.atomistic.data

Provide lazy access to five vendored crystallographic symmetry datasets.

All five datasets ship as canonical upstream .json.gz artifacts, copied verbatim, read through DatasetLoader, and licensed CC BY 4.0 (see the adjacent LICENSE and README.md). The canonical per-concern split happened upstream.

symmetry_basics.json.gz

One record per space-group setting — 527 of them, of which 230 are flagged is_reference_setting (the International Tables standard setting for their IT number). Each record is self-contained in its own setting: its symmetry operations, its Wyckoff table, and its asymmetric-unit region are all expressed in that setting’s coordinates. So SG 15 Wyckoff letter e reads 0,y,1/4 in the reference setting 15:b1 but 1/4,0,z in 15:c1.

spacegroup_setting_transforms.json.gz

The change-of-basis operation taking each setting to its IT standard setting, keyed on Hall entry, covering all 527 settings. See setting_transform() for the direction convention, which is easy to get backwards.

baernighausen_std.json.gz

Per-IT-number Bärnighausen subgroup transformations.

continuous_euclidean_normalizer_std.json.gz

Per-IT-number continuous-normalizer bases.

affine_normalizer_cosets.json.gz

Affine-normalizer cosets for all 527 Hall entries.

Nothing here is read at import time. The first lookup parses the whole document: about 0.4 s and 12 MB resident for symmetry_basics, with the other datasets much smaller. Upstream also publishes .sqlar twins for lazy access to large datasets; they are readable by the same DatasetLoader.

Two field-choice traps worth stating once, because both fail silently:

  • Use symops and orbit, not symops_mod_centering and orbit_mod_centering. The former are the full sets with centering translations folded in, so len(orbit) == multiplicity holds; the _mod_centering variants are the factored forms and mixing the two in a set comparison misreports every centred group.

  • orbit[0] follows the record’s first_orbit, which differs from first_orbit_ita in 180 of the 3440 Wyckoff entries. Both describe the same orbit, but only the latter matches what International Tables prints.

Functions

spacegroup_settings()

Return every tabulated space-group setting, one record each.

point_groups()

Return the crystallographic point groups with their operations and character tables.

spacegroup_setting(*[, hall_entry, setting_it_nc, ...])

The setting record identified by exactly one of the given keys.

spacegroup_setting_by_symop_key(key)

Return the setting indexed by a canonical complete-operation-set key.

standard_spacegroup_setting(it_number)

The IT standard (reference) setting for a space-group number, 1 <= it_number <= 230.

spglib_default_spacegroup_setting(it_number)

The setting spglib treats as its default for a space-group number.

standard_setting_it_numbers()

Return the IT numbers that have a tabulated standard setting.

setting_transform(hall_entry)

The change-of-basis operation between a setting and its IT standard setting.

spacegroup_subgroup_record(it_number)

Return the subgroup record for an IT number.

isomorphic_subgroup_record(it_number)

Return the standard-setting same-setting isomorphic subgroup record for an IT number.

affine_normalizer_coset_record(hall_entry)

Return the affine-normalizer coset record for a Hall entry.

Package Contents

httk.atomistic.data.spacegroup_settings()[source]

Return every tabulated space-group setting, one record each.

The symmetry-basics dataset is loaded lazily on the first lookup.

Returns:

All tabulated space-group setting records.

Return type:

collections.abc.Sequence[collections.abc.Mapping[str, Any]]

httk.atomistic.data.point_groups()[source]

Return the crystallographic point groups with their operations and character tables.

The symmetry-basics dataset is loaded lazily on the first lookup.

Returns:

All tabulated point-group records.

Return type:

collections.abc.Sequence[collections.abc.Mapping[str, Any]]

httk.atomistic.data.spacegroup_setting(*, hall_entry=None, setting_it_nc=None, hm_entry=None)[source]

The setting record identified by exactly one of the given keys.

hall_entry is the normalized Hall symbol ("-c_2yc"), setting_it_nc the IT number with coordinate-system code ("15:c1"), and hm_entry the Hermann-Mauguin entry name ("C 1 2/c 1"). A Hall entry names a setting unambiguously — symbol, axes and origin — which is why it is the key the transform dataset uses.

Raises KeyError if the key is unknown, and TypeError unless exactly one key is given.

Parameters:
  • hall_entry (str | None) – The normalized Hall symbol identifying the setting.

  • setting_it_nc (str | None) – The IT number and coordinate-system code identifying the setting.

  • hm_entry (str | None) – The Hermann-Mauguin entry name identifying the setting.

Returns:

The matching space-group setting record.

Raises:
  • KeyError – If the selected key is unknown.

  • TypeError – If zero or multiple keys are supplied.

Return type:

collections.abc.Mapping[str, Any]

httk.atomistic.data.spacegroup_setting_by_symop_key(key)[source]

Return the setting indexed by a canonical complete-operation-set key.

Parameters:

key (str) – The v1 key from httk.atomistic.symmetry.symop_key.symop_key_v1().

Returns:

The matching space-group setting record.

Raises:

KeyError – If the operations key is not tabulated.

Return type:

collections.abc.Mapping[str, Any]

httk.atomistic.data.standard_spacegroup_setting(it_number)[source]

The IT standard (reference) setting for a space-group number, 1 <= it_number <= 230.

This is the setting flagged is_reference_setting and is the one setting_transform() transforms to. Note it is not always spglib’s default setting: the two differ for the 24 space groups with two origin choices (48, 50, 59, 68, 70, 85, 86, 88, 125, 126, 129, 130, 133, 134, 137, 138, 141, 142, 201, 203, 222, 224, 227, 228) and agree for the other 206. Any interoperation with spglib must go through an explicit transform rather than assuming the two coincide.

Parameters:

it_number (int) – The International Tables space-group number.

Returns:

The reference setting record for the number.

Raises:

KeyError – If no reference setting has the requested number.

Return type:

collections.abc.Mapping[str, Any]

httk.atomistic.data.spglib_default_spacegroup_setting(it_number)[source]

The setting spglib treats as its default for a space-group number.

This differs from standard_spacegroup_setting() for the 24 space groups with two origin choices and coincides with it for the other 206, which is exactly why any code that hands coordinates to or takes them from spglib must transform explicitly rather than assume the two agree — the failure mode is a structure displaced by a fraction of a cell that still passes a symmetry check.

Parameters:

it_number (int) – The International Tables space-group number.

Returns:

The setting record selected by spglib for the number.

Raises:

KeyError – If spglib has no setting for the requested number.

Return type:

collections.abc.Mapping[str, Any]

httk.atomistic.data.standard_setting_it_numbers()[source]

Return the IT numbers that have a tabulated standard setting.

Returns:

The available International Tables space-group numbers in ascending order.

Return type:

list[int]

httk.atomistic.data.setting_transform(hall_entry)[source]

The change-of-basis operation between a setting and its IT standard setting.

The returned record’s affine_transformation holds an exact rational matrix M and vector v. Direction matters and the field name is misleading: despite deriving from a table called hall_to_it_std_transform, the pair maps standard-setting coordinates into this setting, as column vectors:

x_own = M @ x_std + v

Under httk’s row-vector convention that is f_own = f_std @ M.T + v, with the reverse f_std = (f_own - v) @ inv(M).T and cell basis rows transforming as B_own = inv(M).T @ B_std. Applying it backwards yields a structurally valid but systematically wrong crystal.

M is unimodular for 520 of the 527 settings. The exceptions are the seven rhombohedral-axes settings (IT numbers 146, 148, 155, 160, 161, 166, 167), where det M == 3 because the standard hexagonal cell has three times the volume of the rhombohedral one — and correspondingly inv(M) has thirds, so nothing may assume the reverse transform is integral.

Parameters:

hall_entry (str) – The normalized Hall symbol identifying the setting.

Returns:

The setting-transform record mapping standard-setting coordinates into the named setting.

Raises:

KeyError – If no transform is tabulated for hall_entry.

Return type:

collections.abc.Mapping[str, Any]

httk.atomistic.data.spacegroup_subgroup_record(it_number)[source]

Return the subgroup record for an IT number.

Parameters:

it_number (int) – The International Tables space-group number.

Returns:

The Bärnighausen and continuous-normalizer record.

Raises:

KeyError – If no record is tabulated for the IT number.

Return type:

collections.abc.Mapping[str, Any]

httk.atomistic.data.isomorphic_subgroup_record(it_number)[source]

Return the standard-setting same-setting isomorphic subgroup record for an IT number.

The record’s isomorphic_subgroups["items"] list holds one entry per tabulated isomorphic (same IT number) subgroup transform up to index 9, each with the same index/wyckoff_splitting/affine_transformation field shapes as the Bärnighausen entries; index 1 items are identity-cell re-descriptions.

Parameters:

it_number (int) – The International Tables space-group number.

Returns:

The isomorphic subgroup record.

Raises:

KeyError – If no record is tabulated for the IT number.

Return type:

collections.abc.Mapping[str, Any]

httk.atomistic.data.affine_normalizer_coset_record(hall_entry)[source]

Return the affine-normalizer coset record for a Hall entry.

Parameters:

hall_entry (str) – The normalized Hall symbol identifying the setting.

Returns:

The affine-normalizer coset record.

Raises:

KeyError – If no record is tabulated for the Hall entry.

Return type:

collections.abc.Mapping[str, Any]