mag4.io_cif

CIF reading: CrystalData construction, M–M pair extraction, distance shells.

Functions

crystal_from_cif(cif_path, element)

Build a CrystalData directly from a CIF file (no POSCAR needed).

get_distance_shells(cif_path, element, cutoff)

Lightweight version of group_inequivalent() for the magnon pipeline.

get_mm_distances(cif_path, element, cutoff)

Return sorted list of unique M–M pairs within cutoff Å.

group_inequivalent(results[, tol])

Cluster M–M pairs into distance shells (J1, J2, …).

mag4.io_cif.crystal_from_cif(cif_path, element)[source]

Build a CrystalData directly from a CIF file (no POSCAR needed).

Parameters:
  • cif_path (str) – Path to the CIF file.

  • element (str) – Magnetic element symbol (e.g. "Gd").

Raises:

ValueError – If element is not present in the structure.

Return type:

CrystalData

mag4.io_cif.get_mm_distances(cif_path, element, cutoff)[source]

Return sorted list of unique M–M pairs within cutoff Å.

Each entry is a dict with keys site_i, site_j, label_i, label_j, image, distance.

Return type:

list

Parameters:
mag4.io_cif.group_inequivalent(results, tol=0.01)[source]

Cluster M–M pairs into distance shells (J1, J2, …).

Returns a list of dicts {label, distance, dist_min, dist_max, multiplicity, pairs}.

Return type:

list

Parameters:
mag4.io_cif.get_distance_shells(cif_path, element, cutoff, tol=0.01)[source]

Lightweight version of group_inequivalent() for the magnon pipeline.

Returns [{"label": "J1", "distance": d_mean, "n_bonds": k}, …].

Return type:

List[Dict]

Parameters: