1

I'd like to color some qubit lines in quantum circuit diagrams drawn using QCircuit as exemplified in the following image:

enter image description here

Can this be done with Qcircuit? As a follow-up, is it possible to do some other modifications like making lines dashed, bold, etc?

The code producing the uncolored image is:

\Qcircuit @C=1em @R=1em {
   \lstick{|\psi\rangle} & \qw & \gate{R_x(\theta)} & \ctrl{1} & \meter \\
   \lstick{|0\rangle} & \qw {/} & \qw & \gate{U} & \qw & \rstick{|\phi\rangle}
}
  • 2
    Welcome! You have way better chances of getting a good and timely answer if you post the code that generated the above screen shot. – user121799 Jun 16 at 21:28
  • @marmot Thanks, I just added it. This specific circuit is not important though, my question concerns a general method to color the lines in any circuit. If there is one. – PDRX Jun 16 at 21:36
1

Reading different comments on web I have finded a specific similar question in this link https://github.com/CQuIC/qcircuit/wiki/FAQ.

At the end of the clarifications there is a specific question with an answer:

How do I color parts of my circuit? [...] LaTeX views the wires and gate outlines as a single object, so you cannot color them separately. The entire circuit or any text argument can be colored in the normal manner.

Looking also this link that it is related with Qcircuit https://www.researchgate.net/publication/327592129_Tutorial_on_the_Quantikz_Package, you can see that all the wires are colored only with the black color.

This suggests that you can't color the wires with the colors of your choice. It will be interesting, lastly, to understand the source (with the full LaTeX MWE) of your first image where a thread is colored red.

  • Thanks for looking into it. I also couldn't find a solution. Maybe this could be added as a feature request on qcircuit's github. I'll keep this open a little longer to see if someone comes up with a solution. Anyway, I colored the first image by myself to explain what I wanted. – PDRX Jun 20 at 18:09
  • @PDRX I have also done other searches but the results are null. Unfortunately I have not found anything because all the results converge towards my answer. Your initiative on github could be a solution. I am always available. My greetings. – Sebastiano Jun 20 at 19:26

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.