3

I want the boxes to be of the same height, not width. What is the best way to achieve this?

\tikzset{
%Define standard arrow tip
>=stealth',
%Define style for boxes
punkt/.style={
      rectangle,
      rounded corners,
      draw=black, very thick,
      text width=6.5em,
      minimum height=4cm,
      text centered}
}

\begin{tikzpicture}[node distance=1cm, auto]

\node[name=dummy] (dummy) {}; \node[punkt, name=oracle, left = 4cm of dummy] (oracle) {Oracle circuit $O_H$ providing access to $H_{xy}$}; \node[punkt, name=block, left = 0cm of dummy] (block) {$U_H$, block encoding of $H_{xy}$, which implements ${\ket{\psi}\mapsto H\ket{\psi}}$}; \node[punkt, name=algo, left = -4cm of dummy] (algo) {A circuit built upon the usage of $U_H$, which implements ${\ket{\psi}\mapsto f(H)\ket{\psi}}$ for some matrix function $f$};

\draw [-stealth] (oracle) edge[bend left=0, every node/.style={left=2cm}] [] (block); \draw [-stealth] (block) edge[bend left=0, every node/.style={left=2cm}] [] (algo);

\end{tikzpicture}

enter image description here

Increasing the minimum height leads to the following results:

enter image description here

Which is not what I need, since I don't want to change the first box height, and instead just want to make the second and third boxes wider.

mavzolej
  • 556

2 Answers2

4
\documentclass[tikz, border=1cm]{standalone}
\usepackage{braket}
\usetikzlibrary{arrows.meta, positioning}
\tikzset{
>=Stealth,
punkt/.style={rectangle, rounded corners, draw, very thick, inner sep=8pt, align=center},
}
\begin{document}
\begin{tikzpicture}[node distance=1cm]
\node[punkt] (oracle) {Oracle circuit\\$O_H$ providing\\access to $H_{xy}$};
\node[punkt, right=of oracle] (block) {$U_H$, block encoding $H_{xy}$,\\which implements of\\${\ket{\psi}\mapsto H\ket{\psi}}$};
\node[punkt, right=of block] (algo) {A circuit built upon the usage of $U_H$,\\which implements ${\ket{\psi}\mapsto f(H)\ket{\psi}}$ for\\some matrix function $f$};
\draw[->] (oracle) -- (block);
\draw[->] (block) -- (algo);
\end{tikzpicture}
\end{document}

Three boxes with text and arrows

2

A bit rude solution, which require some manual tweak of nodes width:

enter image description here

In above image I first define width of the first node text line so, that complete text is spread in three lines., width of the second node is wide approximately 5/3 mail width (for this is text longer) of width of the first node, etc.

\documentclass[margin=3mm]{standalone}
\usepackage{braket}
\usepackage{tikz}
\usetikzlibrary{arrows.meta,
                chains,
                positioning}

\begin{document}

\begin{tikzpicture}[

node distance = 7mm, start chain = going right, arr/.style = {-Stealth}, box/.style = {draw, thick, rounded corners, align=left, text width=#1, on chain, join=by arr} ] \node [box=7em] {Oracle circuit\ $O_H$ providing\ access to $H_{xy}$}; \node [box=1.6*7em] {$U_H$, block encoding $H_{xy}$, \ which implements of \ ${\ket{\psi}\mapsto H\ket{\psi}}$}; \node [box=2.4*7em] {A circuit built upon the usage of $U_H$, \ which implements ${\ket{\psi}\mapsto f(H)\ket{\psi}}$ for \ some matrix function $f$}; \end{tikzpicture}

\end{document}

You can calculate factors of nodes width so, that first you measure length of text in each node and than calculate ratio between them.In above MWE I first estimate text length and then (manually) calculate ratios between them.

Zarko
  • 296,517