Skip to content

Linear adapter returns no guess for one requested atom map, and reports success anyway #1045

Description

@kfir4444

Describe the bug

Follow-up to #1042. On the branch that addresses it (linear_adapter_explicit_atom_map, PR #1044) an explicit atom_map is honored and different maps now give different geometries — but for one reaction a requested map returns no guess at all, and the adapter reports success regardless, simply returning fewer guesses than maps requested.

Measured on main @ 4d67ad4c with that branch merged, requesting one guess per distinct correspondence:

reaction distinct maps guesses returned identical pairs
CC[CH]C -> CCC[CH2] 6 6 0
CC[CH]CC -> CCCC[CH2] 6 6 0
CCC[CH2] -> CC[CH]C 4 4 0
[CH2]CC -> C[CH]C 2 2 0
[CH2]C(C)CC -> CC(C)[CH]C 2 1 0

The last row is the problem. The two maps differ only in which of the two hydrogens on one carbon migrates, so they are about as similar as two paths of one reaction can be, yet one produces nothing. The failing one is the map closest to the identity:

map A = [2, 1, 0, 3, 4, 9, 11, 8, ...]   guess produced
map B = [0, 1, 2, 3, 4, 5,  6, 8, ...]   no guess

interpolate_isomerization raises for every weight on that path. The exception is caught, so nothing surfaces to the caller:

File "arc/job/adapters/ts/linear.py", line 1059, in execute_incore
    xyzs = interpolate(rxn=rxn, weight=w, existing_xyzs=all_xyzs_so_far,
                       map_cache=map_cache, forced_atom_map=forced_atom_map)
File "arc/job/adapters/ts/linear.py", line 1813, in interpolate
    return interpolate_isomerization(...)

How to reproduce

Request a guess per distinct atom map for [CH2]C(C)CC -> CC(C)[CH]C (intra_H_migration), enumerating the maps first and passing each one to the adapter as atom_map. One of the two comes back empty.

Expected behavior

  1. When a map is supplied explicitly and no guess survives for it, report that distinctly. An explicitly requested map returning nothing is a different situation from a derived map that happened not to work, and a caller iterating over maps cannot currently tell them apart without counting the results.
  2. Worth checking whether near-identity maps are the trigger. The same map failed before that branch existed, when I forced it by monkeypatching map_rxn, so it looks like a property of the interpolation rather than of the new argument.

This is not a regression — the branch is a clear improvement on the previous behavior, where every requested map returned the same geometry. Filing it separately so it is not lost when that PR merges.

Installation information

  • ARC main @ 4d67ad4c with linear_adapter_explicit_atom_map merged
  • Python 3.14, Linux

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions