ConsolidateBlocks
can collect valid blocks that cannot be resynthesised in optimization_level=3
#11975
Labels
ConsolidateBlocks
can collect valid blocks that cannot be resynthesised in optimization_level=3
#11975
Environment
What is happening?
At
optimization_level=3
, we run a pass to take long 2q runs, and resynthesise them if the run contains more 2q gates than we estimate a full resynthesis will need. This makes a tacit assumption that we will certainly be able to resynthesise any block we collect back to the supported basis set for the particular qubits. If that assumption is violated,ConsolidateBlocks
can collect blocks of already valid instructions into a matrix, but then the followingUnitarySynthesis
run will fail to decompose it, resulting in a pipeline that took a valid circuit and made it invalid.How can we reproduce the issue?
What should happen?
This is how #11974 manifested itself to me, but fixing #11974 to have
UnitarySynthesis
raise an error would then cause my code block to throw an error. Alone, though, this isn't reallyUnitarySynthesis
's fault - it would have no way of reverting the circuit to its prior state if the synthesis fails.The result should be that
optimization_level=3
should not cause basis-gate failures in its optimisation loop. There's maybe a couple of ways to go about this:ConsolidateBlocks
communicate withUnitarySynthesis
somehow to know if it has complete decomposers for the relevant qubits. If not, don't collect those blocks into unitaries.ConsolidateBlocks
store the collected run somewhere, so if resynthesis fails, we can revert to the previous form.It's potentially also worth considering if the whole "2q resynthesis" logic might be better as an encapsulated single pass, or something like this, if the alternative is making inter-pass communication ever more complex. That of course risks code duplication.
Any suggestions?
No response
The text was updated successfully, but these errors were encountered: