Created
April 22, 2014 16:12
-
-
Save stared/11185110 to your computer and use it in GitHub Desktop.
TikZ code drawing Matrix Product State in tensor diagram notation (i.e. Penrose graphical notation). Get pdf, ps or svg.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
\documentclass{standalone} | |
%% for compilation with htlatex (to produce svg image), | |
%% uncomment the line below: | |
% \def\pgfsysdriver{pgfsys-tex4ht.def} | |
\usepackage{tikz} | |
\tikzstyle{tensor}=[rectangle,draw=blue!50,fill=blue!20,thick] | |
\begin{document} | |
\begin{tikzpicture}[inner sep=1mm] | |
\foreach \i in {1,...,5} { | |
\node[tensor] (\i) at (\i, 0) {$A_\i$}; | |
\node (\i spin) at (\i, -0.7) {$s_\i$}; | |
\draw[-] (\i) -- (\i spin); | |
}; | |
\foreach \i in {1,...,4} { | |
\pgfmathtruncatemacro{\iplusone}{\i + 1}; | |
\draw[-] (\i) -- (\iplusone); | |
}; | |
\draw[-] (1.west) .. controls +(-1.5, 1) and +(1.5, 1) .. (5.east); | |
\end{tikzpicture} | |
\end{document} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment