File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -574,7 +574,10 @@ def _perceive_irc_fragments(xyz: dict,
574574 n_atoms = len (symbols )
575575
576576 dmat = xyz_to_dmat (xyz )
577- bonds = get_bonds_from_dmat (dmat = dmat , elements = symbols )
577+ # Use n_fragments=0 to disable the heavy-atom bridging heuristic in
578+ # get_bonds_from_dmat, which would collapse genuinely multi-fragment
579+ # IRC endpoints (e.g., loose complexes) into a single component.
580+ bonds = get_bonds_from_dmat (dmat = dmat , elements = symbols , n_fragments = 0 )
578581
579582 # Find connected components via DFS
580583 adj = {i : set () for i in range (n_atoms )}
@@ -614,7 +617,10 @@ def _perceive_irc_fragments(xyz: dict,
614617
615618 # For multi-fragment systems, search over charge splits that sum to the total charge.
616619 # Prefer splits that minimize the total absolute charge (e.g., 0,0 over +1,-1).
617- # Derive per-fragment charge bounds from total charge to handle |charge| > 2.
620+ # Cap at 4 fragments to keep the combinatorial search bounded;
621+ # more fragments likely indicates over-fragmentation from bond perception.
622+ if n_frags > 4 :
623+ return None
618624 max_abs_charge = max (2 , abs (charge ) + 1 )
619625 charge_range = range (- max_abs_charge , max_abs_charge + 1 )
620626 best_mols = None
You can’t perform that action at this time.
0 commit comments