0

I would like to know how to add the ground symbol enter image description here to my qcircuit instead of trash in the following.enter image description here when I search it shows me how to do it in tikz circuits.

3
  • 1
    qcircuit is meant for drawing quantum gates. What is the meaning of a ground symbol in this context? What does it look like? Check out the documentation of qcircuit on CTAN.
    – gernot
    Jan 20, 2021 at 19:57
  • 1
    Maybe it helps if you show an example drawing of a quantum circuit with ground symbol, to illustrate where it is supposed to connect to.
    – gernot
    Jan 20, 2021 at 21:24
  • @gernot I have edited my question
    – Nehad
    Jan 20, 2021 at 23:59

1 Answer 1

1

Qcircuit does not provide a ground symbol because this is not a standard component for quantum circuit diagrams. If you have a ground symbol you can just drop it into the appropriate entry of your quantum circuit.

If you don't have a ground symbol you can make one and drop it in as shown below:

\documentclass{standalone}
\usepackage[braket]{qcircuit}
\usepackage{pgf}
\newcommand{\ground}{
\begin{pgfpicture}{0cm}{0cm}{.5cm}{-.35cm}
\pgfline{\pgfxy(.25,.05)}{\pgfxy(.25,-.25)}
\pgfline{\pgfxy(.05,-.25)}{\pgfxy(.45,-.25)}
\pgfline{\pgfxy(.1,-.3)}{\pgfxy(.4,-.3)}
\pgfline{\pgfxy(.15,-.35)}{\pgfxy(.35,-.35)}
\end{pgfpicture}
}
\begin{document}
\hspace{1.5em}
\begin{tabular}{c}
\vspace{-.6em}\\
     \Qcircuit @C=0.5cm @R=.5cm {
         \lstick{\ket{0}} & \gate{U} & \ground \qw \\
     }
\vspace{1.em}\hspace{1em}
\\
\end{tabular}
\end{document}

The resulting output is as follows:

QcircuitGround

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .