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.

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