Skip to content

Commit

Permalink
Move "Testing string diagrams" to a separate note
Browse files Browse the repository at this point in the history
  • Loading branch information
utensil committed Jun 16, 2024
1 parent fd76770 commit 8ea0cae
Show file tree
Hide file tree
Showing 2 changed files with 72 additions and 63 deletions.
72 changes: 72 additions & 0 deletions trees/math-0008.tree
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
\import{tt-macros}
% clifford hopf spin tt math draft
\tag{draft}
\title{Testing string diagrams}

% definition theorem lemma construction observation
% convention corollary axiom example exercise proof
% discussion remark notation
% \taxon{}

\p{The following is testing string diagram drawing using the example from [Jon Sterling's String diagrams](https://www.jonmsterling.com/jms-00B8.xml):}

\tikz{
\begin{tikzpicture}[scale=0.5]
\CreateRect{7}{4}

\path
coordinate[label=below:$M$] (s/M) at (spath cs:south 0.5)
coordinate[label=above:$F$] (n/F) at (spath cs:north 0.165)
coordinate[label=above:$M$] (n/M) at (spath cs:north 0.33)
coordinate[label=above:$N$] (n/N) at (spath cs:north 0.66)
coordinate[label=below:$F$] (s/F) at (spath cs:south 0.85)
;

\path[spath/save = middle-vert] (s/M) to (nw -| s/M);
\coordinate[dot,label=-135:$\mu$] (mu) at (spath cs:middle-vert 0.33);

\draw[spath/save=swoosh] (n/F) to[out=-90,in=90] ($(s/F)+(0,1)$) to (s/F);
\draw[spath/save=cup] (n/M) to ($(n/M)+(0,-1.5)$) to[out=-90,in=180] (mu.center) to[out=0,in=-90] ($(n/N)+(0,-1.5)$) to (n/N);
\draw (s/M) to (mu.center);

\path[name intersections={of=cup and swoosh}]
coordinate[dot,label=-135:$\lambda$] (lambda) at (intersection-1)
coordinate[dot,label=25:$\lambda$] (lambda') at (intersection-2)
;

\begin{scope}[on background layer]
\fill[catd] (nw) to (n/F) to[spath/use={swoosh,weld}] (s/F) to (sw) to cycle;
\fill[catc] (n/F) to[spath/use={swoosh,weld}] (s/F) to (se) to (ne) to cycle;
\end{scope}
\end{tikzpicture}
}

\tikz{
\begin{tikzpicture}[scale=0.6]
\node[box=0/2/0/1] (A) at (-2, 0) {A};
\node[box=0/1/0/2] (B) at (+2, 0) {B};
\node[box=0/1/0/1] (C) at ( 0,+1) {C};
\node[box=0/1/0/1] (D) at ( 0,-1) {D};
\wires{
A = { east.1 = C.west, east.2 = D.west },
C = { east = B.west.1 },
D = { east = B.west.2 },
}{ A.west, B.east }
\end{tikzpicture}
}

\tikz{
\begin{tikzpicture}
\node[box=0/1/0/2] (A) at ( 0,+1) {A};
\node[box=0/2/0/1] (B) at ( 0,-1) {B};
\node[dot] (x) at (+1, 0) {};
\node[dot] (y) at (-1, 0) {};
\wires[looseness=1.5, dashed]{
A = { east = x.north },
B = { east.1 = x.south },
y = { north = A.west.2, south = B.west },
}{
A.west.1, B.east.2, x.east, y.west
}
\end{tikzpicture}
}
63 changes: 0 additions & 63 deletions trees/tt-0003.tree
Original file line number Diff line number Diff line change
Expand Up @@ -12,66 +12,3 @@
\p{In most literatures (e.g. \cite{chen2016infinitely}), objects in #{\C} are denoted like #{X, Y \in \Ob(\C)}, the set of these arrows are denoted by #{\Hom_\C(X, Y)}, thus an arrow from #{X} to #{Y} is #{f \in \Hom_\C(X, Y)}. }

\p{\cite{zhang2021type} simply writes the above as #{X \in \C} and #{f \in \C(X, Y)}, respectively, which is quite friendly, as long as one doesn't use the set theory mindset.}

\p{The following is testing string diagram drawing using the example from [Jon Sterling's String diagrams](https://www.jonmsterling.com/jms-00B8.xml):}

\tikz{
\begin{tikzpicture}[scale=0.5]
\CreateRect{7}{4}

\path
coordinate[label=below:$M$] (s/M) at (spath cs:south 0.5)
coordinate[label=above:$F$] (n/F) at (spath cs:north 0.165)
coordinate[label=above:$M$] (n/M) at (spath cs:north 0.33)
coordinate[label=above:$N$] (n/N) at (spath cs:north 0.66)
coordinate[label=below:$F$] (s/F) at (spath cs:south 0.85)
;

\path[spath/save = middle-vert] (s/M) to (nw -| s/M);
\coordinate[dot,label=-135:$\mu$] (mu) at (spath cs:middle-vert 0.33);

\draw[spath/save=swoosh] (n/F) to[out=-90,in=90] ($(s/F)+(0,1)$) to (s/F);
\draw[spath/save=cup] (n/M) to ($(n/M)+(0,-1.5)$) to[out=-90,in=180] (mu.center) to[out=0,in=-90] ($(n/N)+(0,-1.5)$) to (n/N);
\draw (s/M) to (mu.center);

\path[name intersections={of=cup and swoosh}]
coordinate[dot,label=-135:$\lambda$] (lambda) at (intersection-1)
coordinate[dot,label=25:$\lambda$] (lambda') at (intersection-2)
;

\begin{scope}[on background layer]
\fill[catd] (nw) to (n/F) to[spath/use={swoosh,weld}] (s/F) to (sw) to cycle;
\fill[catc] (n/F) to[spath/use={swoosh,weld}] (s/F) to (se) to (ne) to cycle;
\end{scope}
\end{tikzpicture}
}

\tikz{
\begin{tikzpicture}[scale=0.6]
\node[box=0/2/0/1] (A) at (-2, 0) {A};
\node[box=0/1/0/2] (B) at (+2, 0) {B};
\node[box=0/1/0/1] (C) at ( 0,+1) {C};
\node[box=0/1/0/1] (D) at ( 0,-1) {D};
\wires{
A = { east.1 = C.west, east.2 = D.west },
C = { east = B.west.1 },
D = { east = B.west.2 },
}{ A.west, B.east }
\end{tikzpicture}
}

\tikz{
\begin{tikzpicture}
\node[box=0/1/0/2] (A) at ( 0,+1) {A};
\node[box=0/2/0/1] (B) at ( 0,-1) {B};
\node[dot] (x) at (+1, 0) {};
\node[dot] (y) at (-1, 0) {};
\wires[looseness=1.5, dashed]{
A = { east = x.north },
B = { east.1 = x.south },
y = { north = A.west.2, south = B.west },
}{
A.west.1, B.east.2, x.east, y.west
}
\end{tikzpicture}
}

0 comments on commit 8ea0cae

Please sign in to comment.