merge_single_qubit_gates_to_phxz shouldn't return ops.I - #8319
NoureldinYosri wants to merge 1 commit into
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #8319 +/- ##
==========================================
- Coverage 99.59% 99.59% -0.01%
==========================================
Files 1125 1125
Lines 103250 103250
==========================================
- Hits 102829 102828 -1
- Misses 421 422 +1 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
arettig
left a comment
There was a problem hiding this comment.
Adding nonfunctional phxz gates could lead to slightly less optimized circuits when running this transformer (of course returning ops.I is also not ideal).
For your use case, do you need a gate at all? The best solution is probably to just return [] if gate and merge_tags_fn are both None. (I think this would handle the parameter sweep use case that caused the ops.I to be added in the first place)
|
returning |
|
maybe an extra param is the answer? |
Yeah, that seems like the best option since we want both behaviors. |
Is the concern that such circuit would have a different length? If so, would it help to produce an empty |
I think this would still not work. Even if the number of moments is the same, if we drop parameterized operations, then we could end up with incorrect symbolized circuits output from the I was thinking we could use the existing This would return a |
return
PhasedXZGate(0, 0, 0)instead ofIsince callers expect the returned gates to be of type PhasedXZGate