# Creating a (tensor) network using TikZ [duplicate]

I am trying to draw a very simple network diagram. My code:

    \begin{tikzpicture}
\node[draw, shape=circle] (v0) at (0,0) {$v_0$};
\node[draw, shape=circle] (v1) at (1,0) {$v_1$};
\node[rectangle,minimum width=6em,draw] (v3) at (0.5,-1) {$v_3$};
\draw [thick] (v0) -- (v1)
(v0) -- (v3)
(v1) -- (v3);
\end{tikzpicture}


This produces the following figure:

I want the lines from the upper two nodes to go straight down towards the edge of the rectangle. Is there a simple way to do this?

yes, it is :-):

\documentclass[tikz,
border=3mm]{standalone}

\begin{document}
\begin{tikzpicture}
\node[draw, shape=circle] (v0) at (0,0) {$v_0$};
\node[draw, shape=circle] (v1) at (1,0) {$v_1$};
\node[rectangle,minimum width=6em,draw] (v3) at (0.5,-1) {$v_3$};
\draw [thick] (v0) -- (v1)
(v0) -- (v0 |-  v3.north) % <-- changed coordinates
(v1) -- (v1 |- v3.north); % <-- changed coordinates
\end{tikzpicture}
\end{document}


|- means that lines go first "verticaly" and than "horzontaly" .... (v0 |- v3.north) determine coordinate in intersection of vertical lines through v0.center and horizontal line through v3.north.

• Wow, that IS easy! Thank you very much for the quick and thorough help!! – Grim Reaper Oct 12 '16 at 19:47
• Your are welcome! Happy TeXing! – Zarko Oct 12 '16 at 20:00