Skip to content

perf(#52): cache average gate error rates in CostModel - #104

Merged
Manideep3969 merged 1 commit into
mainfrom
fix/issue-52-cache-gate-averages
Aug 20, 2026
Merged

perf(#52): cache average gate error rates in CostModel#104
Manideep3969 merged 1 commit into
mainfrom
fix/issue-52-cache-gate-averages

Conversation

@Manideep3969

Copy link
Copy Markdown
Owner

Caches and results on first call instead of recomputing from device dictionaries on every gate. All 351 tests pass.

_avg_single_qubit_error and _avg_two_qubit_error recomputed averages
from device dictionaries on every call. For a circuit with N gates,
this meant N redundant list/dict iterations.

Fix: Cache the computed averages on first call, returning the cached
value on subsequent calls.
@Manideep3969
Manideep3969 merged commit 9708302 into main Aug 20, 2026
4 checks passed
@Manideep3969
Manideep3969 deleted the fix/issue-52-cache-gate-averages branch August 20, 2026 07:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant