mag4.analysis.bond_angles

Bridging-ligand bond-angle analysis (M – L – M).

Functions

compress_angles(ang_vals[, tol])

Group similar angles: [159.07, 159.07, 159.07]'159.07° (x3)'.

find_bridging_angles(structure, site_i, ...)

Find every ligand L bridging site_i and site_j (at jimage).

find_dihedral_paths(structure, site_i, ...)

Find every M1–L1–L2–M2 super-super-exchange path between site_i (home) and site_j (at jimage).

get_mm_pairs(structure, element, cutoff)

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

group_into_shells(results[, tol])

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

print_angles_for_shell(group, structure, ...)

Bond-angle table for one J shell.

print_header(structure, element, ...)

Print a header summarising the structure and the search parameters.

print_shell_summary(groups, element)

Brief summary of the J shells.

write_report(lines_out, output_file)

Write accumulated report lines to output_file.

mag4.analysis.bond_angles.get_mm_pairs(structure, element, cutoff)[source]

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

Mirrors mag4.io_cif.get_mm_distances() but returns lighter dicts (no label_* fields) suited to the bond-angle workflow.

Parameters:
mag4.analysis.bond_angles.group_into_shells(results, tol=0.01)[source]

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

Parameters:

tol (float)

mag4.analysis.bond_angles.find_bridging_angles(structure, site_i, site_j, jimage, ligand_elements, bond_cutoff)[source]

Find every ligand L bridging site_i and site_j (at jimage).

A ligand L bridges the pair when dist(site_i, L) < bond_cutoff AND dist(site_j + jimage, L) < bond_cutoff.

Returns a list of dicts sorted by angle.

mag4.analysis.bond_angles.find_dihedral_paths(structure, site_i, site_j, jimage, ligand_elements, bond_cutoff, ll_cutoff)[source]

Find every M1–L1–L2–M2 super-super-exchange path between site_i (home) and site_j (at jimage).

A path exists when:

  • L1 is bonded to M1 (distance ≤ bond_cutoff);

  • L2 is bonded to M2 + jimage (distance ≤ bond_cutoff);

  • L1 and L2 are bonded to each other (distance ≤ ll_cutoff);

  • L1 and L2 are distinct ligand atoms (otherwise the path is a direct M–L–M bridge already covered by find_bridging_angles()).

The returned dihedral is the signed torsion angle of the four-atom path in degrees, in [-180°, +180°] following the IUPAC convention.

Returns a list of dicts, deduplicated on (L1 identity, L2 identity) and sorted by signed dihedral.

mag4.analysis.bond_angles.compress_angles(ang_vals, tol=0.01)[source]

Group similar angles: [159.07, 159.07, 159.07]'159.07° (x3)'.

Return type:

str

Parameters:
mag4.analysis.bond_angles.print_header(structure, element, ligand_elements, cutoff, bond_cutoff)[source]

Print a header summarising the structure and the search parameters.

mag4.analysis.bond_angles.print_shell_summary(groups, element)[source]

Brief summary of the J shells.

mag4.analysis.bond_angles.print_angles_for_shell(group, structure, element, ligand_elements, bond_cutoff, lines_out)[source]

Bond-angle table for one J shell. Appends each printed line to lines_out.

mag4.analysis.bond_angles.write_report(lines_out, output_file)[source]

Write accumulated report lines to output_file.