Issue
batching.py:191 — In the loop over core_groups, circuits.index(c) is called for each circuit, making overall complexity O(n²). With many circuits, this becomes slow.
Fix
Build an {id(circuit): index} dictionary before the loop, or enumerate circuits and store indices alongside.
Issue
batching.py:191— In the loop overcore_groups,circuits.index(c)is called for each circuit, making overall complexity O(n²). With many circuits, this becomes slow.Fix
Build an
{id(circuit): index}dictionary before the loop, or enumerate circuits and store indices alongside.