Skip to content

add lanthanide and actinide support to xyz2mol_tmc#2

Merged
corinwagen merged 3 commits intomasterfrom
feature/ln-and-ac
Mar 10, 2026
Merged

add lanthanide and actinide support to xyz2mol_tmc#2
corinwagen merged 3 commits intomasterfrom
feature/ln-and-ac

Conversation

@corinwagen
Copy link
Copy Markdown
Member

  • Extend TRANSITION_METALS/TRANSITION_METALS_NUM to include Ce-Yb (58-70) and Ac-Lr (89-103); add missing Lu to ALLOWED_OXIDATION_STATES
  • Add oxidation states for all new f-block elements
  • Add atomic_valence_electrons for all metals in both xyz2mol_tmc.py and xyz2mol_local.py (required to avoid KeyError in charge assignment)
  • Extend ATOM_LIST in xyz2mol_local.py with Am-Lr (was missing, causing ValueError for any actinide heavier than Pu)
  • Rebuild MetalNon_Hg and fix_NO2 SMARTS programmatically from TRANSITION_METALS_NUM so future additions are automatic
  • Route Ln/An through get_tmc_mol in steamroll.py (previously fell back to geometry-only xyz2ac_obabel); empty _SKIP_XYZ2MOL
  • Add tests: lookup completeness, SMARTS validity, Ce 18-crown-6 end-to-end, [UCl6]2- actinide end-to-end, ferrocene regression

- Extend TRANSITION_METALS/TRANSITION_METALS_NUM to include Ce-Yb (58-70)
  and Ac-Lr (89-103); add missing Lu to ALLOWED_OXIDATION_STATES
- Add oxidation states for all new f-block elements
- Add atomic_valence_electrons for all metals in both xyz2mol_tmc.py and
  xyz2mol_local.py (required to avoid KeyError in charge assignment)
- Extend __ATOM_LIST__ in xyz2mol_local.py with Am-Lr (was missing, causing
  ValueError for any actinide heavier than Pu)
- Rebuild MetalNon_Hg and fix_NO2 SMARTS programmatically from
  TRANSITION_METALS_NUM so future additions are automatic
- Route Ln/An through get_tmc_mol in steamroll.py (previously fell back to
  geometry-only xyz2ac_obabel); empty _SKIP_XYZ2MOL
- Add tests: lookup completeness, SMARTS validity, Ce 18-crown-6 end-to-end,
  [UCl6]2- actinide end-to-end, ferrocene regression

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Copy link
Copy Markdown
Contributor

@jevandezande jevandezande left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, with soft request to clean up prior code.


# Lanthanides — 4f electrons treated as core-like; dominant +3 chemistry.
# Note: only used in get_proposed_ligand_charge() which runs on metal-free fragments.
atomic_valence_electrons[58] = 3 # Ce
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we rewrite this section so that the whole dictionary gets built at once?

Comment thread steamroll/xyz2mol_tmc/xyz2mol_local.py Outdated
atomic_valence_electrons[53] = 7

# d-block TMs — match values in xyz2mol_tmc.py
atomic_valence_electrons[21] = 3 # Sc
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we rewrite this section so that the whole dictionary gets built at once?

@corinwagen corinwagen changed the title [draft] add lanthanide and actinide support to xyz2mol_tmc add lanthanide and actinide support to xyz2mol_tmc Mar 9, 2026
Copy link
Copy Markdown
Contributor

@jevandezande jevandezande left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Comment on lines +147 to +150
**{z: [20] for z in range(21, 31)}, # Sc–Zn
**{z: [20] for z in range(39, 49)}, # Y–Cd
**{z: [20] for z in range(57, 81)}, # La–Hg
**{z: [20] for z in range(89, 104)}, # Ac–Lr
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice!

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah, it's much clearer this way

@corinwagen corinwagen merged commit 57adba6 into rowansci:master Mar 10, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants