You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
While reviewing unitaryfund/ucc-demo#1, @jordandsullivannoticed that a simple Bell state circuit was transforming the circuit even though it was already in the target gate basis:
Debugging a bit, this appears to be due to forcing consolidation of blocks, after which unitary synthesis expands to the different gateset:
@jordandsullivan and @Misty-W , removing the force_consolidate gives the expected result, but I'm wondering what the original reason was behind setting that to True in the first place. Do either of you know? I'll make a branch with that change and run the benchmarks to see the impact.
On the flip side, there's an interesting question of why the compiler didn't re-optimize back to the simpler circuit after that pass, versus the more complex one it ended up with.
But stepping back, for the next milestone, it might be worth revisiting these choice of default passes, and ensuring we capture somewhere the reasons, or at least types of circuits, where they perform well.
So qft gate count is definitely worse without the consolidation. I added qiskit-default as a baseline, as it shows that ucc without the consolidation is the same gate count reduction for qft as qiskit (ignoring compilation time for now).
bachase
changed the title
Unexpected behavior with default transpilation set
Unexpected behavior with default compilation set
Mar 12, 2025
Describe the bug
While reviewing unitaryfund/ucc-demo#1, @jordandsullivan noticed that a simple Bell state circuit was transforming the circuit even though it was already in the target gate basis:
Debugging a bit, this appears to be due to forcing consolidation of blocks, after which unitary synthesis expands to the different gateset:
ucc/ucc/transpilers/ucc_defaults.py
Line 73 in d92c341
To Reproduce
Steps to reproduce the behavior:
ucc/ucc/tests/test_compile.py
Lines 19 to 22 in d92c341
To debug, I edited
UCCDefault1.run
to print the circuit after each pass:Expected behavior
We would expect the circuit to stay the same.
The text was updated successfully, but these errors were encountered: