0

I've been implementing various transpilation algorithms such as SABRE and I've come across a strange thing (that's potentially an issue) when drawing the circuits as mpl in a Jupyter notebook.

When I draw the original circuit, it looks normal: enter image description here

When I draw the transpiled circuit however, the icons are not present (resulting in the drawing being much bigger, hence two measures being cropped out): enter image description here

The same thing happens with significantly simpler transpilers (e.g. ones that simply copy the dag without making any modifications), and from simulations I believe the issue doesn't have to do with any parameters.

Is there something special required to make the circuits look normal when drawing them out?

1 Answers1

0

Figured it out in the end.

Turns out the Instruction constructor is lacking fields that are required for diagrams. When adding nodes to a DAGCircuit, the options are either to call the constructor for the gate (e.g. SwapGate()), or to just copy an existing node's operation object.