problema de preparar um ciclo usando tikz em látex

problema de preparar um ciclo usando tikz em látex

O programa que utilizo atualmente visa gerar uma representação cíclica semelhante à imagem fornecida. Porém, ao executar o código, encontro vários erros e a saída não corresponde à imagem esperada. Qualquer assistência na resolução desses problemas seria muito apreciada. Imagem que eu quero que fique =insira a descrição da imagem aqui

"código"

 \documentclass[border=0.1cm]{revtex4-2}
%
\usepackage[dvipsnames]{xcolor}
\usepackage{tikz}
\usepackage{circuitikz}
\usepackage{qcircuit}
\usetikzlibrary{positioning, arrows.meta}
% Create style for node rectangles
\tikzstyle{state}=[
    rectangle,
    minimum width=1.5cm,
    minimum height=1cm,
    draw=white,
    thick,
    text=black,
    font=\bfseries,
    align=center,
    fill=Orange!70,
    rounded corners=5pt % Adjust the radius as needed
]

\begin{document}
% \begin{tikzpicture}[>=Stealth, thick, text=black, font=\sffamily]
%%%%
\tikzset{meter/.append style={draw, inner sep=10, rectangle, font=\vphantom{A}, minimum width=30, minimum height=10 line width=.5, path picture={\draw[black] ([shift={(.1,.3)}]path picture bounding box.south west) to[bend left=50] ([shift={(-.1,.3)}]path picture bounding box.south east);\draw[black,-latex] ([shift={(0,.1)}]path picture bounding box.south) -- ([shift={(.3,-.1)}]path picture bounding box.north);}}}
%
%
% \begin{tikzpicture}[-stealth, thick, text=black]
\begin{tikzpicture}[>=Stealth, thick, text=black, font=\sffamily]
% State q0
\node[state, minimum width=2.cm, minimum height=0.5cm] (A) at (90:2) {\rm {Optimizer}};

% State q1
\node[state, fill=NavyBlue, minimum width=2.cm, minimum height=0.5cm, left=-1 cm] (B) at (18:2) {\rm R({$\Theta$},{$X$})};
\node[above] at (B.north) {{$\Theta$}};

% Box on the side of q1
\node[state, fill=NavyBlue, minimum width=1.cm, minimum height=0.5cm] (B_side) at (3.8,0.6) {$|0\rangle$};
\node[below=0.7 cm,left=-0.4 cm] at (B_side.east) {Quantum};
\node[below=0.9cm,left=-0.4 cm] at (B_side.east) {pre-processing};
\draw[-stealth] (B_side) -- (B);
% \node[below=0.3cm, align=center, font=\footnotesize] at (B_side.east) {Quantum\\pre-processing};
% Box on top of q1
\node[state, fill=Orange, minimum width=1.5cm, minimum height=0.8cm] (B_top) at (2.2,2.1) {Data: {x}};
\node[above] at (B_top.east) {};
\draw[-stealth] (B_top) -- (B);

% State q2
\node[state, fill=NavyBlue, minimum width=1.cm, minimum height=.5cm, left=-2.2 cm] (C) at (-32:2) { 
    ~\Qcircuit @C=.4em @R=.3em{
      \gate{R_y}&\gate{R_z} &\qw & 
     \gate{R_y}&\gate{R_z}
    \protect\gategroup{1}{1}{1}{2}{0.25em}{--}
    \protect\gategroup{1}{4}{1}{5}{0.25em}{--}
    }};
\node[above=0.4cm, right=-0.0 cm] at (C.north west) {Quantum circuit};
% State q3
\node[meter, state, fill=NavyBlue, minimum width=2.cm, minimum height=0.2cm] (D) at (-147:2) {M};
% \node[meter, state, fill=NavyBlue, minimum width=2.cm, minimum height=0.5cm] (meter) at (-138:2) {M};
\node[above=0.01cm] at (D.north west) {State measurement};

% State q4
\node[state, minimum width=2.cm, minimum height=0.5cm] (E) at (162:2) {$f(|\langle y | \phi \rangle |^2 )$};
\node[above=-0.5] at (E.north) {post-processing};
% Transition q0 to q1
\draw[-stealth] (A) to[bend left=30] node[above]{Parameter} (B);

% Transition q1 to q2
\draw[-stealth] (B) to[bend left=15] node[right]{$e_1$} (C);

% Transition q2 to q3
\draw[-stealth] (C) to[bend left=15] node[right]{$e_2$} (D);

% Transition q3 to q4
\draw[-stealth] (D) to[bend left=15] node[below=-0.4 cm, right=0.1 cm]{Quantum state$ |\phi\rangle$} (E);

% Transition q4 to q0
\draw[-stealth] (E) to[bend left=30] node[left]{Classical} (A);
\end{tikzpicture}
%
\end{document}

PS: Veja minha modificaçãoaqui, com algum pequeno problema restante, descrito lá.

Responder1

Em resposta ao seupergunta extra.

Análise

Minha primeira coisa a fazer foi desenhar um círculo para referência, para ver os desvios bastante grandes:

        % ~~~ a circle for reference              ~~~
       \draw (0,0) circle[radius=\rd];

Logo abandonei minha primeira ideia de substituir cada uma to[bend left]por instruções individuais to[bend in=, out=], onde cada ângulo de entrada e saída pudesse ser ajustado manualmente. Mas isso é muito trabalho a fazer.

Então tive a ideia de

  • colocando o círculo atrás de todos os outros caminhos (ou seja, desenhe como o primeiro)
  • decorando-o com flechas, ver cap.50.6.1 Marcações de ponta de setano manual do pgf

Solução, de cima para baixo

Carregue a biblioteca \usetikzlibrary{decorations.markings}.

Defina marcações de decoração. A peculiaridade aqui é que o círculo é desenhado matematicamente, ou seja, no sentido anti-horário. É por isso que as setas são decoradas como setas invertidas. Você pode ajustar seu estilo como acontece com os nós. Coloquei-os em vermelho para torná-los mais evidentes. As posições resultam de tentativa e erro, e pode ser que não seja tão ruim tê-las “no meio”, mais ou menos.

        decoration={% will put arrows along the path (here: a counter clockwise circle)
            markings,
            mark=at position 0   with {\arrowreversed[red]{Stealth}},% (0:\rd) or east, so to say
            mark=at position .15 with {\arrowreversed[red]{Stealth}},
            mark=at position .35 with {\arrowreversed[red]{Stealth}},
            mark=at position .5  with {\arrowreversed[red]{Stealth}},% west
            mark=at position .75 with {\arrowreversed[red]{Stealth}},% south
        },

Então, vamos decorar o círculo:

        % ~~~ a circle for reference, alter with decoration ~~~
%        \draw (0,0) circle[radius=\rd];
        \draw[postaction={decorate}] (0,0) circle[radius=\rd];

Vamos remover todas as conexões que não são mais necessárias:

        % Connections
%        \draw[->] (OP) to[bend left] node[arrlbl,anchor=west,pos=.8]{} (QP.70);
%        \draw[->] (QP) to[bend left] node[arrlbl,anchor=west,pos=.8]{} (QC.65);
%        \draw[->] (QC) to[bend left] node[arrlbl,anchor=west,pos=.8]{} (QM);
    %    \draw[->] (QM) to[bend left] node[arrlbl,anchor=west,pos=.8, black] {Quantum state:\\$|\phi\rangle$} (PP);
%        \draw[->] (PP) to[bend left] node[arrlbl,anchor=west,pos=.8]{} (OP);

Preserve o rótulo agora ausente. Há muitas maneiras de posicioná-lo, assim como acontece com qualquer nó.

        % ~~~ moved label ~~~~~~~~~~~~~~~~~
        \node[arrlbl,anchor=north west]  at (PP.300) {Quantum state:\\$|\phi\rangle$};

Agora, faça seus ajustes. Aliás, você pode substituir o stateestilo do circuito Quantum para torná-lo um pouco maior, por exemplo:

 \node[state,minimum height=12mm] (QC) at ( -30:\rd) {
...

resultado

%%%%%%%%%%%%%%%%%
%\documentclass{article} % ok to use
\documentclass[10pt,border=3mm,tikz]{standalone} % I find this more useful for development
\usepackage{tikz}
\usetikzlibrary{arrows.meta}
% \usetikzlibrary{quantikz}
\usepackage{qcircuit}
\usepackage[absolute,overlay]{textpos}
\usetikzlibrary{shapes}
\newcommand\rd[0]{32mm} % radius for the circle placement
\usetikzlibrary{decorations.markings}           % <<< new

\begin{document}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Define the measurement symbol style
\tikzset{
    meter/.style={
        draw,
        inner sep=10pt,
        rectangle,
        font=\vphantom{A},
        minimum width=30pt,
        minimum height=10pt,
        line width=.5pt,
        path picture={
            \draw[black] ([shift={(2pt,7pt)}]path picture bounding box.south west) to[bend left=50] ([shift={(-2pt,7pt)}]path picture bounding box.south east);
            \node[anchor=center] at (path picture bounding box.center) {$M$};
            \draw[black,-latex] ([shift={(0pt,3pt)}]path picture bounding box.south) -- ([shift={(10pt,-5pt)}]path picture bounding box.north);
        }
    }
}
%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%
\begin{tikzpicture}[
        geom/.style={
            rounded corners,
            minimum width=25mm,
            minimum height=9mm,
        },
        state/.style={fill=blue!40!teal!40,geom},
        other/.style={fill=orange!40,geom},
        txt/.style={align=center,font={\small\sffamily}},
        arrlbl/.style={blue,align=center}, % < < < replace blue by black if you prefer
        % ~~~ new ~~~~~~~~~
        decoration={% will put arrows along the path (here: a counter clockwise circle)
            markings,
            mark=at position 0   with {\arrowreversed[red]{Stealth}},% (0:\rd) or east, so to say
            mark=at position .15 with {\arrowreversed[red]{Stealth}},
            mark=at position .35 with {\arrowreversed[red]{Stealth}},
            mark=at position .5  with {\arrowreversed[red]{Stealth}},% west
            mark=at position .75 with {\arrowreversed[red]{Stealth}},% south
        },
    ]
        % ~~~ a circle for reference, later with decoration ~~~
%        \draw (0,0) circle[radius=\rd];
        \draw[postaction={decorate}] (0,0) circle[radius=\rd];
        
        % Blocks
        \node[other] (OP) at (  90:\rd) {\large Optimizer};
        \node[state] (QP) at (  20:\rd) {$R(\{\vec{\Theta}\},\{\vec{X}\})$};
        \node[state] (QC) at ( -30:\rd) {
            \resizebox{.45\linewidth}{!}{
            \hspace{-.58cm}~\Qcircuit @C=.8em @R=.5em{
                \push{\cdots} &\gate{R_y} & \gate{R_z} & \gate{R_y} & \gate{R_z}&\cdots\\
                % & & & & \\ 
                % & & & & & \\
                \protect\gategroup{1}{2}{1}{3}{0.3em}{--}
                \protect\gategroup{1}{4}{1}{5}{0.3em}{--}
            }
            }
    };
        \node[meter, state] (QM) at ( 210:\rd)  {M};
        \node[other] (PP) at ( 160:\rd) {$f(|\langle y | \phi \rangle |^2 )$ };
    % ~~~ (1) relative placement of other blocks
%   \node[state] (QX) at ([xshift=\rd]QP) {QX}; % before step (5)
    \node[rounded corners, fill=blue!40!teal!40] (QX) at ([shift=(0:2)]QP)       {$|0\rangle$};
    \node[rounded corners, fill=orange!40] (DT) at ([shift=(75:2)]QP)     {\large Data: $\{\vec{X\}}$};
        % Connections
%        \draw[->] (OP) to[bend left] node[arrlbl,anchor=west,pos=.8]{} (QP.70);
%        \draw[->] (QP) to[bend left] node[arrlbl,anchor=west,pos=.8]{} (QC.65);
%        \draw[->] (QC) to[bend left] node[arrlbl,anchor=west,pos=.8]{} (QM);
    %    \draw[->] (QM) to[bend left] node[arrlbl,anchor=west,pos=.8, black] {Quantum state:\\$|\phi\rangle$} (PP);
%        \draw[->] (PP) to[bend left] node[arrlbl,anchor=west,pos=.8]{} (OP);
        \draw[->] (DT) -- (QP.35);
        \draw[->] (QX) -- (QP);

        % ~~~ moved label ~~~~~~~~~~~~~~~~~
        \node[arrlbl,anchor=north west]  at (PP.300) {Quantum state:\\$|\phi\rangle$};

        % Extra labels
        \node[txt] at ([shift=(-100:-0.8)]QM) {\large Quantum state measurement};
        \node[txt] at ([shift=(90:0.7)]PP) {\large Classical post-processing};
        \node[txt] at ([shift=( -85:1.0)]QX) {\large Quantum\\pre-processing};
        \node[txt] at ([shift=(-100:1.7)]QP) {\large Quantum circuit};
        \node[txt] at ([shift=(30:-1.2)]QC) {Layer i};
        \node[txt] at ([shift=(150:-1.2)]QC) {Layer i+1};
        \node[txt,font = {\large}, red] at ([shift=(128:1.3)]QP) {Parameters:\\$\{\vec\Theta\}$};
        
    \end{tikzpicture}
    \end{document}

Responder2

Aqui está um ponto de partida para você. Está inacabado porque:

  • Não consigo recuperar tudo do seu código
  • ele tenta mostrar o refinamento iterativo gradual
  • então para em algo que poderia ser um novo ponto de partida para você.

resultado

Vejamos alguns detalhes:

  • Eu alinhei o processo como comentários
  • (1) coloca nós não estilizados em um círculo, onde você pode alterar seu raio em\newcommand\rd[0]{35mm}
  • (2), conexões retas, agora mostra as linhas iniciais com uma primeira bendintroduzida; não se dobre muito cedo, concentre-se primeiro nas partes mais relevantes
  • para o rótulo de conexões mostrei um estilo, âncora e para demonstração uma posição
  • os estilos preliminares (3) estão bons o suficiente por enquanto, e seriam mais refinados ao final da criação de tudo isso
  • a mudança em um só lugar são seus paradigmas; veja, por exemplo, o papel do estilogeom

DESFEITO então estão o medidor (não foi possível encontrar o código) e o que está dentro do "Circuito Quântico". São locais onde você pode ligar para tikzdentro tikz, o que é altamente desencorajado.

Como alternativa sugiro criar esses desenhos separadamente usando a standaloneclasse, como feito aqui, AND \includegraphics(ou seja, aqueles .pdfs) via package graphicx. Veja, por exemploaqui (controlador PI)para esta abordagem.

Agora você começa uma fase de mixagem, onde ambos:

  • apresentar mais conteúdo
  • deseja ou precisa ajustar posicionamentos, estilos etc.

Mas deve ser mais viável agora, espero.

% ~~~ Procedure of stepwise iterative refinement ~~~~~~~~~
% (1)   place nodes with dummy content, to check general placement
% (2)   draw straight connections; bends can be done later
% (3)   introduce preliminary styles for the blocks
% (4)   introducing extra labels for block descriptions; 
%       add+adjust styles as minimalistic as possible+needed
% (5)   start refining nodes text contents
% (6)   let's have nicer arrow tips
% (7)   first labels at connections


\documentclass[10pt,border=3mm,tikz]{standalone}
\usetikzlibrary{arrows.meta}

\newcommand\rd[0]{35mm} % radius for the circle placement

\begin{document}
 \begin{tikzpicture}[% (3)
    geom/.style={
                    rounded corners,
                    minimum width=25mm,
                    minimum height=8mm,
                },
    state/.style={fill=blue!40!teal!40,geom},
    other/.style={fill=orange!40,geom},
    txt/.style={align=center,font={\small\sffamily}},
    >={Stealth},    % (6)
    arrlbl/.style={blue,align=center},
 ]
 
    % ~~~ (1) placing your "blocks" on circle ~~~~~~~~~~ 
    %\node (OP) at (  90:\rd) {Optimizer};  % for reference: from step (1)
    \node[other] (OP) at (  90:\rd) {Optimizer};
%   \node[state] (QP) at (  20:\rd) {PreProc};
    \node[state] (QP) at (  20:\rd) {$R(\{\vec{\Theta}\},\{\vec{X}\})$};
    \node[state] (QC) at ( -30:\rd) {Quantum Circuit};
    \node[state] (QM) at ( 210:\rd) {Quantum Meas};
%   \node[other] (PP) at ( 160:\rd) {PostProc};
    \node[other] (PP) at ( 160:\rd) {$f(|\langle y | \phi \rangle |^2 )$ };
    
    % ~~~ (1) relative placement of other blocks
%   \node[state] (QX) at ([xshift=\rd]QP) {QX}; % before step (5)
    \node[state] (QX) at ([xshift=\rd]QP)       {$|0\rangle$};
    \node[other] (DT) at ([shift=(60:4)]QP)     {Data: $\{\vec{X\}}$};
    
    % ~~~ (2) draw connections ~~~~~~~~~~
    \draw[->] (OP) -- (QP);
    \draw[->] (QP) -- (QC);
    \draw[->] (QC) -- (QM);
    \draw[->] (QM) to[bend left]
                        node[arrlbl,anchor=east,pos=.3]
                            {Quantum\\state:$|\phi\rangle$}
                        (PP);
    \draw[->] (PP) -- (OP);
    

    \draw[->] (DT) -- (QP.30);  % polar: x deg at node QP's shape
    \draw[->] (QX) -- (QP);
    
    % ~~~ (4) (first) extra labels for block desciptions ~~~~
    \node[txt] at ([shift=(130:1.5)]PP) {Classical\\post-processing};
    \node[txt] at ([shift=( 60:1.0)]QX) {Quantum\\pre-processing};
    \node[txt] at ([shift=(-40:1.5)]QP) {Pre-\\processor};
    
 \end{tikzpicture}
\end{document}

Para referência, consulte minha tentativa de trabalhar com seu código e refatorá-lo para maior legibilidade. Neste ponto ficou evidente para mim que deveria ser refeito do zero com uma abordagem diferente. Você pode embelezá-lo ainda mais (o que também reduz os problemas), mas... as coisas simplesmente estavam misturadas demais para isso.

%\documentclass[border=0.1cm]{revtex4-2}
\documentclass[10pt,border=3mm,tikz]{standalone}
%
\usepackage[dvipsnames]{xcolor}
%\usepackage{tikz}
\usepackage{circuitikz}
\usepackage{qcircuit}
\usetikzlibrary{positioning, arrows.meta}

% Create style for node rectangles
\tikzstyle{state}=[
    rectangle,
    minimum width=1.5cm,
    minimum height=1cm,
    draw=white,
    thick,
    text=black,
    font=\bfseries,
    align=center,
    fill=Orange!70,
    rounded corners=5pt % Adjust the radius as needed
]

\begin{document}
% \begin{tikzpicture}[>=Stealth, thick, text=black, font=\sffamily]
%%%%
\tikzset{
    meter/.append style={draw, inner sep=10, rectangle, font=\vphantom{A}, 
    minimum width=30, minimum height=10 line width=.5, 
    path picture={\draw[black] ([shift={(.1,.3)}]path picture bounding box.south west) to[bend left=50] ([shift={(-.1,.3)}]path picture bounding box.south east);\draw[black,-latex] ([shift={(0,.1)}]path picture bounding box.south) -- ([shift={(.3,-.1)}]path picture bounding box.north);}}
}
%
%
% \begin{tikzpicture}[-stealth, thick, text=black]
\begin{tikzpicture}[
    >=Stealth, thick, 
    text=black, 
    font=\sffamily,
    w2h/.style={minimum width=2.cm, minimum height=0.5cm},
    wh/.style={minimum width=1.cm, minimum height=0.5cm},
    fNB/.style={fill=NavyBlue},
    lbl/.style={align=center,font=\small},
]
% ~~~ placing nodes ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    % State q0
    \node[state, w2h] (A)                   at (90:2) {\rm {Optimizer}};
    
    % State q1
    \node[state,fNB,w2h, left=-1 cm] (B)    at (18:2) {\rm R({$\Theta$},{$X$})};
%   \node[above]                            at (B.north) {{$\Theta$}};
    
    % Box on the side of q1
    \node[state,fNB,wh] (B_side)            at (3.8,0.6) {$|0\rangle$};

%   % \node[below=0.3cm, align=center, font=\footnotesize] at (B_side.east) {Quantum\\pre-processing};
    % Box on top of q1
    \node[state, fill=Orange, minimum width=1.5cm, minimum height=0.8cm] (B_top) at (2.2,2.1) {Data: {x}};
%   \node[above]                            at (B_top.east) {}; % ???
    
    % State q2
    \node[state,fNB,wh, left=-2.2 cm] (C)   at (-32:2) 
    { 
%       ~\Qcircuit @C=.4em @R=.3em{
%%        \gate{R_y}&\gate{R_z} &\qw & 
%%       \gate{R_y}&\gate{R_z}
%%      \protect\gategroup{1}{1}{1}{2}{0.25em}{--}
%%      \protect\gategroup{1}{4}{1}{5}{0.25em}{--}
%       }
        ???};
%   {xyz};
%   \node[above=0.4cm, right=-0.0 cm]       at (C.north west) {Quantum circuit};
    % State q3
    \node[meter, state,fNB, minimum width=2.cm, minimum height=0.2cm] (D) at (-147:2) {M};
    % \node[meter, state, fill=NavyBlue, minimum width=2.cm, minimum height=0.5cm] (meter) at (-138:2) {M};
%   \node[above=0.01cm]                     at (D.north west) {State measurement};
    
    % State q4
    \node[state, w2h] (E)                   at (162:2) {$f(|\langle y | \phi \rangle |^2 )$};
%   \node[above=-0.5]                       at (E.north) {post-processing};

% ~~~ extra labels ~~~~~~~~~~~~~~~~~~~~
    \node[lbl,anchor=west]      at (B_side.east) {Quantum\\pre-processing};


% ~~~ drawing connections ~~~~~~~~~~~~~~~~~~~~~~~~~
\draw[-stealth] (B_side) -- (B);
\draw[-stealth] (B_top) -- (B);

    % Transition q0 to q1
    \draw[-stealth] (A) to[bend left=30] node[red,above]{Parameter} (B);
    
    % Transition q1 to q2
    \draw[-stealth] (B) to[bend left=15] node[red,right]{$e_1$} (C);
    
    % Transition q2 to q3
    \draw[-stealth] (C) to[bend left=15] node[red,right]{$e_2$} (D);
    
    % Transition q3 to q4
    \draw[-stealth] (D) to[bend left=15] node[red,below=-0.4 cm, right=0.1 cm]{Quantum state$ |\phi\rangle$} (E);
    
    % Transition q4 to q0
    \draw[-stealth] (E) to[bend left=30] node[red,left]{Classical} (A);
\end{tikzpicture}
%
\end{document}

Responder3

Isto é o que eu modifiquei.

%%%%%%%%%%%%%%%%%
\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{arrows.meta}
% \usetikzlibrary{quantikz}
\usepackage{qcircuit}
\usepackage[absolute,overlay]{textpos}
\usetikzlibrary{shapes}
\newcommand\rd[0]{32mm} % radius for the circle placement

\begin{document}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Define the measurement symbol style
\tikzset{
    meter/.style={
        draw,
        inner sep=10pt,
        rectangle,
        font=\vphantom{A},
        minimum width=30pt,
        minimum height=10pt,
        line width=.5pt,
        path picture={
            \draw[black] ([shift={(2pt,7pt)}]path picture bounding box.south west) to[bend left=50] ([shift={(-2pt,7pt)}]path picture bounding box.south east);
            \node[anchor=center] at (path picture bounding box.center) {$M$};
            \draw[black,-latex] ([shift={(0pt,3pt)}]path picture bounding box.south) -- ([shift={(10pt,-5pt)}]path picture bounding box.north);
        }
    }
}
%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%
\begin{tikzpicture}[
        geom/.style={
            rounded corners,
            minimum width=25mm,
            minimum height=9mm,
        },
        state/.style={fill=blue!40!teal!40,geom},
        other/.style={fill=orange!40,geom},
        txt/.style={align=center,font={\small\sffamily}},
        arrlbl/.style={blue,align=center},
    ]
        % Blocks
        \node[other] (OP) at (  90:\rd) {\large Optimizer};
        \node[state] (QP) at (  20:\rd) {$R(\{\vec{\Theta}\},\{\vec{X}\})$};
        \node[state] (QC) at ( -30:\rd) {
    \resizebox{.45\linewidth}{!}{
    \hspace{-.58cm}~\Qcircuit @C=.8em @R=.5em{
    \push{\cdots} &\gate{R_y} & \gate{R_z} & \gate{R_y} & \gate{R_z}&\cdots\\
    % & & & & \\ 
    % & & & & & \\
    \protect\gategroup{1}{2}{1}{3}{0.3em}{--}
    \protect\gategroup{1}{4}{1}{5}{0.3em}{--}
    }
    }
    };
        \node[meter, state] (QM) at ( 210:\rd)  {M};
        \node[other] (PP) at ( 160:\rd) {$f(|\langle y | \phi \rangle |^2 )$ };
    % ~~~ (1) relative placement of other blocks
%   \node[state] (QX) at ([xshift=\rd]QP) {QX}; % before step (5)
    \node[rounded corners, fill=blue!40!teal!40] (QX) at ([shift=(0:2)]QP)       {$|0\rangle$};
    \node[rounded corners, fill=orange!40] (DT) at ([shift=(75:2)]QP)     {\large Data: $\{\vec{X\}}$};
        % Connections
        \draw[->] (OP) to[bend left] node[arrlbl,anchor=west,pos=.8]{} (QP.70);
        \draw[->] (QP) to[bend left] node[arrlbl,anchor=west,pos=.8]{} (QC.65);
        \draw[->] (QC) to[bend left] node[arrlbl,anchor=west,pos=.8]{} (QM);
        \draw[->] (QM) to[bend left] node[arrlbl,anchor=west,pos=.8, black] {Quantum state:\\$|\phi\rangle$} (PP);
        \draw[->] (PP) to[bend left] node[arrlbl,anchor=west,pos=.8]{} (OP);
        \draw[->] (DT) -- (QP.35);
        \draw[->] (QX) -- (QP);

        % Extra labels
        \node[txt] at ([shift=(-100:-0.8)]QM) {\large Quantum state measurement};
        \node[txt] at ([shift=(90:0.7)]PP) {\large Classical post-processing};
        \node[txt] at ([shift=( -85:1.0)]QX) {\large Quantum\\pre-processing};
        \node[txt] at ([shift=(-100:1.7)]QP) {\large Quantum circuit};
        \node[txt] at ([shift=(30:-1.2)]QC) {Layer i};
        \node[txt] at ([shift=(150:-1.2)]QC) {Layer i+1};
        \node[txt,font = {\large}, red] at ([shift=(128:1.3)]QP) {Parameters:\\$\{\vec\Theta\}$};
    \end{tikzpicture}
    \end{document}

insira a descrição da imagem aqui

informação relacionada