problema de preparar un ciclo usando tikz en látex

problema de preparar un ciclo usando tikz en látex

El programa que estoy usando actualmente tiene como objetivo generar una representación cíclica similar a la imagen proporcionada. Sin embargo, al ejecutar el código, encuentro varios errores y el resultado no coincide con la imagen esperada. Cualquier ayuda para resolver estos problemas será muy apreciada. Imagen que quiero ver =ingrese la descripción de la imagen aquí

"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}

PD: Ver mi modificaciónaquí, quedando algún problema menor, descrito allí.

Respuesta1

En respuesta a tupregunta adicional.

Análisis

Lo primero que hice fue dibujar un círculo como referencia, para ver las desviaciones bastante grandes:

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

Pronto abandoné mi primera idea de reemplazar cada una to[bend left]por declaraciones individuales to[bend in=, out=], donde cada ángulo de entrada y salida se pudiera ajustar manualmente. Pero hay mucho trabajo por hacer.

Entonces se me ocurrió la idea de

  • poner el círculo detrás de todos los demás caminos (es decir, dibujar como el primero)
  • decorándolo con flechas, ver cap.50.6.1 Marcas de punta de flechaen el manual de página

Solución, de arriba a abajo

Cargue la biblioteca \usetikzlibrary{decorations.markings}.

Definir marcas decorativas. La peculiaridad aquí es que el círculo se dibuja matemáticamente, es decir, en el sentido contrario a las agujas del reloj. Por eso las flechas están decoradas como flechas invertidas. Puedes ajustar su estilo como con los nodos. Los puse rojos para hacerlos más evidentes. Las posiciones son resultado de prueba&error, y puede que no esté tan mal tenerlas "en el medio", más o 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
        },

Entonces, decoremos el círculo:

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

Eliminemos todas las conexiones que ya no son necesarias:

        % 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);

Conserve la etiqueta que ahora falta. Hay muchas formas de colocarlo, como ocurre con cualquier nodo.

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

Ahora, haz tus ajustes. Por cierto, puedes sobrescribir el stateestilo del circuito Quantum para hacerlo un poco más grande, por ejemplo:

 \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}

Respuesta2

Aquí tienes un punto de partida. Está inacabado porque:

  • No puedo recuperar todo de tu código
  • intenta mostrarte el refinamiento iterativo paso a paso
  • por lo que se detiene en algo que podría ser un nuevo punto de partida para ti.

resultado

Veamos algunos detalles:

  • Describí el proceso como comentarios.
  • (1) coloca nodos sin estilo en un círculo, donde puedes cambiar su radio en\newcommand\rd[0]{35mm}
  • (2), conexiones rectas, muestra ahora las líneas iniciales con una primera bendintroducida; no se doblegue demasiado pronto, concéntrese primero en las partes más relevantes
  • para la etiqueta de conexiones mostré un estilo, un ancla y para la demostración una posición
  • Los estilos preliminares (3) están bastante bien por ahora, y se refinarían más hasta el final de crear todo esto.
  • el cambio en un solo lugar son sus paradigmas; ver, por ejemplo, el papel del estilogeom

DESHECHO, la tarifa es el medidor (no se pudo encontrar el código) y lo que hay dentro del "Circuito Cuántico". Estos son lugares a los que se puede llamar tikzal interior tikz, lo cual no se recomienda.

Como alternativa, sugiero crear estos dibujos por separado usando la standaloneclase, como se hace aquí, Y \includegraphics(es decir, esos .pdf) a través del paquete graphicx. Ver por ejemploaquí (controlador PI)para este enfoque.

Ahora comienzas una fase de mezcla, donde ambos:

  • introducir más contenido
  • quiere o tiene que ajustar ubicaciones, estilos, etc.

Pero espero que ahora sea más factible.

% ~~~ 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}

Como referencia, vea mi intento de trabajar con su código y refactorizarlo para una mayor legibilidad. En este punto me resultó evidente que debía rehacerse desde cero con un enfoque diferente. Es posible que puedas embellecerlo aún más (lo que también reduce los problemas), pero... las cosas simplemente estaban demasiado entremezcladas para eso.

%\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}

Respuesta3

Esto es lo que modifiqué.

%%%%%%%%%%%%%%%%%
\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}

ingrese la descripción de la imagen aquí

información relacionada