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
RuntimeError: Cannot obtain matrix from op: CircBox
This error seems to only occur when the Circboxes are right next to each other. Upon uncommenting the line # main_circ.CX(0, 2).X(0), the code runs without an issue and simply leaves the Circboxes untouched. This bug also disappears when DecomposeBoxes is used on the Circuit first.
The text was updated successfully, but these errors were encountered:
Hmm I find this surprising that the error only manifests when the two CircBox(es) are next to one another. As you pointed out if we put gates in between then the KAKDecomposition pass can be applied without issue.
The subcircuits here are pure quantum so the subcircuit unitary is well defined.
We can do
circbox_subcirc_0.get_unitary()
and
circbox_subcirc_1.get_unitary()
without issue.
In the default_compilation_pass for the different backends we always call DecomposeBoxes prior to doing local rewrites like KAKDecomposition or FullPeepholeOptimise. However its understandable that the beahviour exhibited above is confusing. If indeed DecomposeBoxes is needed then this should ideally be clear from the error message.
Ilan and I have found this issue during random testing:
When running:
Throws a runtime error:
This error seems to only occur when the Circboxes are right next to each other. Upon uncommenting the line
# main_circ.CX(0, 2).X(0)
, the code runs without an issue and simply leaves the Circboxes untouched. This bug also disappears whenDecomposeBoxes
is used on the Circuit first.The text was updated successfully, but these errors were encountered: