TransWikia.com

How to add a brace in the output side of my quantum circuit?

TeX - LaTeX Asked by walid on January 7, 2021

I want to add a brace in the output side of my quantum circuit, I saw this answer which gives a solution to add a brace in the input side, I tried to reproduce the same for the output where I used ouputgroupv{1}{4}{1.3em}{2.4em}{ket{psi}} instead of inputgroupv{1}{4}{1.3em}{2.4em}{ket{psi}}, but it doesn’t work.

How can I add this brace using Qcircuit?

One Answer

What you are looking for is the gategroup command-- since no code has been provided I take the same example as linked in your question and the brace is put on the output side--the gategroup{row1}{column6}{row4}{column6}{0.8em}{}} are the options for the command

enter image description here

documentclass{article}
usepackage[braket]{qcircuit}
begin{document}
[
  Qcircuit @C=1em @R=.7em {
    &&& lstick{ket{q_n}}     & multigate{3}{U} & qw \
    &&& lstick{ket{q_{n-1}}} & ghost{U}        & qw \
    &&& lstick{ket{q_1}}     & ghost{U}        & qw \
    &&& lstick{ket{q_0}}     & ghost{U}        & qw gategroup{1}{6}{4}{6}{.8em}{}}
    inputgroupv{1}{4}{1.3em}{2.4em}{ket{psi}} \
  }
]
end{document}

edit-- with new code from OP

enter image description here

documentclass{article}
usepackage[braket]{qcircuit}
begin{document}
[
Qcircuit @C=1em @R=.7em {
     lstick{ket{i}} & gate{H} & ctrl{1} & qw \ 
     lstick{ket{j}} & qw&targ & qwgategroup{1}{4}{2}{4}{.8em}{}}
    }
 ]
end{document}

Correct answer by js bibra on January 7, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP