Message Boards Message Boards

"Diagram" gives extra text line above the diagram

The attached five lines code gives such a circuit diagram which contains some extra text lines above the diagram. Probably it describes the circuit but I would like to have only nice figure of the circuit. How can I get rid of this extra text line?

POSTED BY: Andras Kruppa
5 Replies

I think the problem presented in the pdf file is different from previos question. Please create a separate post for this question.

POSTED BY: Andras Kruppa

These are the automatic subcircuit labels for Multiplexers. You can either assign some better labels to them as a second argument:

mplexerz1 = 
 QuantumCircuitOperator[{"Multiplexer", "RZ"[a1], "RZ"[a2], "RZ"[a3], 
   "RZ"[a4]}, "Multiplexer"]

Or specify an option for subcircuits not to show any label:

mot["Diagram", "SubcircuitOptions" -> "ShowLabel" -> False]
POSTED BY: Nikolay Murzin

Thanks for the answer to my previous question. "SubcircuitOptions" -> "ShowLabel" -> False removes the text message above the diagram.

I attach a pdf file which shows a quantum circuit created by the command

op["Diagram","SubcircuitOptions" -> "ShowLabel" -> False]

I do not understand why a simple multiple controlled "X" gates are not displayed
The operator op is created by a longer code.

Attachments:
POSTED BY: Andras Kruppa

By default, only the first level of sub-circuits is shown; you can either flatten your operator with op["Flatten"] (or flatten just a few of them up to some given level op["Flatten", level]) or increase the level like this op["Diagram", "SubcircuitLevel" -> 2].

POSTED BY: Nikolay Murzin

Thank you. It works perfectly

POSTED BY: Andras Kruppa
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract