Fix logic for handling repetition_ids in CircuitOperation.replace#6984
Fix logic for handling repetition_ids in CircuitOperation.replace#6984
repetition_ids in CircuitOperation.replace#6984Conversation
Previously, passing `repetition_ids` to `replace` would enable `use_repetition_ids`, even if the value passed was `None`. This fixes things so we only enable `use_repetition_ids` if a non-None value is passed, which is the same as what is done in the `CircuitOperation` constructor.
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #6984 +/- ##
=======================================
Coverage 97.89% 97.89%
=======================================
Files 1085 1085
Lines 95034 95050 +16
=======================================
+ Hits 93032 93048 +16
Misses 2002 2002 ☔ View full report in Codecov by Sentry. |
|
Seems like the only use case of When repetition ids were the default behavior, this flag was necessary to allow it to be turned off. But now that it's not the default behavior, should the field be deprecated entirely? (Or removed without deprecation, given the behavior modification was already a breaking change). |
I would be fine with removing the |
…quantumlib#6984) * Fix logic for handling `repetition_ids` in `CircuitOperation.replace` Previously, passing `repetition_ids` to `replace` would enable `use_repetition_ids`, even if the value passed was `None`. This fixes things so we only enable `use_repetition_ids` if a non-None value is passed, which is the same as what is done in the `CircuitOperation` constructor. * fmt
…quantumlib#6984) * Fix logic for handling `repetition_ids` in `CircuitOperation.replace` Previously, passing `repetition_ids` to `replace` would enable `use_repetition_ids`, even if the value passed was `None`. This fixes things so we only enable `use_repetition_ids` if a non-None value is passed, which is the same as what is done in the `CircuitOperation` constructor. * fmt
Previously, passing
repetition_idstoreplacewould enableuse_repetition_ids, even if the value passed wasNone. This fixes things so we only enableuse_repetition_idsif a non-None value is passed, which is the same as what is done in theCircuitOperationconstructor.