Q회로,양자회로,게임

Q회로,양자회로,게임

LaTeX에서 이 두 그림을 어떻게 만들 수 있습니까? 알아내기는 어렵지만 화면의 "그림 및 표" 제목 바로 아래에 있는 lhs에 있습니다.여기. Qcircuit LaTeX 코드를 알려주실 수 있나요?

사진은 다음과 같습니다:

여기에 이미지 설명을 입력하세요

그리고

여기에 이미지 설명을 입력하세요

MWE는 다음과 같습니다.

\documentclass{article} 
\input{Qcircuit} 
\begin{document} 
\Qcircuit @C=1em @R=1em { \lstick{\ket{x}} & \qw \ar@{.}[]+<3.5em,1em>; [d]+<3.5em,-1em> 
& \ctrl{1} &
 \qw & \rstick{\ket{x}} \qw \\ 
\lstick{\ket{y}} & \gate{H} & 
\gate{\pi} & \gate{H} & \rstick{\ket{y \oplus x}} \qw } 
\end{document}

답변1

Jan이 저에게 직접 연락해 제가 이 질문에 답변해 드렸지만 누군가 비슷한 내용이 필요할 경우를 대비해 여기에 답변을 게시하겠습니다.

이 두 회로에 대한 LaTeX 소스와 결과 PDF는 다음과 같습니다.

수평으로 쌓인 게이트 중첩:

\documentclass{standalone}

\usepackage{rotating}

\input{Qcircuit}

\newcommand{\puremultigate}[2]{*+<1em,.9em>{\hphantom{#2}} \POS [0,0]="i",[0,0].[#1,0]="e",!C *{#2},"e"+UR;"e"+UL **\dir{-};"e"+DL **\dir{-};"e"+DR **\dir{-};"e"+UR **\dir{-},"i"}

\begin{document}

\begin{tabular}{c}
\vspace{-.6em}\\
\Qcircuit @R=.2em @C=.5em @!R {
& & & & & & & & & & & & & \puremultigate{5}{\rotatebox{-90}{\small Measurement}} \\
& & \qw & \qw & \multigate{3}{U} & \qw & \qw & \multigate{3}{\fbox{$U_1$\rule[-1em]{0em}{2.7em}}\ \,\fbox{$U_2$\rule[-1em]{0em}{2.7em}}} & \qw & \qw & \multigate{3}{U^\dagger} & \qw & \qw & \ghost{\rotatebox{-90}{\small Measurement}} & \qw & \qw \\
& \lstick{\raisebox{-1.5em}{$\rho$}} & \qw & \qw & \ghost{U} & \qw & \qw & \ghost{\fbox{$U_1$\rule[-1em]{0em}{2.7em}}\ \,\fbox{$U_2$\rule[-1em]{0em}{2.7em}}} & \qw & \qw & \ghost{U^\dagger} & \qw & \qw & \ghost{\rotatebox{-90}{\small Measurement}} & \qw & \qw \\
& & & \raisebox{.3em}{\vdots} & \pureghost{U} & \push{\rule{3em}{0em}} & & \pureghost{\fbox{$U_1$\rule[-1em]{0em}{2.7em}}\ \,\fbox{$U_2$\rule[-1em]{0em}{2.7em}}} & \push{\rule{.5em}{0em}} & & \pureghost{U^\dagger} & \push{\rule{1.5em}{0em}} & & \pureghost{\rotatebox{-90}{\small Measurement}} & & \\
& & \qw & \qw & \ghost{U} & \qw & \qw & \ghost{\fbox{$U_1$\rule[-1em]{0em}{2.7em}}\ \,\fbox{$U_2$\rule[-1em]{0em}{2.7em}}} & \qw & \qw & \ghost{U^\dagger} & \qw & \qw & \ghost{\rotatebox{-90}{\small Measurement}} & \qw & \qw \\
\push{\rule{.6em}{0em}} & & & & & & & & & & & & & &
}
\vspace{1.2em}\\
\end{tabular}

\end{document}

수평으로 중첩된 양자 게이트

수직으로 쌓인 게이트 중첩:

\documentclass{standalone}

\usepackage{rotating}

\input{Qcircuit}

\newcommand{\puremultigate}[2]{*+<1em,.9em>{\hphantom{#2}} \POS [0,0]="i",[0,0].[#1,0]="e",!C *{#2},"e"+UR;"e"+UL **\dir{-};"e"+DL **\dir{-};"e"+DR **\dir{-};"e"+UR **\dir{-},"i"}

\begin{document}

\begin{tabular}{c}
\vspace{-.6em}\\
\Qcircuit @R=.2em @C=.5em @!R {
& & & & & & & & & & & & & \puremultigate{5}{\rotatebox{-90}{\small Measurement}} \\
& & \qw & \qw & \multigate{3}{U} & \qw & \qw & \multigate{3}{\parbox{2em}{\fbox{$U_1$}\vspace{.2em}\\\fbox{$U_2$}}} & \qw & \qw & \multigate{3}{U^\dagger} & \qw & \qw & \ghost{\rotatebox{-90}{\small Measurement}} & \qw & \qw \\
& \lstick{\raisebox{-1.5em}{$\rho$}} & \qw & \qw & \ghost{U} & \qw & \qw & \ghost{\parbox{2em}{\fbox{$U_1$}\vspace{.2em}\\\fbox{$U_2$}}} & \qw & \qw & \ghost{U^\dagger} & \qw & \qw & \ghost{\rotatebox{-90}{\small Measurement}} & \qw & \qw \\
& & & \raisebox{.3em}{\vdots} & \pureghost{U} & \push{\rule{3em}{0em}} & & \pureghost{\parbox{2em}{\fbox{$U_1$}\vspace{.2em}\\\fbox{$U_2$}}} & \push{\rule{.5em}{0em}} & & \pureghost{U^\dagger} & \push{\rule{1.5em}{0em}} & & \pureghost{\rotatebox{-90}{\small Measurement}} & & \\
& & \qw & \qw & \ghost{U} & \qw & \qw & \ghost{\parbox{2em}{\fbox{$U_1$}\vspace{.2em}\\\fbox{$U_2$}}} & \qw & \qw & \ghost{U^\dagger} & \qw & \qw & \ghost{\rotatebox{-90}{\small Measurement}} & \qw & \qw \\
\push{\rule{.6em}{0em}} & & & & & & & & & & & & & &
}
\vspace{1.2em}\\
\end{tabular}

\end{document}

수직으로 중첩된 양자 게이트

Qcircuit에는 중첩된 게이트에 대한 특별한 기능이 없지만 중첩된 게이트 효과를 얻으려면 내부 게이트를 나타내는 상자를 표준 \multigate 명령에 삽입하기만 하면 됩니다.

측정 게이트가 올바르게 보이도록 하기 위해 리드 와이어를 강제로 사용하지 않는 새로운 \multigate 명령인 \puremultigate를 정의해야 했습니다. 이를 위해 Qcircuit.tex에서 \multigate의 표준 정의를 가져와서 최종 \qw 명령을 삭제했습니다.

관련 정보