Skip to content

fix(#41): Cost model uses per-qubit error rates when layout is provided - #92

Merged
Manideep3969 merged 1 commit into
mainfrom
fix/issue-41-cost-model-layout
Aug 18, 2026
Merged

fix(#41): Cost model uses per-qubit error rates when layout is provided#92
Manideep3969 merged 1 commit into
mainfrom
fix/issue-41-cost-model-layout

Conversation

@Manideep3969

Copy link
Copy Markdown
Owner

Bug Fix

The _get_gate_fidelity method accepted a layout parameter but never used it, always returning average error rates regardless of which physical qubit a gate was mapped to. Per-qubit calibration data from the backend was effectively ignored.

Fix:

  • Add _get_gate_fidelity_for_qubit and _get_gate_fidelity_for_pair methods that look up specific error rates from device calibration data
  • Update estimate_gate_error to iterate over circuit instructions (not just count_ops) when layout-aware or per-qubit data is available
  • Falls back to average error rates when per-qubit data is unavailable

All 313 tests pass.

…ovided

The _get_gate_fidelity method accepted a layout parameter but never
used it, always returning average error rates regardless of which
physical qubit a gate was mapped to. This meant per-qubit calibration
data from the backend was effectively ignored for fidelity estimation.

Fix: Add _get_gate_fidelity_for_qubit and
_get_gate_fidelity_for_pair methods that look up specific error
rates from device calibration data when available. Update
estimate_gate_error to iterate over circuit instructions (not just
count_ops) when layout-aware or per-qubit data is available, using
the correct per-qubit/per-link rates.

All 313 tests pass.
@Manideep3969
Manideep3969 merged commit 5f23835 into main Aug 18, 2026
4 checks passed
@Manideep3969
Manideep3969 deleted the fix/issue-41-cost-model-layout branch August 18, 2026 07:34
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