rgpycrumbs.geom.api.alignment

Attributes

Classes

IRAMatchInputs

Encapsulates the raw arrays required for an IRA graph match.

IRAMatchResults

Encapsulates the transformation outputs from the IRA algorithm.

IRAConfig

Configuration parameters for the Iterative Rotations and Alignment.

AlignmentMethod

Tracks which algorithm was successfully applied.

AlignmentResult

Container for alignment outputs.

Functions

_apply_ira_alignment(→ bool)

Performs the low-level IRA isomorphism and affine transformation.

align_structure_robust(→ AlignmentResult)

Aligns a mobile structure to a reference using IRA with an ASE fallback.

Module Contents

rgpycrumbs.geom.api.alignment.ira_mod[source]
class rgpycrumbs.geom.api.alignment.IRAMatchInputs[source]

Encapsulates the raw arrays required for an IRA graph match.

ref_count: int[source]
ref_numbers: numpy.ndarray[source]
ref_positions: numpy.ndarray[source]
mobile_count: int[source]
mobile_numbers: numpy.ndarray[source]
mobile_positions: numpy.ndarray[source]
kmax: float[source]
class rgpycrumbs.geom.api.alignment.IRAMatchResults[source]

Encapsulates the transformation outputs from the IRA algorithm.

rotation: numpy.ndarray[source]
translation: numpy.ndarray[source]
permutation: numpy.ndarray[source]
hausdorff_dist: float[source]
class rgpycrumbs.geom.api.alignment.IRAConfig[source]

Configuration parameters for the Iterative Rotations and Alignment.

enabled: bool = False[source]
kmax: float = 1.8[source]
class rgpycrumbs.geom.api.alignment.AlignmentMethod(*args, **kwds)[source]

Bases: enum.Enum

Tracks which algorithm was successfully applied.

ASE_PROCRUSTES[source]
IRA_PERMUTATION[source]
NONE[source]
class rgpycrumbs.geom.api.alignment.AlignmentResult[source]

Container for alignment outputs.

Parameters:
  • atoms – The aligned structure (modified in-place, but returned for chaining).

  • method – The specific algorithm that was used.

atoms: ase.Atoms[source]
method: AlignmentMethod[source]
property used_ira: bool[source]

Helper to maintain backward compatibility with boolean checks.

rgpycrumbs.geom.api.alignment._apply_ira_alignment(ref_atoms: ase.Atoms, mobile_atoms: ase.Atoms, config: IRAConfig) bool[source]

Performs the low-level IRA isomorphism and affine transformation.

This function modifies mobile_atoms in-place. It returns True if the alignment succeeds, or False if an error occurs or IRA remains unavailable.

rgpycrumbs.geom.api.alignment.align_structure_robust(ref_atoms: ase.Atoms, mobile_atoms: ase.Atoms, ira_config: IRAConfig) AlignmentResult[source]

Aligns a mobile structure to a reference using IRA with an ASE fallback.

This method minimizes the RMSD between the reference and mobile structures. It first attempts to solve the isomorphism problem (finding $P, R, t$) using IRA. If IRA fails or remains unavailable, it defaults to standard Procrustes superimposition (finding $R, t$) via ASE.

Parameters:
  • ref_atoms – The fixed reference configuration.

  • mobile_atoms – The configuration to align (modified in-place).

  • ira_config – Configuration object with state of IRA and the adjacency cutoff distance for IRA graph matching.

Returns:

An AlignmentResult.