Skip to content

PERF: _measurement_based_batch uses O(n^2) circuits.index(c) #60

Description

@Manideep3969

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.

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

    P3-lowLow priority

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions